From 239a7492fd3a6ed3551be8ac4a3a65c5bb2cbcd3 Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Thu, 12 Sep 2024 19:52:23 +0200 Subject: [PATCH 01/94] test: fix proxy address --- apps/ledger-live-mobile/e2e/bridge/proxy.ts | 2 +- apps/ledger-live-mobile/e2e/helpers.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/ledger-live-mobile/e2e/bridge/proxy.ts b/apps/ledger-live-mobile/e2e/bridge/proxy.ts index 284eb574e39f..90d03c498b84 100644 --- a/apps/ledger-live-mobile/e2e/bridge/proxy.ts +++ b/apps/ledger-live-mobile/e2e/bridge/proxy.ts @@ -29,7 +29,7 @@ interface ProxyOptions { speculosApiPort: string; } -export async function startProxy(speculosApiPort?: string, proxyPort?: string): Promise { +export async function startProxy(proxyPort?: string, speculosApiPort?: string): Promise { if (!proxyPort) proxyPort = (await findFreePort()).toString(); if (!speculosApiPort) speculosApiPort = getEnv("SPECULOS_API_PORT").toString(); invariant(speculosApiPort, "E2E Proxy : speculosApiPort is not defined"); diff --git a/apps/ledger-live-mobile/e2e/helpers.ts b/apps/ledger-live-mobile/e2e/helpers.ts index cb44df561000..c429dd585b94 100644 --- a/apps/ledger-live-mobile/e2e/helpers.ts +++ b/apps/ledger-live-mobile/e2e/helpers.ts @@ -183,7 +183,10 @@ export async function launchSpeculos(appName: string) { invariant(speculosApiPort, "[E2E Setup] speculosApiPort not defined"); setEnv("SPECULOS_API_PORT", speculosApiPort); - const proxyAddress = await startProxy(); + const proxyPort = await findFreePort(); + await device.reverseTcpPort(proxyPort); + await startProxy(proxyPort.toString()); + const proxyAddress = `localhost:${proxyPort}`; speculosDevices.push([proxyAddress, speculosDevice]); console.warn(`Speculos started on ${proxyAddress}`); return proxyAddress; From 0037f38aabb7ea06b04894b8ee77177c43fcfce8 Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Mon, 16 Sep 2024 10:23:09 +0200 Subject: [PATCH 02/94] test: add speculos filter in pnpm --- .github/workflows/test-mobile-e2e-reusable.yml | 2 +- apps/ledger-live-mobile/package.json | 1 + apps/ledger-live-mobile/scripts/e2e-ci.mjs | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-mobile-e2e-reusable.yml b/.github/workflows/test-mobile-e2e-reusable.yml index cd50fb28eaea..f2b3d38ab592 100644 --- a/.github/workflows/test-mobile-e2e-reusable.yml +++ b/.github/workflows/test-mobile-e2e-reusable.yml @@ -257,7 +257,7 @@ jobs: script: ./tools/scripts/wait_emulator_idle.sh - name: Run Android Tests id: detox - run: pnpm mobile e2e:ci -p android -t + run: pnpm mobile e2e:ci -p android -t --speculos timeout-minutes: 45 env: DETOX_INSTALL_TIMEOUT: 120000 diff --git a/apps/ledger-live-mobile/package.json b/apps/ledger-live-mobile/package.json index 052f6f038a55..ac7810cb6f11 100644 --- a/apps/ledger-live-mobile/package.json +++ b/apps/ledger-live-mobile/package.json @@ -20,6 +20,7 @@ "e2e:build": "pnpm detox build", "e2e:ci": "zx ./scripts/e2e-ci.mjs", "e2e:test": "pnpm detox test", + "e2e:test:speculos": "pnpm detox test --testMatch $(pwd)/e2e/specs/speculos/**/*.spec.ts", "prebeta": "bundle install", "debug:detox": "pnpm detox test -c ios.manual currencies.spec.ts", "ios:staging": "ENVFILE=.env.ios.staging react-native run-ios --mode Staging", diff --git a/apps/ledger-live-mobile/scripts/e2e-ci.mjs b/apps/ledger-live-mobile/scripts/e2e-ci.mjs index 734b2104afaa..85c6d35d2268 100755 --- a/apps/ledger-live-mobile/scripts/e2e-ci.mjs +++ b/apps/ledger-live-mobile/scripts/e2e-ci.mjs @@ -2,13 +2,14 @@ import { basename } from "path"; let platform, test, build, bundle; +let speculos = ""; let cache = true; const usage = (exitCode = 1) => { console.log( `Usage: ${basename( __filename, - )} -p --platform [-h --help] [-t --test] [-b --build] [--bundle] [--cache | --no-cache]`, + )} -p --platform [-h --help] [-t --test] [-b --build] [--bundle] [--cache | --no-cache] [--speculos]`, ); process.exit(exitCode); }; @@ -34,7 +35,7 @@ const bundle_ios_with_cache = async () => { }; const test_ios = async () => { - await $`pnpm mobile e2e:test \ + await $`pnpm mobile e2e:test${speculos} \ -c ios.sim.release \ --loglevel error \ --record-logs all \ @@ -50,7 +51,7 @@ const build_android = async () => { }; const test_android = async () => { - await $`pnpm mobile e2e:test \\ + await $`pnpm mobile e2e:test${speculos} \\ -c android.emu.release \\ --loglevel error \\ --record-logs all \\ @@ -104,6 +105,9 @@ for (const argName in argv) { break; case "_": break; + case "speculos": + speculos = ":speculos"; + break; default: usage(42); break; From 887f9938d2cefe2e03295c57a42bc8d15ff327d1 Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Wed, 11 Sep 2024 16:31:01 +0200 Subject: [PATCH 03/94] ci: android --- .../workflows/test-mobile-e2e-reusable.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/test-mobile-e2e-reusable.yml b/.github/workflows/test-mobile-e2e-reusable.yml index f2b3d38ab592..9c430011fa7e 100644 --- a/.github/workflows/test-mobile-e2e-reusable.yml +++ b/.github/workflows/test-mobile-e2e-reusable.yml @@ -173,6 +173,8 @@ jobs: AVD_CORES: 4 AVD_RAM_SIZE: 4096M AVD_OPTIONS: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.9.5 + COINAPPS: ${{ github.workspace }}/coin-apps outputs: status: ${{ steps.detox.outcome }} steps: @@ -255,12 +257,29 @@ jobs: disable-linux-hw-accel: false emulator-options: ${{ env.AVD_OPTIONS }} script: ./tools/scripts/wait_emulator_idle.sh + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.GH_BOT_APP_ID }} + private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }} + - name: Retrieving coin apps + uses: actions/checkout@v4 + with: + ref: master + repository: LedgerHQ/coin-apps + token: ${{ steps.generate-token.outputs.token }} + path: ${{ env.COINAPPS }} + - name: Pull docker image + run: docker pull ${{ env.SPECULOS_IMAGE_TAG }} + shell: bash - name: Run Android Tests id: detox run: pnpm mobile e2e:ci -p android -t --speculos timeout-minutes: 45 env: DETOX_INSTALL_TIMEOUT: 120000 + SEED: ${{ secrets.SEED_QAA_B2C }} - name: Generate single file Allure report if: ${{ !cancelled() || steps.detox.outcome == 'cancelled' }} run: pnpm dlx allure-commandline generate apps/ledger-live-mobile/artifacts --single-file From c898babc954a1a094243486e06afb8c9bd0787a8 Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Tue, 17 Sep 2024 16:31:50 +0200 Subject: [PATCH 04/94] ci: create boolean for speculos tests --- .github/workflows/test-mobile-e2e-reusable.yml | 11 ++++++++++- .github/workflows/test-mobile-e2e.yml | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-mobile-e2e-reusable.yml b/.github/workflows/test-mobile-e2e-reusable.yml index 9c430011fa7e..2929381f883f 100644 --- a/.github/workflows/test-mobile-e2e-reusable.yml +++ b/.github/workflows/test-mobile-e2e-reusable.yml @@ -32,6 +32,11 @@ on: description: "[iOS] Test Execution ticket ID. Ex: 'B2CQA-2461'" required: false type: string + speculos_tests: + description: Run Speculos tests + required: false + type: boolean + default: false # Uncomment to have log-level: trace on detox run and build # (cf: apps/ledger-live-mobile/detox.config.js) @@ -258,12 +263,14 @@ jobs: emulator-options: ${{ env.AVD_OPTIONS }} script: ./tools/scripts/wait_emulator_idle.sh - name: Generate token + if: ${{inputs.speculos_tests}} == 'true' id: generate-token uses: tibdex/github-app-token@v1 with: app_id: ${{ secrets.GH_BOT_APP_ID }} private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }} - name: Retrieving coin apps + if: ${{inputs.speculos_tests}} == 'true' uses: actions/checkout@v4 with: ref: master @@ -271,15 +278,17 @@ jobs: token: ${{ steps.generate-token.outputs.token }} path: ${{ env.COINAPPS }} - name: Pull docker image + if: ${{inputs.speculos_tests}} == 'true' run: docker pull ${{ env.SPECULOS_IMAGE_TAG }} shell: bash - name: Run Android Tests id: detox - run: pnpm mobile e2e:ci -p android -t --speculos + run: pnpm mobile e2e:ci -p android -t ${INPUT_SPECULOS:+--speculos} timeout-minutes: 45 env: DETOX_INSTALL_TIMEOUT: 120000 SEED: ${{ secrets.SEED_QAA_B2C }} + INPUT_SPECULOS: ${{ inputs.speculos_tests }} - name: Generate single file Allure report if: ${{ !cancelled() || steps.detox.outcome == 'cancelled' }} run: pnpm dlx allure-commandline generate apps/ledger-live-mobile/artifacts --single-file diff --git a/.github/workflows/test-mobile-e2e.yml b/.github/workflows/test-mobile-e2e.yml index 5f28d86dfb9a..54369f71fd71 100644 --- a/.github/workflows/test-mobile-e2e.yml +++ b/.github/workflows/test-mobile-e2e.yml @@ -28,6 +28,11 @@ on: description: "[iOS] Test Execution ticket ID. Ex: 'B2CQA-2461'" required: false type: string + speculos_tests: + description: Run Speculos tests + required: false + type: boolean + default: false # Uncomment to have log-level: trace on detox run and build # (cf: apps/ledger-live-mobile/detox.config.js) From ef9024105b6b37372e37faca46a65cbf8fdf2b7a Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Tue, 17 Sep 2024 16:54:30 +0200 Subject: [PATCH 05/94] ci: use composite to setup image --- .../workflows/test-mobile-e2e-reusable.yml | 27 +++++---------- .../setup-speculos_image/action.yml | 34 +++++++++++++++++++ 2 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 tools/actions/composites/setup-speculos_image/action.yml diff --git a/.github/workflows/test-mobile-e2e-reusable.yml b/.github/workflows/test-mobile-e2e-reusable.yml index 2929381f883f..da711859c946 100644 --- a/.github/workflows/test-mobile-e2e-reusable.yml +++ b/.github/workflows/test-mobile-e2e-reusable.yml @@ -262,28 +262,17 @@ jobs: disable-linux-hw-accel: false emulator-options: ${{ env.AVD_OPTIONS }} script: ./tools/scripts/wait_emulator_idle.sh - - name: Generate token - if: ${{inputs.speculos_tests}} == 'true' - id: generate-token - uses: tibdex/github-app-token@v1 + - name: Setup Speculos image and Coin Apps + if: ${{ inputs.speculos_tests }} + uses: LedgerHQ/ledger-live/tools/actions/composites/setup-speculos_image@develop with: - app_id: ${{ secrets.GH_BOT_APP_ID }} - private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }} - - name: Retrieving coin apps - if: ${{inputs.speculos_tests}} == 'true' - uses: actions/checkout@v4 - with: - ref: master - repository: LedgerHQ/coin-apps - token: ${{ steps.generate-token.outputs.token }} - path: ${{ env.COINAPPS }} - - name: Pull docker image - if: ${{inputs.speculos_tests}} == 'true' - run: docker pull ${{ env.SPECULOS_IMAGE_TAG }} - shell: bash + coinapps_path: ${{ env.COINAPPS }} + speculos_tag: ${{ env.SPECULOS_IMAGE_TAG }} + bot_id: ${{ secrets.GH_BOT_APP_ID }} + bot_key: ${{ secrets.GH_BOT_PRIVATE_KEY }} - name: Run Android Tests id: detox - run: pnpm mobile e2e:ci -p android -t ${INPUT_SPECULOS:+--speculos} + run: pnpm mobile e2e:ci -p android -t $([[ "$INPUT_SPECULOS" == "true" ]] && printf %s '--speculos') timeout-minutes: 45 env: DETOX_INSTALL_TIMEOUT: 120000 diff --git a/tools/actions/composites/setup-speculos_image/action.yml b/tools/actions/composites/setup-speculos_image/action.yml new file mode 100644 index 000000000000..498c5517fe54 --- /dev/null +++ b/tools/actions/composites/setup-speculos_image/action.yml @@ -0,0 +1,34 @@ +name: "Setup Speculos Image and Coin Apps" +description: "Uploading allure report to Allure Server" +inputs: + coinapps_path: + required: true + description: "Path to the coin apps folder" + speculos_tag: + required: false + description: "Speculos docker image tag" + bot_id: + description: "GitHub Bot ID" + bot_key: + description: "GitHub Bot private key" + +runs: + using: composite + + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ inputs.bot_id }} + private_key: ${{ inputs.bot_key }} + - name: Retrieving coin apps + uses: actions/checkout@v4 + with: + ref: master + repository: LedgerHQ/coin-apps + token: ${{ steps.generate-token.outputs.token }} + path: ${{ inputs.coinapps_path }} + - name: Pull docker image + run: docker pull ${{ inputs.speculos_tag }} + shell: bash From aaa4790d832aa88c7d23d9b1ab62e64bd61411ff Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Wed, 18 Sep 2024 10:14:19 +0200 Subject: [PATCH 06/94] ci: to revert before merge --- .github/workflows/test-mobile-e2e-reusable.yml | 2 +- .github/workflows/test-mobile-e2e.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-mobile-e2e-reusable.yml b/.github/workflows/test-mobile-e2e-reusable.yml index da711859c946..3bddafe0d461 100644 --- a/.github/workflows/test-mobile-e2e-reusable.yml +++ b/.github/workflows/test-mobile-e2e-reusable.yml @@ -264,7 +264,7 @@ jobs: script: ./tools/scripts/wait_emulator_idle.sh - name: Setup Speculos image and Coin Apps if: ${{ inputs.speculos_tests }} - uses: LedgerHQ/ledger-live/tools/actions/composites/setup-speculos_image@develop + uses: ./tools/actions/composites/setup-speculos_image with: coinapps_path: ${{ env.COINAPPS }} speculos_tag: ${{ env.SPECULOS_IMAGE_TAG }} diff --git a/.github/workflows/test-mobile-e2e.yml b/.github/workflows/test-mobile-e2e.yml index 54369f71fd71..18d3fb4d0c0b 100644 --- a/.github/workflows/test-mobile-e2e.yml +++ b/.github/workflows/test-mobile-e2e.yml @@ -50,5 +50,5 @@ permissions: jobs: test-mobile-e2e: name: "Test Mobile E2E" - uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-e2e-reusable.yml@develop + uses: ./.github/workflows/test-mobile-e2e-reusable.yml secrets: inherit From f037f767000997cc738dced6efb3c32c08c8a67f Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Wed, 18 Sep 2024 11:16:23 +0200 Subject: [PATCH 07/94] Revert "ci: to revert before merge" This reverts commit aaa4790d832aa88c7d23d9b1ab62e64bd61411ff. --- .github/workflows/test-mobile-e2e-reusable.yml | 2 +- .github/workflows/test-mobile-e2e.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-mobile-e2e-reusable.yml b/.github/workflows/test-mobile-e2e-reusable.yml index 3bddafe0d461..da711859c946 100644 --- a/.github/workflows/test-mobile-e2e-reusable.yml +++ b/.github/workflows/test-mobile-e2e-reusable.yml @@ -264,7 +264,7 @@ jobs: script: ./tools/scripts/wait_emulator_idle.sh - name: Setup Speculos image and Coin Apps if: ${{ inputs.speculos_tests }} - uses: ./tools/actions/composites/setup-speculos_image + uses: LedgerHQ/ledger-live/tools/actions/composites/setup-speculos_image@develop with: coinapps_path: ${{ env.COINAPPS }} speculos_tag: ${{ env.SPECULOS_IMAGE_TAG }} diff --git a/.github/workflows/test-mobile-e2e.yml b/.github/workflows/test-mobile-e2e.yml index 18d3fb4d0c0b..54369f71fd71 100644 --- a/.github/workflows/test-mobile-e2e.yml +++ b/.github/workflows/test-mobile-e2e.yml @@ -50,5 +50,5 @@ permissions: jobs: test-mobile-e2e: name: "Test Mobile E2E" - uses: ./.github/workflows/test-mobile-e2e-reusable.yml + uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-e2e-reusable.yml@develop secrets: inherit From 0a463b9417e9a37d41c306d7a75fa0bd5a0e2275 Mon Sep 17 00:00:00 2001 From: Victor Alber Date: Tue, 17 Sep 2024 09:53:24 +0200 Subject: [PATCH 08/94] =?UTF-8?q?test:=20=F0=9F=8E=AD=20Updating=20TMS=20l?= =?UTF-8?q?ink=20for=20xray=20execution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/specs/speculos/add.account.spec.ts | 43 +++++------ .../specs/speculos/delete.account.spec.ts | 38 +++++----- .../specs/speculos/receive.address.spec.ts | 46 ++++++------ .../tests/specs/speculos/send.tx.spec.ts | 50 ++++++++----- .../tests/specs/speculos/subAccount.spec.ts | 71 +++++++++---------- 5 files changed, 135 insertions(+), 113 deletions(-) diff --git a/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts index 3078a47be449..5de92f1ef0ff 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts @@ -3,38 +3,41 @@ import { Currency } from "../../enum/Currency"; import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; -const currencies: Currency[] = [ - Currency.BTC, - Currency.ETH, - Currency.ETC, - Currency.XRP, +const currencies = [ + { + currency: Currency.BTC, + xrayTicket: "B2CQA-2499, B2CQA-2644, B2CQA-2658, B2CQA-2672, B2CQA-929, B2CQA-786", + }, + { currency: Currency.ETH, xrayTicket: "B2CQA-2503, B2CQA-2645, B2CQA-2659, B2CQA-2673" }, + { currency: Currency.ETC, xrayTicket: "B2CQA-2502, B2CQA-2646, B2CQA-2660, B2CQA-2674" }, + { currency: Currency.XRP, xrayTicket: "B2CQA-2505, B2CQA-2647, B2CQA-2661, B2CQA-2675" }, //todo: Reactivate after DOT API issue is resolved - TSD-3603 - //Currency.DOT, - Currency.TRX, - Currency.ADA, - Currency.XLM, - Currency.BCH, - Currency.ALGO, - Currency.ATOM, - Currency.XTZ, - Currency.SOL, - Currency.TON, + //{ currency: Currency.DOT, xrayTicket: "B2CQA-2504, B2CQA-2648, B2CQA-2662, B2CQA-2676" }, + { currency: Currency.TRX, xrayTicket: "B2CQA-2508, B2CQA-2649, B2CQA-2663, B2CQA-2677" }, + { currency: Currency.ADA, xrayTicket: "B2CQA-2500, B2CQA-2650, B2CQA-2664, B2CQA-2678" }, + { currency: Currency.XLM, xrayTicket: "B2CQA-2506, B2CQA-2651, B2CQA-2665, B2CQA-2679" }, + { currency: Currency.BCH, xrayTicket: "B2CQA-2498, B2CQA-2652, B2CQA-2666, B2CQA-2680" }, + { currency: Currency.ALGO, xrayTicket: "B2CQA-2497, B2CQA-2653, B2CQA-2667, B2CQA-2681" }, + { currency: Currency.ATOM, xrayTicket: "B2CQA-2501, B2CQA-2654, B2CQA-2668, B2CQA-2682" }, + { currency: Currency.XTZ, xrayTicket: "B2CQA-2507, B2CQA-2655, B2CQA-2669, B2CQA-2683" }, + { currency: Currency.SOL, xrayTicket: "B2CQA-2642, B2CQA-2656, B2CQA-2670, B2CQA-2684" }, + { currency: Currency.TON, xrayTicket: "B2CQA-2643, B2CQA-2657, B2CQA-2671, B2CQA-2685" }, ]; for (const currency of currencies) { test.describe("Add Accounts", () => { test.use({ userdata: "skip-onboarding", - speculosApp: currency.speculosApp, + speculosApp: currency.currency.speculosApp, }); let firstAccountName = "NO ACCOUNT NAME YET"; test( - `[${currency.name}] Add account`, + `[${currency.currency.name}] Add account`, { annotation: { type: "TMS", - description: "B2CQA-101, B2CQA-102, B2CQA-314, B2CQA-330, B2CQA-929, B2CQA-786", + description: currency.xrayTicket, }, }, async ({ app }) => { @@ -42,13 +45,13 @@ for (const currency of currencies) { await app.portfolio.openAddAccountModal(); await app.addAccount.expectModalVisiblity(); - await app.addAccount.selectCurrency(currency); + await app.addAccount.selectCurrency(currency.currency); firstAccountName = await app.addAccount.getFirstAccountName(); await app.addAccount.addAccounts(); await app.addAccount.done(); // Todo: Remove 'if' when CounterValue is fixed for $TON - LIVE-13685 - if (currency.name !== Currency.TON.name) { + if (currency.currency.name !== Currency.TON.name) { await app.layout.expectBalanceVisibility(); } await app.layout.goToAccounts(); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts index ffac42606dbe..8171d0ab2947 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts @@ -3,45 +3,45 @@ import { Account } from "../../enum/Account"; import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; -const accounts: Account[] = [ - Account.BTC_1, - Account.ETH_1, - Account.SOL_1, - Account.TRX_1, - Account.DOT_1, - Account.XRP_1, - Account.ADA_1, - Account.ALGO_1, - Account.XLM_1, - Account.BCH_1, - Account.ATOM_1, - Account.XTZ_1, +const accounts = [ + { account: Account.BTC_1, xrayTicket: "B2CQA-2548" }, + { account: Account.ETH_1, xrayTicket: "B2CQA-2551" }, + { account: Account.SOL_1, xrayTicket: "B2CQA-2553" }, + { account: Account.XRP_1, xrayTicket: "B2CQA-2557" }, + { account: Account.ADA_1, xrayTicket: "B2CQA-2549" }, + { account: Account.DOT_1, xrayTicket: "B2CQA-2552" }, + { account: Account.TRX_1, xrayTicket: "B2CQA-2556" }, + { account: Account.XLM_1, xrayTicket: "B2CQA-2554" }, + { account: Account.BCH_1, xrayTicket: "B2CQA-2547" }, + { account: Account.ALGO_1, xrayTicket: "B2CQA-2546" }, + { account: Account.ATOM_1, xrayTicket: "B2CQA-2550" }, + { account: Account.XTZ_1, xrayTicket: "B2CQA-2555" }, ]; for (const account of accounts) { test.describe("Delete Accounts", () => { test.use({ userdata: "speculos-tests-app", - speculosApp: account.currency.speculosApp, + speculosApp: account.account.currency.speculosApp, }); test( - `[${account.currency.name}] Delete Account`, + `[${account.account.currency.name}] Delete Account`, { annotation: { type: "TMS", - description: "B2CQA-320", + description: account.xrayTicket, }, }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations).split(", ")); await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(account.accountName); - await app.account.expectAccountVisibility(account.accountName); + await app.accounts.navigateToAccountByName(account.account.accountName); + await app.account.expectAccountVisibility(account.account.accountName); await app.account.deleteAccount(); - await app.accounts.expectAccountAbsence(account.accountName); + await app.accounts.expectAccountAbsence(account.account.accountName); }, ); }); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts index 17373434ef47..2ceccd67678a 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts @@ -3,18 +3,17 @@ import { Account } from "../../enum/Account"; import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; -const accounts: Account[] = [ - // Derivation path is updated when account receive money - Account.BTC_1, - Account.ETH_1, - Account.SOL_1, - Account.TRX_1, - Account.DOT_1, - Account.XRP_1, - Account.BCH_1, - Account.ATOM_1, - Account.XTZ_1, - Account.BSC_1, +const accounts = [ + { account: Account.BTC_1, xrayTicket: "B2CQA-2559, B2CQA-2687" }, + { account: Account.ETH_1, xrayTicket: "B2CQA-2561, B2CQA-2688, B2CQA-2697" }, + { account: Account.SOL_1, xrayTicket: "B2CQA-2563, B2CQA-2689" }, + { account: Account.TRX_1, xrayTicket: "B2CQA-2565, B2CQA-2690, B2CQA-2699" }, + { account: Account.DOT_1, xrayTicket: "B2CQA-2562, B2CQA-2691" }, + { account: Account.XRP_1, xrayTicket: "B2CQA-2566, B2CQA-2692" }, + { account: Account.BCH_1, xrayTicket: "B2CQA-2558, B2CQA-2693" }, + { account: Account.ATOM_1, xrayTicket: "B2CQA-2560, B2CQA-2694" }, + { account: Account.XTZ_1, xrayTicket: "B2CQA-2564, B2CQA-2695" }, + { account: Account.BSC_1, xrayTicket: "B2CQA-2686, B2CQA-2696, B2CQA-2698" }, ]; //Warning 🚨: Test may fail due to the GetAppAndVersion issue - Jira: LIVE-12581 @@ -22,11 +21,11 @@ for (const account of accounts) { test.describe("Receive", () => { test.use({ userdata: "speculos-tests-app", - speculosApp: account.currency.speculosApp, + speculosApp: account.account.currency.speculosApp, }); test( - `[${account.currency.name}] Receive`, + `[${account.account.currency.name}] Receive`, { annotation: { type: "TMS", @@ -37,24 +36,27 @@ for (const account of accounts) { await addTmsLink(getDescription(test.info().annotations).split(", ")); await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(account.accountName); - await app.account.expectAccountVisibility(account.accountName); + await app.accounts.navigateToAccountByName(account.account.accountName); + await app.account.expectAccountVisibility(account.account.accountName); await app.account.clickReceive(); - switch (account) { + switch (account.account) { case Account.TRX_1: - await app.receive.verifySendCurrencyTokensWarningMessage(account, "TRC10/TRC20"); + await app.receive.verifySendCurrencyTokensWarningMessage( + account.account, + "TRC10/TRC20", + ); break; case Account.ETH_1: - await app.receive.verifySendCurrencyTokensWarningMessage(account, "Ethereum"); + await app.receive.verifySendCurrencyTokensWarningMessage(account.account, "Ethereum"); break; case Account.BSC_1: - await app.receive.verifySendCurrencyTokensWarningMessage(account, "BEP20"); + await app.receive.verifySendCurrencyTokensWarningMessage(account.account, "BEP20"); break; } await app.modal.continue(); - await app.receive.expectValidReceiveAddress(account.address); + await app.receive.expectValidReceiveAddress(account.account.address); - await app.speculos.expectValidReceiveAddress(account); + await app.speculos.expectValidReceiveAddress(account.account); await app.receive.expectApproveLabel(); }, ); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts index 4a993700adc5..7319fbf10ac7 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts @@ -9,32 +9,44 @@ const transactionsInputsInvalid = [ { transaction: new Transaction(Account.ETH_1, Account.ETH_2, "", Fee.MEDIUM), expectedErrorMessage: null, + xrayTicket: "B2CQA-2568", }, { transaction: new Transaction(Account.ETH_1, Account.ETH_2, "0", Fee.MEDIUM), expectedErrorMessage: null, + xrayTicket: "B2CQA-2569", }, { transaction: new Transaction(Account.XRP_1, Account.XRP_2, "1", Fee.MEDIUM), expectedErrorMessage: "Recipient address is inactive. Send at least 10 XRP to activate it", + xrayTicket: "B2CQA-2571", }, { transaction: new Transaction(Account.DOT_1, Account.DOT_2, "1.2", Fee.MEDIUM), expectedErrorMessage: "Balance cannot be below 1 DOT. Send max to empty account.", + xrayTicket: "B2CQA-2567", }, { transaction: new Transaction(Account.DOT_1, Account.DOT_3, "0.5", Fee.MEDIUM), expectedErrorMessage: "Recipient address is inactive. Send at least 1 DOT to activate it", + xrayTicket: "B2CQA-2570", }, { transaction: new Transaction(Account.ETH_1, Account.ETH_2, "100", Fee.MEDIUM), expectedErrorMessage: "Sorry, insufficient funds", + xrayTicket: "B2CQA-2572", }, ]; const transactionE2E = [ - new Transaction(Account.sep_ETH_1, Account.sep_ETH_2, "0.00001", Fee.SLOW), - new Transaction(Account.DOGE_1, Account.DOGE_2, "0.01", Fee.SLOW), + { + transaction: new Transaction(Account.sep_ETH_1, Account.sep_ETH_2, "0.00001", Fee.SLOW), + xrayTicket: "B2CQA-2574", + }, + { + transaction: new Transaction(Account.DOGE_1, Account.DOGE_2, "0.01", Fee.SLOW), + xrayTicket: "B2CQA-2573", + }, ]; //Warning 🚨: Test may fail due to the GetAppAndVersion issue - Jira: LIVE-12581 or insufficient funds @@ -43,39 +55,43 @@ for (const transaction of transactionE2E) { test.describe("Send from 1 account to another", () => { test.use({ userdata: "speculos-tests-app", - speculosApp: transaction.accountToDebit.currency.speculosApp, + speculosApp: transaction.transaction.accountToDebit.currency.speculosApp, }); test( - `Send from ${transaction.accountToDebit.accountName} to ${transaction.accountToCredit.accountName}`, + `Send from ${transaction.transaction.accountToDebit.accountName} to ${transaction.transaction.accountToCredit.accountName}`, { annotation: { type: "TMS", - description: "B2CQA-473", + description: transaction.xrayTicket, }, }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations).split(", ")); await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(transaction.accountToDebit.accountName); + await app.accounts.navigateToAccountByName( + transaction.transaction.accountToDebit.accountName, + ); await app.account.clickSend(); - await app.send.fillTxInfo(transaction); - await app.send.expectTxInfoValidity(transaction); + await app.send.fillTxInfo(transaction.transaction); + await app.send.expectTxInfoValidity(transaction.transaction); await app.send.clickContinueToDevice(); - await app.speculos.expectValidTxInfo(transaction); + await app.speculos.expectValidTxInfo(transaction.transaction); await app.send.expectTxSent(); await app.account.navigateToViewDetails(); - await app.drawer.addressValueIsVisible(transaction.accountToCredit.address); + await app.drawer.addressValueIsVisible(transaction.transaction.accountToCredit.address); await app.drawer.close(); await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(transaction.accountToCredit.accountName); + await app.accounts.navigateToAccountByName( + transaction.transaction.accountToCredit.accountName, + ); await app.layout.syncAccounts(); await app.account.clickOnLastOperation(); - await app.drawer.expectReceiverInfos(transaction); + await app.drawer.expectReceiverInfos(transaction.transaction); }, ); }); @@ -97,7 +113,7 @@ test.describe("Send token (subAccount) - invalid address input", () => { { annotation: { type: "TMS", - description: "B2CQA-479", + description: "B2CQA-2702", }, }, async ({ app }) => { @@ -123,12 +139,14 @@ test.describe("Send token (subAccount) - invalid amount input", () => { expectedWarningMessage: new RegExp( /You need \d+\.\d+ BNB in your account to pay for transaction fees on the Binance Smart Chain network\. .*/, ), + xrayTicket: "B2CQA-2700", }, { transaction: new Transaction(Account.ETH_USDT_2, Account.ETH_USDT_1, "1", Fee.MEDIUM), expectedWarningMessage: new RegExp( /You need \d+\.\d+ ETH in your account to pay for transaction fees on the Ethereum network\. .*/, ), + xrayTicket: "B2CQA-2701", }, ]; for (const transaction of tokenTransactionInvalid) { @@ -141,7 +159,7 @@ test.describe("Send token (subAccount) - invalid amount input", () => { { annotation: { type: "TMS", - description: "B2CQA-475", + description: transaction.xrayTicket, }, }, async ({ app }) => { @@ -178,7 +196,7 @@ test.describe("Send token (subAccount) - valid address & amount input", () => { { annotation: { type: "TMS", - description: "B2CQA-479, B2CQA-475", + description: "B2CQA-2703, B2CQA-475", }, }, async ({ app }) => { @@ -242,7 +260,7 @@ for (const transaction of transactionsInputsInvalid) { { annotation: { type: "TMS", - description: "B2CQA-473", + description: transaction.xrayTicket, }, }, async ({ app }) => { diff --git a/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts index dff28423accc..5fdb6d5b680a 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/subAccount.spec.ts @@ -3,39 +3,38 @@ import { Account } from "../../enum/Account"; import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; -const subAccounts: Account[] = [ - Account.ETH_USDT_1, - Account.XLM_USCD, - Account.ALGO_USDT_1, - Account.TRX_USDT, - Account.BSC_BUSD_1, - Account.POL_DAI_1, +const subAccounts = [ + { account: Account.ETH_USDT_1, xrayTicket1: "B2CQA-2577, B2CQA-1079", xrayTicket2: "B2CQA-2583" }, + { account: Account.XLM_USCD, xrayTicket1: "B2CQA-2579", xrayTicket2: "B2CQA-2585" }, + { account: Account.ALGO_USDT_1, xrayTicket1: "B2CQA-2575", xrayTicket2: "B2CQA-2581" }, + { account: Account.TRX_USDT, xrayTicket1: "B2CQA-2580", xrayTicket2: "B2CQA-2586" }, + { account: Account.BSC_BUSD_1, xrayTicket1: "B2CQA-2576", xrayTicket2: "B2CQA-2582" }, + { account: Account.POL_DAI_1, xrayTicket1: "B2CQA-2578", xrayTicket2: "B2CQA-2584" }, ]; -const subAccountReceive: Account[] = [ - Account.ETH_USDT_1, - Account.ETH_LIDO, - Account.TRX_USDT, - Account.TRX_BTT, - Account.BSC_BUSD_1, - Account.BSC_SHIBA, - Account.POL_DAI_1, - Account.POL_UNI, +const subAccountReceive = [ + { account: Account.ETH_USDT_1, xrayTicket: "B2CQA-2492" }, + { account: Account.ETH_LIDO, xrayTicket: "B2CQA-2491" }, + { account: Account.TRX_USDT, xrayTicket: "B2CQA-2496" }, + { account: Account.BSC_BUSD_1, xrayTicket: "B2CQA-2489" }, + { account: Account.BSC_SHIBA, xrayTicket: "B2CQA-2490" }, + { account: Account.POL_DAI_1, xrayTicket: "B2CQA-2493" }, + { account: Account.POL_UNI, xrayTicket: "B2CQA-2494" }, ]; for (const token of subAccounts) { test.describe("Add subAccount without parent", () => { test.use({ userdata: "skip-onboarding", - speculosApp: token.currency.speculosApp, + speculosApp: token.account.currency.speculosApp, }); test( - `Add Sub Account without parent (${token.currency.speculosApp.name}) - ${token.currency.ticker}`, + `Add Sub Account without parent (${token.account.currency.speculosApp.name}) - ${token.account.currency.ticker}`, { annotation: { type: "TMS", - description: "B2CQA-2448, B2CQA-1079", + description: token.xrayTicket1, }, }, async ({ app }) => { @@ -44,15 +43,15 @@ for (const token of subAccounts) { await app.portfolio.openAddAccountModal(); await app.addAccount.expectModalVisiblity(); - await app.addAccount.selectToken(token); + await app.addAccount.selectToken(token.account); await app.addAccount.addAccounts(); await app.addAccount.done(); await app.layout.goToPortfolio(); - await app.portfolio.navigateToAsset(token.currency.name); - await app.account.navigateToToken(token); + await app.portfolio.navigateToAsset(token.account.currency.name); + await app.account.navigateToToken(token.account); await app.account.expectLastOperationsVisibility(); - await app.account.expectTokenAccount(token); + await app.account.expectTokenAccount(token.account); }, ); }); @@ -63,31 +62,31 @@ for (const token of subAccountReceive) { test.describe("Add subAccount when parent exists", () => { test.use({ userdata: "speculos-subAccount", - speculosApp: token.currency.speculosApp, + speculosApp: token.account.currency.speculosApp, }); test( - `[${token.currency.speculosApp.name}] Add subAccount when parent exists (${token.currency.ticker})`, + `[${token.account.currency.speculosApp.name}] Add subAccount when parent exists (${token.account.currency.ticker})`, { annotation: { type: "TMS", - description: "B2CQA-640", + description: token.xrayTicket, }, }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations).split(", ")); await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(token.accountName); - await app.account.expectAccountVisibility(token.accountName); + await app.accounts.navigateToAccountByName(token.account.accountName); + await app.account.expectAccountVisibility(token.account.accountName); await app.account.clickAddToken(); - await app.receive.selectToken(token); + await app.receive.selectToken(token.account); await app.modal.continue(); - await app.receive.expectValidReceiveAddress(token.address); + await app.receive.expectValidReceiveAddress(token.account.address); - await app.speculos.expectValidReceiveAddress(token); + await app.speculos.expectValidReceiveAddress(token.account); await app.receive.expectApproveLabel(); }, ); @@ -98,23 +97,23 @@ for (const token of subAccounts) { test.describe("Token visible in parent account", () => { test.use({ userdata: "speculos-subAccount", - speculosApp: token.currency.speculosApp, + speculosApp: token.account.currency.speculosApp, }); test( - `Token visible in parent account (${token.currency.speculosApp.name}) - ${token.currency.ticker}`, + `Token visible in parent account (${token.account.currency.speculosApp.name}) - ${token.account.currency.ticker}`, { annotation: { type: "TMS", - description: "B2CQA-1425", + description: token.xrayTicket2, }, }, async ({ app }) => { await addTmsLink(getDescription(test.info().annotations).split(", ")); await app.layout.goToAccounts(); - await app.accounts.navigateToAccountByName(token.accountName); - await app.account.expectTokenToBePresent(token); + await app.accounts.navigateToAccountByName(token.account.accountName); + await app.account.expectTokenToBePresent(token.account); }, ); }); From 7122715d31b99cf95c20a113f86ac16c110235bc Mon Sep 17 00:00:00 2001 From: Victor Alber Date: Thu, 19 Sep 2024 10:08:31 +0200 Subject: [PATCH 09/94] =?UTF-8?q?test:=20=F0=9F=8E=AD=20Reactivating=20DOT?= =?UTF-8?q?=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/specs/speculos/add.account.spec.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts index 5de92f1ef0ff..eb4b9779097b 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/add.account.spec.ts @@ -11,8 +11,7 @@ const currencies = [ { currency: Currency.ETH, xrayTicket: "B2CQA-2503, B2CQA-2645, B2CQA-2659, B2CQA-2673" }, { currency: Currency.ETC, xrayTicket: "B2CQA-2502, B2CQA-2646, B2CQA-2660, B2CQA-2674" }, { currency: Currency.XRP, xrayTicket: "B2CQA-2505, B2CQA-2647, B2CQA-2661, B2CQA-2675" }, - //todo: Reactivate after DOT API issue is resolved - TSD-3603 - //{ currency: Currency.DOT, xrayTicket: "B2CQA-2504, B2CQA-2648, B2CQA-2662, B2CQA-2676" }, + { currency: Currency.DOT, xrayTicket: "B2CQA-2504, B2CQA-2648, B2CQA-2662, B2CQA-2676" }, { currency: Currency.TRX, xrayTicket: "B2CQA-2508, B2CQA-2649, B2CQA-2663, B2CQA-2677" }, { currency: Currency.ADA, xrayTicket: "B2CQA-2500, B2CQA-2650, B2CQA-2664, B2CQA-2678" }, { currency: Currency.XLM, xrayTicket: "B2CQA-2506, B2CQA-2651, B2CQA-2665, B2CQA-2679" }, From e82ef1af23fc7f140e77c9d622e727452c05135c Mon Sep 17 00:00:00 2001 From: Kieran Allen Date: Tue, 24 Sep 2024 10:54:17 +0100 Subject: [PATCH 10/94] fix: pass account to asset page --- .../renderer/screens/asset/AssetBalanceSummaryHeader.tsx | 7 +++++-- .../src/renderer/screens/asset/BalanceSummary.tsx | 5 ++++- .../src/renderer/screens/asset/index.tsx | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/ledger-live-desktop/src/renderer/screens/asset/AssetBalanceSummaryHeader.tsx b/apps/ledger-live-desktop/src/renderer/screens/asset/AssetBalanceSummaryHeader.tsx index 8480b45dd475..a80be7c3568f 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/asset/AssetBalanceSummaryHeader.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/asset/AssetBalanceSummaryHeader.tsx @@ -20,7 +20,7 @@ import { useRampCatalog } from "@ledgerhq/live-common/platform/providers/RampCat import { useFeature } from "@ledgerhq/live-common/featureFlags/index"; import useStakeFlow from "~/renderer/screens/stake"; import { stakeDefaultTrack } from "~/renderer/screens/stake/constants"; -import { BalanceHistoryWithCountervalue, ValueChange } from "@ledgerhq/types-live"; +import { AccountLike, BalanceHistoryWithCountervalue, ValueChange } from "@ledgerhq/types-live"; import { useFetchCurrencyAll } from "@ledgerhq/live-common/exchange/swap/hooks/index"; type Props = { isAvailable: boolean; @@ -31,6 +31,7 @@ type Props = { countervalueFirst: boolean; currency: CryptoCurrency | TokenCurrency; unit: Unit; + account: AccountLike; }; export default function AssetBalanceSummaryHeader({ counterValue, @@ -41,6 +42,7 @@ export default function AssetBalanceSummaryHeader({ countervalueFirst, currency, unit, + account, }: Props) { const { data: currenciesAll } = useFetchCurrencyAll(); const swapDefaultTrack = useGetSwapTrackingProperties(); @@ -106,10 +108,11 @@ export default function AssetBalanceSummaryHeader({ history.push({ pathname: "/swap", state: { + defaultAccount: account, defaultCurrency: currency, }, }); - }, [currency, history, swapDefaultTrack]); + }, [currency, history, swapDefaultTrack, account]); const onStake = useCallback(() => { track("button_clicked2", { diff --git a/apps/ledger-live-desktop/src/renderer/screens/asset/BalanceSummary.tsx b/apps/ledger-live-desktop/src/renderer/screens/asset/BalanceSummary.tsx index 8167f2ebf632..bfcbf46771ce 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/asset/BalanceSummary.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/asset/BalanceSummary.tsx @@ -10,7 +10,7 @@ import { useCurrencyPortfolio, usePortfolio } from "~/renderer/actions/portfolio import AssetBalanceSummaryHeader from "./AssetBalanceSummaryHeader"; import { discreetModeSelector } from "~/renderer/reducers/settings"; import { Data } from "~/renderer/components/Chart/types"; -import { PortfolioRange } from "@ledgerhq/types-live"; +import { AccountLike, PortfolioRange } from "@ledgerhq/types-live"; import PlaceholderChart from "~/renderer/components/PlaceholderChart"; import Alert from "~/renderer/components/Alert"; import { useTranslation } from "react-i18next"; @@ -24,6 +24,7 @@ type Props = { unit: Unit; range: PortfolioRange; countervalueFirst: boolean; + account: AccountLike; }; export default function BalanceSummary({ unit, @@ -32,6 +33,7 @@ export default function BalanceSummary({ range, chartColor, currency, + account, }: Props) { const { t } = useTranslation(); const portfolio = usePortfolio(); @@ -85,6 +87,7 @@ export default function BalanceSummary({ Date: Tue, 24 Sep 2024 11:29:01 +0100 Subject: [PATCH 11/94] fix: update to include from path when redirecting to swap --- .../components/BalanceInfos/index.tsx | 50 ++++++++++++++----- .../ContextMenu/AccountContextMenu.tsx | 1 + .../renderer/modals/NoFundsStake/index.tsx | 1 + .../screens/account/AccountHeaderActions.tsx | 1 + .../asset/AssetBalanceSummaryHeader.tsx | 1 + .../screens/dashboard/GlobalSummary.tsx | 1 + .../exchange/Swap2/Form/SwapWebViewDemo3.tsx | 18 ++++++- .../screens/market/hooks/useMarketActions.ts | 1 + 8 files changed, 60 insertions(+), 14 deletions(-) diff --git a/apps/ledger-live-desktop/src/renderer/components/BalanceInfos/index.tsx b/apps/ledger-live-desktop/src/renderer/components/BalanceInfos/index.tsx index 29e8aa85d422..263b9c23b14e 100644 --- a/apps/ledger-live-desktop/src/renderer/components/BalanceInfos/index.tsx +++ b/apps/ledger-live-desktop/src/renderer/components/BalanceInfos/index.tsx @@ -1,20 +1,24 @@ -import React, { useCallback, useRef } from "react"; -import { useTranslation } from "react-i18next"; -import { AccountLike, ValueChange } from "@ledgerhq/types-live"; +import { flattenAccounts } from "@ledgerhq/live-common/account/index"; +import { getAvailableAccountsById } from "@ledgerhq/live-common/exchange/swap/utils/index"; +import { useFeature } from "@ledgerhq/live-common/featureFlags/index"; +import { Text } from "@ledgerhq/react-ui"; import { Unit } from "@ledgerhq/types-cryptoassets"; +import { AccountLike, ValueChange } from "@ledgerhq/types-live"; +import React, { useCallback, useMemo, useRef } from "react"; +import { useTranslation } from "react-i18next"; +import { useSelector } from "react-redux"; +import { useHistory } from "react-router-dom"; +import { setTrackingSource } from "~/renderer/analytics/TrackPage"; import Box from "~/renderer/components/Box"; +import Button from "~/renderer/components/ButtonV3"; import FormattedVal from "~/renderer/components/FormattedVal"; import PillsDaysCount from "~/renderer/components/PillsDaysCount"; import TransactionsPendingConfirmationWarning from "~/renderer/components/TransactionsPendingConfirmationWarning"; +import { useResize } from "~/renderer/hooks/useResize"; +import { accountsSelector } from "~/renderer/reducers/accounts"; import { useGetSwapTrackingProperties } from "~/renderer/screens/exchange/Swap2/utils/index"; -import { PlaceholderLine } from "./Placeholder"; -import Button from "~/renderer/components/ButtonV3"; -import { setTrackingSource } from "~/renderer/analytics/TrackPage"; -import { useHistory } from "react-router-dom"; -import { useFeature } from "@ledgerhq/live-common/featureFlags/index"; -import { Text } from "@ledgerhq/react-ui"; import PilldDaysSelect from "../PillsDaysSelect"; -import { useResize } from "~/renderer/hooks/useResize"; +import { PlaceholderLine } from "./Placeholder"; type BalanceSinceProps = { valueChange: ValueChange; @@ -35,6 +39,7 @@ type BalanceTotalProps = { }; type Props = { unit: Unit; + counterValueId?: string; } & BalanceSinceProps; export function BalanceDiff({ valueChange, unit, isAvailable, ...boxProps }: Props) { if (!isAvailable) return null; @@ -115,11 +120,28 @@ export function BalanceTotal({ ); } -export default function BalanceInfos({ totalBalance, valueChange, isAvailable, unit }: Props) { +export default function BalanceInfos({ + totalBalance, + valueChange, + isAvailable, + unit, + counterValueId, +}: Props) { const swapDefaultTrack = useGetSwapTrackingProperties(); const { t } = useTranslation(); const history = useHistory(); + const allAccounts = useSelector(accountsSelector); + const flattenedAccounts = useMemo(() => flattenAccounts(allAccounts), [allAccounts]); + + const defaultAccount = useMemo( + () => + counterValueId + ? getAvailableAccountsById(counterValueId, flattenedAccounts).find(Boolean) + : undefined, + [counterValueId, flattenedAccounts], + ); + // Remove "SWAP" and "BUY" redundant buttons when portafolio exchange banner is available const portfolioExchangeBanner = useFeature("portfolioExchangeBanner"); const onBuy = useCallback(() => { @@ -135,8 +157,12 @@ export default function BalanceInfos({ totalBalance, valueChange, isAvailable, u setTrackingSource("Page Portfolio"); history.push({ pathname: "/swap", + state: { + from: history.location.pathname, + defaultAccount, + }, }); - }, [history]); + }, [history, defaultAccount]); const ref = useRef(null); const { width } = useResize(ref); diff --git a/apps/ledger-live-desktop/src/renderer/components/ContextMenu/AccountContextMenu.tsx b/apps/ledger-live-desktop/src/renderer/components/ContextMenu/AccountContextMenu.tsx index 42f57cfd4190..416cad1660f5 100644 --- a/apps/ledger-live-desktop/src/renderer/components/ContextMenu/AccountContextMenu.tsx +++ b/apps/ledger-live-desktop/src/renderer/components/ContextMenu/AccountContextMenu.tsx @@ -121,6 +121,7 @@ export default function AccountContextMenu({ defaultCurrency: currency, defaultAccount: account, defaultParentAccount: parentAccount, + from: history.location.pathname, }, }); }, diff --git a/apps/ledger-live-desktop/src/renderer/modals/NoFundsStake/index.tsx b/apps/ledger-live-desktop/src/renderer/modals/NoFundsStake/index.tsx index da700c9ad4b5..44b9809ef946 100644 --- a/apps/ledger-live-desktop/src/renderer/modals/NoFundsStake/index.tsx +++ b/apps/ledger-live-desktop/src/renderer/modals/NoFundsStake/index.tsx @@ -92,6 +92,7 @@ const NoFundsStakeModal = ({ account, parentAccount, entryPoint }: NoFundsStakeM defaultCurrency: currency, defaultAccount: account, defaultParentAccount: parentAccount, + from: history.location.pathname, }, }); }, [currency, account, parentAccount, history, dispatch]); diff --git a/apps/ledger-live-desktop/src/renderer/screens/account/AccountHeaderActions.tsx b/apps/ledger-live-desktop/src/renderer/screens/account/AccountHeaderActions.tsx index d2e25a7714e0..5732eafdf0ac 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/account/AccountHeaderActions.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/account/AccountHeaderActions.tsx @@ -250,6 +250,7 @@ const AccountHeaderActions = ({ account, parentAccount, openModal }: Props) => { defaultCurrency: currency, defaultAccount: account, defaultParentAccount: parentAccount, + from: history.location.pathname, }, }); }, [currency, swapDefaultTrack, history, account, parentAccount, buttonSharedTrackingFields]); diff --git a/apps/ledger-live-desktop/src/renderer/screens/asset/AssetBalanceSummaryHeader.tsx b/apps/ledger-live-desktop/src/renderer/screens/asset/AssetBalanceSummaryHeader.tsx index a80be7c3568f..a7c760c5239d 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/asset/AssetBalanceSummaryHeader.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/asset/AssetBalanceSummaryHeader.tsx @@ -110,6 +110,7 @@ export default function AssetBalanceSummaryHeader({ state: { defaultAccount: account, defaultCurrency: currency, + from: history.location.pathname, }, }); }, [currency, history, swapDefaultTrack, account]); diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/GlobalSummary.tsx b/apps/ledger-live-desktop/src/renderer/screens/dashboard/GlobalSummary.tsx index 960a0f1a5447..0707e548e6f7 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/dashboard/GlobalSummary.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/dashboard/GlobalSummary.tsx @@ -46,6 +46,7 @@ export default function PortfolioBalanceSummary({ range, chartColor, counterValu "bc1qed3mqr92zvq2s782aqkyx785u23723w02qfrgs"; @@ -112,7 +117,11 @@ const SwapWebView = ({ manifest, liveAppUnavailable }: SwapWebProps) => { const accounts = useSelector(flattenAccountsSelector); const { t } = useTranslation(); const swapDefaultTrack = useGetSwapTrackingProperties(); - const { state } = useLocation<{ defaultAccount?: AccountLike; defaultParentAccount?: Account }>(); + const { state } = useLocation<{ + defaultAccount?: AccountLike; + defaultParentAccount?: Account; + from?: string; + }>(); const redirectToHistory = useRedirectToSwapHistory(); const { networkStatus } = useNetworkStatus(); @@ -270,6 +279,10 @@ const SwapWebView = ({ manifest, liveAppUnavailable }: SwapWebProps) => { [], ); + useEffect(() => { + console.log("xxxx", state); + }, [state]); + const hashString = useMemo( () => new URLSearchParams({ @@ -283,8 +296,9 @@ const SwapWebView = ({ manifest, liveAppUnavailable }: SwapWebProps) => { ).id, } : {}), + ...(state?.from ? { fromPath: simplifyFromPath(state.from) } : {}), }).toString(), - [isOffline, state?.defaultAccount, state?.defaultParentAccount, walletState], + [isOffline, state?.defaultAccount, state?.defaultParentAccount, walletState, state?.from], ); const onSwapWebviewError = (error?: SwapLiveError) => { diff --git a/apps/ledger-live-desktop/src/renderer/screens/market/hooks/useMarketActions.ts b/apps/ledger-live-desktop/src/renderer/screens/market/hooks/useMarketActions.ts index 57689634d5bf..a453ab1bccd5 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/market/hooks/useMarketActions.ts +++ b/apps/ledger-live-desktop/src/renderer/screens/market/hooks/useMarketActions.ts @@ -104,6 +104,7 @@ export const useMarketActions = ({ currency, page, currenciesAll }: MarketAction "parentId" in defaultAccount && defaultAccount.parentId ? flattenedAccounts.find(a => a.id === defaultAccount.parentId) : null, + from: history.location.pathname, }, }); } From 03c3a53559a81d77b046bf6e31d75184af8495d9 Mon Sep 17 00:00:00 2001 From: Kieran Allen Date: Tue, 24 Sep 2024 11:52:01 +0100 Subject: [PATCH 12/94] chore: add changeset --- .changeset/plenty-hornets-turn.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/plenty-hornets-turn.md diff --git a/.changeset/plenty-hornets-turn.md b/.changeset/plenty-hornets-turn.md new file mode 100644 index 000000000000..ddc7d6958572 --- /dev/null +++ b/.changeset/plenty-hornets-turn.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +pass from and default accounts to all instances of redirect to /swap From 01529de7070116acfabd316ce11d995d1b91f7fc Mon Sep 17 00:00:00 2001 From: Kieran Allen Date: Tue, 24 Sep 2024 13:42:57 +0100 Subject: [PATCH 13/94] fix: remove debugging logs --- .../renderer/screens/exchange/Swap2/Form/SwapWebViewDemo3.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/SwapWebViewDemo3.tsx b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/SwapWebViewDemo3.tsx index 946fbff76521..fb394f656c39 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/SwapWebViewDemo3.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/SwapWebViewDemo3.tsx @@ -279,10 +279,6 @@ const SwapWebView = ({ manifest, liveAppUnavailable }: SwapWebProps) => { [], ); - useEffect(() => { - console.log("xxxx", state); - }, [state]); - const hashString = useMemo( () => new URLSearchParams({ From f9811e02ffe68c4acb165d0932059d020bbca2f4 Mon Sep 17 00:00:00 2001 From: "Valentin D. Pinkman" Date: Tue, 24 Sep 2024 11:58:14 +0200 Subject: [PATCH 14/94] chore: update turbo.json config to allow envs to be passed --- .changeset/olive-drinks-complain.md | 6 +++ turbo.json | 64 +++++++++++++++++++++-------- 2 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 .changeset/olive-drinks-complain.md diff --git a/.changeset/olive-drinks-complain.md b/.changeset/olive-drinks-complain.md new file mode 100644 index 000000000000..8bd20d8f14ad --- /dev/null +++ b/.changeset/olive-drinks-complain.md @@ -0,0 +1,6 @@ +--- +"ledger-live-desktop": patch +"live-mobile": patch +--- + +Update turbo.json to accept envs diff --git a/turbo.json b/turbo.json index 7045b2b91f0d..47c9ae79538e 100644 --- a/turbo.json +++ b/turbo.json @@ -1,6 +1,49 @@ { "$schema": "https://turborepo.org/schema.json", "globalDependencies": ["turbo.json"], + "globalEnv": [ + "ANDROID_HOME", + "ANDROID_KEYSTORE_FILE", + "ANDROID_KEYSTORE_PASS", + "ANDROID_KEY_ALIAS", + "ANDROID_KEY_PASS", + "ANDROID_SDK_ROOT", + "ANALYTICS_TOKEN", + "APPLECONNECT_API_KEY_CONTENT", + "APPLECONNECT_API_KEY_ID", + "APPLECONNECT_API_ISSUER_ID", + "APPLEID", + "APPLEID_PASSWORD", + "APP_IDENTIFIER", + "APP_NAME", + "AZURE_APP_ID", + "AZURE_SECRET", + "BRAZE_ANDROID_API_KEY", + "BRAZE_API_KEY", + "BRAZE_CUSTOM_ENDPOINT", + "BRAZE_IOS_API_KEY", + "CI_KEYCHAIN_PASSWORD", + "DEVELOPER_TEAM_ID", + "ENVFILE", + "FASTLANE_PASSWORD", + "FIREBASE_API_KEY", + "FIREBASE_APP_ID", + "FIREBASE_AUTH_DOMAIN", + "FIREBASE_MESSAGING_SENDER_ID", + "FIREBASE_PROJECT_ID", + "FIREBASE_STORAGE_BUCKET", + "GENERATE_METAFILES", + "GH_TOKEN", + "GIT_REPO_URL", + "GIT_REPO_USER", + "MATCH_PASSWORD", + "MY_APP_BUNDLE_ID", + "SENTRY_AUTH_TOKEN", + "SENTRY_ENVIRONMENT", + "SENTRY_PROJECT", + "SHORT_BUNDLE_ID", + "SUPPLY_UPLOAD_MAX_RETRIES" + ], "ui": "tui", "tasks": { "build": { @@ -31,24 +74,10 @@ "cache": false }, "android:apk:local": { - "dependsOn": ["^build"], - "env": [ - "ANDROID_KEYSTORE_PASS", - "ANDROID_KEY_ALIAS", - "ANDROID_KEY_PASS", - "ANDROID_KEYSTORE_FILE", - "ANDROID_HOME" - ] + "dependsOn": ["^build"] }, "android:apk": { - "dependsOn": ["^build"], - "env": [ - "ANDROID_KEYSTORE_PASS", - "ANDROID_KEY_ALIAS", - "ANDROID_KEY_PASS", - "ANDROID_KEYSTORE_FILE", - "ANDROID_HOME" - ] + "dependsOn": ["^build"] }, "ios:local:ipa": { "dependsOn": ["^build"] @@ -88,8 +117,7 @@ }, "ledger-live-desktop#build": { "dependsOn": ["^build"], - "cache": false, - "env": ["GENERATE_METAFILES"] + "cache": false }, "@ledgerhq/icons-ui#build": { "dependsOn": ["^build"], From f95d6289e11a12f5228b42c51a98a38d61ac7477 Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Tue, 24 Sep 2024 11:50:29 +0200 Subject: [PATCH 15/94] ci: increase maxFailures in CI --- apps/ledger-live-desktop/tests/playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ledger-live-desktop/tests/playwright.config.ts b/apps/ledger-live-desktop/tests/playwright.config.ts index 028af3024939..e35cdf187ac4 100644 --- a/apps/ledger-live-desktop/tests/playwright.config.ts +++ b/apps/ledger-live-desktop/tests/playwright.config.ts @@ -37,7 +37,7 @@ const config: PlaywrightTestConfig = { }, forbidOnly: !!process.env.CI, preserveOutput: process.env.CI ? "failures-only" : "always", - maxFailures: process.env.CI ? 5 : undefined, + maxFailures: process.env.CI ? 10 : undefined, reportSlowTests: process.env.CI ? { max: 0, threshold: 60000 } : null, fullyParallel: true, workers: "50%", // NOTE: 'macos-latest' and 'windows-latest' can't run 3 concurrent workers From c55d0b356beb03698e3cca04db0e9522ece46440 Mon Sep 17 00:00:00 2001 From: Lucas Werey <73439207+LucasWerey@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:31:59 +0200 Subject: [PATCH 16/94] :sparkles:(lld): add empty message and dummy drawer for ordis (#7881) --- .changeset/empty-clouds-glow.md | 5 ++ .../Ordinals/components/Error.tsx | 9 +++- .../Inscriptions/DetailsDrawer/index.tsx | 18 +++++++ .../components/Inscriptions/helpers.ts | 10 ++-- .../components/Inscriptions/index.tsx | 50 ++++++++++++++++--- .../Inscriptions/useInscriptionsModel.tsx | 25 ++++++---- .../Ordinals/components/RareSats/index.tsx | 33 +++++++++--- .../Ordinals/screens/Account/index.tsx | 17 ++++++- .../screens/Account/useBitcoinAccountModel.ts | 30 ++++++++++- .../components/Collection/EmptyCollection.tsx | 20 ++++++-- .../Collectibles/hooks/useFetchOrdinals.ts | 4 +- .../src/renderer/modals/Receive/Body.tsx | 3 ++ .../static/i18n/en/app.json | 7 ++- 13 files changed, 187 insertions(+), 44 deletions(-) create mode 100644 .changeset/empty-clouds-glow.md create mode 100644 apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx diff --git a/.changeset/empty-clouds-glow.md b/.changeset/empty-clouds-glow.md new file mode 100644 index 000000000000..373b48d68356 --- /dev/null +++ b/.changeset/empty-clouds-glow.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +Add ui for empty rare sats and inscriptions. Add error message from Error when inscriptions / rare sats can't load. Add dumy drawer for inscriptions diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Error.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Error.tsx index 6e08b8876426..7a668f81ae3a 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Error.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Error.tsx @@ -2,13 +2,18 @@ import React from "react"; import { Flex, Icons, Text } from "@ledgerhq/react-ui"; import { useTranslation } from "react-i18next"; -const Error: React.FC = () => { +type Props = { + error: Error; +}; + +const Error: React.FC = ({ error }) => { const { t } = useTranslation(); return ( - + {t("crash.title")} + {`(${error?.message})`} ); }; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx new file mode 100644 index 000000000000..eb7ff49015cf --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx @@ -0,0 +1,18 @@ +import React from "react"; +import { SideDrawer } from "~/renderer/components/SideDrawer"; +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; + +type Props = { + inscription: SimpleHashNft; + onClose: () => void; +}; +const InscriptionDetailsDrawer: React.FC = ({ inscription, onClose }) => { + // will be replaced by DetailsDrawer from collectibles + return ( + + {inscription.name || inscription.contract.name} + + ); +}; + +export default InscriptionDetailsDrawer; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/helpers.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/helpers.ts index 0917bb99b130..7ea111c9c9c9 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/helpers.ts +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/helpers.ts @@ -25,7 +25,10 @@ function matchCorrespondingIcon( }); } -export function getInscriptionsData(inscriptions: SimpleHashNft[]) { +export function getInscriptionsData( + inscriptions: SimpleHashNft[], + onInscriptionClick: (inscription: SimpleHashNft) => void, +) { const inscriptionsWithIcons = matchCorrespondingIcon(inscriptions); return inscriptionsWithIcons.map(item => ({ tokenName: item.name || item.contract.name || "", @@ -39,9 +42,6 @@ export function getInscriptionsData(inscriptions: SimpleHashNft[]) { contentType: item.extra_metadata?.ordinal_details?.content_type, mediaType: "image", }, - onClick: () => { - console.log(`you clicked on : \x1b[32m${item.name}\x1b[0m inscription`); - }, - // it does nothing for now but it will be used for the next PR with the drawer + onClick: () => onInscriptionClick(item), })); } diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/index.tsx index 489b9f88d905..3e88f98b0e75 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/index.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Box, Flex } from "@ledgerhq/react-ui"; +import { Box, Flex, Icons } from "@ledgerhq/react-ui"; import { useInscriptionsModel } from "./useInscriptionsModel"; import TableContainer from "~/renderer/components/TableContainer"; import TableHeader from "LLD/features/Collectibles/components/Collection/TableHeader"; @@ -9,13 +9,25 @@ import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; import Loader from "../Loader"; import Error from "../Error"; import Item from "./Item"; +import EmptyCollection from "LLD/features/Collectibles/components/Collection/EmptyCollection"; +import { CollectibleTypeEnum } from "../../../types/enum/Collectibles"; +import Button from "~/renderer/components/Button"; +import { useTranslation } from "react-i18next"; -type ViewProps = ReturnType & { isLoading: boolean; isError: boolean }; +type ViewProps = ReturnType & { + isLoading: boolean; + isError: boolean; + error: Error | null; + onReceive: () => void; +}; type Props = { inscriptions: SimpleHashNft[]; isLoading: boolean; isError: boolean; + error: Error | null; + onReceive: () => void; + onInscriptionClick: (inscription: SimpleHashNft) => void; }; const View: React.FC = ({ @@ -23,17 +35,21 @@ const View: React.FC = ({ isLoading, isError, inscriptions, + error, onShowMore, + onReceive, }) => { + const { t } = useTranslation(); const hasInscriptions = inscriptions.length > 0 && !isError; const nothingToShow = !hasInscriptions && !isLoading && !isError; + const hasError = isError && error; return ( {isLoading && } - {isError && } + {hasError && } {hasInscriptions && inscriptions.map((item, index) => ( = ({ /> ))} {nothingToShow && ( - - {"NOTHING TO SHOW WAITING FOR DESIGN"} - + + + )} {displayShowMore && !isError && } @@ -58,8 +79,21 @@ const View: React.FC = ({ ); }; -const Inscriptions: React.FC = ({ inscriptions, isLoading, isError }) => ( - +const Inscriptions: React.FC = ({ + inscriptions, + isLoading, + isError, + error, + onReceive, + onInscriptionClick, +}) => ( + ); export default Inscriptions; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/useInscriptionsModel.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/useInscriptionsModel.tsx index c3893f978713..431e3234b68f 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/useInscriptionsModel.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/useInscriptionsModel.tsx @@ -5,21 +5,28 @@ import { InscriptionsItemProps } from "LLD/features/Collectibles/types/Inscripti type Props = { inscriptions: SimpleHashNft[]; + onInscriptionClick: (inscription: SimpleHashNft) => void; }; -export const useInscriptionsModel = ({ inscriptions }: Props) => { - const [displayShowMore, setDisplayShowMore] = useState(false); - const [displayedObjects, setDisplayedObjects] = useState([]); - +export const useInscriptionsModel = ({ inscriptions, onInscriptionClick }: Props) => { const items: InscriptionsItemProps[] = useMemo( - () => getInscriptionsData(inscriptions), - [inscriptions], + () => getInscriptionsData(inscriptions, onInscriptionClick), + [inscriptions, onInscriptionClick], ); + const initialDisplayedObjects = items.slice(0, 3); + const initialDisplayShowMore = items.length > 3; + + const [displayShowMore, setDisplayShowMore] = useState(initialDisplayShowMore); + const [displayedObjects, setDisplayedObjects] = + useState(initialDisplayedObjects); + useEffect(() => { - if (items.length > 3) setDisplayShowMore(true); - setDisplayedObjects(items.slice(0, 3)); - }, [items]); + if (displayedObjects.length === 0) { + if (items.length > 3) setDisplayShowMore(true); + setDisplayedObjects(items.slice(0, 3)); + } + }, [items, displayedObjects.length]); const onShowMore = () => { setDisplayedObjects(prevDisplayedObjects => { diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/index.tsx index fe8603eedfb6..e1e8dc8f9adb 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/index.tsx @@ -4,16 +4,22 @@ import TableContainer from "~/renderer/components/TableContainer"; import TableHeader from "LLD/features/Collectibles/components/Collection/TableHeader"; import Item from "./Item"; import { TableHeaderTitleKey } from "LLD/features/Collectibles/types/Collection"; -import { Box, Flex } from "@ledgerhq/react-ui"; +import { Box, Flex, Icons } from "@ledgerhq/react-ui"; import { TableHeader as TableHeaderContainer } from "./TableHeader"; import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; import Loader from "../Loader"; import Error from "../Error"; +import EmptyCollection from "../../../components/Collection/EmptyCollection"; +import { CollectibleTypeEnum } from "../../../types/enum/Collectibles"; +import Button from "~/renderer/components/Button"; +import { useTranslation } from "react-i18next"; type ViewProps = ReturnType & { isLoading: boolean; isError: boolean; isFetched: boolean; + error: Error | null; + onReceive: () => void; }; type Props = { @@ -21,19 +27,23 @@ type Props = { isLoading: boolean; isError: boolean; isFetched: boolean; + error: Error | null; + onReceive: () => void; }; -function View({ rareSats, isLoading, isError, isFetched }: ViewProps) { - const isLoaded = isFetched; +function View({ rareSats, isLoading, isError, isFetched, error, onReceive }: ViewProps) { + const { t } = useTranslation(); + const isLoaded = isFetched && !isError && !isLoading; const hasRareSats = Object.values(rareSats).length > 0; const dataReady = isLoaded && hasRareSats; + const hasError = isError && error; return ( {isLoading && } - {isError && } + {hasError && } {dataReady && } {dataReady && @@ -45,9 +55,14 @@ function View({ rareSats, isLoading, isError, isFetched }: ViewProps) { ))} {isLoaded && !hasRareSats && ( - - {"NOTHING TO SHOW WAITING FOR DESIGN"} - + + + )} @@ -55,12 +70,14 @@ function View({ rareSats, isLoading, isError, isFetched }: ViewProps) { ); } -const RareSats = ({ rareSats, isLoading, isError, isFetched }: Props) => { +const RareSats = ({ rareSats, isLoading, isError, isFetched, error, onReceive }: Props) => { return ( ); diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx index 7f8bb60fa721..f1683da348f9 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx @@ -5,6 +5,7 @@ import RareSats from "../../components/RareSats"; import DiscoveryDrawer from "../../components/Inscriptions/DiscoveryDrawer"; import { BitcoinAccount } from "@ledgerhq/coin-bitcoin/lib/types"; import { useBitcoinAccountModel } from "./useBitcoinAccountModel"; +import InscriptionDetailsDrawer from "../../components/Inscriptions/DetailsDrawer"; type ViewProps = ReturnType; @@ -17,12 +18,24 @@ const View: React.FC = ({ rest, rareSats, isDrawerOpen, + selectedInscription, handleDrawerClose, + onReceive, + onInscriptionClick, + onDetailsDrawerClose, }) => ( - - + + + {selectedInscription && ( + + )} ); diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/useBitcoinAccountModel.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/useBitcoinAccountModel.ts index 0c7ab8993add..b6bbe99d37d3 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/useBitcoinAccountModel.ts +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/useBitcoinAccountModel.ts @@ -1,7 +1,9 @@ import { BitcoinAccount } from "@ledgerhq/coin-bitcoin/lib/types"; +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; import useFetchOrdinals from "LLD/features/Collectibles/hooks/useFetchOrdinals"; -import { useState, useEffect } from "react"; +import { useState, useEffect, useCallback } from "react"; import { useDispatch, useSelector } from "react-redux"; +import { openModal } from "~/renderer/actions/modals"; import { setHasSeenOrdinalsDiscoveryDrawer } from "~/renderer/actions/settings"; import { hasSeenOrdinalsDiscoveryDrawerSelector } from "~/renderer/reducers/settings"; @@ -12,6 +14,7 @@ interface Props { export const useBitcoinAccountModel = ({ account }: Props) => { const dispatch = useDispatch(); const hasSeenDiscoveryDrawer = useSelector(hasSeenOrdinalsDiscoveryDrawerSelector); + const [selectedInscription, setSelectedInscription] = useState(null); const { rareSats, inscriptions, ...rest } = useFetchOrdinals({ account }); @@ -28,5 +31,28 @@ export const useBitcoinAccountModel = ({ account }: Props) => { dispatch(setHasSeenOrdinalsDiscoveryDrawer(true)); }; - return { rareSats, inscriptions, rest, isDrawerOpen, handleDrawerClose }; + const onReceive = useCallback(() => { + dispatch( + openModal("MODAL_RECEIVE", { + account, + receiveOrdinalMode: true, + }), + ); + }, [dispatch, account]); + + const onInscriptionClick = (inscription: SimpleHashNft) => setSelectedInscription(inscription); + + const onDetailsDrawerClose = () => setSelectedInscription(null); + + return { + rareSats, + inscriptions, + rest, + isDrawerOpen, + selectedInscription, + onReceive, + handleDrawerClose, + onInscriptionClick, + onDetailsDrawerClose, + }; }; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/components/Collection/EmptyCollection.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/components/Collection/EmptyCollection.tsx index 464912b45c42..9dde6dc79a93 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/components/Collection/EmptyCollection.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/components/Collection/EmptyCollection.tsx @@ -30,7 +30,7 @@ const Placeholder = styled.div` type Props = { collectionType: CollectibleType; - currencyName: string; + currencyName?: string; children?: ReactNode; }; @@ -59,8 +59,22 @@ const EmptyCollection: React.FC = ({ collectionType, currencyName, childr ); - case CollectibleTypeEnum.Ordinal: - return null; + case CollectibleTypeEnum.Inscriptions: + return ( + + + {t("ordinals.inscriptions.empty")} + + + ); + case CollectibleTypeEnum.RareSat: + return ( + + + {t("ordinals.rareSats.empty")} + + + ); default: return t("collectibles.emptyState.default"); } diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useFetchOrdinals.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useFetchOrdinals.ts index 01da9b38977c..17587a67bff1 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useFetchOrdinals.ts +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useFetchOrdinals.ts @@ -7,12 +7,10 @@ type Props = { const useFetchOrdinals = ({ account }: Props) => { const utxosAddresses = account.bitcoinResources?.utxos?.map(utxo => utxo.address).join(",") || ""; - const { rareSats, inscriptions, isLoading, isError, isFetched } = fetchOrdinalsFromSimpleHash({ + return fetchOrdinalsFromSimpleHash({ addresses: utxosAddresses, threshold: 0, }); - - return { rareSats, inscriptions, isLoading, isError, isFetched }; }; export default useFetchOrdinals; diff --git a/apps/ledger-live-desktop/src/renderer/modals/Receive/Body.tsx b/apps/ledger-live-desktop/src/renderer/modals/Receive/Body.tsx index a78d8185ec59..821fc94f75a8 100644 --- a/apps/ledger-live-desktop/src/renderer/modals/Receive/Body.tsx +++ b/apps/ledger-live-desktop/src/renderer/modals/Receive/Body.tsx @@ -28,6 +28,7 @@ export type Data = { startWithWarning?: boolean; receiveTokenMode?: boolean; receiveNFTMode?: boolean; + receiveOrdinalMode?: boolean; eventType?: string; isFromPostOnboardingEntryPoint?: boolean; }; @@ -58,6 +59,7 @@ export type StepProps = { token: TokenCurrency | undefined | null; receiveTokenMode: boolean; receiveNFTMode: boolean; + receiveOrdinalMode: boolean; closeModal: () => void; isAddressVerified: boolean | undefined | null; verifyAddressError: Error | undefined | null; @@ -208,6 +210,7 @@ const Body = ({ disabledSteps, receiveTokenMode: !!params.receiveTokenMode, receiveNFTMode: !!params.receiveNFTMode, + receiveOrdinalMode: !!params.receiveOrdinalMode, hideBreadcrumb, token, isAddressVerified, diff --git a/apps/ledger-live-desktop/static/i18n/en/app.json b/apps/ledger-live-desktop/static/i18n/en/app.json index 23772be65a3c..9d544abbb96e 100644 --- a/apps/ledger-live-desktop/static/i18n/en/app.json +++ b/apps/ledger-live-desktop/static/i18n/en/app.json @@ -6595,6 +6595,8 @@ "ordinals": { "inscriptions": { "seeMore": "See more inscriptions", + "empty": "To add Inscriptions, simply send them to your Bitcoin address.", + "receive": "Receive Inscription", "discoveryDrawer": { "title": "Discover Ordinals", "description": "Do you know that you may own valuable rare sats and inscriptions?", @@ -6603,11 +6605,12 @@ } }, "rareSats": { + "empty": "To add Rare Sats, simply send them to your Bitcoin address.", + "receive": "Receive Rare Sat", "title": "Rare Sats", "table": { "type": "Sat Type / Amount", - "year": "Year", - "utxo": "UTXO size" + "year": "Year" }, "rareSat": { "description": { From b2dcc7256f976734b27705725340286c72d5f7f1 Mon Sep 17 00:00:00 2001 From: Louis Aussedat Date: Wed, 25 Sep 2024 10:35:45 +0200 Subject: [PATCH 17/94] =?UTF-8?q?=F0=9F=93=A6=20(context-module/keyring-et?= =?UTF-8?q?h):=20make=20packages=20private?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/ledgerjs/packages/context-module/package.json | 3 ++- libs/ledgerjs/packages/keyring-eth/package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/ledgerjs/packages/context-module/package.json b/libs/ledgerjs/packages/context-module/package.json index 23a5d085f499..ad179126033b 100644 --- a/libs/ledgerjs/packages/context-module/package.json +++ b/libs/ledgerjs/packages/context-module/package.json @@ -2,6 +2,7 @@ "name": "@ledgerhq/context-module", "version": "0.1.1", "description": "Ledger context module", + "private": true, "files": [ "./lib" ], @@ -29,4 +30,4 @@ "axios": "1.7.3", "ethers": "^5.7.2" } -} \ No newline at end of file +} diff --git a/libs/ledgerjs/packages/keyring-eth/package.json b/libs/ledgerjs/packages/keyring-eth/package.json index a7ea83c75c43..d86eeb7d4592 100644 --- a/libs/ledgerjs/packages/keyring-eth/package.json +++ b/libs/ledgerjs/packages/keyring-eth/package.json @@ -2,6 +2,7 @@ "name": "@ledgerhq/keyring-eth", "version": "0.2.3", "description": "Ledger keyring eth module", + "private": true, "files": [ "./lib" ], From 898174308b195a951dc914e7d838a70b35250dcd Mon Sep 17 00:00:00 2001 From: Abdurrahman Sastim <106583189+abdurrahman-ledger@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:53:13 +0200 Subject: [PATCH 18/94] [QAA-206] Increase max failure to speculos test only (#7899) test: increase max failure to speculos test only --- .github/workflows/test-ui-e2e-only-desktop.yml | 2 +- apps/ledger-live-desktop/tests/playwright.config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-ui-e2e-only-desktop.yml b/.github/workflows/test-ui-e2e-only-desktop.yml index 5ea2379d9460..8cce945c1b09 100644 --- a/.github/workflows/test-ui-e2e-only-desktop.yml +++ b/.github/workflows/test-ui-e2e-only-desktop.yml @@ -130,7 +130,7 @@ jobs: export COINAPPS=$PWD/coin-apps export MOCK=0 if [ "${{ inputs.invert_filter }}" = true ]; then invert_filter="-invert"; fi - xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm desktop test:playwright:speculos ${INPUTS_TEST_FILTER:+--grep$invert_filter} "${{ inputs.test_filter }}" --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm desktop test:playwright:speculos --max-failures 50 ${INPUTS_TEST_FILTER:+--grep$invert_filter} "${{ inputs.test_filter }}" --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} env: INPUTS_TEST_FILTER: ${{ inputs.test_filter }} SEED: ${{ secrets.SEED_QAA_B2C }} diff --git a/apps/ledger-live-desktop/tests/playwright.config.ts b/apps/ledger-live-desktop/tests/playwright.config.ts index e35cdf187ac4..028af3024939 100644 --- a/apps/ledger-live-desktop/tests/playwright.config.ts +++ b/apps/ledger-live-desktop/tests/playwright.config.ts @@ -37,7 +37,7 @@ const config: PlaywrightTestConfig = { }, forbidOnly: !!process.env.CI, preserveOutput: process.env.CI ? "failures-only" : "always", - maxFailures: process.env.CI ? 10 : undefined, + maxFailures: process.env.CI ? 5 : undefined, reportSlowTests: process.env.CI ? { max: 0, threshold: 60000 } : null, fullyParallel: true, workers: "50%", // NOTE: 'macos-latest' and 'windows-latest' can't run 3 concurrent workers From 6340b8b78a76719d986282a956489e016e836ab4 Mon Sep 17 00:00:00 2001 From: Kant Date: Wed, 25 Sep 2024 15:20:32 +0200 Subject: [PATCH 19/94] chore: mark start tasks as `persistent` to enable `interactive` mode From the doc: Label a task as persistent to prevent other tasks from depending on long-running processes. https://turbo.build/repo/docs/reference/configuration#persistent --- turbo.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index 47c9ae79538e..140d8db52b3d 100644 --- a/turbo.json +++ b/turbo.json @@ -68,7 +68,8 @@ }, "start": { "cache": false, - "dependsOn": ["^build"] + "dependsOn": ["^build"], + "persistent": true }, "unimported": { "cache": false From f16375ded204392f6e0e9af46e1c49362ce49561 Mon Sep 17 00:00:00 2001 From: Kant Date: Wed, 25 Sep 2024 15:34:41 +0200 Subject: [PATCH 20/94] fix(wallet-api): only call success and fail handlers when closing the flow on LLM Allows to properly retry the sign message without sending an error through the wallet-api We also only send the success when we actually close the last success screen --- .changeset/clever-rocks-watch.md | 8 ++++++++ .../src/screens/SignMessage/04-ValidationError.tsx | 8 +++----- .../src/screens/SignMessage/04-ValidationSuccess.tsx | 9 ++++----- 3 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 .changeset/clever-rocks-watch.md diff --git a/.changeset/clever-rocks-watch.md b/.changeset/clever-rocks-watch.md new file mode 100644 index 000000000000..fcdf5af7b7ac --- /dev/null +++ b/.changeset/clever-rocks-watch.md @@ -0,0 +1,8 @@ +--- +"live-mobile": patch +--- + +fix(wallet-api): only call success and fail handlers when closing the flow on LLM + +Allows to properly retry the sign message without sending an error through the wallet-api +We also only send the success when we actually close the last success screen diff --git a/apps/ledger-live-mobile/src/screens/SignMessage/04-ValidationError.tsx b/apps/ledger-live-mobile/src/screens/SignMessage/04-ValidationError.tsx index 13facc028e45..b0aff88d5a3d 100644 --- a/apps/ledger-live-mobile/src/screens/SignMessage/04-ValidationError.tsx +++ b/apps/ledger-live-mobile/src/screens/SignMessage/04-ValidationError.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect } from "react"; +import React, { useCallback } from "react"; import { StyleSheet } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; import { CompositeScreenProps, useTheme } from "@react-navigation/native"; @@ -22,14 +22,12 @@ export default function ValidationError({ navigation, route }: Navigation) { const { colors } = useTheme(); const { error, onFailHandler } = route.params; - useEffect(() => { + const onClose = useCallback(() => { if (onFailHandler && error) { onFailHandler(error); } - }, [onFailHandler, error]); - const onClose = useCallback(() => { navigation.getParent>().pop(); - }, [navigation]); + }, [error, navigation, onFailHandler]); const retry = useCallback(() => { navigation.goBack(); }, [navigation]); diff --git a/apps/ledger-live-mobile/src/screens/SignMessage/04-ValidationSuccess.tsx b/apps/ledger-live-mobile/src/screens/SignMessage/04-ValidationSuccess.tsx index 9e1e3daa100f..3480b7c4ee8d 100644 --- a/apps/ledger-live-mobile/src/screens/SignMessage/04-ValidationSuccess.tsx +++ b/apps/ledger-live-mobile/src/screens/SignMessage/04-ValidationSuccess.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect } from "react"; +import React, { useCallback } from "react"; import { View, StyleSheet } from "react-native"; import { useTranslation } from "react-i18next"; import { CompositeScreenProps, useTheme } from "@react-navigation/native"; @@ -25,14 +25,13 @@ export default function ValidationSuccess({ const { t } = useTranslation(); const { signature, onConfirmationHandler } = route.params; - useEffect(() => { + const onClose = useCallback(() => { if (onConfirmationHandler && signature) { onConfirmationHandler(signature); } - }, [onConfirmationHandler, signature]); - const onClose = useCallback(() => { navigation.getParent>().pop(); - }, [navigation]); + }, [navigation, onConfirmationHandler, signature]); + return ( Date: Wed, 25 Sep 2024 15:45:05 +0200 Subject: [PATCH 21/94] fix(LLM): wallet-connect deep-link from native app for a request would reload the page [LIVE-13641] Reloading the page would break the wallet-api flow shown when coming back to the app --- .changeset/sour-poets-play.md | 7 +++++++ .../src/navigation/DeeplinksProvider.tsx | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/sour-poets-play.md diff --git a/.changeset/sour-poets-play.md b/.changeset/sour-poets-play.md new file mode 100644 index 000000000000..ae7b88b5aee8 --- /dev/null +++ b/.changeset/sour-poets-play.md @@ -0,0 +1,7 @@ +--- +"live-mobile": patch +--- + +fix(LLM): wallet-connect deep-link from native app for a request would reload the page + +Reloading the page would break the wallet-api flow shown when coming back to the app diff --git a/apps/ledger-live-mobile/src/navigation/DeeplinksProvider.tsx b/apps/ledger-live-mobile/src/navigation/DeeplinksProvider.tsx index ebbd52345b89..1b2b3d634c1f 100644 --- a/apps/ledger-live-mobile/src/navigation/DeeplinksProvider.tsx +++ b/apps/ledger-live-mobile/src/navigation/DeeplinksProvider.tsx @@ -459,7 +459,7 @@ export const DeeplinksProvider = ({ ) { const uri = isWalletConnectUrl(url) ? url : new URL(url).searchParams.get("uri"); // Only update for a connection not a request - if (uri && !new URL(uri).searchParams.get("requestId")) { + if (uri && uri !== "wc:" && !new URL(uri).searchParams.get("requestId")) { // TODO use wallet-api to push event instead of reloading the webview dispatch(setWallectConnectUri(uri)); } From 0295c4b6f66c608e1310d247c7d276f6746a2c62 Mon Sep 17 00:00:00 2001 From: Angus Bayley Date: Wed, 25 Sep 2024 10:24:37 +0100 Subject: [PATCH 22/94] docs: specify xcode version in LLM readme --- apps/ledger-live-mobile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ledger-live-mobile/README.md b/apps/ledger-live-mobile/README.md index 00a62dd8bd88..15da94b620ba 100644 --- a/apps/ledger-live-mobile/README.md +++ b/apps/ledger-live-mobile/README.md @@ -25,7 +25,7 @@ We also share core business logic with Ledger Live mobile through [@ledgerhq/liv ### iOS -- XCode +- XCode (our CI builds run 15.4, so 15.4 is recommended) - Ruby 3.3.0 or above. The macOS built-in Ruby [does not work properly for installing dependencies of the iOS app](https://jeffreymorgan.io/articles/ruby-on-macos-with-rvm/), you have to install Ruby with for instance [Homebrew](https://brew.sh/) or [rvm](https://rvm.io/rvm/install) and make sure that `which ruby` points to that newly installed Ruby. ### Android From 2f71fecc0e4bd2692277386931978242a25a364c Mon Sep 17 00:00:00 2001 From: Samy Rabah Date: Wed, 25 Sep 2024 17:20:23 +0200 Subject: [PATCH 23/94] chore: update default explorer for local base & zkevm config (#7817) * chore: update default explorer for local base & zkevm config * update test --- .changeset/four-worms-end.md | 6 ++++++ .../src/__tests__/integration/bridge.integration.test.ts | 7 +++---- libs/ledger-live-common/src/families/evm/config.ts | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/four-worms-end.md diff --git a/.changeset/four-worms-end.md b/.changeset/four-worms-end.md new file mode 100644 index 000000000000..a64eceb72b84 --- /dev/null +++ b/.changeset/four-worms-end.md @@ -0,0 +1,6 @@ +--- +"@ledgerhq/live-common": patch +"@ledgerhq/coin-evm": patch +--- + +chore: update default explorer for local base & zkevm config, update evm bridge test diff --git a/libs/coin-modules/coin-evm/src/__tests__/integration/bridge.integration.test.ts b/libs/coin-modules/coin-evm/src/__tests__/integration/bridge.integration.test.ts index 0bcc5b6d7987..450360e7c27c 100644 --- a/libs/coin-modules/coin-evm/src/__tests__/integration/bridge.integration.test.ts +++ b/libs/coin-modules/coin-evm/src/__tests__/integration/bridge.integration.test.ts @@ -2,7 +2,7 @@ * ⚠️ In order to test this file, you must run the test from the live-common repo */ -import { FeeNotLoaded, NotEnoughBalance } from "@ledgerhq/errors"; +import { NotEnoughBalance } from "@ledgerhq/errors"; import type { AccountRaw, DatasetTest, TransactionStatusCommon } from "@ledgerhq/types-live"; import { BigNumber } from "bignumber.js"; import { ethereum1 } from "../../datasets/ethereum1"; @@ -33,15 +33,14 @@ export const dataset: DatasetTest = { chainId: 1, nonce: 0, }), - expectedStatus: (_account, transaction): Partial => { - const estimatedFees = transaction.gasLimit.times(transaction.maxFeePerGas || 0); + expectedStatus: (_account, _, status): Partial => { + const estimatedFees = status.estimatedFees; return { amount: new BigNumber(1e19), // 10 ETH estimatedFees, // fees are calculated during preparation and therefore cannot be guessed without mocks totalSpent: new BigNumber(1e19).plus(estimatedFees), // fees are calculated during preparation and therefore cannot be guessed without mocks errors: { amount: new NotEnoughBalance(), // "The parent account balance is insufficient for network fees" since account is empty - gasLimit: new FeeNotLoaded(), // "Could not load fee rates. Please set manual fees" because gas estimation failed as the account is empty }, warnings: {}, }; diff --git a/libs/ledger-live-common/src/families/evm/config.ts b/libs/ledger-live-common/src/families/evm/config.ts index 25e97982bfbc..dd667bf20277 100644 --- a/libs/ledger-live-common/src/families/evm/config.ts +++ b/libs/ledger-live-common/src/families/evm/config.ts @@ -550,8 +550,8 @@ const evmConfig: CurrencyLiveConfigDefinition = { uri: "https://zkevm-rpc.com", }, explorer: { - type: "etherscan", - uri: "https://api-zkevm.polygonscan.com/api", + type: "blockscout", + uri: "https://zkevm.blockscout.com/api", }, }, }, @@ -566,8 +566,8 @@ const evmConfig: CurrencyLiveConfigDefinition = { uri: "https://developer-access-mainnet.base.org", }, explorer: { - type: "etherscan", - uri: "https://api.basescan.org/api", + type: "blockscout", + uri: "https://base.blockscout.com/api", }, }, }, From 4847469680cdfdf6fde5b638aa51ecd3e4e71551 Mon Sep 17 00:00:00 2001 From: Lucas Werey <73439207+LucasWerey@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:34:11 +0200 Subject: [PATCH 24/94] =?UTF-8?q?=F0=9F=92=84(llm):=20ui=20and=20message?= =?UTF-8?q?=20on=20receive=20confirmation=20screen=20(#7868)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :lipstick:(llm): ui and message on receive confirmation screen --- .changeset/green-starfishes-suffer.md | 5 + .../modals/Receive/steps/StepReceiveFunds.tsx | 7 +- .../src/locales/en/common.json | 1 + .../screens/ReceiveFunds/03-Confirmation.tsx | 104 +++++++++++------- .../src/currencies/helpers.ts | 4 + 5 files changed, 77 insertions(+), 44 deletions(-) create mode 100644 .changeset/green-starfishes-suffer.md diff --git a/.changeset/green-starfishes-suffer.md b/.changeset/green-starfishes-suffer.md new file mode 100644 index 000000000000..4aacaeeb1498 --- /dev/null +++ b/.changeset/green-starfishes-suffer.md @@ -0,0 +1,5 @@ +--- +"live-mobile": patch +--- + +add change address disclaimer for utxos accounts diff --git a/apps/ledger-live-desktop/src/renderer/modals/Receive/steps/StepReceiveFunds.tsx b/apps/ledger-live-desktop/src/renderer/modals/Receive/steps/StepReceiveFunds.tsx index 20d0c2c9d7d7..fc9fed00f4d4 100644 --- a/apps/ledger-live-desktop/src/renderer/modals/Receive/steps/StepReceiveFunds.tsx +++ b/apps/ledger-live-desktop/src/renderer/modals/Receive/steps/StepReceiveFunds.tsx @@ -40,6 +40,7 @@ import { useCompleteActionCallback } from "~/renderer/components/PostOnboardingH import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName"; import { useMaybeAccountName } from "~/renderer/reducers/wallet"; import { UTXOAddressAlert } from "~/renderer/components/UTXOAddressAlert"; +import { isUTXOCompliant } from "@ledgerhq/live-common/currencies/helpers"; const Separator = styled.div` border-top: 1px solid #99999933; @@ -56,8 +57,6 @@ const QRCodeWrapper = styled.div` background: white; `; -const UTXOFamily = ["bitcoin", "bitcoin_cash", "dash", "dogecoin", "litecoin", "zcash", "cardano"]; - const Receive1ShareAddress = ({ account, name, @@ -69,7 +68,7 @@ const Receive1ShareAddress = ({ address: string; showQRCodeModal: () => void; }) => { - const isUTXOCompliant = UTXOFamily.includes(account.currency.id); + const isUTXOCompliantCurrency = isUTXOCompliant(account.currency.family); return ( <> @@ -99,7 +98,7 @@ const Receive1ShareAddress = ({ - {isUTXOCompliant && ( + {isUTXOCompliantCurrency && ( diff --git a/apps/ledger-live-mobile/src/locales/en/common.json b/apps/ledger-live-mobile/src/locales/en/common.json index 38b2c3e0d8c4..3b23fbe1c237 100644 --- a/apps/ledger-live-mobile/src/locales/en/common.json +++ b/apps/ledger-live-mobile/src/locales/en/common.json @@ -3158,6 +3158,7 @@ } }, "receiveConfirmation": { + "utxoWarning": "For privacy reasons, a new address is generated for every transaction. The previous ones do remain valid.", "title": "Receive {{currencyTicker}}", "onCurrencyName": "On {{currencyName}}", "copyAdress": "Copy address", diff --git a/apps/ledger-live-mobile/src/screens/ReceiveFunds/03-Confirmation.tsx b/apps/ledger-live-mobile/src/screens/ReceiveFunds/03-Confirmation.tsx index a345ece5cd67..8fc419880fcd 100644 --- a/apps/ledger-live-mobile/src/screens/ReceiveFunds/03-Confirmation.tsx +++ b/apps/ledger-live-mobile/src/screens/ReceiveFunds/03-Confirmation.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useMemo, useState } from "react"; -import { Linking, Share, View } from "react-native"; +import { Dimensions, Linking, Share, View } from "react-native"; import { useDispatch, useSelector } from "react-redux"; import QRCode from "react-native-qrcode-svg"; import { useTranslation } from "react-i18next"; @@ -27,7 +27,6 @@ import { ScreenName } from "~/const"; import { track, TrackScreen } from "~/analytics"; import byFamily from "../../generated/Confirmation"; import byFamilyPostAlert from "../../generated/ReceiveConfirmationPostAlert"; - import { ReceiveFundsStackParamList } from "~/components/RootNavigator/types/ReceiveFundsNavigator"; import { BaseComposite, StackNavigatorProps } from "~/components/RootNavigator/types/helpers"; import styled, { BaseStyledProps } from "@ledgerhq/native-ui/components/styled"; @@ -37,12 +36,16 @@ import { BankMedium } from "@ledgerhq/native-ui/assets/icons"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { hasClosedWithdrawBannerSelector } from "~/reducers/settings"; import { setCloseWithdrawBanner } from "~/actions/settings"; -import * as Animatable from "react-native-animatable"; import { useCompleteActionCallback } from "~/logic/postOnboarding/useCompleteAction"; import { urls } from "~/utils/urls"; import { useMaybeAccountName } from "~/reducers/wallet"; - -const AnimatedView = Animatable.View; +import Animated, { + useSharedValue, + useAnimatedStyle, + withTiming, + runOnJS, +} from "react-native-reanimated"; +import { isUTXOCompliant } from "@ledgerhq/live-common/currencies/helpers"; type ScreenProps = BaseComposite< StackNavigatorProps @@ -83,7 +86,7 @@ function ReceiveConfirmationInner({ navigation, route, account, parentAccount }: const insets = useSafeAreaInsets(); const hasClosedWithdrawBanner = useSelector(hasClosedWithdrawBannerSelector); - const [displayBanner, setBanner] = useState(!hasClosedWithdrawBanner); + const [displayBanner, setDisplayBanner] = useState(!hasClosedWithdrawBanner); const onRetry = useCallback(() => { track("button_clicked", { @@ -113,8 +116,9 @@ function ReceiveConfirmationInner({ navigation, route, account, parentAccount }: button: "How to withdraw from exchange", page: "Receive Account Qr Code", }); + dispatch(setCloseWithdrawBanner(true)); - setBanner(false); + setDisplayBanner(false); }, [dispatch]); const clickLearn = () => { @@ -125,6 +129,7 @@ function ReceiveConfirmationInner({ navigation, route, account, parentAccount }: }); Linking.openURL(urls.withdrawCrypto); }; + useEffect(() => { if (route.params?.createTokenAccount && !hasAddedTokenAccount) { const newMainAccount = { ...mainAccount }; @@ -225,9 +230,26 @@ function ReceiveConfirmationInner({ navigation, route, account, parentAccount }: const mainAccountName = useMaybeAccountName(mainAccount); + const screenHeight = Dimensions.get("window").height; + const bannerHeight = useSharedValue(screenHeight * 0.23); + const bannerOpacity = useSharedValue(1); + + const animatedBannerStyle = useAnimatedStyle(() => ({ + height: withTiming(bannerHeight.value, { duration: 200 }, onFinish => { + if (onFinish && bannerHeight.value === 0) { + runOnJS(hideBanner)(); + } + }), + opacity: withTiming(bannerOpacity.value, { duration: 200 }), + })); + + const handleBannerClose = useCallback(() => { + bannerHeight.value = 0; + bannerOpacity.value = 0; + }, [bannerHeight, bannerOpacity]); + if (!account || !currency || !mainAccount) return null; - // check for coin specific UI if (currency.type === "CryptoCurrency" && Object.keys(byFamily).includes(currency.family)) { const CustomConfirmation = currency.type === "CryptoCurrency" @@ -255,8 +277,11 @@ function ReceiveConfirmationInner({ navigation, route, account, parentAccount }: : null; } + const isAnAccount = account.type === "Account"; + const isUTXOCompliantCurrency = isAnAccount && isUTXOCompliant(account.currency.family); + return ( - + - - + + {isUTXOCompliantCurrency && ( + + {t("transfer.receive.receiveConfirmation.utxoWarning")} + + )} + {t("transfer.receive.receiveConfirmation.sendWarning", { network: network || currency.name, })} @@ -382,21 +405,25 @@ function ReceiveConfirmationInner({ navigation, route, account, parentAccount }: {CustomConfirmationAlert && } - - + {displayBanner && ( + + + + )} + + - - {displayBanner ? ( - - - - ) : ( - - - - )} {verified ? null : isModalOpened ? ( @@ -413,16 +440,13 @@ type BannerProps = { const WithdrawBanner = ({ onPress, hideBanner }: BannerProps) => { const { t } = useTranslation(); - const insets = useSafeAreaInsets(); return ( - - } - onPressDismiss={hideBanner} - onPress={onPress} - /> - + } + onPressDismiss={hideBanner} + onPress={onPress} + /> ); }; diff --git a/libs/ledger-live-common/src/currencies/helpers.ts b/libs/ledger-live-common/src/currencies/helpers.ts index 0c50932a4fd7..70c839fa1e05 100644 --- a/libs/ledger-live-common/src/currencies/helpers.ts +++ b/libs/ledger-live-common/src/currencies/helpers.ts @@ -16,6 +16,10 @@ export function isTokenCurrency(currency: Currency): currency is TokenCurrency { return currency.type === "TokenCurrency"; } +export function isUTXOCompliant(currencyFamilly: string): boolean { + return currencyFamilly === "bitcoin" || currencyFamilly === "cardano"; +} + export function listCurrencies(includeTokens: boolean): CryptoOrTokenCurrency[] { const currencies = listSupportedCurrencies(); From c80b4b073eeccdc7a55cddd8587f5aabb6821ee9 Mon Sep 17 00:00:00 2001 From: Kevin Le Seigle Date: Wed, 25 Sep 2024 09:49:12 +0200 Subject: [PATCH 25/94] feat: upgrade pnpm to v9.11 --- .prototools | 2 +- package.json | 2 +- tools/actions/composites/bot/action.yml | 2 +- tools/actions/composites/setup-toolchain/action.yml | 2 +- tools/actions/turbo-affected/build/main.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.prototools b/.prototools index f406208c3376..82827233e47c 100644 --- a/.prototools +++ b/.prototools @@ -1,3 +1,3 @@ node = "20.11.0" npm = "10.3.0" -pnpm = "9.4.0" +pnpm = "9.11.0" diff --git a/package.json b/package.json index 10fba56f586c..4c3029030a16 100644 --- a/package.json +++ b/package.json @@ -219,5 +219,5 @@ } } }, - "packageManager": "pnpm@9.4.0" + "packageManager": "pnpm@9.11.0" } diff --git a/tools/actions/composites/bot/action.yml b/tools/actions/composites/bot/action.yml index 4e83143d2b08..3693c8ad0e96 100644 --- a/tools/actions/composites/bot/action.yml +++ b/tools/actions/composites/bot/action.yml @@ -45,7 +45,7 @@ runs: steps: - uses: pnpm/action-setup@v2 with: - version: 9.4.0 + version: 9.11.0 - uses: actions/setup-node@v4 with: node-version: 20.11.0 diff --git a/tools/actions/composites/setup-toolchain/action.yml b/tools/actions/composites/setup-toolchain/action.yml index 158bb012e87d..53946be1eed5 100644 --- a/tools/actions/composites/setup-toolchain/action.yml +++ b/tools/actions/composites/setup-toolchain/action.yml @@ -50,7 +50,7 @@ runs: - uses: pnpm/action-setup@v4 with: - version: 9.4.0 + version: 9.11.0 - name: Get pnpm store directory shell: bash run: | diff --git a/tools/actions/turbo-affected/build/main.js b/tools/actions/turbo-affected/build/main.js index 477ba92c9cec..f6e8b9be3c73 100644 --- a/tools/actions/turbo-affected/build/main.js +++ b/tools/actions/turbo-affected/build/main.js @@ -19102,7 +19102,7 @@ var package_default = { } } }, - packageManager: "pnpm@9.4.0" + packageManager: "pnpm@9.11.0" }; // src/main.ts From f557e09ed04af702e2eda588e8a73054b1b2d2d1 Mon Sep 17 00:00:00 2001 From: Kevin Le Seigle Date: Thu, 26 Sep 2024 09:59:25 +0200 Subject: [PATCH 26/94] fix: allow mobile codecheck workflow only on dispatch --- .github/workflows/test-mobile.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test-mobile.yml b/.github/workflows/test-mobile.yml index 315586c03f30..f2faa42bb4cd 100644 --- a/.github/workflows/test-mobile.yml +++ b/.github/workflows/test-mobile.yml @@ -2,12 +2,6 @@ name: "@Mobile • Test App" run-name: "@Mobile • Test App triggered by ${{ inputs.login || github.actor }} ${{ format('on ref {0}', github.ref_name) }}" on: - push: - branches: - - main - - develop - - release - - hotfix workflow_dispatch: inputs: ref: From d3fa14f536533dd961c9eb829ed4465bda5569e4 Mon Sep 17 00:00:00 2001 From: Lucas Werey <73439207+LucasWerey@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:01:45 +0200 Subject: [PATCH 27/94] :bug:(lld): fix inte test for nfts (#7914) --- .changeset/fresh-cobras-argue.md | 5 +++++ .../__integration__/nftsCollection.test.tsx | 20 +++++++++---------- .../tests/handlers/index.ts | 5 +++++ apps/ledger-live-desktop/tests/jestSetup.js | 16 ++++++++++----- 4 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 .changeset/fresh-cobras-argue.md diff --git a/.changeset/fresh-cobras-argue.md b/.changeset/fresh-cobras-argue.md new file mode 100644 index 000000000000..581e0dd9b2cd --- /dev/null +++ b/.changeset/fresh-cobras-argue.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +Fix unstable integration test diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/nftsCollection.test.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/nftsCollection.test.tsx index 5104ff9891f1..5cf226f23b07 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/nftsCollection.test.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/nftsCollection.test.tsx @@ -22,9 +22,9 @@ describe("displayNftCollection", () => { }); await waitFor(() => expect(screen.getByText(/momentum/i)).toBeVisible()); - await expect(screen.getByText(/receive nft/i)).toBeVisible(); - await expect(screen.getByText(/see gallery/i)).toBeVisible(); - await expect(screen.getByText(/see more collections/i)).toBeVisible(); + expect(screen.getByText(/receive nft/i)).toBeVisible(); + expect(screen.getByText(/see gallery/i)).toBeVisible(); + expect(screen.getByText(/see more collections/i)).toBeVisible(); }); it("should open the NFTs gallery", async () => { @@ -36,10 +36,10 @@ describe("displayNftCollection", () => { }); await waitFor(() => expect(screen.getByText(/momentum/i)).toBeVisible()); - await expect(screen.getByText(/receive nft/i)).toBeVisible(); - await expect(screen.getByText(/see gallery/i)).toBeVisible(); + expect(screen.getByText(/receive nft/i)).toBeVisible(); + expect(screen.getByText(/see gallery/i)).toBeVisible(); await user.click(screen.getByText(/see gallery/i)); - await expect(screen.getByText(/all nft/i)).toBeVisible(); + expect(screen.getByText(/all nft/i)).toBeVisible(); }); it("should open the corresponding NFTs collection and the correct detail drawer", async () => { @@ -65,10 +65,10 @@ describe("displayNftCollection", () => { // Open external viewer await user.click(screen.getByTestId("external-viewer-button")); - await expect(screen.getByText(/open in opensea.io/i)).toBeVisible(); + expect(screen.getByText(/open in opensea.io/i)).toBeVisible(); // Close drawer - await waitFor(() => user.click(screen.getByTestId("drawer-close-button"))); + await user.click(screen.getByTestId("drawer-close-button")); await waitFor(() => expect(screen.queryByTestId("side-drawer-container")).toBeNull()); }); @@ -80,7 +80,7 @@ describe("displayNftCollection", () => { initialRoute: `/`, }); - await expect(screen.getByText(/receive nft/i)).toBeVisible(); - await expect(screen.getByText(/learn more/i)).toBeVisible(); + expect(screen.getByText(/receive nft/i)).toBeVisible(); + expect(screen.getByText(/learn more/i)).toBeVisible(); }); }); diff --git a/apps/ledger-live-desktop/tests/handlers/index.ts b/apps/ledger-live-desktop/tests/handlers/index.ts index 369c16330c8f..df84b0f3291b 100644 --- a/apps/ledger-live-desktop/tests/handlers/index.ts +++ b/apps/ledger-live-desktop/tests/handlers/index.ts @@ -1,3 +1,8 @@ import NFTsHandlers from "./nfts"; export default [...NFTsHandlers]; + +export const ALLOWED_UNHANDLED_REQUESTS = [ + "https://nft.api.live.ledger.com/v1/marketdata/ethereum/1/contract/0xe3BE0054Da2F8da5002E8bdD8AA4c7fDf851E86D/floor-price", + "https://nft.api.live.ledger.com/v1/ethereum/1/contracts/infos", +]; diff --git a/apps/ledger-live-desktop/tests/jestSetup.js b/apps/ledger-live-desktop/tests/jestSetup.js index 2957526bcb73..d5aef69b2f0c 100644 --- a/apps/ledger-live-desktop/tests/jestSetup.js +++ b/apps/ledger-live-desktop/tests/jestSetup.js @@ -1,17 +1,23 @@ import "@jest/globals"; import "@testing-library/jest-dom"; import { server } from "./server"; +import { ALLOWED_UNHANDLED_REQUESTS } from "./handlers"; global.setImmediate = global.setImmediate || ((fn, ...args) => global.setTimeout(fn, 0, ...args)); -beforeAll(() => server.listen()); +beforeAll(() => + server.listen({ + onUnhandledRequest(request, print) { + if (ALLOWED_UNHANDLED_REQUESTS.some(ignoredUrl => request.url.includes(ignoredUrl))) { + return; + } + print.warning(); + }, + }), +); afterEach(() => server.resetHandlers()); afterAll(() => server.close()); -server.events.on("request:start", ({ request }) => { - console.log("MSW intercepted:", request.method, request.url); -}); - jest.mock("src/sentry/install", () => ({ init: jest.fn(), setUser: jest.fn(), From 521c394f7d35f61d07b9e907b2085d329bff2cab Mon Sep 17 00:00:00 2001 From: Mounir Hamzaoui Date: Thu, 26 Sep 2024 10:12:21 +0200 Subject: [PATCH 28/94] chore: bump storyly version and adapt new api spec (#7896) --- .changeset/calm-pets-shout.md | 5 + apps/ledger-live-desktop/package.json | 2 +- .../src/storyly/StorylyProvider.tsx | 26 +-- .../src/storyly/useStoryly.tsx | 30 ++- .../src/types/storyly-web.d.ts | 58 ++++-- pnpm-lock.yaml | 181 ++---------------- 6 files changed, 85 insertions(+), 217 deletions(-) create mode 100644 .changeset/calm-pets-shout.md diff --git a/.changeset/calm-pets-shout.md b/.changeset/calm-pets-shout.md new file mode 100644 index 000000000000..d99d754e65de --- /dev/null +++ b/.changeset/calm-pets-shout.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +bump storyly version diff --git a/apps/ledger-live-desktop/package.json b/apps/ledger-live-desktop/package.json index 9ec1b91b4288..86ecfa6626aa 100644 --- a/apps/ledger-live-desktop/package.json +++ b/apps/ledger-live-desktop/package.json @@ -143,7 +143,7 @@ "rxjs": "^7.8.1", "secp256k1": "^4.0.3", "semver": "^7.1.3", - "storyly-web": "^2.8.0", + "storyly-web": "^3.5.0", "styled-components": "^5.3.3", "styled-system": "^5.1.5", "timemachine": "^0.3.2", diff --git a/apps/ledger-live-desktop/src/storyly/StorylyProvider.tsx b/apps/ledger-live-desktop/src/storyly/StorylyProvider.tsx index 067a8b513683..68200efaae8d 100644 --- a/apps/ledger-live-desktop/src/storyly/StorylyProvider.tsx +++ b/apps/ledger-live-desktop/src/storyly/StorylyProvider.tsx @@ -7,7 +7,7 @@ import { useDispatch } from "react-redux"; import { openURL } from "~/renderer/linking"; import { Feature_Storyly, StorylyInstanceType } from "@ledgerhq/types-live"; -import { StorylyRef } from "storyly-web"; +import { StorylyRef, Story } from "storyly-web"; interface StorylyProviderProps { children: ReactNode; } @@ -44,19 +44,19 @@ const StorylyProvider: React.FC = ({ children }) => { storylyRef.current?.init({ layout: "classic", token: token, - events: { - closeStoryGroup: clear, - actionClicked: story => { - if (story?.media?.actionUrl) { - openURL(story.media.actionUrl); - storylyRef.current?.close?.(); - dispatch(closeAllModal()); - setDrawer(); - dispatch(closeInformationCenter()); - } - }, - }, }); + + storylyRef.current?.on("actionClicked", (story: Story) => { + if (!story.actionUrl) return; + openURL(story.actionUrl as string); + storylyRef.current?.close?.(); + dispatch(closeAllModal()); + setDrawer(); + dispatch(closeInformationCenter()); + }); + + storylyRef.current?.on("closeStoryGroup", clear); + storylyRef.current?.openStory({ group: query?.g, story: query?.s, playMode: query?.play }); }, [params, token, query, dispatch, setDrawer]); diff --git a/apps/ledger-live-desktop/src/storyly/useStoryly.tsx b/apps/ledger-live-desktop/src/storyly/useStoryly.tsx index 2e84f519e696..8522a5fd35f8 100644 --- a/apps/ledger-live-desktop/src/storyly/useStoryly.tsx +++ b/apps/ledger-live-desktop/src/storyly/useStoryly.tsx @@ -8,7 +8,7 @@ import { useDispatch } from "react-redux"; import { languageSelector } from "~/renderer/reducers/settings"; import { StorylyStyleProps, useStorylyDefaultStyleProps } from "./style"; import { openURL } from "~/renderer/linking"; -import { StorylyRef, StorylyData } from "storyly-web"; +import { StorylyRef, StorylyData, Story, StoryGroup } from "storyly-web"; /** * Hook to use Storyly @@ -26,7 +26,7 @@ export const useStoryly = ( const dispatch = useDispatch(); const { setDrawer } = useContext(context); const ref = useRef(); - const dataRef = useRef(); + const dataRef = useRef(); const props = useStorylyDefaultStyleProps(); const language = useSelector(languageSelector); @@ -39,22 +39,20 @@ export const useStoryly = ( token: storyly.params?.stories[instanceId].token || "", lang: language, segments: [`lang_${language}`], - events: { - isReady: data => { - dataRef.current = data; - // Triggered when story is ready. - }, - actionClicked: story => { - if (story?.media?.actionUrl) { - openURL(story.media.actionUrl); - ref.current?.close?.(); - dispatch(closeAllModal()); - setDrawer(); - } - }, - }, props: { ...props, ...options?.styleProps }, }); + + ref.current?.on("loaded", (data: StorylyData) => { + dataRef.current = data.groupList; + }); + + ref.current?.on("actionClicked", (story: Story) => { + if (!story.actionUrl) return; + openURL(story.actionUrl); + ref.current?.close?.(); + dispatch(closeAllModal()); + setDrawer(); + }); }); /** diff --git a/apps/ledger-live-desktop/src/types/storyly-web.d.ts b/apps/ledger-live-desktop/src/types/storyly-web.d.ts index 26e98b1278b6..c1ed46194d11 100644 --- a/apps/ledger-live-desktop/src/types/storyly-web.d.ts +++ b/apps/ledger-live-desktop/src/types/storyly-web.d.ts @@ -1,38 +1,53 @@ declare module "storyly-web" { - type StorylyData = Array<{ - title: string; - image: URL; - pinned: boolean; - id: number; - }>; - type Story = { group_id: number; id: number; index: number; - media: { - actionUrl?: string; - }; + actionUrl: string | undefined; seen: boolean; title: string; }; + type StoryGroup = { + iconUrl: string; + id: number; + nudge?: string; + pinned?: boolean; + stories: Story[]; + title: string; + type: unknown; + }; + + type StorylyData = { + dataSource: string; + groupList: StoryGroup[]; + }; + /** * Storyly Options */ interface StorylyOptions { layout: "classic" | "modern"; token: string; - events?: { - closeStoryGroup?(): void; - isReady?(data: StorylyData): void; - actionClicked?(story: Story): void; - }; - lang?: Language; + lang?: Language /* TODO: delete it in LIVE-14102 and replace it with locale*/; segments?: string[]; props?: StorylyStyleProps; } + /** + * Storyly user events + */ + type StorylyUserEvents = + | "actionClicked" + | "loaded" + | "loadFailed" + | "openStoryGroup" + | "storyOpenFailed" + | "storyImpression" + | "storyCompleted" + | "groupCompleted" + | "closeStoryGroup"; + /** * Storyly Ref */ @@ -42,6 +57,7 @@ declare module "storyly-web" { setLang: (options: { language: StorylyOptions["lang"] }) => void; openStory: (props: openStoryParams) => void; close: () => void; + on: (event: StorylyUserEvents, callback: (...args) => void) => void; } interface openStoryParams { @@ -64,5 +80,13 @@ declare module "storyly-web" { >; export default StorylyWeb; - export { StorylyRef, StorylyOptions, StorylyData, openStoryParams }; + export { + StorylyRef, + StorylyOptions, + StorylyData, + openStoryParams, + StorylyUserEvents, + Story, + StoryGroup, + }; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0da12488a5f1..b502993c8961 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -535,8 +535,8 @@ importers: specifier: ^7.1.3 version: 7.5.4 storyly-web: - specifier: ^2.8.0 - version: 2.16.5 + specifier: ^3.5.0 + version: 3.6.7 styled-components: specifier: ^5.3.3 version: 5.3.11(react-dom@18.2.0(react@18.2.0))(react-is@17.0.2)(react@18.2.0) @@ -12436,10 +12436,6 @@ packages: resolution: {integrity: sha512-yqcRVnjf+qS+tC4NxOKLJOaSJ+csHmh/dHUzvCTkf5rLsplwXYRnny2r0tqGTQ4tuXMxwgSMKPYwicg81P+xuw==} engines: {node: '>=12'} - '@sentry-internal/feedback@7.109.0': - resolution: {integrity: sha512-EL7N++poxvJP9rYvh6vSu24tsKkOveNCcCj4IM7+irWPjsuD2GLYYlhp/A/Mtt9l7iqO4plvtiQU5HGk7smcTQ==} - engines: {node: '>=12'} - '@sentry-internal/feedback@8.16.0': resolution: {integrity: sha512-BmRazZKl6iiVSg6eybUNOI1ve4eZqYpJYjkX48Jedn+7iZg7z12MNYl6IWPFBcN+sg+clf4wiKDr/SYS0yNemQ==} engines: {node: '>=14.18'} @@ -12448,10 +12444,6 @@ packages: resolution: {integrity: sha512-TnqxqJGhbFhhYRhTG2WLFer+lVieV7mNGeIxFBiw1L4kuj8KGl+C0sknssKyZSRVJFSahhHIosHJGRMkkD//7g==} engines: {node: '>=12'} - '@sentry-internal/replay-canvas@7.109.0': - resolution: {integrity: sha512-Lh/K60kmloR6lkPUcQP0iamw7B/MdEUEx/ImAx4tUSMrLj+IoUEcq/ECgnnVyQkJq59+8nPEKrVLt7x6PUPEjw==} - engines: {node: '>=12'} - '@sentry-internal/replay-canvas@8.16.0': resolution: {integrity: sha512-Bjh6pCDLZIPAPU2dNvJfI7BQV16rsRtYcylJgkGamjf8IcaBu7r/Whsvt1q34xO29xc0ISlp+0xG+YAdN1690Q==} engines: {node: '>=14.18'} @@ -12464,18 +12456,10 @@ packages: resolution: {integrity: sha512-+u9RRf5eL3StiyiRyAHZmdkAR7GTSGx4Mt4Lmi5NEtCcWlTGZ1QgW2r8ZbhouVmTiJkjhQgYCyej3cojtazeJg==} engines: {node: '>=8'} - '@sentry-internal/tracing@7.109.0': - resolution: {integrity: sha512-PzK/joC5tCuh2R/PRh+7dp+uuZl7pTsBIjPhVZHMTtb9+ls65WkdZJ1/uKXPouyz8NOo9Xok7aEvEo9seongyw==} - engines: {node: '>=8'} - '@sentry/browser@7.100.1': resolution: {integrity: sha512-IxHQ08ixf0bmaWpe4yt1J4UUsOpg02fxax9z3tOQYXw5MSzz5pDXn8M8DFUVJB3wWuyXhHXTub9yD3VIP9fnoA==} engines: {node: '>=8'} - '@sentry/browser@7.109.0': - resolution: {integrity: sha512-yx+OFG+Ab9qUDDgV9ZDv8M9O9Mqr0fjKta/LMlWALYLjzkMvxsPlRPFj7oMBlHqOTVLDeg7lFYmsA8wyWQ8Z8g==} - engines: {node: '>=8'} - '@sentry/browser@8.16.0': resolution: {integrity: sha512-8Fxmk2aFWRixi2IKixiJR10Du34yb13HYr2iRw1haPKb5ZKa6CFA+XAnSzwpPZxO0RSHuPQR06YNkXaQ8fRAQQ==} engines: {node: '>=14.18'} @@ -12580,10 +12564,6 @@ packages: resolution: {integrity: sha512-f+ItUge/o9AjlveQq0ZUbQauKlPH1FIJbC1TRaYLJ4KNfOdrsh8yZ29RmWv0cFJ/e+FGTr603gWpRPObF5rM8Q==} engines: {node: '>=8'} - '@sentry/core@7.109.0': - resolution: {integrity: sha512-xwD4U0IlvvlE/x/g/W1I8b4Cfb16SsCMmiEuBf6XxvAa3OfWBxKoqLifb3GyrbxMC4LbIIZCN/SvLlnGJPgszA==} - engines: {node: '>=8'} - '@sentry/core@8.16.0': resolution: {integrity: sha512-l9mQgm5OqnykvZMh6PmJ/9ygW4qLyEFop+pQH/uM5zQCZQvEa7rvAd9QXKHdbVKq1CxJa/nJiByc8wPWxsftGQ==} engines: {node: '>=14.18'} @@ -12646,10 +12626,6 @@ packages: resolution: {integrity: sha512-B1NFjzGEFaqejxBRdUyEzH8ChXc2kfiqlA/W/Lg0aoWIl2/7nuMk+l4ld9gW5F5bIAXDTVd5vYltb1lWEbpr7w==} engines: {node: '>=12'} - '@sentry/replay@7.109.0': - resolution: {integrity: sha512-hCDjbTNO7ErW/XsaBXlyHFsUhneyBUdTec1Swf98TFEfVqNsTs6q338aUcaR8dGRLbLrJ9YU9D1qKq++v5h2CA==} - engines: {node: '>=12'} - '@sentry/types@6.19.7': resolution: {integrity: sha512-jH84pDYE+hHIbVnab3Hr+ZXr1v8QABfhx39KknxqKWr2l0oEItzepV0URvbEhB446lk/S/59230dlUUIBGsXbg==} engines: {node: '>=6'} @@ -12658,10 +12634,6 @@ packages: resolution: {integrity: sha512-fLM+LedHuKzOd8IhXBqaQuym+AA519MGjeczBa5kGakes/BbAsUMwsNfjsKQedp7Kh44RgYF99jwoRPK2oDrXw==} engines: {node: '>=8'} - '@sentry/types@7.109.0': - resolution: {integrity: sha512-egCBnDv3YpVFoNzRLdP0soVrxVLCQ+rovREKJ1sw3rA2/MFH9WJ+DZZexsX89yeAFzy1IFsCp7/dEqudusml6g==} - engines: {node: '>=8'} - '@sentry/types@8.16.0': resolution: {integrity: sha512-cIRsn7gWGVaWHgCniBWA0N8PNwzDYibhjyjPRTMxUjuZCT37i7zxByKKmd9u4TpRIJ64MyirNyM0O6T0A26fpg==} engines: {node: '>=14.18'} @@ -12674,10 +12646,6 @@ packages: resolution: {integrity: sha512-Ve6dXr1o6xiBe3VCoJgiutmBKrugryI65EZAbYto5XI+t+PjiLLf9wXtEMF24ZrwImo4Lv3E9Uqza+fWkEbw6A==} engines: {node: '>=8'} - '@sentry/utils@7.109.0': - resolution: {integrity: sha512-3RjxMOLMBwZ5VSiH84+o/3NY2An4Zldjz0EbfEQNRY9yffRiCPJSQiCJID8EoylCFOh/PAhPimBhqbtWJxX6iw==} - engines: {node: '>=8'} - '@sentry/utils@8.16.0': resolution: {integrity: sha512-tltCf2DVzz5TiYjxu/Rxbc9Qmm04893MFshV97jOTBcQeO2AAZBEl5rAoTCv1P08y7Yg+KiVwCx9Zj2x5U80/g==} engines: {node: '>=14.18'} @@ -16437,9 +16405,6 @@ packages: axios@0.24.0: resolution: {integrity: sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==} - axios@0.26.1: - resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==} - axios@1.7.3: resolution: {integrity: sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==} @@ -17884,9 +17849,6 @@ packages: resolution: {integrity: sha512-TG2hpqe4ELx54QER/S3HQ9SRVnQnGBtKUz5bLQWtYAQ+o6GpgMs6sYUvaiJjVxb+UXwhRhAEP3m7LbsIZ77Hmw==} engines: {node: '>= 0.8'} - copy-to-clipboard@3.3.3: - resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==} - copy-to@2.0.1: resolution: {integrity: sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w==} @@ -18659,9 +18621,6 @@ packages: des.js@1.1.0: resolution: {integrity: sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==} - desandro-matches-selector@2.0.2: - resolution: {integrity: sha512-+1q0nXhdzg1IpIJdMKalUwvvskeKnYyEe3shPRwedNcWtnhEKT3ZxvFjzywHDeGcKViIxTCAoOYQWP1qD7VNyg==} - destroy@1.2.0: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} @@ -19582,9 +19541,6 @@ packages: resolution: {integrity: sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==} engines: {node: '>=6.5.0', npm: '>=3'} - ev-emitter@1.1.1: - resolution: {integrity: sha512-ipiDYhdQSCZ4hSbX4rMW+XzNKMD1prg/sTvoVmSLkuQ1MVlwjJQQA+sW8tMYR3BLUr9KjodFV4pvzunvRhd33Q==} - event-emitter@0.3.5: resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} @@ -20419,9 +20375,6 @@ packages: firebase@9.23.0: resolution: {integrity: sha512-/4lUVY0lUvBDIaeY1q6dUYhS8Sd18Qb9CgWkPZICUo9IXpJNCEagfNZXBBFCkMTTN5L5gx2Hjr27y21a9NzUcA==} - fizzy-ui-utils@2.0.7: - resolution: {integrity: sha512-CZXDVXQ1If3/r8s0T+v+qVeMshhfcuq0rqIFgJnrtd+Bu8GmDmqMjntjUePypVtjHXKJ6V4sw9zeyox34n9aCg==} - flat-cache@3.2.0: resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} engines: {node: ^10.12.0 || >=12.0.0} @@ -20726,9 +20679,6 @@ packages: resolution: {integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==} engines: {node: '>=8'} - get-size@2.0.3: - resolution: {integrity: sha512-lXNzT/h/dTjTxRbm9BXb+SGxxzkm97h/PCIKtlN/CBCxxmkkIVV21udumMS93MuVTDX583gqc94v3RjuHmI+2Q==} - get-stream@3.0.0: resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==} engines: {node: '>=4'} @@ -21961,12 +21911,6 @@ packages: peerDependencies: ws: '*' - isotope-horizontal@2.0.1: - resolution: {integrity: sha512-rTm8K3d3Xt/pQBOdZj06IJpNkAjL+my4SWQLxJhjnxWTdDEX+r5qBsdstOou9kIvJFkgLYaR+YOog+7en6kHXw==} - - isotope-layout@3.0.6: - resolution: {integrity: sha512-z2ZKablhocXhoNyWwzJPFd7u7FWbYbVJA51Nvsqsod8jH2ExGc1SwDsSWKE54e3PhXzqf2yZPhFSq/c2MR1arw==} - isstream@0.1.2: resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} @@ -23555,9 +23499,6 @@ packages: marky@1.2.5: resolution: {integrity: sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q==} - masonry-layout@4.2.2: - resolution: {integrity: sha512-iGtAlrpHNyxaR19CvKC3npnEcAwszXoyJiI8ARV2ePi7fmYhIud25MHK8Zx4P0LCC4d3TNO9+rFa1KoK1OEOaA==} - match-sorter@6.3.4: resolution: {integrity: sha512-jfZW7cWS5y/1xswZo8VBOdudUiSd9nifYRWphc9M5D/ee4w4AoXLgBEdRbgVaxbMuagBPeUC5y2Hi8DO6o9aDg==} @@ -24814,9 +24755,6 @@ packages: outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} - outlayer@2.1.1: - resolution: {integrity: sha512-+GplXsCQ3VrbGujAeHEzP9SXsBmJxzn/YdDSQZL0xqBmAWBmortu2Y9Gwdp9J0bgDQ8/YNIPMoBM13nTwZfAhw==} - outvariant@1.4.2: resolution: {integrity: sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ==} @@ -27851,8 +27789,8 @@ packages: prop-types: optional: true - storyly-web@2.16.5: - resolution: {integrity: sha512-5kb3krdsjNCiALAVWBFDfPtj6EVODujalCgppzD1eUgjByfdYC5+yTyqblUlk1AAd9evGzaxqhHut0W4Ph8LLA==} + storyly-web@3.6.7: + resolution: {integrity: sha512-2i7yOUF4xENFynQwDGZmGWLKHcXeTjhxJwtD8g4Vj163GI9Zw8WfLwsYgSZWgP1mMC+vq3iP+l8TgHuBd/r2rg==} stream-browserify@3.0.0: resolution: {integrity: sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==} @@ -28547,9 +28485,6 @@ packages: tocbot@4.25.0: resolution: {integrity: sha512-kE5wyCQJ40hqUaRVkyQ4z5+4juzYsv/eK+aqD97N62YH0TxFhzJvo22RUQQZdO3YnXAk42ZOfOpjVdy+Z0YokA==} - toggle-selection@1.0.6: - resolution: {integrity: sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==} - toidentifier@1.0.0: resolution: {integrity: sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==} engines: {node: '>=0.6'} @@ -34084,7 +34019,7 @@ snapshots: '@emotion/core@10.3.1(react@18.2.0)': dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.25.0 '@emotion/cache': 10.0.29 '@emotion/css': 10.0.27 '@emotion/serialize': 0.11.16 @@ -40020,12 +39955,6 @@ snapshots: '@sentry/types': 7.100.1 '@sentry/utils': 7.100.1 - '@sentry-internal/feedback@7.109.0': - dependencies: - '@sentry/core': 7.109.0 - '@sentry/types': 7.109.0 - '@sentry/utils': 7.109.0 - '@sentry-internal/feedback@8.16.0': dependencies: '@sentry/core': 8.16.0 @@ -40039,13 +39968,6 @@ snapshots: '@sentry/types': 7.100.1 '@sentry/utils': 7.100.1 - '@sentry-internal/replay-canvas@7.109.0': - dependencies: - '@sentry/core': 7.109.0 - '@sentry/replay': 7.109.0 - '@sentry/types': 7.109.0 - '@sentry/utils': 7.109.0 - '@sentry-internal/replay-canvas@8.16.0': dependencies: '@sentry-internal/replay': 8.16.0 @@ -40066,12 +39988,6 @@ snapshots: '@sentry/types': 7.100.1 '@sentry/utils': 7.100.1 - '@sentry-internal/tracing@7.109.0': - dependencies: - '@sentry/core': 7.109.0 - '@sentry/types': 7.109.0 - '@sentry/utils': 7.109.0 - '@sentry/browser@7.100.1': dependencies: '@sentry-internal/feedback': 7.100.1 @@ -40082,16 +39998,6 @@ snapshots: '@sentry/types': 7.100.1 '@sentry/utils': 7.100.1 - '@sentry/browser@7.109.0': - dependencies: - '@sentry-internal/feedback': 7.109.0 - '@sentry-internal/replay-canvas': 7.109.0 - '@sentry-internal/tracing': 7.109.0 - '@sentry/core': 7.109.0 - '@sentry/replay': 7.109.0 - '@sentry/types': 7.109.0 - '@sentry/utils': 7.109.0 - '@sentry/browser@8.16.0': dependencies: '@sentry-internal/browser-utils': 8.16.0 @@ -40195,11 +40101,6 @@ snapshots: '@sentry/types': 7.100.1 '@sentry/utils': 7.100.1 - '@sentry/core@7.109.0': - dependencies: - '@sentry/types': 7.109.0 - '@sentry/utils': 7.109.0 - '@sentry/core@8.16.0': dependencies: '@sentry/types': 8.16.0 @@ -40335,19 +40236,10 @@ snapshots: '@sentry/types': 7.100.1 '@sentry/utils': 7.100.1 - '@sentry/replay@7.109.0': - dependencies: - '@sentry-internal/tracing': 7.109.0 - '@sentry/core': 7.109.0 - '@sentry/types': 7.109.0 - '@sentry/utils': 7.109.0 - '@sentry/types@6.19.7': {} '@sentry/types@7.100.1': {} - '@sentry/types@7.109.0': {} - '@sentry/types@8.16.0': {} '@sentry/utils@6.19.7': @@ -40359,10 +40251,6 @@ snapshots: dependencies: '@sentry/types': 7.100.1 - '@sentry/utils@7.109.0': - dependencies: - '@sentry/types': 7.109.0 - '@sentry/utils@8.16.0': dependencies: '@sentry/types': 8.16.0 @@ -46444,10 +46332,6 @@ snapshots: dependencies: follow-redirects: 1.15.6 - axios@0.26.1: - dependencies: - follow-redirects: 1.15.6 - axios@1.7.3: dependencies: follow-redirects: 1.15.6 @@ -46605,7 +46489,7 @@ snapshots: babel-plugin-macros@2.8.0: dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.25.0 cosmiconfig: 6.0.0 resolve: 1.22.8 @@ -48198,10 +48082,6 @@ snapshots: depd: 2.0.0 keygrip: 1.1.0 - copy-to-clipboard@3.3.3: - dependencies: - toggle-selection: 1.0.6 - copy-to@2.0.1: {} copy-webpack-plugin@10.2.4(webpack@5.91.0(metro@0.80.8)): @@ -49050,7 +48930,7 @@ snapshots: date-fns@2.30.0: dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.25.0 dateformat@4.6.3: {} @@ -49269,8 +49149,6 @@ snapshots: inherits: 2.0.4 minimalistic-assert: 1.0.1 - desandro-matches-selector@2.0.2: {} - destroy@1.2.0: {} detect-indent@6.1.0: {} @@ -49509,7 +49387,7 @@ snapshots: dom-helpers@5.2.1: dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.25.0 csstype: 3.1.3 dom-serializer@0.2.2: @@ -50911,8 +50789,6 @@ snapshots: is-hex-prefixed: 1.0.0 strip-hex-prefix: 1.0.0 - ev-emitter@1.1.1: {} - event-emitter@0.3.5: dependencies: d: 1.0.2 @@ -51786,10 +51662,6 @@ snapshots: transitivePeerDependencies: - encoding - fizzy-ui-utils@2.0.7: - dependencies: - desandro-matches-selector: 2.0.2 - flat-cache@3.2.0: dependencies: flatted: 3.3.1 @@ -52127,8 +51999,6 @@ snapshots: get-port@5.1.1: {} - get-size@2.0.3: {} - get-stream@3.0.0: {} get-stream@4.1.0: @@ -52715,7 +52585,7 @@ snapshots: history@4.10.1: dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.25.0 loose-envify: 1.4.0 resolve-pathname: 3.0.0 tiny-invariant: 1.3.3 @@ -53575,18 +53445,6 @@ snapshots: dependencies: ws: 8.17.1 - isotope-horizontal@2.0.1: - dependencies: - isotope-layout: 3.0.6 - - isotope-layout@3.0.6: - dependencies: - desandro-matches-selector: 2.0.2 - fizzy-ui-utils: 2.0.7 - get-size: 2.0.3 - masonry-layout: 4.2.2 - outlayer: 2.1.1 - isstream@0.1.2: {} istanbul-lib-coverage@3.2.2: {} @@ -56831,11 +56689,6 @@ snapshots: marky@1.2.5: {} - masonry-layout@4.2.2: - dependencies: - get-size: 2.0.3 - outlayer: 2.1.1 - match-sorter@6.3.4: dependencies: '@babel/runtime': 7.24.1 @@ -58866,12 +58719,6 @@ snapshots: outdent@0.5.0: {} - outlayer@2.1.1: - dependencies: - ev-emitter: 1.1.1 - fizzy-ui-utils: 2.0.7 - get-size: 2.0.3 - outvariant@1.4.2: {} ow@0.17.0: @@ -62929,14 +62776,10 @@ snapshots: optionalDependencies: prop-types: 15.8.1 - storyly-web@2.16.5: + storyly-web@3.6.7: dependencies: - '@babel/runtime': 7.24.1 - '@sentry/browser': 7.109.0 + '@babel/runtime': 7.25.0 canvas-confetti: 1.9.2 - copy-to-clipboard: 3.3.3 - isotope-horizontal: 2.0.1 - isotope-layout: 3.0.6 platform: 1.3.6 swiper: 7.4.1 uuid: 8.3.2 @@ -64007,8 +63850,6 @@ snapshots: tocbot@4.25.0: {} - toggle-selection@1.0.6: {} - toidentifier@1.0.0: {} toidentifier@1.0.1: {} From be18f816fa098f8217420b8a875b7afb1be748b0 Mon Sep 17 00:00:00 2001 From: Kant Date: Wed, 25 Sep 2024 16:05:28 +0200 Subject: [PATCH 29/94] fix(LLM): allow wallet-connect live-app to open a deep-link at any time [LIVE-13641] Refactor by sharing a single constant for wallet-connect live-app manifest id --- .changeset/slow-dingos-destroy.md | 9 +++++++++ .../src/renderer/hooks/useDeeplinking.ts | 6 ++++-- .../renderer/screens/account/AccountHeaderActions.tsx | 3 ++- .../RootNavigator/WalletConnectLiveAppNavigator.tsx | 5 ++--- .../src/components/Web3AppWebview/WalletAPIWebview.tsx | 5 +++-- apps/ledger-live-mobile/src/screens/Platform/v2/hooks.ts | 5 ++--- libs/ledger-live-common/src/wallet-api/constants.ts | 2 ++ 7 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 .changeset/slow-dingos-destroy.md diff --git a/.changeset/slow-dingos-destroy.md b/.changeset/slow-dingos-destroy.md new file mode 100644 index 000000000000..93f3e2a4871e --- /dev/null +++ b/.changeset/slow-dingos-destroy.md @@ -0,0 +1,9 @@ +--- +"ledger-live-desktop": patch +"live-mobile": patch +"@ledgerhq/live-common": patch +--- + +fix(LLM): allow wallet-connect live-app to open a deep-link at any time + +Refactor by sharing a single constant for wallet-connect live-app manifest id diff --git a/apps/ledger-live-desktop/src/renderer/hooks/useDeeplinking.ts b/apps/ledger-live-desktop/src/renderer/hooks/useDeeplinking.ts index 0834195f8231..ba0631a9d6c5 100644 --- a/apps/ledger-live-desktop/src/renderer/hooks/useDeeplinking.ts +++ b/apps/ledger-live-desktop/src/renderer/hooks/useDeeplinking.ts @@ -19,6 +19,7 @@ import { useStorylyContext } from "~/storyly/StorylyProvider"; import { useNavigateToPostOnboardingHubCallback } from "~/renderer/components/PostOnboardingHub/logic/useNavigateToPostOnboardingHubCallback"; import { usePostOnboardingDeeplinkHandler } from "@ledgerhq/live-common/postOnboarding/hooks/index"; import { setDrawerVisibility as setLedgerSyncDrawerVisibility } from "../actions/walletSync"; +import { WC_ID } from "@ledgerhq/live-common/wallet-api/constants"; const getAccountsOrSubAccountsByCurrency = ( currency: CryptoOrTokenCurrency, @@ -315,8 +316,9 @@ export function useDeepLinkHandler() { } break; case "wc": { + const wcPathname = `/platform/${WC_ID}`; // Only prevent requests if already on the wallet connect live-app - if (location.pathname === "/platform/ledger-wallet-connect") { + if (location.pathname === wcPathname) { try { // Prevent a request from updating the live-app url and reloading it if (!query.uri || new URL(query.uri).searchParams.get("requestId")) { @@ -327,7 +329,7 @@ export function useDeepLinkHandler() { } } setTrackingSource("deeplink"); - navigate("/platform/ledger-wallet-connect", query); + navigate(wcPathname, query); break; } diff --git a/apps/ledger-live-desktop/src/renderer/screens/account/AccountHeaderActions.tsx b/apps/ledger-live-desktop/src/renderer/screens/account/AccountHeaderActions.tsx index d2e25a7714e0..4b90d1f8761b 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/account/AccountHeaderActions.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/account/AccountHeaderActions.tsx @@ -39,6 +39,7 @@ import { ManageAction } from "~/renderer/families/types"; import { getAvailableProviders } from "@ledgerhq/live-common/exchange/swap/index"; import { useFetchCurrencyAll } from "@ledgerhq/live-common/exchange/swap/hooks/index"; import { isWalletConnectSupported } from "@ledgerhq/live-common/walletConnect/index"; +import { WC_ID } from "@ledgerhq/live-common/wallet-api/constants"; type RenderActionParams = { label: React.ReactNode; @@ -137,7 +138,7 @@ const AccountHeaderSettingsButtonComponent = ({ account, parentAccount, openModa initialAccountId: mainAccount.id, }; history.push({ - pathname: "/platform/ledger-wallet-connect", + pathname: `/platform/${WC_ID}`, state: params, }); }, [mainAccount.id, history]); diff --git a/apps/ledger-live-mobile/src/components/RootNavigator/WalletConnectLiveAppNavigator.tsx b/apps/ledger-live-mobile/src/components/RootNavigator/WalletConnectLiveAppNavigator.tsx index cd476c7839bc..4790d3b9e1f2 100644 --- a/apps/ledger-live-mobile/src/components/RootNavigator/WalletConnectLiveAppNavigator.tsx +++ b/apps/ledger-live-mobile/src/components/RootNavigator/WalletConnectLiveAppNavigator.tsx @@ -10,8 +10,7 @@ import { LiveApp } from "~/screens/Platform"; import { uriSelector } from "~/reducers/walletconnect"; import { setWallectConnectUri } from "~/actions/walletconnect"; import { WalletConnectLiveAppNavigatorParamList } from "./types/WalletConnectLiveAppNavigator"; - -const PLATFORM = "ledger-wallet-connect"; +import { WC_ID } from "@ledgerhq/live-common/wallet-api/constants"; const options = { headerBackImage: () => ( @@ -48,7 +47,7 @@ export default function WalletConnectLiveAppNavigator() { key: _props.route.key, name: ScreenName.PlatformApp, params: { - platform: PLATFORM, + platform: WC_ID, uri: uri || _props.route.params?.uri, requestId: _props.route.params?.requestId, sessionTopic: _props.route.params?.sessionTopic, diff --git a/apps/ledger-live-mobile/src/components/Web3AppWebview/WalletAPIWebview.tsx b/apps/ledger-live-mobile/src/components/Web3AppWebview/WalletAPIWebview.tsx index 136d825b3783..d5d69a1a0ee2 100644 --- a/apps/ledger-live-mobile/src/components/Web3AppWebview/WalletAPIWebview.tsx +++ b/apps/ledger-live-mobile/src/components/Web3AppWebview/WalletAPIWebview.tsx @@ -5,7 +5,7 @@ import Config from "react-native-config"; import { WebviewAPI, WebviewProps } from "./types"; import { useWebView } from "./helpers"; import { NetworkError } from "./NetworkError"; -import { INTERNAL_APP_IDS } from "@ledgerhq/live-common/wallet-api/constants"; +import { INTERNAL_APP_IDS, WC_ID } from "@ledgerhq/live-common/wallet-api/constants"; import { useInternalAppIds } from "@ledgerhq/live-common/hooks/useInternalAppIds"; import { INJECTED_JAVASCRIPT } from "./dappInject"; import { NoAccountScreen } from "./NoAccountScreen"; @@ -41,7 +41,8 @@ export const WalletAPIWebview = forwardRef( const internalAppIds = useInternalAppIds() || INTERNAL_APP_IDS; - const javaScriptCanOpenWindowsAutomatically = internalAppIds.includes(manifest.id); + const javaScriptCanOpenWindowsAutomatically = + internalAppIds.includes(manifest.id) || manifest.id === WC_ID; if (!!manifest.dapp && noAccounts) { return ; diff --git a/apps/ledger-live-mobile/src/screens/Platform/v2/hooks.ts b/apps/ledger-live-mobile/src/screens/Platform/v2/hooks.ts index 58d7b6e67e7b..0653d7aad098 100644 --- a/apps/ledger-live-mobile/src/screens/Platform/v2/hooks.ts +++ b/apps/ledger-live-mobile/src/screens/Platform/v2/hooks.ts @@ -14,6 +14,7 @@ import { DAPP_DISCLAIMER_ID, DISCOVER_STORE_KEY, BROWSE_SEARCH_OPTIONS, + WC_ID, } from "@ledgerhq/live-common/wallet-api/constants"; import { DiscoverDB, AppManifest } from "@ledgerhq/live-common/wallet-api/types"; import { useNavigation, useRoute } from "@react-navigation/native"; @@ -100,8 +101,6 @@ export type Disclaimer = DisclaimerRaw & { openApp: (manifest: AppManifest) => void; }; -const WALLET_CONNECT_LIVE_APP = "ledger-wallet-connect"; - function useDisclaimer(appendRecentlyUsed: (manifest: AppManifest) => void): Disclaimer { const isReadOnly = useSelector(readOnlyModeEnabledSelector); const [isDismissed, dismiss] = useBanner(DAPP_DISCLAIMER_ID); @@ -117,7 +116,7 @@ function useDisclaimer(appendRecentlyUsed: (manifest: AppManifest) => void): Dis (manifest: AppManifest) => { // Navigate to the WalletConnect navigator screen instead of the discover one // In order to avoid issue with deeplinks opening wallet-connect multiple times - if (manifest.id === WALLET_CONNECT_LIVE_APP) { + if (manifest.id === WC_ID) { navigation.navigate(NavigatorName.WalletConnect, { screen: ScreenName.WalletConnectConnect, params: {}, diff --git a/libs/ledger-live-common/src/wallet-api/constants.ts b/libs/ledger-live-common/src/wallet-api/constants.ts index dec4009fd284..d5cf195b1f53 100644 --- a/libs/ledger-live-common/src/wallet-api/constants.ts +++ b/libs/ledger-live-common/src/wallet-api/constants.ts @@ -49,4 +49,6 @@ export const BUY_SELL_UI_APP_ID = "buy-sell-ui"; export const CARD_APP_ID = "card-program"; +export const WC_ID = "ledger-wallet-connect"; + export const INTERNAL_APP_IDS = [DEFAULT_MULTIBUY_APP_ID, BUY_SELL_UI_APP_ID, CARD_APP_ID]; From 37d8fd917bd2901e1005944d237656e562764818 Mon Sep 17 00:00:00 2001 From: qperrot Date: Wed, 25 Sep 2024 08:35:55 +0200 Subject: [PATCH 30/94] fix: remove rewards from near staking format: fix format, fix: change near snap tests remove: delete the key for near.staking.drawer.rewards add changeset --- .changeset/rare-yaks-deny.md | 8 +++++ .../renderer/families/near/Staking/Header.tsx | 3 -- .../renderer/families/near/Staking/Row.tsx | 6 ---- .../src/families/near/Staking/index.tsx | 8 ----- .../src/locales/en/common.json | 1 - libs/coin-modules/coin-near/src/account.ts | 4 +-- libs/coin-modules/coin-near/src/api/node.ts | 5 +--- .../coin-near/src/api/sdk.types.ts | 1 - libs/coin-modules/coin-near/src/logic.ts | 1 - .../coin-near/src/serialization.ts | 30 ++++++++----------- libs/coin-modules/coin-near/src/types.ts | 2 -- .../bridge.integration.test.ts.snap | 1 - .../src/families/near/banner.test.ts | 1 - 13 files changed, 23 insertions(+), 48 deletions(-) create mode 100644 .changeset/rare-yaks-deny.md diff --git a/.changeset/rare-yaks-deny.md b/.changeset/rare-yaks-deny.md new file mode 100644 index 000000000000..e5c8877cb941 --- /dev/null +++ b/.changeset/rare-yaks-deny.md @@ -0,0 +1,8 @@ +--- +"@ledgerhq/coin-near": patch +"ledger-live-desktop": patch +"live-mobile": patch +"@ledgerhq/live-common": patch +--- + +remove rewards feature from near diff --git a/apps/ledger-live-desktop/src/renderer/families/near/Staking/Header.tsx b/apps/ledger-live-desktop/src/renderer/families/near/Staking/Header.tsx index f06ff6a9bc2d..b9bbcfc57321 100644 --- a/apps/ledger-live-desktop/src/renderer/families/near/Staking/Header.tsx +++ b/apps/ledger-live-desktop/src/renderer/families/near/Staking/Header.tsx @@ -32,9 +32,6 @@ export const Header = () => ( - - - diff --git a/apps/ledger-live-desktop/src/renderer/families/near/Staking/Row.tsx b/apps/ledger-live-desktop/src/renderer/families/near/Staking/Row.tsx index 1db1848e31e8..6d097874497a 100644 --- a/apps/ledger-live-desktop/src/renderer/families/near/Staking/Row.tsx +++ b/apps/ledger-live-desktop/src/renderer/families/near/Staking/Row.tsx @@ -88,7 +88,6 @@ export function Row({ validatorId, staked, formattedAmount, - formattedRewards, formattedPending, formattedAvailable, validator, @@ -151,11 +150,6 @@ export function Row({ {formattedAmount} - - - {formattedRewards} - - {formattedPending} diff --git a/apps/ledger-live-mobile/src/families/near/Staking/index.tsx b/apps/ledger-live-mobile/src/families/near/Staking/index.tsx index e9ad9038bebb..b575c8a15a6f 100644 --- a/apps/ledger-live-mobile/src/families/near/Staking/index.tsx +++ b/apps/ledger-live-mobile/src/families/near/Staking/index.tsx @@ -149,14 +149,6 @@ function StakingPositions({ account }: Props) { ), }, - { - label: t("near.staking.drawer.rewards"), - Component: ( - - {stakingPosition.formattedRewards ?? ""} - - ), - }, { label: t("near.staking.drawer.pending"), Component: ( diff --git a/apps/ledger-live-mobile/src/locales/en/common.json b/apps/ledger-live-mobile/src/locales/en/common.json index 3b23fbe1c237..cc635e420b64 100644 --- a/apps/ledger-live-mobile/src/locales/en/common.json +++ b/apps/ledger-live-mobile/src/locales/en/common.json @@ -5917,7 +5917,6 @@ "status": "Status", "active": "Active", "inactive": "Inactive", - "rewards": "Rewards", "pending": "Pending", "available": "Withdrawable" }, diff --git a/libs/coin-modules/coin-near/src/account.ts b/libs/coin-modules/coin-near/src/account.ts index a55f2b6441f1..23679cc95401 100644 --- a/libs/coin-modules/coin-near/src/account.ts +++ b/libs/coin-modules/coin-near/src/account.ts @@ -24,8 +24,8 @@ function formatAccountSpecifics(account: NearAccount): string { str += `\n Staking Positions:\n`; str += nearResources.stakingPositions .map( - ({ validatorId, staked, pending, available, rewards }) => - ` Validator ID: ${validatorId} | Staked: ${staked} | Pending Release: ${pending} | Available: ${available} | Rewards: ${rewards}`, + ({ validatorId, staked, pending, available }) => + ` Validator ID: ${validatorId} | Staked: ${staked} | Pending Release: ${pending} | Available: ${available}`, ) .join("\n"); } diff --git a/libs/coin-modules/coin-near/src/api/node.ts b/libs/coin-modules/coin-near/src/api/node.ts index 789e39a584be..cc8c35fe16c1 100644 --- a/libs/coin-modules/coin-near/src/api/node.ts +++ b/libs/coin-modules/coin-near/src/api/node.ts @@ -217,7 +217,7 @@ export const getStakingPositions = async ( const activeDelegatedStakeBalance = await account.getActiveDelegatedStakeBalance(); const stakingPositions = await Promise.all( - activeDelegatedStakeBalance.stakedValidators.map(async ({ validatorId, amount: rawTotal }) => { + activeDelegatedStakeBalance.stakedValidators.map(async ({ validatorId }) => { const contract = new nearAPI.Contract(account, validatorId, { viewMethods: [ "get_account_staked_balance", @@ -248,12 +248,10 @@ export const getStakingPositions = async ( available = unstaked; pending = new BigNumber(0); } - let rewards = new BigNumber(0); const staked = new BigNumber(rawStaked); available = new BigNumber(available); pending = new BigNumber(pending); - rewards = new BigNumber(rawTotal || "0").minus(staked); const stakingThreshold = getYoctoThreshold(); @@ -271,7 +269,6 @@ export const getStakingPositions = async ( staked, available, pending, - rewards: rewards.gt(0) ? rewards : new BigNumber(0), validatorId, }; }), diff --git a/libs/coin-modules/coin-near/src/api/sdk.types.ts b/libs/coin-modules/coin-near/src/api/sdk.types.ts index ee87b16322df..2aac91f78d4a 100644 --- a/libs/coin-modules/coin-near/src/api/sdk.types.ts +++ b/libs/coin-modules/coin-near/src/api/sdk.types.ts @@ -69,7 +69,6 @@ export type NearStakingPosition = { staked: BigNumber; available: BigNumber; pending: BigNumber; - rewards: BigNumber; validatorId: string; }; diff --git a/libs/coin-modules/coin-near/src/logic.ts b/libs/coin-modules/coin-near/src/logic.ts index 29c326b02ce5..ef204c186ccf 100644 --- a/libs/coin-modules/coin-near/src/logic.ts +++ b/libs/coin-modules/coin-near/src/logic.ts @@ -119,7 +119,6 @@ export const mapStakingPositions = ( return { ...sp, formattedAmount: formatCurrencyUnit(unit, sp.staked, formatConfig), - formattedRewards: formatCurrencyUnit(unit, sp.rewards, formatConfig), formattedPending: formatCurrencyUnit(unit, sp.pending, formatConfig), formattedAvailable: formatCurrencyUnit(unit, sp.available, formatConfig), rank, diff --git a/libs/coin-modules/coin-near/src/serialization.ts b/libs/coin-modules/coin-near/src/serialization.ts index 715f71222d7c..e15332ef49e2 100644 --- a/libs/coin-modules/coin-near/src/serialization.ts +++ b/libs/coin-modules/coin-near/src/serialization.ts @@ -10,15 +10,12 @@ export function toNearResourcesRaw(r: NearResources): NearResourcesRaw { pendingBalance: pendingBalance.toString(), availableBalance: availableBalance.toString(), storageUsageBalance: storageUsageBalance.toString(), - stakingPositions: stakingPositions.map( - ({ staked, validatorId, available, pending, rewards }) => ({ - staked: staked.toString(), - available: available.toString(), - pending: pending.toString(), - rewards: rewards.toString(), - validatorId, - }), - ), + stakingPositions: stakingPositions.map(({ staked, validatorId, available, pending }) => ({ + staked: staked.toString(), + available: available.toString(), + pending: pending.toString(), + validatorId, + })), }; } @@ -35,15 +32,12 @@ export function fromNearResourcesRaw(r: NearResourcesRaw): NearResources { pendingBalance: new BigNumber(pendingBalance), availableBalance: new BigNumber(availableBalance), storageUsageBalance: new BigNumber(storageUsageBalance), - stakingPositions: stakingPositions.map( - ({ staked, validatorId, available, pending, rewards }) => ({ - staked: new BigNumber(staked), - available: new BigNumber(available), - pending: new BigNumber(pending), - rewards: new BigNumber(rewards), - validatorId, - }), - ), + stakingPositions: stakingPositions.map(({ staked, validatorId, available, pending }) => ({ + staked: new BigNumber(staked), + available: new BigNumber(available), + pending: new BigNumber(pending), + validatorId, + })), }; } diff --git a/libs/coin-modules/coin-near/src/types.ts b/libs/coin-modules/coin-near/src/types.ts index 7b8affe9203b..bdbb2e5abb13 100644 --- a/libs/coin-modules/coin-near/src/types.ts +++ b/libs/coin-modules/coin-near/src/types.ts @@ -54,7 +54,6 @@ export type NearResourcesRaw = { staked: string; available: string; pending: string; - rewards: string; validatorId: string; }[]; }; @@ -73,7 +72,6 @@ export type NearValidatorItem = { export type NearMappedStakingPosition = NearStakingPosition & { formattedAmount: string; - formattedRewards: string; formattedPending: string; formattedAvailable: string; rank: number; diff --git a/libs/ledger-live-common/src/families/near/__snapshots__/bridge.integration.test.ts.snap b/libs/ledger-live-common/src/families/near/__snapshots__/bridge.integration.test.ts.snap index e987b6ac5b45..966e6cc2e0a3 100644 --- a/libs/ledger-live-common/src/families/near/__snapshots__/bridge.integration.test.ts.snap +++ b/libs/ledger-live-common/src/families/near/__snapshots__/bridge.integration.test.ts.snap @@ -18,7 +18,6 @@ exports[`near currency bridge scanAccounts near seed 1 1`] = ` { "available": "10000000000000000001", "pending": "0", - "rewards": "10000000000000000001", "staked": "0", "validatorId": "figment.poolv1.near", }, diff --git a/libs/ledger-live-common/src/families/near/banner.test.ts b/libs/ledger-live-common/src/families/near/banner.test.ts index 78852671f140..e6b54dc19a0f 100644 --- a/libs/ledger-live-common/src/families/near/banner.test.ts +++ b/libs/ledger-live-common/src/families/near/banner.test.ts @@ -125,7 +125,6 @@ describe("near/banner", () => { staked: new BigNumber("1.29802125309300073830514e+23"), available: new BigNumber("1"), pending: new BigNumber("0"), - rewards: new BigNumber("1.462125309300073830515e+21"), validatorId: "vcap.poolv1.near", }; jest.spyOn(preloadedData, "getCurrentNearPreloadData").mockReturnValue(validatorsMap); From 7eb4f48500d14d9ebde0374b239944cb9da9da56 Mon Sep 17 00:00:00 2001 From: Kant Date: Mon, 23 Sep 2024 09:50:37 +0200 Subject: [PATCH 31/94] fix(wallet-api): open any deep-link from the webview on LLM Needed for wallet-connect-live-app deep-link back to mobile dApps --- .changeset/tough-terms-film.md | 7 +++++++ .../components/Web3AppWebview/PlatformAPIWebview.tsx | 10 +++------- .../src/components/Web3AppWebview/helpers.ts | 10 +++------- 3 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 .changeset/tough-terms-film.md diff --git a/.changeset/tough-terms-film.md b/.changeset/tough-terms-film.md new file mode 100644 index 000000000000..ce11edd712fb --- /dev/null +++ b/.changeset/tough-terms-film.md @@ -0,0 +1,7 @@ +--- +"live-mobile": patch +--- + +fix(wallet-api): open any deep-link from the webview on LLM + +Needed for wallet-connect-live-app deep-link back to mobile dApps diff --git a/apps/ledger-live-mobile/src/components/Web3AppWebview/PlatformAPIWebview.tsx b/apps/ledger-live-mobile/src/components/Web3AppWebview/PlatformAPIWebview.tsx index 4888645316c4..e842ff25ddfa 100644 --- a/apps/ledger-live-mobile/src/components/Web3AppWebview/PlatformAPIWebview.tsx +++ b/apps/ledger-live-mobile/src/components/Web3AppWebview/PlatformAPIWebview.tsx @@ -507,13 +507,9 @@ export const PlatformAPIWebview = forwardRef( const onOpenWindow = useCallback((event: WebViewOpenWindowEvent) => { const { targetUrl } = event.nativeEvent; - Linking.canOpenURL(targetUrl).then(supported => { - if (supported) { - Linking.openURL(targetUrl); - } else { - console.error(`Don't know how to open URI: ${targetUrl}`); - } - }); + // Don't use canOpenURL as we cannot check unknown apps on the phone + // Without listing everything in plist and android manifest + Linking.openURL(targetUrl); }, []); useEffect(() => { diff --git a/apps/ledger-live-mobile/src/components/Web3AppWebview/helpers.ts b/apps/ledger-live-mobile/src/components/Web3AppWebview/helpers.ts index 3b32d4aa8eab..2b87b8a7dd0f 100644 --- a/apps/ledger-live-mobile/src/components/Web3AppWebview/helpers.ts +++ b/apps/ledger-live-mobile/src/components/Web3AppWebview/helpers.ts @@ -163,13 +163,9 @@ export function useWebView( const onOpenWindow = useCallback((event: WebViewOpenWindowEvent) => { const { targetUrl } = event.nativeEvent; - Linking.canOpenURL(targetUrl).then(supported => { - if (supported) { - Linking.openURL(targetUrl); - } else { - console.error(`Don't know how to open URI: ${targetUrl}`); - } - }); + // Don't use canOpenURL as we cannot check unknown apps on the phone + // Without listing everything in plist and android manifest + Linking.openURL(targetUrl); }, []); return { From ceac1f5a9d0b297943a2c8bfa6e69c89e7d6b7f1 Mon Sep 17 00:00:00 2001 From: Victor Alber Date: Thu, 26 Sep 2024 11:13:53 +0200 Subject: [PATCH 32/94] =?UTF-8?q?test:=20=F0=9F=A7=AA=20fix=20add=20accoun?= =?UTF-8?q?t=20(bitcoin)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../renderer/components/AccountsList/AccountRow.tsx | 8 +++++++- .../tests/component/layout.component.ts | 11 ++++++----- apps/ledger-live-desktop/tests/enum/Account.ts | 4 ++-- .../ledger-live-desktop/tests/page/abstractClasses.ts | 1 + .../tests/page/modal/add.account.modal.ts | 7 +++++++ .../tests/specs/speculos/delete.account.spec.ts | 2 +- .../tests/specs/speculos/receive.address.spec.ts | 2 +- .../tests/specs/speculos/send.tx.spec.ts | 2 +- .../tests/specs/speculos/swap.spec.ts | 2 +- 9 files changed, 27 insertions(+), 12 deletions(-) diff --git a/apps/ledger-live-desktop/src/renderer/components/AccountsList/AccountRow.tsx b/apps/ledger-live-desktop/src/renderer/components/AccountsList/AccountRow.tsx index 706565331c23..6bb5bec7d559 100644 --- a/apps/ledger-live-desktop/src/renderer/components/AccountsList/AccountRow.tsx +++ b/apps/ledger-live-desktop/src/renderer/components/AccountsList/AccountRow.tsx @@ -142,7 +142,13 @@ function AccountRow(props: Props) { color="palette.text.shade60" /> ) : null} - {!isDisabled && !isReadonly && } + {!isDisabled && !isReadonly && ( + + )} ); } diff --git a/apps/ledger-live-desktop/tests/component/layout.component.ts b/apps/ledger-live-desktop/tests/component/layout.component.ts index 39a9df55bed4..8c0fc4695173 100644 --- a/apps/ledger-live-desktop/tests/component/layout.component.ts +++ b/apps/ledger-live-desktop/tests/component/layout.component.ts @@ -36,7 +36,6 @@ export class Layout extends Component { // general readonly inputError = this.page.locator("id=input-error"); // no data-testid because css style is applied readonly insufficientFundsWarning = this.page.getByTestId("insufficient-funds-warning"); - private loadingSpinner = this.page.getByTestId("loading-spinner"); readonly logo = this.page.getByTestId("logo"); // updater @@ -104,10 +103,12 @@ export class Layout extends Component { } @step("Check warning message") - async checkWarningMessage(expectedWarningMessage: RegExp) { - await expect(this.insufficientFundsWarning).toBeVisible(); - const warningText = await this.insufficientFundsWarning.innerText(); - expect(warningText).toMatch(expectedWarningMessage); + async checkWarningMessage(expectedWarningMessage: RegExp | string | null) { + if (expectedWarningMessage !== null) { + await expect(this.insufficientFundsWarning).toBeVisible(); + const warningText = await this.insufficientFundsWarning.innerText(); + expect(warningText).toMatch(expectedWarningMessage); + } } @step("Check if the error message is the same as expected") diff --git a/apps/ledger-live-desktop/tests/enum/Account.ts b/apps/ledger-live-desktop/tests/enum/Account.ts index 72487e364cae..e42e2ce69cc2 100644 --- a/apps/ledger-live-desktop/tests/enum/Account.ts +++ b/apps/ledger-live-desktop/tests/enum/Account.ts @@ -7,13 +7,13 @@ export class Account { public readonly address: string, ) {} - static readonly BTC_1 = new Account( + static readonly BTC_NATIVE_SEGWIT_1 = new Account( Currency.BTC, "Bitcoin 1", "bc1qx7f9plgr8msjatkv0dw2ne8gguwfjqr6xyjp50", ); - static readonly BTC_2 = new Account( + static readonly BTC_NATIVE_SEGWIT_2 = new Account( Currency.BTC, "Bitcoin 2", "bc1q7ezsfc44adw2gyzqjmwhuh2e83uk8u5hrw590r", diff --git a/apps/ledger-live-desktop/tests/page/abstractClasses.ts b/apps/ledger-live-desktop/tests/page/abstractClasses.ts index 776c85c8f37e..0d2041efedc9 100644 --- a/apps/ledger-live-desktop/tests/page/abstractClasses.ts +++ b/apps/ledger-live-desktop/tests/page/abstractClasses.ts @@ -16,6 +16,7 @@ export abstract class Component extends PageHolder { `//*[contains(text(),"${text}")]/following::span[contains(text(),"${followingText}")]`, ) .first(); + protected loadingSpinner = this.page.getByTestId("loading-spinner"); async waitForPageDomContentLoadedState() { return await this.page.waitForLoadState("domcontentloaded"); diff --git a/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts b/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts index 4f97831e6f92..59f12bce8f61 100644 --- a/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts +++ b/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts @@ -8,6 +8,8 @@ export class AddAccountModal extends Modal { private selectAccount = this.page.locator("text=Choose a crypto asset"); // FIXME: I need an id readonly selectAccountInput = this.page.locator('[placeholder="Search"]'); // FIXME: I need an id readonly addAccountsButton = this.page.getByTestId("add-accounts-import-add-button"); + private deselectAllButton = this.page.getByText("Deselect all"); + private checkbox = this.page.getByTestId("accountRow-checkbox").first(); private accountsList = this.page.getByTestId("add-accounts-step-import-accounts-list"); private stopButton = this.page.getByTestId("add-accounts-import-stop-button"); private doneButton = this.page.getByTestId("add-accounts-finish-close-button"); @@ -92,10 +94,15 @@ export class AddAccountModal extends Modal { await expect(this.closeButton).toBeVisible(); await this.continue(); await this.waitForSync(); + await this.loadingSpinner.waitFor({ state: "hidden" }); } @step("Click `Add Accounts` button") async addAccounts() { + if (await this.deselectAllButton.isVisible()) { + await this.deselectAllButton.click(); + await this.checkbox.click({ force: true }); + } await this.addAccountsButton.click(); await expect(this.successAddLabel).toBeVisible(); } diff --git a/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts index 8171d0ab2947..a78f532861e6 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/delete.account.spec.ts @@ -4,7 +4,7 @@ import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; const accounts = [ - { account: Account.BTC_1, xrayTicket: "B2CQA-2548" }, + { account: Account.BTC_NATIVE_SEGWIT_1, xrayTicket: "B2CQA-2548" }, { account: Account.ETH_1, xrayTicket: "B2CQA-2551" }, { account: Account.SOL_1, xrayTicket: "B2CQA-2553" }, { account: Account.XRP_1, xrayTicket: "B2CQA-2557" }, diff --git a/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts index 2ceccd67678a..ccc7afdfdbd9 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/receive.address.spec.ts @@ -4,7 +4,7 @@ import { addTmsLink } from "tests/utils/allureUtils"; import { getDescription } from "../../utils/customJsonReporter"; const accounts = [ - { account: Account.BTC_1, xrayTicket: "B2CQA-2559, B2CQA-2687" }, + { account: Account.BTC_NATIVE_SEGWIT_1, xrayTicket: "B2CQA-2559, B2CQA-2687" }, { account: Account.ETH_1, xrayTicket: "B2CQA-2561, B2CQA-2688, B2CQA-2697" }, { account: Account.SOL_1, xrayTicket: "B2CQA-2563, B2CQA-2689" }, { account: Account.TRX_1, xrayTicket: "B2CQA-2565, B2CQA-2690, B2CQA-2699" }, diff --git a/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts index 7319fbf10ac7..684827381abe 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts @@ -217,7 +217,7 @@ test.describe("Send token (subAccount) - valid address & amount input", () => { test.describe("Check invalid address input error", () => { const transactionInvalidAddress = new Transaction( Account.ETH_1, - Account.BTC_1, + Account.BTC_NATIVE_SEGWIT_1, "0.00001", Fee.MEDIUM, ); diff --git a/apps/ledger-live-desktop/tests/specs/speculos/swap.spec.ts b/apps/ledger-live-desktop/tests/specs/speculos/swap.spec.ts index cdd1924b219a..6841f9d20102 100644 --- a/apps/ledger-live-desktop/tests/specs/speculos/swap.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/speculos/swap.spec.ts @@ -8,7 +8,7 @@ import { Providers, Rates } from "tests/enum/Swap"; const swaps = [ { - swap: new Swap(Account.ETH_1, Account.BTC_1, "0.015", Fee.MEDIUM), + swap: new Swap(Account.ETH_1, Account.BTC_NATIVE_SEGWIT_1, "0.015", Fee.MEDIUM), }, ]; From 5e6c9723c12ce065eddb5161482ed0ad37adcc27 Mon Sep 17 00:00:00 2001 From: Victor Alber Date: Thu, 26 Sep 2024 14:03:14 +0200 Subject: [PATCH 33/94] =?UTF-8?q?test:=20=F0=9F=90=9B=20creating=20new=20a?= =?UTF-8?q?ddAccount=20function=20for=20mocked=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/page/modal/add.account.modal.ts | 6 ++++++ .../tests/specs/accounts/account.spec.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts b/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts index 59f12bce8f61..241c9bc619c8 100644 --- a/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts +++ b/apps/ledger-live-desktop/tests/page/modal/add.account.modal.ts @@ -97,6 +97,12 @@ export class AddAccountModal extends Modal { await this.loadingSpinner.waitFor({ state: "hidden" }); } + @step("click `Add Accounts` button - mocked tests") + async addAccountsMocked() { + await this.addAccountsButton.click(); + await expect(this.successAddLabel).toBeVisible(); + } + @step("Click `Add Accounts` button") async addAccounts() { if (await this.deselectAllButton.isVisible()) { diff --git a/apps/ledger-live-desktop/tests/specs/accounts/account.spec.ts b/apps/ledger-live-desktop/tests/specs/accounts/account.spec.ts index 4bd5c17d10bf..b3e46876edc5 100644 --- a/apps/ledger-live-desktop/tests/specs/accounts/account.spec.ts +++ b/apps/ledger-live-desktop/tests/specs/accounts/account.spec.ts @@ -51,7 +51,7 @@ test.describe.parallel("Accounts @smoke", () => { }); await test.step(`[${currency}] Scan and add accounts`, async () => { - await addAccountModal.addAccounts(); + await addAccountModal.addAccountsMocked(); await expect.soft(addAccountModal.container).toHaveScreenshot(`${currency}-success.png`); }); From 6bc49edf5dc5f63776c671f9a69a40982ff8e823 Mon Sep 17 00:00:00 2001 From: Angus Bayley Date: Wed, 25 Sep 2024 16:46:53 +0100 Subject: [PATCH 34/94] fix: increase FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT for nightly build --- apps/ledger-live-mobile/fastlane/.env.ios.nightly | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/ledger-live-mobile/fastlane/.env.ios.nightly b/apps/ledger-live-mobile/fastlane/.env.ios.nightly index 07af2ac6514e..bdafb9c14760 100644 --- a/apps/ledger-live-mobile/fastlane/.env.ios.nightly +++ b/apps/ledger-live-mobile/fastlane/.env.ios.nightly @@ -4,3 +4,4 @@ MY_APP_BUNDLE_ID="com.ledger.live" APP_NAME="LL NIGHTLY" SENTRY_ENVIRONMENT=nightly SENTRY_PROJECT=llm-ios-nightly +FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT=180 From fa56035ac15a36e5032efd9ce0036d13d4a30790 Mon Sep 17 00:00:00 2001 From: Theophile Sandoz Date: Thu, 26 Sep 2024 15:27:18 +0200 Subject: [PATCH 35/94] =?UTF-8?q?chore(llm):=20=F0=9F=91=8C=20always=20ski?= =?UTF-8?q?p=20the=20analytics=20prompt=20in=20e2e=20tests=20(#7890)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(llm): always skip the analytics prompt in e2e tests * chore(llm): do not override llmAnalyticsOptInPrompt via the env file --- .changeset/strong-goats-rush.md | 5 +++++ apps/ledger-live-mobile/.env.mock | 2 +- apps/ledger-live-mobile/e2e/bridge/server.ts | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/strong-goats-rush.md diff --git a/.changeset/strong-goats-rush.md b/.changeset/strong-goats-rush.md new file mode 100644 index 000000000000..319fbaa8634e --- /dev/null +++ b/.changeset/strong-goats-rush.md @@ -0,0 +1,5 @@ +--- +"live-mobile": patch +--- + +Always skip the analytics prompt in e2e tests diff --git a/apps/ledger-live-mobile/.env.mock b/apps/ledger-live-mobile/.env.mock index 49b3538d982f..920bb6c6f5d3 100644 --- a/apps/ledger-live-mobile/.env.mock +++ b/apps/ledger-live-mobile/.env.mock @@ -9,7 +9,7 @@ ADJUST_APP_TOKEN=cbxft2ch7wn4 BRAZE_ANDROID_API_KEY="be5e1bc8-43f1-4864-b097-076a3c693a43" BRAZE_IOS_API_KEY="e0a7dfaf-fc30-48f6-b998-01dbebbb73a4" BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu" -FEATURE_FLAGS={"ratingsPrompt":{"enabled":false},"brazePushNotifications":{"enabled":false},"llmAnalyticsOptInPrompt":{"enabled":false}} +FEATURE_FLAGS={"ratingsPrompt":{"enabled":false},"brazePushNotifications":{"enabled":false}} # Fix random iOS app crash https://github.com/wix/Detox/pull/3135 SIMCTL_CHILD_NSZombieEnabled=YES MOCK_REMOTE_LIVE_MANIFEST=[{"name":"Dummy Wallet API Live App","homepageUrl":"https://developers.ledger.com/","icon":"","platforms":["ios","android","desktop"],"apiVersion":"2.0.0","manifestVersion":"1","branch":"stable","categories":["tools"],"currencies":"*","content":{"shortDescription":{"en":"App to test the Wallet API"},"description":{"en":"App to test the Wallet API with Playwright"}},"permissions":["account.list","account.receive","account.request","currency.list","device.close","device.exchange","device.transport","message.sign","transaction.sign","transaction.signAndBroadcast","storage.set","storage.get","bitcoin.getXPub","wallet.capabilities","wallet.userId","wallet.info"],"domains":["http://*"],"visibility":"complete","id":"dummy-live-app","url":"http://localhost:52619"}] \ No newline at end of file diff --git a/apps/ledger-live-mobile/e2e/bridge/server.ts b/apps/ledger-live-mobile/e2e/bridge/server.ts index f8aa7291f47b..e70229d73c8c 100644 --- a/apps/ledger-live-mobile/e2e/bridge/server.ts +++ b/apps/ledger-live-mobile/e2e/bridge/server.ts @@ -2,6 +2,7 @@ import { Server, WebSocket } from "ws"; import path from "path"; import fs from "fs"; import net from "net"; +import merge from "lodash/merge"; import { toAccountRaw } from "@ledgerhq/live-common/account/index"; import { NavigatorName } from "../../src/const"; import { Subject } from "rxjs"; @@ -83,7 +84,9 @@ export async function loadConfig(fileName: string, agreed: true = true): Promise const { data } = JSON.parse(f.toString()); - await postMessage({ type: "importSettings", id: uniqueId(), payload: data.settings }); + const defaultSettings = { shareAnalytics: true, hasSeenAnalyticsOptInPrompt: true }; + const settings = merge(defaultSettings, data.settings); + await postMessage({ type: "importSettings", id: uniqueId(), payload: settings }); navigate(NavigatorName.Base); From 73643335439f0bad460e17fe76dea52e1578db73 Mon Sep 17 00:00:00 2001 From: Mounir Hamzaoui Date: Thu, 26 Sep 2024 15:28:52 +0200 Subject: [PATCH 36/94] =?UTF-8?q?feat:=20=F0=9F=8C=90=20localize=20storyly?= =?UTF-8?q?=20(#7923)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/witty-bugs-add.md | 5 +++++ .../src/storyly/StorylyProvider.tsx | 12 +++++++++++- apps/ledger-live-desktop/src/storyly/useStoryly.tsx | 3 +-- apps/ledger-live-desktop/src/types/storyly-web.d.ts | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 .changeset/witty-bugs-add.md diff --git a/.changeset/witty-bugs-add.md b/.changeset/witty-bugs-add.md new file mode 100644 index 000000000000..232f7175fa82 --- /dev/null +++ b/.changeset/witty-bugs-add.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +storyly stories localization diff --git a/apps/ledger-live-desktop/src/storyly/StorylyProvider.tsx b/apps/ledger-live-desktop/src/storyly/StorylyProvider.tsx index 68200efaae8d..aa3172ea51fa 100644 --- a/apps/ledger-live-desktop/src/storyly/StorylyProvider.tsx +++ b/apps/ledger-live-desktop/src/storyly/StorylyProvider.tsx @@ -3,11 +3,12 @@ import useFeature from "@ledgerhq/live-common/featureFlags/useFeature"; import { closeAllModal } from "~/renderer/actions/modals"; import { context } from "~/renderer/drawers/Provider"; import { closeInformationCenter } from "~/renderer/actions/UI"; -import { useDispatch } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import { openURL } from "~/renderer/linking"; import { Feature_Storyly, StorylyInstanceType } from "@ledgerhq/types-live"; import { StorylyRef, Story } from "storyly-web"; +import { languageSelector } from "~/renderer/reducers/settings"; interface StorylyProviderProps { children: ReactNode; } @@ -37,6 +38,9 @@ const StorylyProvider: React.FC = ({ children }) => { const storylyRef = useRef(null); const { params } = useFeature("storyly") || {}; + + const language = useSelector(languageSelector); + const stories = params?.stories; useEffect(() => { @@ -60,6 +64,12 @@ const StorylyProvider: React.FC = ({ children }) => { storylyRef.current?.openStory({ group: query?.g, story: query?.s, playMode: query?.play }); }, [params, token, query, dispatch, setDrawer]); + useEffect(() => { + if (language) { + storylyRef.current?.setLang({ language }); + } + }, [language]); + useEffect(() => { if (url) { const storylyUrl = new URL(`ledgerlive://${url}`); diff --git a/apps/ledger-live-desktop/src/storyly/useStoryly.tsx b/apps/ledger-live-desktop/src/storyly/useStoryly.tsx index 8522a5fd35f8..1f182ff39b37 100644 --- a/apps/ledger-live-desktop/src/storyly/useStoryly.tsx +++ b/apps/ledger-live-desktop/src/storyly/useStoryly.tsx @@ -37,7 +37,6 @@ export const useStoryly = ( ref.current?.init({ layout: "classic", token: storyly.params?.stories[instanceId].token || "", - lang: language, segments: [`lang_${language}`], props: { ...props, ...options?.styleProps }, }); @@ -59,7 +58,7 @@ export const useStoryly = ( * Change `lang` and `segments` based on the app language */ useLayoutEffect(() => { - ref.current?.setLang({ language: language }); + ref.current?.setLang({ language }); ref.current?.setSegments([`lang_${language}`]); }, [language]); diff --git a/apps/ledger-live-desktop/src/types/storyly-web.d.ts b/apps/ledger-live-desktop/src/types/storyly-web.d.ts index c1ed46194d11..1acf9ef8e966 100644 --- a/apps/ledger-live-desktop/src/types/storyly-web.d.ts +++ b/apps/ledger-live-desktop/src/types/storyly-web.d.ts @@ -29,7 +29,7 @@ declare module "storyly-web" { interface StorylyOptions { layout: "classic" | "modern"; token: string; - lang?: Language /* TODO: delete it in LIVE-14102 and replace it with locale*/; + locale?: LanguagePrefixed; segments?: string[]; props?: StorylyStyleProps; } From 600c7b67afabeb951b10132e5090072c7fd46cf3 Mon Sep 17 00:00:00 2001 From: Lucas Werey <73439207+LucasWerey@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:46:22 +0200 Subject: [PATCH 37/94] :sparkles:(lld): add protect box inside discovery drawer (#7924) --- .changeset/witty-cows-breathe.md | 5 +++ .../Inscriptions/DiscoveryDrawer/Header.tsx | 5 ++- .../DiscoveryDrawer/ProtectBox.tsx | 34 +++++++++++++++++++ .../Inscriptions/DiscoveryDrawer/index.tsx | 10 +++--- .../src/renderer/actions/settings.ts | 5 +++ .../src/renderer/reducers/settings.ts | 9 +++++ .../static/i18n/en/app.json | 3 +- 7 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 .changeset/witty-cows-breathe.md create mode 100644 apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/ProtectBox.tsx diff --git a/.changeset/witty-cows-breathe.md b/.changeset/witty-cows-breathe.md new file mode 100644 index 000000000000..16b2ab79e57d --- /dev/null +++ b/.changeset/witty-cows-breathe.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +Add protectBox to protect ordinals in discovery drawer diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/Header.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/Header.tsx index b1a82554bdb0..281c62f68903 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/Header.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/Header.tsx @@ -5,6 +5,8 @@ const DiscoveryDrawerHeader: React.FC = () => ( ( top: 0, left: "50%", transform: "translateX(-50%) translateY(-50%)", - filter: "blur(120px)", + filter: "blur(17px)", + opacity: 0.2, }} > diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/ProtectBox.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/ProtectBox.tsx new file mode 100644 index 000000000000..482a46ebcbff --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/ProtectBox.tsx @@ -0,0 +1,34 @@ +import React, { useCallback } from "react"; +import { Flex, Text } from "@ledgerhq/react-ui"; +import Switch from "~/renderer/components/Switch"; +import { hasProtectedOrdinalsAssetsSelector } from "~/renderer/reducers/settings"; +import { setHasProtectedOrdinalsAssets } from "~/renderer/actions/settings"; +import { useDispatch, useSelector } from "react-redux"; +import { t } from "i18next"; + +const ProtectBox: React.FC = () => { + const dispatch = useDispatch(); + const hasProtectedOrdinals = useSelector(hasProtectedOrdinalsAssetsSelector); + + const onSwitchChange = useCallback(() => { + dispatch(setHasProtectedOrdinalsAssets(!hasProtectedOrdinals)); + }, [dispatch, hasProtectedOrdinals]); + + return ( + + + {t("ordinals.inscriptions.discoveryDrawer.protectTitle")} + + + + {t("ordinals.inscriptions.discoveryDrawer.protectDescription")} + + + + + + + ); +}; + +export default ProtectBox; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/index.tsx index 806c91d5ece9..b2c36f00ffdc 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/index.tsx @@ -1,6 +1,7 @@ import React from "react"; import DiscoveryDrawerHeader from "./Header"; -import { Button, CryptoIcon, Flex, Link, Text } from "@ledgerhq/react-ui"; +import ProtectBox from "./ProtectBox"; +import { Button, CryptoIcon, Flex, Text } from "@ledgerhq/react-ui"; import { SideDrawer } from "~/renderer/components/SideDrawer"; import { Direction } from "@ledgerhq/react-ui/components/layout/Drawer/index"; import { space } from "@ledgerhq/react-ui/styles/theme"; @@ -17,7 +18,6 @@ const DiscoveryDrawer = ({ isOpen, onClose }: Props) => { const { t } = useTranslation(); const learnMoreUrl = urls.whatAreOrdinals; const onButtonClick = () => openURL(learnMoreUrl); - const onLinkClick = () => onClose(); return ( { > {t("ordinals.inscriptions.discoveryDrawer.description")} - - - {t("ordinals.inscriptions.discoveryDrawer.viewCoinControl")} - + ); diff --git a/apps/ledger-live-desktop/src/renderer/actions/settings.ts b/apps/ledger-live-desktop/src/renderer/actions/settings.ts index 0a93392dd663..ad3a94577590 100644 --- a/apps/ledger-live-desktop/src/renderer/actions/settings.ts +++ b/apps/ledger-live-desktop/src/renderer/actions/settings.ts @@ -393,3 +393,8 @@ export const setHasSeenOrdinalsDiscoveryDrawer = (payload: boolean) => ({ type: "SET_HAS_SEEN_ORDINALS_DISCOVERY_DRAWER", payload, }); + +export const setHasProtectedOrdinalsAssets = (payload: boolean) => ({ + type: "SET_HAS_PROTECTED_ORDINALS_ASSETS", + payload, +}); diff --git a/apps/ledger-live-desktop/src/renderer/reducers/settings.ts b/apps/ledger-live-desktop/src/renderer/reducers/settings.ts index 359bdcab40c1..24f033dc2cba 100644 --- a/apps/ledger-live-desktop/src/renderer/reducers/settings.ts +++ b/apps/ledger-live-desktop/src/renderer/reducers/settings.ts @@ -114,6 +114,7 @@ export type SettingsState = { anonymousBrazeId: string | null; starredMarketCoins: string[]; hasSeenOrdinalsDiscoveryDrawer: boolean; + hasProtectedOrdinalsAssets: boolean; }; export const getInitialLanguageAndLocale = (): { language: Language; locale: Locale } => { @@ -171,6 +172,7 @@ export const INITIAL_STATE: SettingsState = { hasInstalledApps: true, lastSeenDevice: null, hasSeenOrdinalsDiscoveryDrawer: false, + hasProtectedOrdinalsAssets: false, devicesModelList: [], lastSeenCustomImage: { size: 0, @@ -264,6 +266,7 @@ type HandlersPayloads = { MARKET_ADD_STARRED_COINS: string; MARKET_REMOVE_STARRED_COINS: string; SET_HAS_SEEN_ORDINALS_DISCOVERY_DRAWER: boolean; + SET_HAS_PROTECTED_ORDINALS_ASSETS: boolean; }; type SettingsHandlers = Handlers; @@ -464,6 +467,10 @@ const handlers: SettingsHandlers = { ...state, hasSeenOrdinalsDiscoveryDrawer: payload, }), + SET_HAS_PROTECTED_ORDINALS_ASSETS: (state: SettingsState, { payload }) => ({ + ...state, + hasProtectedOrdinalsAssets: payload, + }), }; export default handleActions( @@ -806,3 +813,5 @@ export const currenciesSettingsSelector = (state: State) => state.settings.curre export const starredMarketCoinsSelector = (state: State) => state.settings.starredMarketCoins; export const hasSeenOrdinalsDiscoveryDrawerSelector = (state: State) => state.settings.hasSeenOrdinalsDiscoveryDrawer; +export const hasProtectedOrdinalsAssetsSelector = (state: State) => + state.settings.hasProtectedOrdinalsAssets; diff --git a/apps/ledger-live-desktop/static/i18n/en/app.json b/apps/ledger-live-desktop/static/i18n/en/app.json index 9d544abbb96e..04c1552658bb 100644 --- a/apps/ledger-live-desktop/static/i18n/en/app.json +++ b/apps/ledger-live-desktop/static/i18n/en/app.json @@ -6601,7 +6601,8 @@ "title": "Discover Ordinals", "description": "Do you know that you may own valuable rare sats and inscriptions?", "learnMore": "Learn more", - "viewCoinControl": "View coin control" + "protectTitle": "Protect your ordinals assets", + "protectDescription": "Exclude your Ordinals assets from your transactions." } }, "rareSats": { From 8b3fd36ff06b9777d6428c8b887fec7643d97349 Mon Sep 17 00:00:00 2001 From: Theophile Sandoz Date: Thu, 26 Sep 2024 16:01:52 +0200 Subject: [PATCH 38/94] =?UTF-8?q?chore(lld):=20=F0=9F=91=8C=20always=20ski?= =?UTF-8?q?p=20the=20analytics=20prompt=20in=20e2e=20tests=20(#7910)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(lld): do not show dismissed analytics prompt during onboarding * chore(lld): always skip the analytics prompt in e2e tests * chore: update change log * fix(lld test): accounts/encrypted.spec.ts * Revert "chore(lld): do not show dismissed analytics prompt during onboarding" This reverts commit 38b7ae109eae49c503f7c7eda0e8e83ff4d58d48. * chore(lld): accept analytics on onboarding tests * chore: set hasSeenAnalyticsOptInPrompt to false on all onboarding tests --- .changeset/big-snakes-marry.md | 5 +++++ .../Main/components/MainFooter/index.tsx | 8 +++++++- .../VariantB/components/Footer/index.tsx | 1 + .../tests/fixtures/common.ts | 19 ++++++++++++------- .../tests/page/onboarding.page.ts | 4 ++++ .../specs/onboarding/connect-device.spec.ts | 4 ++++ .../specs/onboarding/restore-device.spec.ts | 4 ++++ .../specs/onboarding/setup-device.spec.ts | 4 ++++ .../tests/specs/syncOnboarding/manual.spec.ts | 2 ++ .../1AccountBTC1AccountETH-encrypted.json | 2 +- 10 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 .changeset/big-snakes-marry.md diff --git a/.changeset/big-snakes-marry.md b/.changeset/big-snakes-marry.md new file mode 100644 index 000000000000..d3d8e8b01bf0 --- /dev/null +++ b/.changeset/big-snakes-marry.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +Always skip the analytics prompt in e2e tests diff --git a/apps/ledger-live-desktop/src/newArch/features/AnalyticsOptInPrompt/screens/VariantA/Main/components/MainFooter/index.tsx b/apps/ledger-live-desktop/src/newArch/features/AnalyticsOptInPrompt/screens/VariantA/Main/components/MainFooter/index.tsx index 0b29747d0e65..bb762e6033d9 100644 --- a/apps/ledger-live-desktop/src/newArch/features/AnalyticsOptInPrompt/screens/VariantA/Main/components/MainFooter/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/AnalyticsOptInPrompt/screens/VariantA/Main/components/MainFooter/index.tsx @@ -38,7 +38,13 @@ const MainFooter = ({ setWantToManagePreferences, onShareAnalyticsChange }: Main > {t("analyticsOptInPrompt.variantA.refuse")} - diff --git a/apps/ledger-live-desktop/src/newArch/features/AnalyticsOptInPrompt/screens/VariantB/components/Footer/index.tsx b/apps/ledger-live-desktop/src/newArch/features/AnalyticsOptInPrompt/screens/VariantB/components/Footer/index.tsx index 1e48da078f0a..0861a1e24fa7 100644 --- a/apps/ledger-live-desktop/src/newArch/features/AnalyticsOptInPrompt/screens/VariantB/components/Footer/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/AnalyticsOptInPrompt/screens/VariantB/components/Footer/index.tsx @@ -30,6 +30,7 @@ const VariantBFooter = ({ clickOptions }: VariantBFooterProps) => { {t("analyticsOptInPrompt.variantB.refuse")} + + + ); +}; +export default Actions; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/SubTitle.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/SubTitle.tsx new file mode 100644 index 000000000000..21c43cae7fe2 --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/SubTitle.tsx @@ -0,0 +1,25 @@ +import React from "react"; +import { Flex, Text } from "@ledgerhq/react-ui"; +import IconContainer from "LLD/features/Collectibles/components/Collection/TableRow/IconContainer"; +import { IconProps } from "LLD/features/Collectibles/types/Collection"; +import { MappingKeys } from "LLD/features/Collectibles/types/Ordinals"; +import { useTranslation } from "react-i18next"; + +type Props = { + icons: (({ size, color, style }: IconProps) => JSX.Element)[]; + names: MappingKeys[]; +}; + +const SubTitle: React.FC = ({ icons, names }) => { + const { t } = useTranslation(); + return ( + + + + {t("ordinals.inscriptions.detailsDrawer.storedOnChain")} + + + ); +}; + +export default SubTitle; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx index eb7ff49015cf..abedd3a803ae 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx @@ -1,18 +1,66 @@ import React from "react"; -import { SideDrawer } from "~/renderer/components/SideDrawer"; import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; +import { DetailDrawer } from "LLD/features/Collectibles/components"; +import { CollectibleTypeEnum } from "LLD/features/Collectibles/types/enum/Collectibles"; +import useInscriptionDetailDrawer from "./useInscriptionDetailDrawer"; +import Actions from "./Actions"; +import SubTitle from "./SubTitle"; + +type ViewProps = ReturnType & { + onClose: () => void; +}; type Props = { inscription: SimpleHashNft; + correspondingRareSat: SimpleHashNft | null | undefined; + isLoading: boolean; onClose: () => void; }; -const InscriptionDetailsDrawer: React.FC = ({ inscription, onClose }) => { - // will be replaced by DetailsDrawer from collectibles + +const View: React.FC = ({ data, rareSat, onClose }) => ( + + {rareSat?.icons && ( + + + + )} + + + + +); + +const InscriptionDetailDrawer = ({ + inscription, + isLoading, + correspondingRareSat, + onClose, +}: Props) => { return ( - - {inscription.name || inscription.contract.name} - + ); }; -export default InscriptionDetailsDrawer; +export default InscriptionDetailDrawer; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/useInscriptionDetailDrawer.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/useInscriptionDetailDrawer.ts new file mode 100644 index 000000000000..c82cae275514 --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/useInscriptionDetailDrawer.ts @@ -0,0 +1,64 @@ +import { useMemo, useState } from "react"; +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; +import useCollectibles from "LLD/features/Collectibles/hooks/useCollectibles"; +import { createDetails } from "LLD/features/Collectibles/utils/createInscriptionDetailsArrays"; +import { useCalendarFormatted } from "~/renderer/hooks/useDateFormatter"; +import { Tag } from "LLD/features/Collectibles/types/DetailDrawer"; +import { processRareSat } from "../helpers"; + +type Props = { + isLoading: boolean; + inscription: SimpleHashNft; + correspondingRareSat: SimpleHashNft | null | undefined; +}; + +const useInscriptionDetailDrawer = ({ isLoading, inscription, correspondingRareSat }: Props) => { + const [useFallback, setUseFallback] = useState(false); + const imageUri = + inscription.video_url || inscription.previews?.image_large_url || inscription.image_url; + + const isVideo = !!inscription.video_url; + + const contentType = isVideo ? "video" : imageUri ? "image" : ""; + + const { isPanAndZoomOpen, openCollectiblesPanAndZoom, closeCollectiblesPanAndZoom } = + useCollectibles(); + + const createdDateFromTimestamp = new Date(inscription.first_created?.timestamp || 0); + const formattedCreatedDate = useCalendarFormatted(createdDateFromTimestamp); + const createdDate = createdDateFromTimestamp === new Date(0) ? "" : formattedCreatedDate; + const details = createDetails(inscription, createdDate); + + const tags: Tag[] = + inscription.extra_metadata?.attributes?.map(attr => ({ + key: attr.trait_type, + value: attr.value, + })) || []; + + const rareSat = useMemo(() => { + if (correspondingRareSat) return processRareSat(correspondingRareSat); + }, [correspondingRareSat]); + + const data = { + areFieldsLoading: isLoading, + collectibleName: inscription.name || inscription.contract.name || "", + contentType, + collectionName: inscription.collection.name || "", + details: details, + previewUri: imageUri, + originalUri: imageUri, + isPanAndZoomOpen, + mediaType: inscription.video_properties?.mime_type || "image", + tags: tags, + useFallback: useFallback, + tokenId: inscription.nft_id, + isOpened: true, + closeCollectiblesPanAndZoom, + openCollectiblesPanAndZoom, + setUseFallback: setUseFallback, + }; + + return { inscription, data, rareSat }; +}; + +export default useInscriptionDetailDrawer; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/ProtectBox.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/ProtectBox.tsx index 482a46ebcbff..8c428e9f8a18 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/ProtectBox.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DiscoveryDrawer/ProtectBox.tsx @@ -4,9 +4,10 @@ import Switch from "~/renderer/components/Switch"; import { hasProtectedOrdinalsAssetsSelector } from "~/renderer/reducers/settings"; import { setHasProtectedOrdinalsAssets } from "~/renderer/actions/settings"; import { useDispatch, useSelector } from "react-redux"; -import { t } from "i18next"; +import { useTranslation } from "react-i18next"; const ProtectBox: React.FC = () => { + const { t } = useTranslation(); const dispatch = useDispatch(); const hasProtectedOrdinals = useSelector(hasProtectedOrdinalsAssetsSelector); diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/Item.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/Item.tsx deleted file mode 100644 index dc3f2ab8ffd8..000000000000 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/Item.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { InscriptionsItemProps } from "LLD/features/Collectibles/types/Inscriptions"; -import TableRow from "LLD/features/Collectibles/components/Collection/TableRow"; -import React from "react"; - -type ItemProps = { - isLoading: boolean; -} & InscriptionsItemProps; - -const Item: React.FC = ({ - isLoading, - tokenName, - collectionName, - tokenIcons, - media, - rareSatName, - onClick, -}) => ( - -); - -export default Item; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/Item/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/Item/index.tsx new file mode 100644 index 000000000000..b9c404527346 --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/Item/index.tsx @@ -0,0 +1,40 @@ +import React, { useMemo } from "react"; +import { InscriptionsItemProps } from "LLD/features/Collectibles/types/Inscriptions"; +import TableRow from "LLD/features/Collectibles/components/Collection/TableRow"; +import { GroupedNftOrdinals } from "@ledgerhq/live-nft-react/index"; +import { findCorrespondingSat } from "LLD/features/Collectibles/utils/findCorrespondingSat"; +import { processRareSat } from "../helpers"; + +type ItemProps = { + isLoading: boolean; + inscriptionsGroupedWithRareSats: GroupedNftOrdinals[]; +} & InscriptionsItemProps; + +const Item: React.FC = ({ + isLoading, + tokenName, + collectionName, + media, + nftId, + inscriptionsGroupedWithRareSats, + onClick, +}) => { + const correspondingRareSat = findCorrespondingSat(inscriptionsGroupedWithRareSats, nftId); + const rareSat = useMemo(() => { + if (correspondingRareSat) return processRareSat(correspondingRareSat.rareSat); + }, [correspondingRareSat]); + + return ( + + ); +}; + +export default Item; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/helpers.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/helpers.ts index 7ea111c9c9c9..695f0a214b1d 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/helpers.ts +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/helpers.ts @@ -1,40 +1,14 @@ import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; -import { IconProps } from "LLD/features/Collectibles/types/Collection"; -import { mappingKeysWithIconAndName } from "../Icons"; -import { MappingKeys } from "LLD/features/Collectibles/types/Ordinals"; - -function matchCorrespondingIcon( - rareSats: SimpleHashNft[], -): Array JSX.Element> }> { - return rareSats.map(rareSat => { - const iconKeys: string[] = []; - const rarity = rareSat.extra_metadata?.ordinal_details?.sat_rarity?.toLowerCase(); - - if (rarity && rarity !== "common") { - iconKeys.push(rarity.replace(" ", "_")); - } - - const icons = iconKeys - .map( - iconKey => - mappingKeysWithIconAndName[iconKey as keyof typeof mappingKeysWithIconAndName]?.icon, - ) - .filter(Boolean) as Array<({ size, color, style }: IconProps) => JSX.Element>; - - return { ...rareSat, icons }; - }); -} +import { createRareSatObject, matchCorrespondingIcon } from "../helpers"; export function getInscriptionsData( inscriptions: SimpleHashNft[], onInscriptionClick: (inscription: SimpleHashNft) => void, ) { - const inscriptionsWithIcons = matchCorrespondingIcon(inscriptions); - return inscriptionsWithIcons.map(item => ({ + return inscriptions.map(item => ({ tokenName: item.name || item.contract.name || "", + nftId: item.nft_id, collectionName: item.collection.name, - tokenIcons: item.icons, - rareSatName: [item.extra_metadata?.ordinal_details?.sat_rarity] as MappingKeys[], media: { uri: item.image_url || item.previews?.image_small_url, isLoading: false, @@ -45,3 +19,9 @@ export function getInscriptionsData( onClick: () => onInscriptionClick(item), })); } + +export function processRareSat(inscription: SimpleHashNft) { + const matchedRareSatsIcons = matchCorrespondingIcon(inscription); + const rareSatObject = createRareSatObject({ rareSat: matchedRareSatsIcons }); + return rareSatObject.rareSat[0]; +} diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/index.tsx index 3e88f98b0e75..e6269cb4034b 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/index.tsx @@ -10,14 +10,16 @@ import Loader from "../Loader"; import Error from "../Error"; import Item from "./Item"; import EmptyCollection from "LLD/features/Collectibles/components/Collection/EmptyCollection"; -import { CollectibleTypeEnum } from "../../../types/enum/Collectibles"; +import { CollectibleTypeEnum } from "LLD/features/Collectibles/types/enum/Collectibles"; import Button from "~/renderer/components/Button"; import { useTranslation } from "react-i18next"; +import { GroupedNftOrdinals } from "@ledgerhq/live-nft-react/index"; type ViewProps = ReturnType & { isLoading: boolean; isError: boolean; error: Error | null; + inscriptionsGroupedWithRareSats: GroupedNftOrdinals[]; onReceive: () => void; }; @@ -26,6 +28,7 @@ type Props = { isLoading: boolean; isError: boolean; error: Error | null; + inscriptionsGroupedWithRareSats: GroupedNftOrdinals[]; onReceive: () => void; onInscriptionClick: (inscription: SimpleHashNft) => void; }; @@ -36,6 +39,7 @@ const View: React.FC = ({ isError, inscriptions, error, + inscriptionsGroupedWithRareSats, onShowMore, onReceive, }) => { @@ -55,12 +59,8 @@ const View: React.FC = ({ ))} {nothingToShow && ( @@ -84,6 +84,7 @@ const Inscriptions: React.FC = ({ isLoading, isError, error, + inscriptionsGroupedWithRareSats, onReceive, onInscriptionClick, }) => ( @@ -92,6 +93,7 @@ const Inscriptions: React.FC = ({ isError={isError} error={error} onReceive={onReceive} + inscriptionsGroupedWithRareSats={inscriptionsGroupedWithRareSats} {...useInscriptionsModel({ inscriptions, onInscriptionClick })} /> ); diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/helpers.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/helpers.ts deleted file mode 100644 index 9a7423bbe53b..000000000000 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/helpers.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { mappingKeysWithIconAndName } from "../Icons"; -import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; -import { - SimpleHashNftWithIcons, - RareSat, - MappingKeys, -} from "LLD/features/Collectibles/types/Ordinals"; - -export function matchCorrespondingIcon(rareSats: SimpleHashNft[]): SimpleHashNftWithIcons[] { - return rareSats.map(rareSat => { - const iconKeys: string[] = []; - if (rareSat.name) { - iconKeys.push(rareSat.name.toLowerCase().replace(" ", "_")); - } - - if (rareSat.extra_metadata?.utxo_details?.satributes) { - iconKeys.push(...Object.keys(rareSat.extra_metadata.utxo_details.satributes)); - } - - const icons = iconKeys - .map( - iconKey => - mappingKeysWithIconAndName[iconKey as keyof typeof mappingKeysWithIconAndName]?.icon, - ) - .filter(Boolean) as RareSat["icons"]; - - return { ...rareSat, icons }; - }); -} - -export function createRareSatObject( - rareSats: Record, -): Record { - const result: Record = {}; - - for (const [key, value] of Object.entries(rareSats)) { - result[key] = value.map(rareSat => { - const { icons, extra_metadata } = rareSat; - const year = extra_metadata?.utxo_details?.sat_ranges?.[0]?.year || ""; - const displayed_names = - Object.values(extra_metadata?.utxo_details?.satributes || {}) - .map(attr => attr.display_name) - .join(" / ") || ""; - const names = rareSat.extra_metadata?.utxo_details?.satributes - ? (Object.keys(rareSat.extra_metadata.utxo_details.satributes) as MappingKeys[]) - : []; - const count = extra_metadata?.utxo_details?.value || 0; - const isMultipleRow = value.length > 1; - - return { - year, - displayed_names, - names, - count: `${count} ${count > 1 ? "sats" : "sat"}`, - isMultipleRow, - icons, - }; - }); - } - - return result; -} diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/useRareSatsModel.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/useRareSatsModel.ts index a59b1eafc054..e73078536530 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/useRareSatsModel.ts +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/RareSats/useRareSatsModel.ts @@ -1,4 +1,4 @@ -import { matchCorrespondingIcon, createRareSatObject } from "./helpers"; +import { matchCorrespondingIcon, createRareSatObject } from "../helpers"; import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; import { regroupRareSatsByContractAddress } from "@ledgerhq/live-nft-react"; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/helpers.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/helpers.ts new file mode 100644 index 000000000000..c323b37e8bd9 --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/helpers.ts @@ -0,0 +1,78 @@ +import { mappingKeysWithIconAndName } from "./Icons"; +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; +import { + SimpleHashNftWithIcons, + RareSat, + MappingKeys, +} from "LLD/features/Collectibles/types/Ordinals"; + +function processSingleRareSat(rareSat: SimpleHashNft): SimpleHashNftWithIcons { + const iconKeys: string[] = []; + if (rareSat.name) { + iconKeys.push(rareSat.name.toLowerCase().replace(" ", "_")); + } + + if (rareSat.extra_metadata?.utxo_details?.satributes) { + iconKeys.push(...Object.keys(rareSat.extra_metadata.utxo_details.satributes)); + } + + const icons = iconKeys + .map( + iconKey => + mappingKeysWithIconAndName[iconKey as keyof typeof mappingKeysWithIconAndName]?.icon, + ) + .filter(Boolean) as RareSat["icons"]; + + return { ...rareSat, icons }; +} + +function mapToRareSat(rareSat: SimpleHashNftWithIcons, isMultipleRow: boolean): RareSat { + const { icons, extra_metadata } = rareSat; + const year = extra_metadata?.utxo_details?.sat_ranges?.[0]?.year || ""; + const displayed_names = + Object.values(extra_metadata?.utxo_details?.satributes || {}) + .map(attr => attr.display_name) + .join(" / ") || ""; + const names = rareSat.extra_metadata?.utxo_details?.satributes + ? (Object.keys(rareSat.extra_metadata.utxo_details.satributes) as MappingKeys[]) + : []; + const count = extra_metadata?.utxo_details?.value || 0; + + return { + year, + displayed_names, + names, + count: `${count} ${count > 1 ? "sats" : "sat"}`, + isMultipleRow, + icons, + }; +} + +function processRareSatObject( + rareSats: Record, +): Record { + const result: Record = {}; + + for (const [key, value] of Object.entries(rareSats)) { + result[key] = value.map(rareSat => mapToRareSat(rareSat, value.length > 1)); + } + + return result; +} + +export function matchCorrespondingIcon( + rareSats: SimpleHashNft | SimpleHashNft[], +): SimpleHashNftWithIcons[] { + const rareSatArray = Array.isArray(rareSats) ? rareSats : [rareSats]; + return rareSatArray.map(processSingleRareSat); +} + +export function createRareSatObject( + rareSats: Record | SimpleHashNftWithIcons[], +): Record { + if (Array.isArray(rareSats)) { + return { default: rareSats.map(rareSat => mapToRareSat(rareSat, rareSats.length > 1)) }; + } else { + return processRareSatObject(rareSats); + } +} diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx index f1683da348f9..cbec04e52909 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx @@ -19,6 +19,8 @@ const View: React.FC = ({ rareSats, isDrawerOpen, selectedInscription, + correspondingRareSat, + inscriptionsGroupedWithRareSats, handleDrawerClose, onReceive, onInscriptionClick, @@ -26,15 +28,21 @@ const View: React.FC = ({ }) => ( {selectedInscription && ( - + )} ); diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/useBitcoinAccountModel.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/useBitcoinAccountModel.ts index b6bbe99d37d3..c1c8d0ad620b 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/useBitcoinAccountModel.ts +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/useBitcoinAccountModel.ts @@ -6,6 +6,7 @@ import { useDispatch, useSelector } from "react-redux"; import { openModal } from "~/renderer/actions/modals"; import { setHasSeenOrdinalsDiscoveryDrawer } from "~/renderer/actions/settings"; import { hasSeenOrdinalsDiscoveryDrawerSelector } from "~/renderer/reducers/settings"; +import { findCorrespondingSat } from "LLD/features/Collectibles/utils/findCorrespondingSat"; interface Props { account: BitcoinAccount; @@ -15,8 +16,13 @@ export const useBitcoinAccountModel = ({ account }: Props) => { const dispatch = useDispatch(); const hasSeenDiscoveryDrawer = useSelector(hasSeenOrdinalsDiscoveryDrawerSelector); const [selectedInscription, setSelectedInscription] = useState(null); + const [correspondingRareSat, setCorrespondingRareSat] = useState< + SimpleHashNft | null | undefined + >(null); - const { rareSats, inscriptions, ...rest } = useFetchOrdinals({ account }); + const { rareSats, inscriptions, inscriptionsGroupedWithRareSats, ...rest } = useFetchOrdinals({ + account, + }); const [isDrawerOpen, setIsDrawerOpen] = useState(!hasSeenDiscoveryDrawer); @@ -40,7 +46,11 @@ export const useBitcoinAccountModel = ({ account }: Props) => { ); }, [dispatch, account]); - const onInscriptionClick = (inscription: SimpleHashNft) => setSelectedInscription(inscription); + const onInscriptionClick = (inscription: SimpleHashNft) => { + const groupedNft = findCorrespondingSat(inscriptionsGroupedWithRareSats, inscription.nft_id); + setCorrespondingRareSat(groupedNft?.rareSat ?? null); + setSelectedInscription(inscription); + }; const onDetailsDrawerClose = () => setSelectedInscription(null); @@ -50,6 +60,8 @@ export const useBitcoinAccountModel = ({ account }: Props) => { rest, isDrawerOpen, selectedInscription, + correspondingRareSat, + inscriptionsGroupedWithRareSats, onReceive, handleDrawerClose, onInscriptionClick, diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/bitcoinPage.test.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/bitcoinPage.test.tsx index e1046b592629..66797fa60c8e 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/bitcoinPage.test.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/bitcoinPage.test.tsx @@ -18,24 +18,24 @@ jest.mock("~/renderer/linking", () => ({ describe("displayBitcoinPage", () => { it("should display Bitcoin page with rare sats and inscriptions", async () => { - const { user } = render(); + const { user } = render(, { + initialState: { + settings: { + hasSeenOrdinalsDiscoveryDrawer: true, + }, + }, + }); - await waitFor(() => expect(screen.getByText(/inscription #63691311/i)).toBeVisible()); - await waitFor(() => expect(screen.getByTestId(/raresaticon-palindrome-0/i)).toBeVisible()); - await user.hover(screen.getByTestId(/raresaticon-palindrome-0/i)); - await waitFor(() => expect(screen.getByText(/in a playful twist/i)).toBeVisible()); - await waitFor(() => - expect( - screen.getByText(/block 9 \/ first transaction \/ nakamoto \/ vintage/i), - ).toBeVisible(), - ); + await waitFor(() => expect(screen.getByText(/the great war #3695/i)).toBeVisible()); await waitFor(() => expect(screen.getByText(/see more inscriptions/i)).toBeVisible()); await user.click(screen.getByText(/see more inscriptions/i)); - await waitFor(() => expect(screen.getByText(/timechain #136/i)).toBeVisible()); - await waitFor(() => expect(screen.getByTestId(/raresaticon-jpeg-0/i)).toBeVisible()); - await user.hover(screen.getByTestId(/raresaticon-jpeg-0/i)); - await waitFor(() => expect(screen.getByText(/journey into the past with jpeg/i)).toBeVisible()); + await user.click(screen.getByText(/see more inscriptions/i)); + await waitFor(() => expect(screen.getByText(/bitcoin puppet #71/i)).toBeVisible()); + await waitFor(() => expect(screen.queryAllByTestId(/raresaticon-pizza-0/i)).toHaveLength(2)); + await user.hover(screen.queryAllByTestId(/raresaticon-pizza-0/i)[0]); + await waitFor(() => expect(screen.getByText(/papa john's pizza/i)).toBeVisible()); }); + it("should open discovery drawer when it is the first time feature is activated", async () => { const { user } = render(); @@ -43,4 +43,20 @@ describe("displayBitcoinPage", () => { await user.click(screen.getByText(/learn more/i)); expect(openURL).toHaveBeenCalledWith("https://www.ledger.com/academy/bitcoin-ordinals"); }); + + it("should open inscription detail drawer", async () => { + const { user } = render(, { + initialState: { + settings: { + hasSeenOrdinalsDiscoveryDrawer: true, + }, + }, + }); + + await waitFor(() => expect(screen.getByText(/the great war #3695/i)).toBeVisible()); + await user.click(screen.getByText(/the great war #3695/i)); + await expect(screen.getByText(/hide/i)).toBeVisible(); + // sat name + await expect(screen.getByText(/dlngbapxjdv/i)).toBeVisible(); + }); }); diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/components/Collection/HeaderActions.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/components/Collection/HeaderActions.tsx index 5a3074491d6d..8f993d1b3d24 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/components/Collection/HeaderActions.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/components/Collection/HeaderActions.tsx @@ -1,7 +1,7 @@ -import Button from "~/renderer/components/Button"; -import { t } from "i18next"; import React from "react"; +import Button from "~/renderer/components/Button"; import Box from "~/renderer/components/Box"; +import { useTranslation } from "react-i18next"; type Props = { children?: JSX.Element; @@ -9,6 +9,7 @@ type Props = { }; const HeaderActions: React.FC = ({ children, textKey }) => { + const { t } = useTranslation(); return ( - + ); }; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx index abedd3a803ae..6fd8b6ebcc66 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/DetailsDrawer/index.tsx @@ -5,8 +5,10 @@ import { CollectibleTypeEnum } from "LLD/features/Collectibles/types/enum/Collec import useInscriptionDetailDrawer from "./useInscriptionDetailDrawer"; import Actions from "./Actions"; import SubTitle from "./SubTitle"; +import { BitcoinAccount } from "@ledgerhq/coin-bitcoin/lib/types"; type ViewProps = ReturnType & { + account: BitcoinAccount; onClose: () => void; }; @@ -14,10 +16,11 @@ type Props = { inscription: SimpleHashNft; correspondingRareSat: SimpleHashNft | null | undefined; isLoading: boolean; + account: BitcoinAccount; onClose: () => void; }; -const View: React.FC = ({ data, rareSat, onClose }) => ( +const View: React.FC = ({ data, rareSat, account, inscription, onClose }) => ( = ({ data, rareSat, onClose }) => ( )} - + ); @@ -53,12 +56,14 @@ const InscriptionDetailDrawer = ({ inscription, isLoading, correspondingRareSat, + account, onClose, }: Props) => { return ( ); }; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx index cbec04e52909..372d2c1a5e18 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/Ordinals/screens/Account/index.tsx @@ -7,7 +7,9 @@ import { BitcoinAccount } from "@ledgerhq/coin-bitcoin/lib/types"; import { useBitcoinAccountModel } from "./useBitcoinAccountModel"; import InscriptionDetailsDrawer from "../../components/Inscriptions/DetailsDrawer"; -type ViewProps = ReturnType; +type ViewProps = ReturnType & { + account: BitcoinAccount; +}; interface Props { account: BitcoinAccount; @@ -21,6 +23,7 @@ const View: React.FC = ({ selectedInscription, correspondingRareSat, inscriptionsGroupedWithRareSats, + account, handleDrawerClose, onReceive, onInscriptionClick, @@ -42,13 +45,14 @@ const View: React.FC = ({ correspondingRareSat={correspondingRareSat} onClose={onDetailsDrawerClose} isLoading={rest.isLoading} + account={account} /> )} ); const OrdinalsAccount: React.FC = ({ account }) => ( - + ); export default OrdinalsAccount; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/bitcoinPage.test.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/bitcoinPage.test.tsx index 66797fa60c8e..a34984d96302 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/bitcoinPage.test.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/__integration__/bitcoinPage.test.tsx @@ -5,6 +5,7 @@ import React from "react"; import { render, screen, waitFor } from "tests/testUtils"; import { BitcoinPage } from "./shared"; import { openURL } from "~/renderer/linking"; +import { DeviceModelId } from "@ledgerhq/devices"; jest.mock( "electron", @@ -22,6 +23,7 @@ describe("displayBitcoinPage", () => { initialState: { settings: { hasSeenOrdinalsDiscoveryDrawer: true, + devicesModelList: [DeviceModelId.stax, DeviceModelId.europa], }, }, }); @@ -49,6 +51,7 @@ describe("displayBitcoinPage", () => { initialState: { settings: { hasSeenOrdinalsDiscoveryDrawer: true, + devicesModelList: [DeviceModelId.stax, DeviceModelId.europa], }, }, }); diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useCreateLinks.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useCreateLinks.tsx new file mode 100644 index 000000000000..d7b58dc5e0df --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useCreateLinks.tsx @@ -0,0 +1,99 @@ +import { useMemo } from "react"; +import { TFunction } from "i18next"; +import { ContextMenuItemType } from "~/renderer/components/ContextMenu/ContextMenuWrapper"; +import { openURL } from "~/renderer/linking"; +import { safeList } from "LLD/features/Collectibles/utils/useSafeList"; +import { ExternalIdEnum, ItemType, ViewerEnum } from "LLD/features/Collectibles/types/enum/Links"; +import IconOpensea from "~/renderer/icons/Opensea"; +import IconRarible from "~/renderer/icons/Rarible"; +import IconMagicEden from "~/renderer/icons/MagicEden"; +import { IconsLegacy } from "@ledgerhq/react-ui"; +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; +import { NFTMetadata, ProtoNFT } from "@ledgerhq/types-live"; +import { isNFTMetadata } from "../utils/typeGuardsChecker"; +import { createOrdinalExplorerUrl } from "../utils/createOrdinalExplorerUrl"; + +const createLinks = ( + t: TFunction, + links: Record | SimpleHashNft["collection"]["marketplace_pages"] | undefined, + isSimpleHash: boolean, + explorerLink?: string, +): ContextMenuItemType[] => { + if (isSimpleHash) { + const marketplacePages = Array.isArray(links) ? links : []; + return safeList( + [ + ...marketplacePages + .filter(link => link.marketplace_id === ExternalIdEnum.MAGICEDEN) + .map(link => ({ + id: link.marketplace_id, + label: t("NFT.viewer.actions.open", { viewer: ViewerEnum.MAGICEDEN }), + Icon: IconMagicEden, + type: ItemType.EXTERNAL, + callback: () => openURL(link.nft_url), + })), + ...(marketplacePages.length > 0 ? [{ id: "sep2", type: "separator", label: "" }] : []), + ...(explorerLink + ? [ + { + id: ExternalIdEnum.EXPLORER, + label: t("NFT.viewer.actions.open", { viewer: ViewerEnum.EXPLORER }), + Icon: IconsLegacy.GlobeMedium, + type: ItemType.EXTERNAL, + callback: () => openURL(explorerLink), + }, + ] + : []), + ].filter(Boolean), + ); + } else { + const linksRecord = links as Record; + return safeList( + [ + linksRecord.opensea && { + id: ExternalIdEnum.OPENSEA, + label: t("NFT.viewer.actions.open", { viewer: ViewerEnum.OPENSEA }), + Icon: IconOpensea, + type: ItemType.EXTERNAL, + callback: () => openURL(linksRecord.opensea), + }, + linksRecord.rarible && { + id: ExternalIdEnum.RARIBLE, + label: t("NFT.viewer.actions.open", { viewer: ViewerEnum.RARIBLE }), + Icon: IconRarible, + type: ItemType.EXTERNAL, + callback: () => openURL(linksRecord.rarible), + }, + { id: "sep2", type: "separator", label: "" }, + linksRecord.explorer && { + id: ExternalIdEnum.EXPLORER, + label: t("NFT.viewer.actions.open", { viewer: ViewerEnum.EXPLORER }), + Icon: IconsLegacy.GlobeMedium, + type: ItemType.EXTERNAL, + callback: () => openURL(linksRecord.explorer), + }, + ].filter(Boolean), + ); + } +}; + +export const useCreateLinks = ( + t: TFunction, + metadata: NFTMetadata | SimpleHashNft["extra_metadata"], + nft: ProtoNFT | SimpleHashNft, + isSimpleHash: boolean, +): ContextMenuItemType[] => { + const inscriptionNumber = (nft as SimpleHashNft).extra_metadata?.ordinal_details + ?.inscription_number; + + return useMemo(() => { + const links = isNFTMetadata(metadata) + ? metadata.links + : (nft as SimpleHashNft).collection?.marketplace_pages; + const explorerLink = isNFTMetadata(metadata) + ? metadata.links?.explorer + : createOrdinalExplorerUrl(inscriptionNumber); + + return createLinks(t, links, isSimpleHash, explorerLink); + }, [t, metadata, nft, isSimpleHash, inscriptionNumber]); +}; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useCustomImage.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useCustomImage.ts new file mode 100644 index 000000000000..efac716e5747 --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useCustomImage.ts @@ -0,0 +1,59 @@ +import { isCustomLockScreenSupported } from "@ledgerhq/live-common/device/use-cases/screenSpecs"; +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; +import { IconsLegacy } from "@ledgerhq/react-ui"; +import { NFTMetadata, NFTMedias } from "@ledgerhq/types-live"; +import { TFunction } from "i18next"; +import { useMemo } from "react"; +import { useSelector } from "react-redux"; +import { getMetadataMediaTypes } from "~/helpers/nft"; +import { setDrawer } from "~/renderer/drawers/Provider"; +import { devicesModelListSelector } from "~/renderer/reducers/settings"; +import { isNFTMetadata } from "LLD/features/Collectibles/utils/typeGuardsChecker"; +import CustomImage from "~/renderer/screens/customImage"; + +export const useCustomImage = ( + t: TFunction, + metadata: NFTMetadata | SimpleHashNft["extra_metadata"], + inscription?: SimpleHashNft, +) => { + const devicesModelList = useSelector(devicesModelListSelector); + const customImageUri = useMemo(() => { + if (!isNFTMetadata(metadata)) + return inscription?.previews?.image_large_url || inscription?.image_url; + + const mediaTypes = metadata ? getMetadataMediaTypes(metadata) : null; + const mediaSizeForCustomImage = mediaTypes + ? ["original", "big", "preview"].find(size => mediaTypes[size] === "image") + : null; + return mediaSizeForCustomImage + ? metadata?.medias?.[mediaSizeForCustomImage as keyof NFTMedias]?.uri + : null; + }, [inscription?.image_url, inscription?.previews?.image_large_url, metadata]); + + const customImageDeviceModelIds = devicesModelList.filter(isCustomLockScreenSupported); + const customImageDeviceModelId = + customImageDeviceModelIds.length === 1 ? customImageDeviceModelIds[0] : null; + const showCustomImageButton = Boolean(customImageUri) && customImageDeviceModelIds.length > 0; + + return useMemo( + () => ({ + customImageUri, + customImageDeviceModelId, + showCustomImageButton, + customImage: { + id: "custom-image", + label: t("customImage.cta"), + Icon: IconsLegacy.PhotographMedium, + callback: () => { + if (customImageUri) + setDrawer(CustomImage, { + imageUri: customImageUri, + deviceModelId: customImageDeviceModelId, + isFromNFTEntryPoint: true, + }); + }, + }, + }), + [customImageDeviceModelId, customImageUri, showCustomImageButton, t], + ); +}; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useNftLinks.tsx b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useNftLinks.tsx index 489f48cbf59d..d8da78b5850d 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useNftLinks.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useNftLinks.tsx @@ -1,165 +1,35 @@ import { useMemo } from "react"; -import { useDispatch, useSelector } from "react-redux"; -import { TFunction } from "i18next"; import { useTranslation } from "react-i18next"; -import { Account, ProtoNFT, NFTMetadata, NFTMedias } from "@ledgerhq/types-live"; -import { isCustomLockScreenSupported } from "@ledgerhq/live-common/device/use-cases/isCustomLockScreenSupported"; -import { IconsLegacy } from "@ledgerhq/react-ui"; -import { openModal } from "~/renderer/actions/modals"; -import IconOpensea from "~/renderer/icons/Opensea"; -import IconRarible from "~/renderer/icons/Rarible"; -import { openURL } from "~/renderer/linking"; -import { getMetadataMediaTypes } from "~/helpers/nft"; -import { setDrawer } from "~/renderer/drawers/Provider"; -import CustomImage from "~/renderer/screens/customImage"; +import { Account, ProtoNFT, NFTMetadata } from "@ledgerhq/types-live"; import { ContextMenuItemType } from "~/renderer/components/ContextMenu/ContextMenuWrapper"; -import { devicesModelListSelector } from "~/renderer/reducers/settings"; -import { safeList } from "LLD/features/Collectibles/utils/useSafeList"; -import { ItemType } from "~/newArch/features/Collectibles/types/enum/Links"; - -const linksPerCurrency: Record< - string, - (t: TFunction, links: NFTMetadata["links"]) => ContextMenuItemType[] -> = { - ethereum: (t, links) => - safeList([ - links?.opensea && { - id: "opensea", - label: t("NFT.viewer.actions.open", { - viewer: "Opensea.io", - }), - Icon: IconOpensea, - type: ItemType.EXTERNAL, - callback: () => openURL(links.opensea), - }, - links?.rarible && { - id: "rarible", - label: t("NFT.viewer.actions.open", { - viewer: "Rarible", - }), - Icon: IconRarible, - type: ItemType.EXTERNAL, - callback: () => openURL(links.rarible), - }, - { - id: "sep2", - type: "separator", - label: "", - }, - links?.explorer && { - id: "explorer", - label: t("NFT.viewer.actions.open", { - viewer: "Explorer", - }), - Icon: IconsLegacy.GlobeMedium, - type: ItemType.EXTERNAL, - callback: () => openURL(links.explorer), - }, - ]), - polygon: (t: TFunction, links: NFTMetadata["links"]) => - safeList([ - links?.opensea && { - id: "opensea", - label: t("NFT.viewer.actions.open", { - viewer: "Opensea.io", - }), - Icon: IconOpensea, - type: ItemType.EXTERNAL, - callback: () => openURL(links.opensea), - }, - links?.rarible && { - id: "rarible", - label: t("NFT.viewer.actions.open", { - viewer: "Rarible", - }), - Icon: IconRarible, - type: ItemType.EXTERNAL, - callback: () => openURL(links.rarible), - }, - { - id: "sep2", - type: "separator", - label: "", - }, - links?.explorer && { - id: "explorer", - label: t("NFT.viewer.actions.open", { - viewer: "Explorer", - }), - Icon: IconsLegacy.GlobeMedium, - type: ItemType.EXTERNAL, - callback: () => openURL(links.explorer), - }, - ]), -}; +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; +import { useCreateLinks } from "./useCreateLinks"; +import { useOpenHideCollectionModal } from "./useOpenHideCollectionModal"; +import { useCustomImage } from "./useCustomImage"; +import { isNFTMetadata } from "../utils/typeGuardsChecker"; export default ( account: Account, - nft: ProtoNFT, - metadata: NFTMetadata, + nft: ProtoNFT | SimpleHashNft, + metadata: NFTMetadata | SimpleHashNft["extra_metadata"], onClose?: () => void, ): ContextMenuItemType[] => { - const dispatch = useDispatch(); const { t } = useTranslation(); - const devicesModelList = useSelector(devicesModelListSelector); - - const hideCollection = useMemo( - () => ({ - id: "hide-collection", - label: t("hideNftCollection.hideCTA"), - Icon: IconsLegacy.NoneMedium, - callback: () => { - return dispatch( - openModal("MODAL_HIDE_NFT_COLLECTION", { - collectionName: metadata?.tokenName ?? nft.contract, - collectionId: `${account.id}|${nft.contract}`, - onClose, - }), - ); - }, - }), - [account.id, dispatch, metadata?.tokenName, nft.contract, onClose, t], - ); - const customImageUri = useMemo(() => { - const mediaTypes = metadata ? getMetadataMediaTypes(metadata) : null; - const mediaSizeForCustomImage = mediaTypes - ? ["original", "big", "preview"].find(size => mediaTypes[size] === "image") - : null; - const customImageUri = - (mediaSizeForCustomImage && - metadata?.medias?.[mediaSizeForCustomImage as keyof NFTMedias]?.uri) || - null; - return customImageUri; - }, [metadata]); - - const customImageDeviceModelIds = devicesModelList.filter(deviceModelId => - isCustomLockScreenSupported(deviceModelId), + const hideCollection = useOpenHideCollectionModal(t, account, nft, metadata, onClose); + const isSimpleHash = (nft as SimpleHashNft).collection !== undefined; + const { customImage, showCustomImageButton } = useCustomImage( + t, + metadata, + !isNFTMetadata(metadata) ? (nft as SimpleHashNft) : undefined, ); - // if user previously connected e.g. a Stax and a Europa we don't pre-select a device model - const customImageDeviceModelId = - customImageDeviceModelIds.length === 1 ? customImageDeviceModelIds[0] : null; - const showCustomImageButton = Boolean(customImageUri) && customImageDeviceModelIds.length > 0; - const customImage = useMemo(() => { - const img: ContextMenuItemType = { - id: "custom-image", - label: t("customImage.cta"), - Icon: IconsLegacy.PhotographMedium, - callback: () => { - if (customImageUri) - setDrawer(CustomImage, { - imageUri: customImageUri, - deviceModelId: customImageDeviceModelId, - isFromNFTEntryPoint: true, - }); - }, - }; - return img; - }, [customImageDeviceModelId, customImageUri, t]); + const links = useCreateLinks(t, metadata, nft, isSimpleHash); - const links = useMemo(() => { - const metadataLinks = linksPerCurrency[account.currency.id]?.(t, metadata?.links) || []; - return [...metadataLinks, ...(showCustomImageButton ? [customImage] : []), hideCollection]; - }, [account.currency.id, t, metadata?.links, showCustomImageButton, customImage, hideCollection]); - return links; + return useMemo(() => { + return [ + ...links, + ...(showCustomImageButton ? [customImage] : []), + ...(hideCollection ? [hideCollection] : []), + ]; + }, [links, showCustomImageButton, customImage, hideCollection]); }; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useOpenHideCollectionModal.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useOpenHideCollectionModal.ts new file mode 100644 index 000000000000..2d4febd2f122 --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/hooks/useOpenHideCollectionModal.ts @@ -0,0 +1,36 @@ +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; +import { IconsLegacy } from "@ledgerhq/react-ui"; +import { ProtoNFT, NFTMetadata, Account } from "@ledgerhq/types-live"; +import { TFunction } from "i18next"; +import { useMemo } from "react"; +import { useDispatch } from "react-redux"; +import { openModal } from "~/renderer/actions/modals"; +import { isNFTMetadata } from "../utils/typeGuardsChecker"; + +export const useOpenHideCollectionModal = ( + t: TFunction, + account: Account, + nft: ProtoNFT | SimpleHashNft, + metadata: NFTMetadata | SimpleHashNft["extra_metadata"], + onClose?: () => void, +) => { + const dispatch = useDispatch(); + return useMemo(() => { + if (!isNFTMetadata(metadata)) return null; + const collectionName = + typeof metadata.tokenName === "string" ? metadata.tokenName : nft.contract; + return { + id: "hide-collection", + label: t("hideNftCollection.hideCTA"), + Icon: IconsLegacy.NoneMedium, + callback: () => + dispatch( + openModal("MODAL_HIDE_NFT_COLLECTION", { + collectionName: collectionName as string, + collectionId: `${account.id}|${nft.contract}`, + onClose, + }), + ), + }; + }, [account.id, dispatch, metadata, nft.contract, onClose, t]); +}; diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/types/DetailDrawer.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/types/DetailDrawer.ts index 815f37c17ba6..554e4817060d 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/types/DetailDrawer.ts +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/types/DetailDrawer.ts @@ -1,11 +1,12 @@ import { Account, ProtoNFT, NFTMetadata } from "@ledgerhq/types-live"; import { ReactNode } from "react"; import { CollectibleType } from "./Collectibles"; +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; export type ExternalViewerButtonProps = { - nft: ProtoNFT; + nft: ProtoNFT | SimpleHashNft; account: Account; - metadata: NFTMetadata; + metadata: NFTMetadata | SimpleHashNft["extra_metadata"]; }; export type CopyableFieldProps = { diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/types/enum/Links.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/types/enum/Links.ts index a8e116faa2b5..71b09cf76b2b 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/types/enum/Links.ts +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/types/enum/Links.ts @@ -1,3 +1,17 @@ export enum ItemType { EXTERNAL = "external", } + +export enum ExternalIdEnum { + MAGICEDEN = "magiceden", + OPENSEA = "opensea", + RARIBLE = "rarible", + EXPLORER = "explorer", +} + +export enum ViewerEnum { + MAGICEDEN = "Magic Eden", + OPENSEA = "Opensea.io", + RARIBLE = "Rarible", + EXPLORER = "Explorer", +} diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/utils/createOrdinalExplorerUrl.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/utils/createOrdinalExplorerUrl.ts new file mode 100644 index 000000000000..c023e8538988 --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/utils/createOrdinalExplorerUrl.ts @@ -0,0 +1,5 @@ +const Ordiscan_BASE_URL = "https://ordinals.com/inscription/"; + +export function createOrdinalExplorerUrl(inscriptionNumber?: number) { + return Ordiscan_BASE_URL + inscriptionNumber; +} diff --git a/apps/ledger-live-desktop/src/newArch/features/Collectibles/utils/typeGuardsChecker.ts b/apps/ledger-live-desktop/src/newArch/features/Collectibles/utils/typeGuardsChecker.ts index 1f6168d989ed..91cbc2b9daba 100644 --- a/apps/ledger-live-desktop/src/newArch/features/Collectibles/utils/typeGuardsChecker.ts +++ b/apps/ledger-live-desktop/src/newArch/features/Collectibles/utils/typeGuardsChecker.ts @@ -1,4 +1,6 @@ +import { NFTMetadata } from "@ledgerhq/types-live"; import { NftRowProps, OrdinalsRowProps, RowProps as Props } from "../types/Collection"; +import { SimpleHashNft } from "@ledgerhq/live-nft/api/types"; export function isNFTRow(props: Props): props is Props & NftRowProps { return "media" in props && !("collectionName" in props); @@ -7,3 +9,9 @@ export function isNFTRow(props: Props): props is Props & NftRowProps { export function isOrdinalsRow(props: Props): props is Props & OrdinalsRowProps { return "rareSatName" in props; } + +export const isNFTMetadata = ( + metadata: NFTMetadata | SimpleHashNft["extra_metadata"], +): metadata is NFTMetadata => { + return !!metadata && "links" in metadata; +}; diff --git a/apps/ledger-live-desktop/src/renderer/icons/MagicEden.tsx b/apps/ledger-live-desktop/src/renderer/icons/MagicEden.tsx new file mode 100644 index 000000000000..e305cb21fb1f --- /dev/null +++ b/apps/ledger-live-desktop/src/renderer/icons/MagicEden.tsx @@ -0,0 +1,29 @@ +import React from "react"; + +const IconMagicEden = ({ size = 24 }: { size: number }) => ( + + + + + +); + +export default IconMagicEden; diff --git a/libs/live-nft/src/api/types.ts b/libs/live-nft/src/api/types.ts index acddedd2dda2..8942292a3bfb 100644 --- a/libs/live-nft/src/api/types.ts +++ b/libs/live-nft/src/api/types.ts @@ -86,10 +86,19 @@ export interface owner { readonly quantity_string: string; } +export interface marketplace_page { + readonly collection_url: string; + readonly marketplace_collection_id: string; + readonly marketplace_id: string; + readonly marketplace_name: string; + readonly nft_url: string; + readonly verified: boolean; +} export interface collection { readonly name: string; readonly spam_score: number; readonly description?: string; + readonly marketplace_pages?: marketplace_page[]; } export interface firstCreated { From 07c584a61573c53ff0d205d316d9195cd8f5399e Mon Sep 17 00:00:00 2001 From: 0xkvn <44363395+lambertkevin@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:09:07 +0200 Subject: [PATCH 57/94] [LIVE-14281] Feature - EIP712 supports filters with empty arrays (#7943) * Regenerate all APDUs with ethereum app test key * Add support for filters with empty arrays * Add empty arrays tests * changeset --- .changeset/breezy-bottles-jam.md | 5 + .../hw-app-eth/src/modules/EIP712/index.ts | 71 ++- .../hw-app-eth/src/modules/EIP712/types.ts | 4 + .../EIP712/filtered-signMessage.unit.test.ts | 360 ++++++++----- .../EIP712/noFilter-signMessage.unit.test.ts | 38 +- .../packages/hw-app-eth/tests/fixtures/CAL.ts | 509 +++++++++++------- .../{0-filtered.apdus => 0-filtered-v1.apdus} | 10 +- .../1-filtered-empty-array-1-level-v2.apdus | 72 +++ .../1-filtered-empty-array-2-levels-v2.apdus | 68 +++ .../{1-filtered.apdus => 1-filtered-v1.apdus} | 16 +- ...10-filtered.apdus => 10-filtered-v1.apdus} | 8 +- ...11-filtered.apdus => 11-filtered-v1.apdus} | 18 +- .../tests/fixtures/apdus/12-filtered-v1.apdus | 38 ++ .../tests/fixtures/apdus/12-filtered.apdus | 38 -- .../tests/fixtures/apdus/13-filtered-v1.apdus | 108 ++++ .../tests/fixtures/apdus/13-filtered.apdus | 108 ---- .../tests/fixtures/apdus/14-filtered-v1.apdus | 28 + .../tests/fixtures/apdus/15-filtered-v1.apdus | 12 +- .../tests/fixtures/apdus/15-filtered-v2.apdus | 14 +- .../tests/fixtures/apdus/16-filtered-v1.apdus | 12 +- .../tests/fixtures/apdus/16-filtered-v2.apdus | 14 +- .../tests/fixtures/apdus/17-filtered-v1.apdus | 164 ++++++ .../tests/fixtures/apdus/17-filtered-v2.apdus | 168 ++++++ .../tests/fixtures/apdus/17-filtered.apdus | 0 .../tests/fixtures/apdus/18-filtered-v1.apdus | 16 +- .../tests/fixtures/apdus/18-filtered-v2.apdus | 20 +- .../{2-filtered.apdus => 2-filtered-v1.apdus} | 14 +- .../tests/fixtures/apdus/3-filtered-v1.apdus | 60 +++ .../tests/fixtures/apdus/3-filtered.apdus | 60 --- .../{4-filtered.apdus => 4-filtered-v1.apdus} | 10 +- .../tests/fixtures/apdus/5-filtered-v1.apdus | 176 ++++++ .../tests/fixtures/apdus/5-filtered.apdus | 176 ------ .../{6-filtered.apdus => 6-filtered-v1.apdus} | 18 +- .../{7-filtered.apdus => 7-filtered-v1.apdus} | 14 +- .../{8-filtered.apdus => 8-filtered-v1.apdus} | 16 +- .../{9-filtered.apdus => 9-filtered-v1.apdus} | 16 +- .../tests/fixtures/apdus/version-1.12.0.apdus | 2 + .../messages/1-empty-array-1-level.json | 79 +++ .../messages/1-empty-array-2-levels.json | 74 +++ 39 files changed, 1767 insertions(+), 867 deletions(-) create mode 100644 .changeset/breezy-bottles-jam.md rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{0-filtered.apdus => 0-filtered-v1.apdus} (66%) create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-empty-array-1-level-v2.apdus create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-empty-array-2-levels-v2.apdus rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{1-filtered.apdus => 1-filtered-v1.apdus} (55%) rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{10-filtered.apdus => 10-filtered-v1.apdus} (56%) rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{11-filtered.apdus => 11-filtered-v1.apdus} (59%) create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/12-filtered-v1.apdus delete mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/12-filtered.apdus create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/13-filtered-v1.apdus delete mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/13-filtered.apdus create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/14-filtered-v1.apdus create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered-v1.apdus create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered-v2.apdus delete mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered.apdus rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{2-filtered.apdus => 2-filtered-v1.apdus} (78%) create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/3-filtered-v1.apdus delete mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/3-filtered.apdus rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{4-filtered.apdus => 4-filtered-v1.apdus} (78%) create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/5-filtered-v1.apdus delete mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/5-filtered.apdus rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{6-filtered.apdus => 6-filtered-v1.apdus} (59%) rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{7-filtered.apdus => 7-filtered-v1.apdus} (58%) rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{8-filtered.apdus => 8-filtered-v1.apdus} (63%) rename libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/{9-filtered.apdus => 9-filtered-v1.apdus} (65%) create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/version-1.12.0.apdus create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/messages/1-empty-array-1-level.json create mode 100644 libs/ledgerjs/packages/hw-app-eth/tests/fixtures/messages/1-empty-array-2-levels.json diff --git a/.changeset/breezy-bottles-jam.md b/.changeset/breezy-bottles-jam.md new file mode 100644 index 000000000000..b7eea7b6bc06 --- /dev/null +++ b/.changeset/breezy-bottles-jam.md @@ -0,0 +1,5 @@ +--- +"@ledgerhq/hw-app-eth": minor +--- + +Add support for filters for empty arrays / discarded paths diff --git a/libs/ledgerjs/packages/hw-app-eth/src/modules/EIP712/index.ts b/libs/ledgerjs/packages/hw-app-eth/src/modules/EIP712/index.ts index 0b4d22c74223..845df49c392e 100644 --- a/libs/ledgerjs/packages/hw-app-eth/src/modules/EIP712/index.ts +++ b/libs/ledgerjs/packages/hw-app-eth/src/modules/EIP712/index.ts @@ -26,6 +26,7 @@ import { makeTypeEntryStructBuffer, } from "./utils"; import { + FilteringInfoDiscardField, FilteringInfoContractName, FilteringInfoShowField, StructImplemData, @@ -40,6 +41,7 @@ type MakeRecursiveFieldStructImplemParams = { types: EIP712MessageTypes; filters: MessageFilters | undefined; shouldUseV1Filters: boolean; + shouldUseDiscardedFields: boolean; coinRefsTokensMap: Record; }; @@ -61,6 +63,7 @@ const makeRecursiveFieldStructImplem = ({ types, filters, shouldUseV1Filters, + shouldUseDiscardedFields, coinRefsTokensMap, }: MakeRecursiveFieldStructImplemParams): (( destructedType: ReturnType, @@ -88,8 +91,33 @@ const makeRecursiveFieldStructImplem = ({ structType: "array", value: data.length, }); + + const entryPath = `${path}.[]`; + if (!data.length) { + // If the array is empty and a filter exists, we need to let the app know that the filter can be discarded + const entryFilters = filters?.fields.filter(f => f.path.startsWith(entryPath)); + if (entryFilters && shouldUseDiscardedFields) { + for (const entryFilter of entryFilters) { + await sendFilteringInfo(transport, "discardField", loadConfig, { + path: entryFilter.path, + }); + await sendFilteringInfo(transport, "showField", loadConfig, { + displayName: entryFilter.label, + sig: entryFilter.signature, + format: entryFilter.format, + coinRef: entryFilter.coin_ref, + chainId, + erc20SignaturesBlob, + shouldUseV1Filters, + coinRefsTokensMap, + isDiscarded: true, + }); + } + } + } + // If the array is not empty, we need to send the struct implementation for each entry for (const entry of data) { - await recursiveFieldStructImplem([typeDescription, restSizes], entry, `${path}.[]`); + await recursiveFieldStructImplem([typeDescription, restSizes], entry, entryPath); } } else if (isCustomType) { for (const [fieldName, fieldValue] of Object.entries(data as EIP712Message["message"])) { @@ -116,6 +144,7 @@ const makeRecursiveFieldStructImplem = ({ erc20SignaturesBlob, shouldUseV1Filters, coinRefsTokensMap, + isDiscarded: false, }); } @@ -282,15 +311,23 @@ async function sendFilteringInfo( ): Promise; async function sendFilteringInfo( transport: Transport, - type: "activate" | "contractName" | "showField", + type: "discardField", loadConfig: LoadConfig, - data?: FilteringInfoContractName | FilteringInfoShowField, + data: FilteringInfoDiscardField, +): Promise; +async function sendFilteringInfo( + transport: Transport, + type: "activate" | "contractName" | "showField" | "discardField", + loadConfig: LoadConfig, + data?: FilteringInfoContractName | FilteringInfoShowField | FilteringInfoDiscardField, ): Promise { enum APDU_FIELDS { CLA = 0xe0, INS = 0x1e, - P1 = 0x00, + P1_standard = 0x00, + P1_discarded = 0x01, P2_activate = 0x00, + P2_discarded = 0x01, P2_show_field = 0xff, // for v1 of filters P2_message_info = 0x0f, P2_datetime = 0xfc, @@ -304,7 +341,7 @@ async function sendFilteringInfo( return transport.send( APDU_FIELDS.CLA, APDU_FIELDS.INS, - APDU_FIELDS.P1, + APDU_FIELDS.P1_discarded, APDU_FIELDS.P2_activate, ); @@ -317,7 +354,7 @@ async function sendFilteringInfo( return transport.send( APDU_FIELDS.CLA, APDU_FIELDS.INS, - APDU_FIELDS.P1, + APDU_FIELDS.P1_standard, APDU_FIELDS.P2_message_info, payload, ); @@ -333,6 +370,7 @@ async function sendFilteringInfo( coinRefsTokensMap, shouldUseV1Filters, erc20SignaturesBlob, + isDiscarded, } = data as FilteringInfoShowField; const { displayNameBuffer, sigBuffer } = getFilterDisplayNameAndSigBuffers(displayName, sig); @@ -341,7 +379,7 @@ async function sendFilteringInfo( return transport.send( APDU_FIELDS.CLA, APDU_FIELDS.INS, - APDU_FIELDS.P1, + APDU_FIELDS.P1_standard, APDU_FIELDS.P2_show_field, payload, ); @@ -408,11 +446,26 @@ async function sendFilteringInfo( return transport.send( APDU_FIELDS.CLA, APDU_FIELDS.INS, - APDU_FIELDS.P1, + isDiscarded ? APDU_FIELDS.P1_discarded : APDU_FIELDS.P1_standard, P2FormatMap[format], payload, ); } + + case "discardField": { + const { path } = data as FilteringInfoDiscardField; + const pathBuffer = Buffer.from(path); + const pathLengthBuffer = Buffer.from(intAsHexBytes(pathBuffer.length, 1), "hex"); + + const payload = Buffer.concat([pathLengthBuffer, pathBuffer]); + return transport.send( + APDU_FIELDS.CLA, + APDU_FIELDS.INS, + APDU_FIELDS.P1_standard, + APDU_FIELDS.P2_discarded, + payload, + ); + } } } @@ -474,6 +527,7 @@ export const signEIP712Message = async ( const { version } = await getAppAndVersion(transport); const shouldUseV1Filters = !semver.gte(version, "1.11.1-0", { includePrerelease: true }); + const shouldUseDiscardedFields = semver.gte(version, "1.12.0-0", { includePrerelease: true }); const filters = await getFiltersForMessage(typedMessage, shouldUseV1Filters, calServiceURL); const coinRefsTokensMap = getCoinRefTokensMap(filters, shouldUseV1Filters, typedMessage); @@ -514,6 +568,7 @@ export const signEIP712Message = async ( types, filters, shouldUseV1Filters, + shouldUseDiscardedFields, coinRefsTokensMap, }); diff --git a/libs/ledgerjs/packages/hw-app-eth/src/modules/EIP712/types.ts b/libs/ledgerjs/packages/hw-app-eth/src/modules/EIP712/types.ts index a015028958a8..d117bfd2c4a9 100644 --- a/libs/ledgerjs/packages/hw-app-eth/src/modules/EIP712/types.ts +++ b/libs/ledgerjs/packages/hw-app-eth/src/modules/EIP712/types.ts @@ -47,6 +47,10 @@ export type FilteringInfoShowField = { deviceTokenIndex?: number; } >; + isDiscarded: boolean; +}; +export type FilteringInfoDiscardField = { + path: string; }; export type FilteringInfoContractName = { diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/EIP712/filtered-signMessage.unit.test.ts b/libs/ledgerjs/packages/hw-app-eth/tests/EIP712/filtered-signMessage.unit.test.ts index 1e33a930c8c0..95de777ca8bb 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/EIP712/filtered-signMessage.unit.test.ts +++ b/libs/ledgerjs/packages/hw-app-eth/tests/EIP712/filtered-signMessage.unit.test.ts @@ -16,6 +16,12 @@ const getFilePath = (type: "apdu" | "message", filename: string): string => { jest.mock("@ledgerhq/cryptoassets/data/eip712", () => v1); jest.mock("@ledgerhq/cryptoassets/data/eip712_v2", () => v2); +jest.mock("@ledgerhq/cryptoassets/data/evm/index", () => ({ + signatures: { + 1: "AAAAZwRVU0RDoLhpkcYhizbB0Z1KLp6wzjYG60gAAAAGAAAAATBEAiBT0S5lTL5ipustFl3sP7dsPLF2QWaAyaXg3iWQsLnNigIgUEdqFpFVhGEAxiwzjHZ5FC0GD/VU92W8nBjTHrsy42AAAABoBFdFVEjAKqo5siP+jQoOXE8n6tkIPHVswgAAABIAAAABMEUCIQDGNSQY0A9zJrjwtmxxxdCfMG4OzgBJPLqeqOoXe0pI7QIgZGYxocaD2s6sFSA355FC7owyjNN8g6eOy4BeE44/Ovc=", + 137: "AAAAZwRVU0RDJ5G8ofLeRmHtiKMMmaepRJqoQXQAAAAGAAAAiTBEAiBjxSGrC/C4mPSUtg6cVMGpgokwZmVNpdnc0rkfhL2c1gIgD+CqcDL9MWCffzbolbi1oWATL/5P3F1YWPvrLGaLG00AAABnBFdFVEh86yP9a8Ct1Z5irCVXgnDP8bn2GQAAABIAAACJMEQCIFBR0vbDO+KtsBq864UEM6P8+6U9jtZ80MCzRJi9MCpsAiAiSy+Re8z4tNPMwJh778qv04NadWUdQK8kfzY2EkC+WgAAAGkGV01BVElDDVALHY6O8x4hyZ0duaZETTrfEnAAAAASAAAAiTBEAiAzUzhabCGosL5APk2DKlMgGkrJxI8WmHeZ0xNKbrSHGQIgQIeT1ugsoIZD7J/5HZf6WmJ9yG/CRdvi88LrccoM9Bc=", + }, +})); nock.disableNetConnect(); describe("EIP712", () => { @@ -25,8 +31,8 @@ describe("EIP712", () => { nanoAppVersionApdus = await fs.readFile(getFilePath("apdu", "version-1.0.0"), "utf-8"); }); - test("should sign correctly the 0.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "0-filtered"), "utf-8"); + it("should sign correctly the 0.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "0-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "0"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -37,14 +43,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "8a540510e13b0f2b11a451275716d29e08caad07e89a1c84964782fb5e1ad788", - s: "64a0de235b270fbe81e8e40688f4a9f9ad9d283d690552c9331d7773ceafa513", + r: "b1a7312afb06c47b56d25475bdfdf37d907c84e6c1143825f85136062e941ff7", + s: "759c2298e0dba1792facd2e579eda48109e4640f4227575bf60db9b06f6e78c8", v: 28, }); }); - test("should sign correctly the 1.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "1-filtered"), "utf-8"); + it("should sign correctly the 1.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "1-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "1"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -55,14 +61,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ + r: "ea66f747173762715751c889fea8722acac3fc35db2c226d37a2e58815398f64", + s: "52d8ba9153de9255da220ffd36762c0b027701a3b5110f0a765f94b16a9dfb55", v: 28, - r: "66ab3c335fa92801af51551371a95a898a6d862bae2087e0d4074cedb48f9d93", - s: "71aac1298822efc8b86b5d4618e7b0b91d73813b150645118414f40d06b2465a", }); }); - test("should sign correctly the 2.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "2-filtered"), "utf-8"); + it("should sign correctly the 2.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "2-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "2"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -73,14 +79,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "5e729ca9970c6436cfb23d50b93c5674aa87adeed4010d89a8e9926732e012fa", - s: "5bb260889e3bacdb322c46343bc38366b0456d36b16a452317f1361cd9ed9e9b", - v: 28, + r: "1539547ae7cf8ebcd3eabfb57cd2b1fb7775ce757c3f4a307c7425d35b7bfff7", + s: "47248cb61e554c1f90af6331d9c9e51cbb8655667514194f509abe097a032319", + v: 27, }); }); - test("should sign correctly the 3.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "3-filtered"), "utf-8"); + it("should sign correctly the 3.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "3-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "3"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -91,14 +97,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "a032f358f76041e239d34a449d859742d79ede0705e294552e68c6f6345cd9a6", - s: "5d14e1607eca346db7a1b4ded81c8dcc82821a8f2ceb24803b611095cf68d320", - v: 28, + r: "5677fec212710c03127cc58c2b0ce31885f6147bc807cdd94de1343c1396d452", + s: "6624ddd7e50c1185f91d80ce4ef7adc96adb8c73e74cd8cb5087a44d3a134c8f", + v: 27, }); }); - test("should sign correctly the 4.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "4-filtered"), "utf-8"); + it("should sign correctly the 4.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "4-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "4"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -109,14 +115,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "c5de7830122a8f8cb769bc22b5c1a1ff56e5afa820125b6d67ac681361409946", - s: "1bf9da83833f445e80a5aa1b04afe62b66f8210cf4ce77281d98dc9596af3294", - v: 27, + r: "341bca1c0dfd805d4befc21500084424dbe559c7aafd78d8fb461c0c76dfea1d", + s: "33ebb7b6fe0691961cd8b263faac20ecbbdcaef3febb57eb76614cad629080ea", + v: 28, }); }); - test("should sign correctly the 5.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "5-filtered"), "utf-8"); + it("should sign correctly the 5.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "5-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "5"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -127,14 +133,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "23c178dc4b78a8c6b6fc87c295927673b22862f7fbabebbeaa9b546e47c241a3", - s: "3efa002b0409d9538ad73638baa7dbe4d2dd760f278c84fbce81ff2c06dee3d5", + r: "e42c7fad36f615a566be673ecbd0542f83addf76ffa97af30acda06b3443ceca", + s: "72ca3cd5b3c9790e2a199c9d03342db7be374794d8bbffa2c4cb2aa1a16389e1", v: 28, }); }); - test("should sign correctly the 6.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "6-filtered"), "utf-8"); + it("should sign correctly the 6.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "6-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "6"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -145,14 +151,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "0e178627d230e134ade95f4d828050bb5906d42605c085d9512ca0cb80efa3b0", - s: "20e280cee0a50fa349a1d95708419f29ae03d34d25edd71a5faffdcfe7935251", + r: "d10f6b61205cf5c5ec45735d7f7186afb7e454212102883caf9b6fd2ebdf9fd3", + s: "2d9c1af9ded7ddb0237c0b67b6a1a2c98fc73af8ff0bf6c43b356a79bbc929f3", v: 27, }); }); - test("should sign correctly the 7.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "7-filtered"), "utf-8"); + it("should sign correctly the 7.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "7-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "7"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -163,14 +169,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "9d94c45d9fed0c7804c8acae6a51c1f955e26f9b97dbb0bb086ec432f6890c05", - s: "63484ac40b7cf6d71f6764625a6eb5204554efc16fcb4990011ae9801dd5362d", + r: "df9e8b6b94a196b5b5608d8a83ad5479f050bbdfb301d4d3f4e2bfb30497fd44", + s: "1bd7074ce7035305a091b2f9994854fec0ceb2b11cf2620b93b76c1723029f6f", v: 27, }); }); - test("should sign correctly the 8.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "8-filtered"), "utf-8"); + it("should sign correctly the 8.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "8-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "8"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -181,14 +187,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "72cd1152bbd5513ebfc9cd2550395de96597bcfde23e79650caae9197f4da51a", - s: "630f3daba6843aa7cb4f14af72648c0a40e1a96bb33e9f46288333b00662cac7", - v: 27, + r: "59adf8ab1d0e87d2623747eac10d5ef23d0145d7f30e2960cba3503b28add2d3", + s: "109f81625ca7a9bb448fa58325b2f08d7f7141b14a20e363d7ea10a9483b780d", + v: 28, }); }); - test("should sign correctly the 9.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "9-filtered"), "utf-8"); + it("should sign correctly the 9.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "9-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "9"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -199,14 +205,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "b1e40db9bd432986de0013a55d0564a1bfc232fb25b3c3da19db3d867df2d551", - s: "6941ad66c0ec9100f3676a4f61761509c1345fe73df16d84053420008c8d73b7", + r: "87698ac1d846331b4b393417353dd20c60b9401a407d76db52fb9e45844aab30", + s: "11b09b38be74fbf2cb5851470d4f70bf0cccaf1bea00ff28e16ca914deba15ce", v: 28, }); }); - test("should sign correctly the 10.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "10-filtered"), "utf-8"); + it("should sign correctly the 10.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "10-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "10"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -217,14 +223,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "bd1a1bd027e9922fba0b5f298791c70074c4fa5564b024833e885872cc6a187c", - s: "256485b3fba419e3454006353d2de19390f0c2fc11dc819cf297bc3b7aa6a005", - v: 27, + r: "aaa9e17e5cb7d8a7d0ecc832a883254599909d8123d846aa6f3f63f47ab78704", + s: "2b7e6adaeb26906e6577efa04c1733a19169ee2747020b73f8f309ca8c2ccc1f", + v: 28, }); }); - test("should sign correctly the 11.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "11-filtered"), "utf-8"); + it("should sign correctly the 11.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "11-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "11"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -235,14 +241,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "d0259bc5208c369532c6161486d7533966d382fc725bcb781a190c0f1a53f771", - s: "7ebbf21c5569d2d2a480615d529b431d3b0dfce863f723d21e3370e860a8965c", + r: "cce2e63aaac6a5f9a74684d8fdddcbc7f3b27aa17235bfab89226821ead933b6", + s: "3f3c93977abcc3f8cc9a3dc1ecc02dbca14aca1a6ecb2fb6ca3d7c713ace1ec4", v: 28, }); }); - test("should sign correctly the 12.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "12-filtered"), "utf-8"); + it("should sign correctly the 12.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "12-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "12"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -253,14 +259,14 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "4aef3aaff62fa0731f4e661c4dbb92a48f8c12d7225219fad74b55ef2ad0045b", - s: "46d7e01804c33a99c4dc7dd7b2ac5e63d07ee4641b01cd3a598cc91d74bbe3e0", - v: 28, + r: "7be1671577753c13bfd1da8b234b6df8484daf47351c2366637fd291dd4aa4d9", + s: "1a7ffbb01dc8a64e9ee97d19b8f154e9eecbe0b1bfb9dcfa781a65e474573963", + v: 27, }); }); - test("should sign correctly the 13.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "13-filtered"), "utf-8"); + it("should sign correctly the 13.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "13-filtered-v1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "13"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -271,21 +277,49 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "daf758e25d9d7769adcab19c4d64953983d29fb44041e0ba4263a9d4686a3de3", - s: "03c52a566b18568ba71576e768ed321a6a90605365fe9766387db3bd24bebe96", + r: "fde9bc1860bae0b867b66176ca654578530edf97771c714cc7bb146943443ef3", + s: "06f92884f1de6fe75c4a650b0fe88d0c185af9943a95dc1c4b3045ae0f81edfe", v: 28, }); }); - test.skip("should sign correctly the 14.json but there is no filters for it", () => { - // no filters for this one + it("should sign correctly the 14.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "14-filtered-v1"), "utf-8"); + const message = await fs.readFile(getFilePath("message", "14"), "utf-8").then(JSON.parse); + + const transport = await openTransportReplayer( + RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), + ); + + const eth = new Eth(transport); + const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); + + expect(result).toEqual({ + r: "55ad4a9295fd8e64082f751f19f158db34de2a9072c0b348483ca4a303cf0cb0", + s: "69d732a52e29963a23d7c6ca032e46ae452cc2e3d9487952567ae4bffd14e237", + v: 28, + }); }); - test.skip("should sign correctly the 14bis.json but there is no filters for it", () => { - // no filters for this one + it("should sign correctly the 14bis.json sample message and have the same APDUs as 14.json", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "14-filtered-v1"), "utf-8"); + const message = await fs.readFile(getFilePath("message", "14bis"), "utf-8").then(JSON.parse); + + const transport = await openTransportReplayer( + RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), + ); + + const eth = new Eth(transport); + const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); + + expect(result).toEqual({ + r: "55ad4a9295fd8e64082f751f19f158db34de2a9072c0b348483ca4a303cf0cb0", + s: "69d732a52e29963a23d7c6ca032e46ae452cc2e3d9487952567ae4bffd14e237", + v: 28, + }); }); - test("should sign correctly the 15-permit.json sample message", async () => { + it("should sign correctly the 15-permit.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "15-filtered-v1"), "utf-8"); const message = await fs .readFile(getFilePath("message", "15-permit"), "utf-8") @@ -305,7 +339,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 16-permit2.json sample message", async () => { + it("should sign correctly the 16-permit2.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "16-filtered-v1"), "utf-8"); const message = await fs .readFile(getFilePath("message", "16-permit2"), "utf-8") @@ -325,7 +359,7 @@ describe("EIP712", () => { }); }); - test.skip("should sign correctly the 17-uniswapx.json sample message", async () => { + it("should sign correctly the 17-uniswapx.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "17-filtered-v1"), "utf-8"); const message = await fs .readFile(getFilePath("message", "17-uniswapx"), "utf-8") @@ -339,13 +373,13 @@ describe("EIP712", () => { const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); expect(result).toEqual({ - r: "daf758e25d9d7769adcab19c4d64953983d29fb44041e0ba4263a9d4686a3de3", - s: "03c52a566b18568ba71576e768ed321a6a90605365fe9766387db3bd24bebe96", - v: 28, + r: "63e951154de94e9f81ecefa38c0f11c2e4a9bfbaa3524b6c9744161211d6cc3b", + s: "62480171ceb1f39f2c41ff06a2ecd483c0faaaf459063b278c09803b8bef3e4d", + v: 27, }); }); - test("should sign correctly the 18-1inch-fusion.json sample message", async () => { + it("should sign correctly the 18-1inch-fusion.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "18-filtered-v1"), "utf-8"); const message = await fs .readFile(getFilePath("message", "18-1inch-fusion"), "utf-8") @@ -367,88 +401,142 @@ describe("EIP712", () => { }); describe("SignEIP712Message with filters v2", () => { - let nanoAppVersionApdus; - beforeAll(async () => { - nanoAppVersionApdus = await fs.readFile(getFilePath("apdu", "version-1.11.1"), "utf-8"); - }); + describe("from version 1.11.1", () => { + let nanoAppVersionApdus; + beforeAll(async () => { + nanoAppVersionApdus = await fs.readFile(getFilePath("apdu", "version-1.11.1"), "utf-8"); + }); - test("should sign correctly the 15-permit.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "15-filtered-v2"), "utf-8"); - const message = await fs - .readFile(getFilePath("message", "15-permit"), "utf-8") - .then(JSON.parse); + it("should sign correctly the 15-permit.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "15-filtered-v2"), "utf-8"); + const message = await fs + .readFile(getFilePath("message", "15-permit"), "utf-8") + .then(JSON.parse); - const transport = await openTransportReplayer( - RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), - ); + const transport = await openTransportReplayer( + RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), + ); - const eth = new Eth(transport); - const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); + const eth = new Eth(transport); + const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); - expect(result).toEqual({ - r: "9573c40857d73d28b43120231886cf4199b1456e00da8887a508d576b6985a6f", - s: "18515302ca7809f9d36b95c8ea91509b602adc3c1653be0255ac5726969307bd", - v: 28, + expect(result).toEqual({ + r: "9573c40857d73d28b43120231886cf4199b1456e00da8887a508d576b6985a6f", + s: "18515302ca7809f9d36b95c8ea91509b602adc3c1653be0255ac5726969307bd", + v: 28, + }); }); - }); - test("should sign correctly the 16-permit2.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "16-filtered-v2"), "utf-8"); - const message = await fs - .readFile(getFilePath("message", "16-permit2"), "utf-8") - .then(JSON.parse); + it("should sign correctly the 16-permit2.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "16-filtered-v2"), "utf-8"); + const message = await fs + .readFile(getFilePath("message", "16-permit2"), "utf-8") + .then(JSON.parse); - const transport = await openTransportReplayer( - RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), - ); + const transport = await openTransportReplayer( + RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), + ); - const eth = new Eth(transport); - const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); + const eth = new Eth(transport); + const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); - expect(result).toEqual({ - r: "ce7c4941157899c0db37c4363c773d919c896ddef669c878e856573659bb3655", - s: "0fed0222b941702c2fd5611ac13ac0217ed889586a56b047b0d5bf0566edbbb7", - v: 27, + expect(result).toEqual({ + r: "ce7c4941157899c0db37c4363c773d919c896ddef669c878e856573659bb3655", + s: "0fed0222b941702c2fd5611ac13ac0217ed889586a56b047b0d5bf0566edbbb7", + v: 27, + }); }); - }); - test.skip("should sign correctly the 17-uniswapx.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "17-filtered-v2"), "utf-8"); - const message = await fs - .readFile(getFilePath("message", "17-uniswapx"), "utf-8") - .then(JSON.parse); + it("should sign correctly the 17-uniswapx.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "17-filtered-v2"), "utf-8"); + const message = await fs + .readFile(getFilePath("message", "17-uniswapx"), "utf-8") + .then(JSON.parse); - const transport = await openTransportReplayer( - RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), - ); + const transport = await openTransportReplayer( + RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), + ); - const eth = new Eth(transport); - const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); + const eth = new Eth(transport); + const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); - expect(result).toEqual({ - r: "daf758e25d9d7769adcab19c4d64953983d29fb44041e0ba4263a9d4686a3de3", - s: "03c52a566b18568ba71576e768ed321a6a90605365fe9766387db3bd24bebe96", - v: 28, + expect(result).toEqual({ + r: "63e951154de94e9f81ecefa38c0f11c2e4a9bfbaa3524b6c9744161211d6cc3b", + s: "62480171ceb1f39f2c41ff06a2ecd483c0faaaf459063b278c09803b8bef3e4d", + v: 27, + }); }); - }); - test("should sign correctly the 18-1inch-fusion.json sample message", async () => { - const apdusBuffer = await fs.readFile(getFilePath("apdu", "18-filtered-v2"), "utf-8"); - const message = await fs - .readFile(getFilePath("message", "18-1inch-fusion"), "utf-8") - .then(JSON.parse); + it("should sign correctly the 18-1inch-fusion.json sample message", async () => { + const apdusBuffer = await fs.readFile(getFilePath("apdu", "18-filtered-v2"), "utf-8"); + const message = await fs + .readFile(getFilePath("message", "18-1inch-fusion"), "utf-8") + .then(JSON.parse); - const transport = await openTransportReplayer( - RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), - ); + const transport = await openTransportReplayer( + RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), + ); - const eth = new Eth(transport); - const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); + const eth = new Eth(transport); + const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); - expect(result).toEqual({ - r: "6f07ba3bb7fa9369ee9b5e4cc3bdc8545d75e3527fa242a5e4d23ead9d232af8", - s: "412a55401fe955b996125682ad0a47277d3ce1b314ee3962956ae643b71166cb", - v: 27, + expect(result).toEqual({ + r: "6f07ba3bb7fa9369ee9b5e4cc3bdc8545d75e3527fa242a5e4d23ead9d232af8", + s: "412a55401fe955b996125682ad0a47277d3ce1b314ee3962956ae643b71166cb", + v: 27, + }); + }); + }); + describe("from version 1.12.0", () => { + let nanoAppVersionApdus; + beforeAll(async () => { + nanoAppVersionApdus = await fs.readFile(getFilePath("apdu", "version-1.12.0"), "utf-8"); + }); + + it("should sign correctly the 1-empty-array-1-level.json sample message", async () => { + const apdusBuffer = await fs.readFile( + getFilePath("apdu", "1-filtered-empty-array-1-level-v2"), + "utf-8", + ); + const message = await fs + .readFile(getFilePath("message", "1-empty-array-1-level"), "utf-8") + .then(JSON.parse); + + const transport = await openTransportReplayer( + RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), + ); + + const eth = new Eth(transport); + const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); + + expect(result).toEqual({ + r: "d564c78ed10b539ca83410d9deca79fdaaa250ad53c4dc41433ba55d02a26d25", + s: "50d3ed7f9c66b3f2c60ffb9b6c696b8f06cd88cafe4ae8371642ab7771827c3a", + v: 27, + }); + }); + + it("should sign correctly the 1-empty-array-2-levels.json sample message", async () => { + const apdusBuffer = await fs.readFile( + getFilePath("apdu", "1-filtered-empty-array-2-levels-v2"), + "utf-8", + ); + const message = await fs + .readFile(getFilePath("message", "1-empty-array-2-levels"), "utf-8") + .then(JSON.parse); + + const transport = await openTransportReplayer( + RecordStore.fromString(nanoAppVersionApdus + apdusBuffer), + ); + + const eth = new Eth(transport); + const result = await eth.signEIP712Message("44'/60'/0'/0/0", message); + + expect(result).toEqual({ + r: "4217052c28965d9d1cdba00a65b5d9a18c41e0ea60161cd5f3b0ccffd2d4a536", + s: "589c87ae016194d0981925d203d203390e6f706e270a7b4ba579a106539ade08", + v: 28, + }); }); }); }); diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/EIP712/noFilter-signMessage.unit.test.ts b/libs/ledgerjs/packages/hw-app-eth/tests/EIP712/noFilter-signMessage.unit.test.ts index be5ce9885b8b..b3082d34e838 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/EIP712/noFilter-signMessage.unit.test.ts +++ b/libs/ledgerjs/packages/hw-app-eth/tests/EIP712/noFilter-signMessage.unit.test.ts @@ -24,7 +24,7 @@ describe("EIP712", () => { }); describe("SignEIP712Message without filters", () => { - test("should sign correctly the 0.json sample message", async () => { + it("should sign correctly the 0.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "0"), "utf-8"); const message = await fs.readFile(getFilePath("message", "0"), "utf-8").then(JSON.parse); const transport = await openTransportReplayer( @@ -41,7 +41,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 1.json sample message", async () => { + it("should sign correctly the 1.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "1"), "utf-8"); const message = await fs.readFile(getFilePath("message", "1"), "utf-8").then(JSON.parse); @@ -59,7 +59,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 2.json sample message", async () => { + it("should sign correctly the 2.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "2"), "utf-8"); const message = await fs.readFile(getFilePath("message", "2"), "utf-8").then(JSON.parse); @@ -77,7 +77,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 3.json sample message", async () => { + it("should sign correctly the 3.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "3"), "utf-8"); const message = await fs.readFile(getFilePath("message", "3"), "utf-8").then(JSON.parse); @@ -95,7 +95,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 4.json sample message", async () => { + it("should sign correctly the 4.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "4"), "utf-8"); const message = await fs.readFile(getFilePath("message", "4"), "utf-8").then(JSON.parse); @@ -113,7 +113,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 5.json sample message", async () => { + it("should sign correctly the 5.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "5"), "utf-8"); const message = await fs.readFile(getFilePath("message", "5"), "utf-8").then(JSON.parse); @@ -131,7 +131,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 6.json sample message", async () => { + it("should sign correctly the 6.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "6"), "utf-8"); const message = await fs.readFile(getFilePath("message", "6"), "utf-8").then(JSON.parse); @@ -149,7 +149,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 7.json sample message", async () => { + it("should sign correctly the 7.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "7"), "utf-8"); const message = await fs.readFile(getFilePath("message", "7"), "utf-8").then(JSON.parse); @@ -167,7 +167,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 8.json sample message", async () => { + it("should sign correctly the 8.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "8"), "utf-8"); const message = await fs.readFile(getFilePath("message", "8"), "utf-8").then(JSON.parse); @@ -185,7 +185,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 9.json sample message", async () => { + it("should sign correctly the 9.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "9"), "utf-8"); const message = await fs.readFile(getFilePath("message", "9"), "utf-8").then(JSON.parse); @@ -203,7 +203,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 10.json sample message", async () => { + it("should sign correctly the 10.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "10"), "utf-8"); const message = await fs.readFile(getFilePath("message", "10"), "utf-8").then(JSON.parse); @@ -221,7 +221,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 11.json sample message", async () => { + it("should sign correctly the 11.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "11"), "utf-8"); const message = await fs.readFile(getFilePath("message", "11"), "utf-8").then(JSON.parse); @@ -239,7 +239,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 12.json sample message", async () => { + it("should sign correctly the 12.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "12"), "utf-8"); const message = await fs.readFile(getFilePath("message", "12"), "utf-8").then(JSON.parse); @@ -257,7 +257,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 13.json sample message", async () => { + it("should sign correctly the 13.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "13"), "utf-8"); const message = await fs.readFile(getFilePath("message", "13"), "utf-8").then(JSON.parse); @@ -275,7 +275,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 14.json sample message (shorthand byte string => 0x3 vs 0x03)", async () => { + it("should sign correctly the 14.json sample message (shorthand byte string => 0x3 vs 0x03)", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "14"), "utf-8"); const messageShorthand = await fs .readFile(getFilePath("message", "14"), "utf-8") @@ -303,7 +303,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 15-permit.json sample message", async () => { + it("should sign correctly the 15-permit.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "15"), "utf-8"); const message = await fs .readFile(getFilePath("message", "15-permit"), "utf-8") @@ -323,7 +323,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 16-permit2.json sample message", async () => { + it("should sign correctly the 16-permit2.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "16"), "utf-8"); const message = await fs .readFile(getFilePath("message", "16-permit2"), "utf-8") @@ -343,7 +343,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 17-uniswapx.json sample message", async () => { + it("should sign correctly the 17-uniswapx.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "17"), "utf-8"); const message = await fs .readFile(getFilePath("message", "17-uniswapx"), "utf-8") @@ -363,7 +363,7 @@ describe("EIP712", () => { }); }); - test("should sign correctly the 18-1inch-fusion.json sample message", async () => { + it("should sign correctly the 18-1inch-fusion.json sample message", async () => { const apdusBuffer = await fs.readFile(getFilePath("apdu", "18"), "utf-8"); const message = await fs .readFile(getFilePath("message", "18-1inch-fusion"), "utf-8") diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/CAL.ts b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/CAL.ts index ddc2030f031f..4a9b55cf04e2 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/CAL.ts +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/CAL.ts @@ -4,20 +4,20 @@ export const v1 = { contractName: { label: "Anakin", signature: - "3044022063587552c233fa3a5cadbd298f6120cb77e29f4d4a2483831e9fb732edabe7f8022034a88f97e8fdc208800960968f7fbcc0c1d3b71aecdb241b2dd36dfca7ea6b32", + "30440220014ab9506fa7ea26d6f695ea2ce2cd3742852c54ce1793cfd1ca462aabd93d39022033e3b7d399cec2eaabc0e9f595f20dea2182fe9915a0fcde266de068a788a149", }, fields: [ { label: "From", path: "from.name", signature: - "3045022100f915a23c2654d761fb810d16c05757e8c1663c99a457b3903d1a5a76fbcb058d02205636516e2e5ab90d5879ad141c329f828d576b5c4cbdf7938b2cf86cb153dce5", + "304402204184ab24eef5044a949d9dd4ab32daa7707633f40025c9ac93501b54a533742b0220125da8ac33437eadcc3128ae41190c2fd62e01921bfd4fc8821dd52ebe1cbf2e", }, { label: "To", path: "to.name", signature: - "3046022100df57f9370b82d1a144d988d085e721cc5e45ec5dab85c906787ed3d6c72d6e22022100cbe041b439cca1784299f42b0e646e03f7c5795f48645c60a0f3b21224167d0c", + "3044022057d81ea65f2a51d88cfee2f567fc8eb4d416cc2036a0473342c082ef1b36a225022026ffe715e5e8e6b1da399a5197ef8bb77a64bf7ff93849a01c160d0ef928106e", }, ], }, @@ -26,26 +26,26 @@ export const v1 = { contractName: { label: "Chewie", signature: - "304402200a68076edda783f20939d29795a2fa64a822ebfb06bf06af9c4deca472fd908002201c7e72fcb7e38bfcefb674cdcdc6a42beabb2d6557b18df9293eb2dea8994bd9", + "30440220695783f5cdb6f7df8c12af70dce746d72eea3e8db2aa4da6883f3ecd0e18114f022069b9a8f51bb2369b950702b29f31594dfe24a1c7aa5471f0f682a7f63cefaef4", }, fields: [ { label: "Sender", path: "from.name", signature: - "304402200c8991afadb1dbf395edaec90a709e3b4659794ec3f759b5f08e0b25d0656f9802201f50addfd159f669d8c2eb6273fb3c366ee8c5c707c9a59089bbc9f2b15304ac", + "30440220415f936aa7869609af6bf29f03a6af995657fda1d53465b9b301c484bcdf80790220732c4c0dde743d51bef4a1a3289729aa178e6e2ee336826b2dc26b794d6eebef", }, { label: "Recipients", path: "to.[].wallets.[]", signature: - "3044022022827c43a60563768826f7d1003273828f373b2ddac58fab7f46398133b4e2360220293e311194fc604aac695663c0768e5174dbc82588a3ba445ade5a0513a6569d", + "3045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0", }, { label: "Message", path: "contents", signature: - "3045022074c6e91513f214590fb7ca8e62a207f6c945a0a02ab96010d8e401eb391f2a36022100f5cfd20bb8903cbc1d6a686ab23764fae1319a6e10856443faaf1953ac9c6b7f", + "304402201a75a81563b580604c43bc51e004f41ec9f45dad9daac80de760bc641e475cfd02200b284e2ce760c24b14709f03630efdc86826d606511820cf15baf56be601b587", }, ], }, @@ -54,14 +54,14 @@ export const v1 = { contractName: { label: "Padme", signature: - "3045022100d68fd98d552a9e28ae4eadb265346b6a9a512ce7d9e64ab5281ab2db8a690bc502201f360b06b06a4b669f54bb632d4b84c155b173b6cce6793cb0ba4ed52dcd3afa", + "3045022100bd6de7636bb63affd2a0e89dae3f7bc89a7f597abf57b8500713a98bdb8b71b0022067651fab5182a96804b8b072804daba643f3485e28662c34be21e566b6208150", }, fields: [ { label: "Value ma man", path: "val", signature: - "3044022020f273ed63ba6c5699829a8e40ec675d3ada63d50eb76a0dfbdf2a4b7ed0240402206f467c1fcef99b15206ba2ce88b4cf1c43df9da953868b9d4fb69ff8e1b69600", + "30440220056eed97085e204cbb98ee6550e6dd4601bdbb488715e7a4c467a01516743f8502204d3ce91c60ec345036fd5c61dbfcd3b0cddec5aa9d303e98add16f94f84a2bcc", }, ], }, @@ -70,32 +70,32 @@ export const v1 = { contractName: { label: "Darth Vador", signature: - "304402200f1c42bb335dabf7d4e70aff3c694acd5d583c55f67ac69353c7089c2f331008022027c8b41271e2d9a49cf7b8ea1f051446fde487cfddb6ae596af2339e547b7cb9", + "3045022100e07b22754b0a822a1985c9a3435aff753beffb5adf4157356c4f8b35a57fd7d402200a87c7c4ccaeab7b32b5569012dcf166c027382155f5f4f6cb347762294351a2", }, fields: [ { label: "Sender", path: "from.name", signature: - "3045022067c2da84e35ab7150d9b811ec10ee98c5a58927b7310cc1616be33672e4d0390022100f22b136e7cc5ec18001564749e773a209c9ccd09a097aba8ac29b43746dd976e", + "3045022100de57b2e02bf337b5892d9a2c088ca4155538c81f439e372966b962c6c93492ad022046fdde6973a3d7ea4d5d431aed73b420fccbba1bf687fd6864039591a453625a", }, { label: "Recipient", path: "to.members.[].name", signature: - "3045022048084193d682f4085080db8f4878926ecda16ee99d8880f6fe8aec0ae82326f6022100983a85b4ccde51b6b6054207cde57af6e32ea0a69b997bad175bf02e28611173", + "3045022100e417d5ad99d507a14e48077f4210bd217f5dbd25afdb14d318cd9f4e3c68789f02203dcff6332826d34aeb1dfb2e064dc8eee803b34de47175403ae7ba5f936315f2", }, { label: "Message", path: "contents", signature: - "304502206ac58f2720209633e0d7183b3e7d9aaf12fb99009ee865dcff2b528ecc6cdb31022100bee53af9d3d0b68a84bd72e772538af3def78e59ee70dec5a1c6df35dbf9e4f0", + "304402206393b2dd0bed33d4e9e19b6f1089c1ca269df6746df9bdc04d0d1e05239ae281022003177fd79ce85556a3b900a35dadae29bb9212eaa64c90428698e49be3695e86", }, { label: "Attachment", path: "attach.list.[].name", signature: - "3045022013d1ea505a8b651a073781b134228c5945c30525ae1dbb90b60729cccae4cd6b0221008cd417efdd6e31f491354a3cad5e8aa3cc707081d83a13c0f4250ca793c0da6f", + "3045022100e7e1454fb07ff84e8d768597e6ff7c01191d58e18ea6a691b5019fa24f9cc41c0220499ac0405908d84d97ce6615185c32b06505243ddf703f02db08dff177d4c3e0", }, ], }, @@ -104,20 +104,20 @@ export const v1 = { contractName: { label: "Palpatine", signature: - "3046022100cb0d41cb506d27433d8ca3ca5c0888bced039de132adedca66895a5116c3af9f022100e22b6902aa07a68d71da702dcc8d44deec0d5483f8e29ed5d0e830e40a95892e", + "304502210091f9ebbc812a20f1a575f64ade029f49e0442f6a88def31c7cf74a9ad7d9fd40022012e210516f01c8e12bc1a73c84b3511f663b0e48d7bf1b533f14e90db2725aec", }, fields: [ { label: "Timestamp", path: "curDate", signature: - "3045022100e9e974f4c04bdce33b81e5bc71d3b9d2f1c63d47f7b092d1cc0b5c52fb5d145f02204edacacfae8dc62c83836f31d3665a9104d40f2c1d34c24f3e4335eb493675de", + "3044022079158841df478fe788b50fe38ea80bac2903f862734b07285f69a92278ece9f9022065fe071875c34897f3c896e278c64eda264b72fac95937400bd40499491f52e3", }, { label: "Identifier", path: "id", signature: - "3045022100dd2ae125d66c0d53b8ff1cd869506aca393d7763766906894e072a9a0bccc6eb022056812867e63e2b81db36690111e922085db2d6390d6a5454c9ec3f248d969323", + "304402201f96f470b926b453cdb43bd6638807ab0e2691f639f68ea3caf7e84810fe7219022057feae8e954a40e86db68c68324ab3fed7e69c098ff5835da543c23297228acc", }, ], }, @@ -126,80 +126,80 @@ export const v1 = { contractName: { label: "Dark Maul", signature: - "3046022100a1ee24c39a79d92bf33f1018fa04721e52db94501e9d1d52d28d08860c7a807d0221008ca107c6a0bf1a560f471959e2641105eb3cd7ea6ed0eb386d9508c3a55f554b", + "3045022100daffe0f32905a3d5951c475f50a1d49c97c168e39582894a5a44c3b24739f3d60220478f167f2cfa44e8b36050715f918343f0dd514e264adde70d6122aa6ba75ecc", }, fields: [ { label: "Negative 256", path: "neg256", signature: - "3046022100d4223b3a49c2719723fce18f32f1610d1af84f5a1e6cacd9f2ea31a08f25a3a5022100ff8be6d7bada8a9f991ebad771c4197a8d50b875b3794830bd9202ecf7dee291", + "30450221008a61ebf1d0e41ea583fc3520249a223b6028a6aaa7f4715b5f6ed64305eed887022041718d2e529976df0d00f4ae1ece50901c9865caf26426af0337f99785079aaa", }, { label: "Positive 256", path: "pos256", signature: - "3045022100812f27a5e993e89cbe2bf1662b226357272cbb6d37bec17ab1ccaf6666de1b48022078823c8c73802362e930146beee375bb6acdb6579c18a459b235e135a6197509", + "3044022021afa673b6653a2f5723201f7831698165d6c8b4817f4082cd5592a1649769ce022006988f97bbbbd647d67a200a28fa1e570cf6f0d51d87bf4e9223f81aca9052f8", }, { label: "Negative 128", path: "neg128", signature: - "3046022100b34cb6b2300217ef2a1281bc69f89430735787637624861aa7848fdaa94ff5e102210099ad54641ec415e7ae26245f8eea52c7c4e97ee14ce9cb55505c80588df1de8f", + "3044022012df54253d5b4146ecaa3f6f15828e90091c9eef3ed76942b47eafc2b164eb1302207907191856b58ed69c703219ec4c1141bf598605737d8555a8abafabf7aba5cf", }, { label: "Positive 128", path: "pos128", signature: - "304502210080453b062c7f7a47e1c4e58774682dde0023ad8646664a26fdb25e1de84c7392022069ade1e93ee8318d2c392b51fa6d088b19d8634188d792be58723a4dd5d2fde2", + "304402203793e717c4eb6f4590ee94c0ed3d7d9d0d4c352e98485199cbe884cf1fa2dc8c022052fce5794e965db53493b20349bdc1b5f00963ced271666e9106a588201cad44", }, { label: "Negative 64", path: "neg64", signature: - "3045022022233aa92cd4deddfb1c09806e80cfabb238c2a5672c244d9af3778140e0f65f0221009ae16aee5f1b3b2bdfa1e2ec0518249333335584015ed444eafab4b3f1dba078", + "304402200c77f00b91d2af7b20f5785bf6b80880b3329abf59ecbc31ec539feb20bb21c302203e8a7b96e86fb95605956006943fdf95733da70fe107b8efb3330e409ce968bf", }, { label: "Positive 64", path: "pos64", signature: - "3044022024c209ad119ddd0939febd8eafd15e95f8e8923c7b35b4ca44206804f05eca7b0220665dfd4d143f497e263da7142ece011e3221d3acfb864e992d4e86df185331b0", + "3045022100eca15cfe664e675898cb75ad5d6119a5dbc2db7bccd51b510b4d1362e47a1e310220787bc9e8a8545340d0c411edba3cedeee1969057c6ca5c10551ad0ac3d2ce697", }, { label: "Negative 32", path: "neg32", signature: - "3045022057c12e49d1a688ff7f1b4322015882b3c5bd6e7984d38d80b1659e4a8b736c0d022100fa74d3a71e237bfe46202b95afb2fe6ff93e7fd64a6a2b14a31465aec965bcb4", + "304402204c1de916521b4e3041cefbd787ea7c17d73e4f7d7b997440c1cf0aa7256c35c70220231937d691154f9f9d1c94d6d9b11565d4d4c4a0cda652405429904c6aaa05cb", }, { label: "Positive 32", path: "pos32", signature: - "304502203b1ed09e5c5a892219b90f0b15894d516ab3f92d07c3d26dcc68e0630f4ec416022100eef30902bc4b97799ec60b5e8cf97209d93880bb3051f9e5d8c3182e9a98770a", + "3045022100da5034823340f1588a816ba514e03b5d0af03f0d78eda8fdc7a8214e0e271efb02200b6bc4a650fde5fb7794bc048ef7e391bb2e182cc17d9b53cd294583cd283d98", }, { label: "Negative 16", path: "neg16", signature: - "304502210083072d1598238548b2dafb28ff8ed9f69ba039a0e202063b10d8f0825a106bd102202a98bd6012f2ece91be71e98e503614506aff3a9425e121fd00b87a69a5251d6", + "30440220099a84a2f9fc7181f4597842b93db7ec8e4090a3b62dbda8facd9eab06d0e9ae02202c83bf02d4ef497d97e843b12caaac9cb755d16e61b690dbe55d0ca4e04e8cf5", }, { label: "Positive 16", path: "pos16", signature: - "304402203f64e6f523779ce67e0b8aa3eef15093eebb9f1d9455e616d46faeb07e75d65602204fb4d652999e8be22acf7feb5014c5e2c8da6017bbed19239231b8a61194e528", + "3044022043b00eeecf90639640fbf8f1a26bfefea6161cc8fb5481205203149eccff7554022012742ff0240b45dafe01db746159185e66eecfd9c8271ac19c1cc2c3f899d0c9", }, { label: "Negative 8", path: "neg8", signature: - "3045022100e750bf41c848674a13aed18ec7675edad8d6e8e10428ebc6ba55eb764d74affd022050cbc317f5e062f7a8231cf810a854d1376c8cedc529d48ac5147c2430625a31", + "3045022100e1e3d137c59ea844d91cd4e6db4c884a63dbb361b887601c7889be951223c7e30220096a8c6722a5e5b6d67be6a8c409b661017927beefc29130b218e86880253248", }, { label: "Positive 8", path: "pos8", signature: - "30450221009ac6447ea324722a93d97e0476e103d2e35401f9152693241f70777d215a320e02201c0a1ad742f3abde26ff1711fbf5d1d7a49765b074c812bbd94a0593dfbcac55", + "304402202544e902c2d379b67582f9ba5abaa196c18d6656c61da0c4dfe07963dcad16850220312bcc15c52b87903a706bb6970cdc4693f4132abcf79f8c00e1ca1e8e8b495a", }, ], }, @@ -208,32 +208,32 @@ export const v1 = { contractName: { label: "Mace Windu", signature: - "304502205098e783a362b1e3d33ae4d8a6ad4073dd5ad97da72d7ffe6ad41af17869a1f0022100c50ba9335788f82a2ef6d0d5e8b29ea83990346cccb73e887398b0a72ed4a2a1", + "3044022073cc8d51f50a641c5f649816afe149d68b4fe1991184d589bc11512b83fd0e6c0220520a66870d5a2965ffbbae7bf834ea2d66a45ebd92b28b44b675ed0538507b75", }, fields: [ { label: "Maker", path: "maker", signature: - "30450220476cc3309dd8104c87102df5fda3c6a760492676c2da3a9f4b4763156c97cf31022100bdaee8bcce4123b59d177ff9e15acfdc8d9a4286b4812479a0f3667ed5cefa4f", + "3044022045440d9956eab04674470ecf319d5957997088afccad4ac24f4c2938f4527d10022051273e6710f1487fc02c178c8705817432994b87b1557d036f8df156443a6c10", }, { label: "Taker", path: "taker", signature: - "3045022100ad6d6a772ddea2ad4ed7f1e2799846f8d520200418fb435eeb34ea35c46c445502200e602c58f398e5eefa8eef759940ceafd51bdc79b85b5b510dd48dccafe0660c", + "3045022100edb53ae572766258aafd3c1b2fd646a188b675ed6d7c2e91d4f30196074fc9300220521129fc3b4d7ff6a4a862a7e3b12c936da8e2f2d62eaf058d56738ded66bde2", }, { label: "Base Price", path: "basePrice", signature: - "3045022100dfead31f8603678ae2eed97f0ea35963f7a00701067be4a58a9c95a03ce73c7702200ed8e835bfbfd336cc047341e7782c0e917ebc4768bdb59b594bf7edbf71885f", + "3045022100909a48f16e71b423a7e7109d8fc513a8a3b6cc038e103aa957f081a4cb39c137022002c7792cbeaacffad1376f5cc0463c2e2f3c28fbf349ba22e5ae4abeb281b1ad", }, { label: "Expiration Time", path: "expirationTime", signature: - "304402207221ee5c1ad62447ae56bc01dd27057bdfd1e807deeaa335f225bc080b9f304f022030a6b8e6eb42287f757e3eac9695abfc68f31c8c358dbd814a4df62bb547ff1d", + "3045022100963ea1d26292e612d6e1657d3613efceb4287e121ce86c9e9430f7ad98adc19f02206507c40721500c3a5b15aa342767c3e01708b37feab8b3283c61ce951902d31d", }, ], }, @@ -242,32 +242,32 @@ export const v1 = { contractName: { label: "Yoda", signature: - "304402204a67f5c38317705c31acd936153d627756202370e6412bea13cd43e3cd7d5da802200e8debc34e70160ccc192e92d720d42399faad243740673e945ab3438f6a2ff6", + "304502210082879b74f069c55b3785dad1667203fc35a4265f30d02b0f73643abb6b9bc0d002203c538793004a4adecde735f9397887ac7ea1ac22e04d8e5d29ebf7b438ce31a2", }, fields: [ { label: "Sender", path: "from", signature: - "30450220277c73383cfe014c12504b991339378123b9a339f005470060747b8ddb2ecfb1022100e29196c745c3b3fb4b6eab097e8972f06a390a2d31ff8deafde2f4ab4bb47392", + "304402207521eb52ad759e37117db390d1b71838dbdcc9191b28c7030a5dcc44321e075b02207266ddebda9ed2b254dafff991c6b016956265b1672df98db2085c52b49cffd2", }, { label: "Recipients", path: "to.[]", signature: - "304502203f4c1125e3133841e17fb6b579b69c4274d38eb2ca363cb0a2c52b30c52a53f7022100bbd38ad455363801af516ad7fc2dccbdf163cc547d1476113928c23079c67bcd", + "3045022100d55e2a2ac4cf2f0c0fc9ef822b69176e22b7c8bc7c9fc2ea417ea84e1c164c3902204ceffd11ba5979d767b9ded852705ec41e3133e3d95a7188e9039b038288509c", }, { label: "Message", path: "contents", signature: - "304502206cc88eb3eab3b55d5e6358d46e0fbbaefbd1590d01e77396a15a9f7887bbaaae02210080fab66195f75656134c67007761abfcc207afc075aaf3894e30fdf29e3daa7d", + "3045022100eec10ea4eb0846466871a8d256dde530b17b404fe7722736282c425e964762a702205f60d8e7760c16a8502caeec97ac17b224353cdaac115d09aa5e071917ea43c2", }, { label: "Hello this is ID", path: "id", signature: - "30450221008dcd615a78440f0ce412717d47903f71b7e0131766a72ef6ab189b02af36ac2802205f9ad7f6688f6e36f96442202f2d9f46532319ebf5f12ba3c92ca263ff08143a", + "3045022100c57245b7832fb5cbae86bd35b3dd4c9f93a88b903285bc18f0db67a7133a29990220500b475c779985dd222b64cd76f93d6e08aefc21f356d29762c5b31da281ee93", }, ], }, @@ -276,20 +276,20 @@ export const v1 = { contractName: { label: "Boba", signature: - "304502202f9e99e99544e9971c6e8c1f58901debd762fc96b6c388c24e921a72f3588a4a022100a9f80217965c99362424017d0fedfd25060fd4e5aae2daf85ac8cbef033fe7e2", + "3045022100ff890837754849bac57d6109f2dcc05a6222417501e7dea899865af11a12f0ca02204dac269e4c9e4c4496c5bcc958477dd808a30a29aa87382a3d130545574a3f87", }, fields: [ { label: "Maker", path: "maker", signature: - "3045022100a2dd1bab1c723f5c4978ddfc3416bc32a3e665e1a2a798061ace5a171a821e66022012cd32cbb142b366548c46c0ae4688a174da5f63ece1ac88db5e9d82627daf8e", + "304402201c4ce72a81bf1808ba5b0c797eccfbb625d673f817c73c0532cc57863c94447302205321f3c48855d22caf3e81c5de27d87a5175369fdaa3940054d3e33b73bb60ea", }, { label: "Taker", path: "taker", signature: - "3046022100cb5a8695a4c498dfd5e44b6af9238efb7baed439870b7534c81fd70cea8d4b23022100a49eec86927485697a41362455972926a7b6312ad78c1352f3051b69c1dc4f4f", + "3044022100ff48fa8b4c0269b9029d758e6af195a3e9891938fb49bc9a702bd7b0afb98ba0021f5249c69cc859839101abdee4a173c85606a1c2a0a0c63ebdfc8619a1f51328", }, ], }, @@ -298,26 +298,26 @@ export const v1 = { contractName: { label: "R2D2", signature: - "3044022056df947a834ef2bf6502e3e1ce611a34ff1b959c0ae366c2d1c8c361077d5a2d022045e7f8afc13d6cde7da3e0d95d834c2ce2d7cab49483d96b14cc35f1150f7215", + "3045022100ab5dc977a4b06ad45aa15497fe6dbde7104392c4cb8cec5204cd7f0fdc12adff022072b90de52f617c88b2d31cc31ff7a944997e9d626727f4ebaff73e5b19f8217d", }, fields: [ { label: "Document", path: "document.[].[]", signature: - "3044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b", + "30440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249", }, { label: "Proof", path: "proof.[].[]", signature: - "3046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f", + "30450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef", }, { label: "Depth", path: "depthy.[].[].[].[]", signature: - "304402207a5f12624b8f5f6628f64520246d31ac24893876a33010307f8b500d212088be02205ea516cde61a61d6dece3d33949b91bfebf31427e199b7c6f94746bb2e81b7d8", + "3045022100a8957fb0acabb7b011250321403ca4cab82c03cc321aff2f9935e89b7ba6934402202ad7e3225f3f4a9099abef2af765949cbdef744cc912917e5978dc486cd3ee85", }, ], }, @@ -326,32 +326,32 @@ export const v1 = { contractName: { label: "C3P0", signature: - "304502203b0768bde7f99183d3687336d63e314ea6806bf125dfa9261d55b7319ee18fa3022100f9b711b626ec116318ef2ee2ac96a31746cd071c5caac3655adfcc1934161d51", + "304402204a84b6192451644adf47eac6c022a92a4eb0fe33849a8db84d9979f35a3261470220704a2da9a4e9f5f438fec1aaf328a94ce0962c5bb2b2cbf7ce5a85af0552968a", }, fields: [ { label: "Sender", path: "from.name", signature: - "3045022100ced76e0e61411b1ef5642586834e29ae9189974ce4338a9a9a2516e43edbde7302200a36170372164d778f873a4f5e95923ab09f48ac0cb9fa106f7f7d097e891eb9", + "3044022061102a17459e3eb33ea99f875a6e1a0bf32059752e858b8a714080c667d8adcb02204ed10e590bf7a29a417ca56b9484fc14d0a7c4f0d86e7ce24fb5ccf0556633c1", }, { label: "Recipient", path: "to.members.[].name", signature: - "3044022100a9a05f12fbe643750f0c8a60b30dbc793077c2104dcf999a62303dba8458d65d021f6edd5f71a9c32b411f17df3fb1aa4721b356259cf77a48c4a44319806a5435", + "3045022100da0d2991bb43f2f15750c506fe6de293403ac8554abba91a42a17b9bd606d28a022000eb1dc52e27f1787ad7974dc2c46b8d3e2b6a21a7d29b59dae6cd5950dd3ad7", }, { label: "Message", path: "contents", signature: - "304502200f6f7be32f617791e4ed639ba294b8ab38e9a4f9c39e3fe415c4e03ab4674168022100853409de5fc10e80c2a406439ba184b28762dc74797e1e383b167676d8fae959", + "3045022100b8eb78af1926c0f467a9eaae8bddfc9809142457b274e569c47ba67ea6e3670302204849783769cfd8db7881dc218cbd6ce68065daa7c91a86dac801450d794b4f27", }, { label: "Attachment", path: "attach.list.[].name", signature: - "304502206650c083b2c895fba0fdb8edf952f56f443a6cdde0086aab469c38032f7aeb320221009c7acee25f280180c8cbf0038c1b3692a671cdab0651501948e6a2b59783c539", + "3045022100b01fb7a24c68490b628a2733399d50325ef77fcd23937c47b621b2d081fbf29f02204194a21dc935f873172928cdd13e30cbdef28c08f1bae37b51d78355b0df5561", }, ], }, @@ -360,26 +360,26 @@ export const v1 = { contractName: { label: "Leia", signature: - "3046022100d786a7581ca1bd313e8271cca5635e4b35ae69c13cce9664b2f61886979a5e94022100a45a87afd52f3ae630510dcde9139e98f1979f84efba29b85b5dac583605e225", + "304402206aade75a0906c6c6f47080a195d32bcc9d2ca44d9e1fe7c936a8f2040f10722a0220378e54fc0b9b6cccab50bd3c43cf0ed034ffbaba834dd18246289b26fe8ebb3e", }, fields: [ { label: "Sender", path: "from.name", signature: - "3046022100fdf2641839d9eb35211a1dff0a642efffcdada1b4a735fed1dc8286cfef3a69f0221009ab91a098be77ed3fa385bb33300c3f6050f1871c2df1a420411b9049e018cf2", + "304402205d72013185f9324c724f1456214818daa52778282f39f9511a197bef9266e91002205564bcfeb4bfbb13596e2c4cf86a602b01e8cea41abb6bb36fc5276142bb7844", }, { label: "Should be Alice & Bob", path: "to.[].name", signature: - "3046022100ec0bb0ee7962ea0b89a4c1b81e7141c38f4fb3841dc254611b39357e98fa13710221009d38375810801157565b9e7338feb8f44babf4c3bfd46f9dff7be412684323d9", + "3044022024e948f1f8206bea3eee90636526d33565df61271fa2c2acebd9d5f5778fa42002206a2d68bb87a13008bcc735de5a238b67e6d2b7df91236bc50f8eb6cd58749193", }, { label: "Message", path: "contents", signature: - "304502210084741fe267c0e68f588c2b46b7e9a33490912bfff0075fa0f35ea807707beba802204692e9380005cd613e0bd8177de9a9189fef1bbeee77a483df65f87b86dfc5a3", + "30450221009e6d3ceb72239082bb60202a3b095bb308f41d8a6b63360c487b8798e1dd2d24022006ef5ddfffaa1acd0911c64ae7a00adad98ab82a57d6d010906df496511213a6", }, ], }, @@ -388,26 +388,42 @@ export const v1 = { contractName: { label: "Han", signature: - "304602210090e6002a4b5b2a96409fbbfce11510a5ec3efc52139b43fb313e195ad7cab1a2022100eccaf2257b8f9e35c42c064ade707bfff9e04399730efa4e1460ccd444cdad1f", + "304402207ea368d6351bf9718c16f588592cac7f62c291aa944883788135165ee8c3490b02204039f684a10f75c474fb1be52a28cff3e1c2cbe82873179c6bc34c2b256d7ca3", }, fields: [ { label: "Sender", path: "from.name", signature: - "3045022076c5578debbf0c30422d46f546272bbee51d1983691b7f24098991b892f0fb05022100ee5aee20b96e7b60e8cb9d95a185140c5427d7f3b8c8795c9267cc5c52e0a962", + "304402206ace512db580330cba97a8519e888ac75968a88868bb76956bf23aac2c40d4d902202f8b91e8733799d2dce389a34b67d1e95f55d1d69c760a4ff6fdc98441648d70", }, { label: "Recipients", path: "to.[].wallets.[]", signature: - "3046022100ba2e37ab42de23f088924639d0c340352a013dd8258882f2fed42d2516313b68022100ec2474e9d083a7935251da520b35b08fe125d2153c7102afc8572135b42c3d0d", + "3045022100a35791e52689caef688b4c11da7472d94460f714076c796cf210d5319bc232d60220692feb421e1dcb694ca03ce6f783d2403c24c25a63720cdcdf8786f7848bc579", }, { label: "Message", path: "contents", signature: - "3044022052996b835132bf8248277b443439382bd3af11d4614052e9e03e22ab093a36dc02201ed76b7f35f1fd8d61a36abd65d70295d7db02a8e89623ecf4fbe0d01ef1106a", + "3045022100d6095472a275cf338b4d83b5c7c50da3ef60f482c665b14be25c16fe4e04dc1a02204a5371fe846ba16360ff55ddb85cf2bb79b9db305c863d4a06e168e766ee13de", + }, + ], + }, + "0:0x0000000000000000000000000000000000000000:cf5a5f8e4ae5baff4e1dd4d767b839464ba1bc26c84228d89955de54": + { + contractName: { + label: "Warrick", + signature: + "3045022100f1af490dc8b60d080fe2488ea720f2d305d60fcce71bf73609d432be64cbfc0f022046e68ffa02041b8677f73a922d2a077831195ab2067a37dcc2219e5e991efb14", + }, + fields: [ + { + label: "New Threshold", + path: "newThreshold", + signature: + "3044022026d6cdb4b241594798d40203d787eb948f6513f665178de17a6044b8e4b084d30220575dab77928807a6b80a0d0e72b45c33e501a4d2e5c999fb33c4a2ac670f9e5c", }, ], }, @@ -416,86 +432,86 @@ export const v1 = { contractName: { label: "Dark Maul", signature: - "3045022100de39788362c05cb30910cb4c19968fa560b4542fb423cc235a544fce6f959a6902207cc3ee39f5f34ea6a653188ae6fc189b27950c837bedf7e6d243d904b3fc2bf5", + "3045022100d9f6612aa98300474292182491148326e8e377b5584ca47f8f766b974bfce124022068409e7ef96e2312694e081449ae703a9b26bdd3eec2332f18156a5326a7b9f2", }, fields: [ { label: "Max UInt256", path: "max", signature: - "3044022078c0dffd20a30d109a239d75967c72d3dc32992a202fecb66bef6392e6f9d537022071643b9700dc7a1306b1829fe66a583dda4db0d0980d273aade56ac917db89ff", + "304402202338f93fac8fe95ce7fac892fffe6e99d5ed3453b82429893bbddf68cede1abc0220712eec364c5e73cf81474530dea84835e639f5c58cdfef27fc7a42e5c09f6414", }, { label: "Min Int256", path: "neg256", signature: - "3045022006564e0dfc69b6c264d591b8240225364b1b2ca59aa659fab9aa840894f17cf5022100b59e14e66978f433938ff6e267e8b3677e69265b30379e65a16458694586067c", + "3045022100b4a931fcfab181c760817ec86262336033c9d296f8f68aed04766fd8e7a506c8022014abf7617ec659497c75914a3e6ee13c7356c625ad7e3e641a7187fed8fe5502", }, { label: "Max Int256", path: "pos256", signature: - "3046022100b400948769b2315d2eaa2b2cf1a954b939ea72633333eacd7eb48a4049d16668022100c303719ad330dda6b351aab92648d0b64c992229c657265bc0d338cc1987f0de", + "3045022100de1ea9d3db73089a8e9885b94652ff0a84fee2991352ed6711be82a410593aaf02202f04c7654037225fba8b8bbcb2d4becc091a6b36eb1fa373d6b7844c24d40787", }, { label: "Min Int128", path: "neg128", signature: - "3046022100a93da4fcbae42bdadabfd71d3e0ee2b01c5e444b389e67dbe27f5ec82bdc2c2b0221009f7bd6f88501340b627a04bdd7478e4bc93c0be206b9c3def2c9b07d6591d033", + "3044022035616f2cf0eaac3a0d075ba69a85362b9f7348c051904466a4bf65f88a6d36d502200c9c5736f4800bae51890d7721fe534d798472f61f839a7b585854ca403a4b1c", }, { label: "Max Int128", path: "pos128", signature: - "30460221009a7fef85d6c57a40ad0b7661322809a03fd62153277999688b54324f91245357022100923e53738e94b99af01819ad36c3f095fde94d7cf859118fbfa40ac25c3f422b", + "3045022100fac114b732aa682525ca014b2e8cb36a23ea882c55a7173c4fbf2657cfeb094702203a1fb3460878c5a775977555718fb9d16a3b972a441fee23a000a90a0b81fea2", }, { label: "Min Int64", path: "neg64", signature: - "3045022100e159a15b0366603cb28f4a9646daab4ab42fd3fb4e0590b32f88192465df358702205cc164b3fe6bfe24007cd804f8d8053a51f53ff9f066e9c5cb9612c0ea69f240", + "304402203771ba95ab8b4f673b31c0ad63495f40acb95df743707ccdda32a7fa32ec59d30220340e906465992877840a4e179c41cfaa78f352767c9acae55eb585eab99de28b", }, { label: "Max Int64", path: "pos64", signature: - "30450221008a99fedd95c0c9f112b3448ebded92d031d000c9373eb85570ed0399d0fbe54d0220152e20a2ab45c88fd46de66b4a48f06eb2069285513849dce3240df048a42a93", + "3044022068c50782a96e92e85e8027a892383395c183c797a410da981a89f761ceed16f702207ce1ab44a6125f0f1d16f94ae5165af5c7064e4cbe094fd830cebba2af7d1eba", }, { label: "Min Int32", path: "neg32", signature: - "3046022100dd364ea2741d7acaa54ba20319ac066bcbd0051841547efa3e902dd7ae139149022100eea484a02cda9ec353f4cbbd58e61f7514f3ae4e6c52e31ad111d4f1ad22627b", + "304402202dbe56656795e5a3732186851ad56675d46c053233610f3dbfbdd1287d9f7dbc022066a396e10450912d03911dc54e4479f85c7447acd98719a7ad5e1b5ec006d0bb", }, { label: "Max Int32", path: "pos32", signature: - "3046022100d989e8e665d4490fc5aead1c4580b594335a520edfb355eae7f861a2a479f69f022100aaea7e95cd9851fac86eb67cdbad1865d74dbb6e8655ea92814a7acf8c682e16", + "304402200c3f65b45e88fd78d45a66ac4a7db9837eb9c8f1d7165e6c48623291218f7373022049f6c49c7bac26b82de50392f0354380da7c9aeb26660fd34227415374f9cd85", }, { label: "Min Int16", path: "neg16", signature: - "3046022100a9c3972100875d2ee99d9c7c4087cbc3d808650d73d48fd68bc42c4061317906022100f90ce13f28e4af7fe040b849ba89eb153a230e54439d313c1432234a81ffa2fe", + "30440220304c255c31b96173db32434550e2c9e580f2e66036cbdba6352a2c0f02dc92ec02200d752473b881502c6c024ccdfb7523072da676a15f77c19729305eebb0001321", }, { label: "Max Int16", path: "pos16", signature: - "3045022100ef489d1df222497dce64426a13c8fd78530eb22719eebcce1ee77ac745e77009022000b03f51200cc8c8e90a6d25d6f4ad82b3e5da70ce6e806386bce621e38d8a26", + "3044022019d155f12a3d4e4bf463954227c4978fad9bfa4c36c2b28eca459133d0c40136022028e6c4f0f223f9a74c15d3fb98baffa10aa2aec850ed42813301cbfb751ffbe0", }, { label: "Min Int8", path: "neg8", signature: - "3046022100a3c1c24fd5b3705cbdc2e35e4de49147cd178554f32d33ef78b538c01e8c73d9022100aeb71d657345b52bd06a42d1a2099f5a9a6f42d5d06a9b50581e1959ab6ac772", + "304402204cd508c120bba2708c00c947711b106944e014d3322b6d018fca849219ff641f0220296c4c72b1a9d6f40f1c4c768d3dae3c4dd49d3b3dae95b64561f33d48793246", }, { label: "Max Int8", path: "pos8", signature: - "3046022100c2761449f313cbfc55376fb31c12283833dfd5a49273a5ff4022645043a2a64b0221009640e0d52de7f9481b3157fa1b3ad05a7fc0b018d1539d526fbd299d9ba6471d", + "30440220606bab0c711597bc314b28b1395b88cf4008f686d4a52f743485837e61f2adf602203f5f452a06ef1a3acf66542473745165a7a9e6310db827038d02a23a50c84bdf", }, ], }, @@ -504,32 +520,32 @@ export const v1 = { contractName: { label: "Permit USDC transfers", signature: - "30440220206a52ce36fb75683481981c6f1f2e1cc405da8b7172b4fe3b465b19139bd66602200d5d2a800a253881fe4d87ebaf57fffbc7fbb8591ebe251ac69d650469b51d16", + "3045022100a79de252776cf2fe2758823fb523414e483420c9645466dd18189bd05376c527022076222d6e261689e5b25214562a75cd173dba49b20b923084dcd60ced2b0719ff", }, fields: [ { label: "From", path: "owner", signature: - "3044022048b3e79d00220b5fb5908cb13264f0a10ab1faa1f9c95702c4dcb91aefa2475a02204096676422035d37f30a9fea09553d5d1751413e5a2cb60d1b9919aa33e166b1", + "30440220785a896fb5465f02c9e5dfb3d94e4d9455e2beb788be5ab7f6cdb7f30f2c6bd8022017ee7bf88e02635841692eac82e40cb1642264e83af05bdf490eeed3c9e7c8d7", }, { label: "Approve to spender", path: "spender", signature: - "3045022100da7a47dbc3c943c29f2211e139c5dc43b6c54d79d4aec205694155a8a2bed5b902202f1a885a2a6de6b705f8cfe87d6994e470c779f8bb8e6e52166c4e41437e605f", + "3045022100cd3d674ab32ea5ce0755a0447df2d4216367e4a53b9132743e3c5a34a79240920220363230a8e765d42c7b60ff265297f865e7548fe34afc5a03294800a54ca885f1", }, { label: "Amount allowance", path: "value", signature: - "3045022100fc3e850699e3abfcbca2f4258f248573b43c91b2dd8d59d423804518b2e5f79502200868300f4a75b3f77b35e7f45511fdd4e7717604d416841052b9a0a27b1087e1", + "3045022100e9bbc349b93502ffbdd714179d909d14a43c9c97e44017628be3cf0c6699d4710220064d25e9b636307ef43a2b89c9732e2646ba9dbebed68b13b7dabe244426fe42", }, { label: "Approval expire", path: "deadline", signature: - "3045022100e809928ed622936a7a8d03141dd7b477ec92243918293e6ea48d32c0f90b70ea022054065681702e458131a18cb8e8eb588618bda83b1a24ff5bddacdfc060ce851d", + "3045022100c37a7e1e4d7a45544728dea6410ed07297e74840afba73f7c0802d9a7e46d243022064c0d57ff2e4815769800b361d6657f697dc0f9ec19f4a6f40e9f20221841d8a", }, ], }, @@ -538,96 +554,96 @@ export const v1 = { contractName: { label: "Permit2", signature: - "3045022100d259cbf0306cda1fbd842725394b29020aaa05159884cdff8c256ad87e6d55ea02205e5c7bbbbc030c2e1362e41185312aa8140802495fed2325031da2af79dde7a4", + "304402207b4555721d2144f142052d1f323429d542961573e0a0f3c5e87aa5aeded6b3f70220546903db2f0633c2f36c5398eedac02e71c18ab311f916ed9b28787552e49ca3", }, fields: [ { label: "Amount allowance", path: "details.token", signature: - "3045022100b0c62b0c9e085b87332b8a32a7106ca20027f41501abf28f2ef6eddcfee70cb2022048fc3ff7d0e8840f4f6581f0026d2099034011b572a9b87804e2e5b4559a708e", + "3045022100a7c66fce7e291eb0e3d64a95a8794dd19a205c9b19d343920ecc06228cba6d4b022052b86d00e19e4f8ec8a71ced44baa5340a0c379e0b74dc5864d9395717a790a3", }, { label: "Amount allowance", path: "details.amount", signature: - "304402206f542985fa2aa16417942f0daceb72b951c2c485088cb8dfa79cba7358f1cc0a02202d31f11b13df2f15c143c727dafc2aee2c34d6df8eba28e8c44d9a5d16493c49", + "3045022100d0a303974f5821109b72fe89ed708014fa078a4814c492d81d85f70f9bd5410e02201e2a39a4982f9e1ddb2715e3f6c6c7c50842a10923609db54c3b2e098cb5bac1", }, { label: "Approve to spender", path: "spender", signature: - "304402207d9c68450fd568c07e5b5ecffe29747c64d247cc1ccc8cce83d4112d029317d202206c631ddb8ea90ad75aa1339f2e966b72193758615f303af6c8f94c733f6e877c", + "3045022100a4f400735e562a75688eb30ff2535c73ba91505bc0b70004e3118ef186789918022030db9543fcf5bea2866649757de7f007a87e7e292780ec2a5d585b9b326c84fb", }, { label: "Approval expire", path: "details.expiration", signature: - "304402206a2fffb754431f7c4bccf3e9e4d0685d90717e995e4c719dcf56fa55d0601dad022021f53e18abaa4ac5ecbccbe2e87d16acae1883e78ff6de3427ba0c2a306bae81", + "30450221008946ceda75026d2dac97cf4d1826e7e6333489839a3793d3d22c6b6638e5194902201acd183f3e178e23773707df03a43326d470b4d1aab732917d1409aeadb545a7", }, ], }, - "42161:0x000000000022d473030f116ddee9f6b43ac78ba3:a35a03a79619e46c3773d8880c952f7caeea45674557cfd2470e8fc5": + "1:0x000000000022d473030f116ddee9f6b43ac78ba3:a35a03a79619e46c3773d8880c952f7caeea45674557cfd2470e8fc5": { contractName: { label: "UniswapX Exclusive Dutch Order", signature: - "304502210087b5fd4ca85d8d902459aabf0cfb97c676809c967b84c8a8301838f54d2f144602200d268e03f892d81b35ac1bd493310f4fb65a202c2ad2ebec3f427978756b3106", + "30440220133222a33ac1797d287d213d9af3292534915e481edbc9002d4f1ec91452ad4902203223d57b5284dea9497286becc5aeef54760fb7a64b12019175f9df90f40c3fe", }, fields: [ { label: "Approve to spender", path: "spender", signature: - "3045022100b5e936abd5df8c51ae2ee04b8f06e58162c5702083fddce3494b19c9bc9c2e01022032e9c8fdfd04c78d70d0f1e03e1fe716afc7bb2d2f643cb4586316e87a7c2150", + "304402203a66cd6d84b6b24faeba9a5049dce8f43591e028214bd133de39f73c6fc5ce89022072a91ff94c52aaed99b6f09a98251b6a25a301755c961e8801a79a466129ee3f", }, { label: "Amount allowance", path: "permitted.token", signature: - "30450221008f6d92026f956e9a4635ea2877fcff52b58349050e14e446175d668464090fed022051ace7037868f8984aa208c8d9b7d8a94cd22a93b83e9ca8911227d0f5e5747b", + "3044022056c647b6ff1a72a4aebddadf8a45e28a5884ac40fe45bd8ae79bc1e997dd89e3022066e77ae8105aba3ee9d9646c5743927f12585435a374f2f900196fb16bc36afa", }, { label: "Amount allowance", path: "permitted.amount", signature: - "30440220659cebc0ec70ec020a1c0ec8dd6a4ce650a836ceddda28d9c26d01404ce03bf402205ff6c87cace6b7b575a341347d81927a8fb0650d53cfa2020eb13b542ce68780", + "3044022005f3b9faf97fc508487e4895560ffe234073b3513cd157d406f2207d511aec130220412b05e0cd35c9495520d3795ec476b0f4abc7cf0f9c8e721cb150fe5fd86d5d", }, { label: "To swap", path: "witness.inputToken", signature: - "3044022100d2a7086532e5076845eef95cd717a59527499db3e32081bc54f1d194cb03091c021f2a2c5b8062b9b48bce8993ba878bd516d6123a022537319a3671be2554f4f9", + "3045022100c7996111dbcdce34c0e3f8c74f0b155308708c16ac60ca3b42961a4c07878f2a0220672111b4935ff21d3901414723fee7501c9923f164f2453ac95f60df97787bed", }, { label: "To swap", path: "witness.inputStartAmount", signature: - "3044022039f099a0c207376807f176374b8ddd15b4b0d54396915ecf071e120e4002c8e4022024478aa5c1074cda3755894674a55e21e773b83fc6b74e55822b2d05cab29cce", + "304402203b5c7c7c71e2d342f76bdd652d55c73c61e1685773f621d25821e69ec0fbe6fd022059ae5049d1ed5a7be82585219e239a8adc3dfbbb57406ddf87ea919c409daf6c", }, { label: "Tokens to receive", - path: "witness.outputs.[].tokens", + path: "witness.outputs.[].token", signature: - "3044022012200dbd0f9badcb2b27407289e2f87db36900cbc885e4f5cf70def72af8a83c022042d69ea567ec837c8efd443c135b2f807715dd64fb04900d95515530373f36ff", + "304402200518911aed49f8972b543fa71c3ccf0d3029800fff13ce27bb2981f19d3bdc4902200a7cb06951e60c69e4c7c41717687e47f2a1d49f04f82eb4bb19de2abc9d8ee8", }, { label: "Minimum amounts to receive", - path: "witness.outputs.[].amount", + path: "witness.outputs.[].endAmount", signature: - "3045022100b98951b5fdd4b51aafac8ca1f2c9d186be8d52eb989f8e8b8d6937964a30e7ef02201f974191cc577b7ed3221e5dfee07aeee19bd361418c95e76589ada56b3e3b76", + "30440220095fc59a5c1b65fb19886025eff26d4627d574489a2d41e1050105c1579da4e102206c3f08ee24c44c87eb0e513c42ff65ba4875ae3603f7f5245b0aa5f85a8c6ac2", }, { label: "On Addresses", path: "witness.outputs.[].recipient", signature: - "3045022100eb5d8a309b9b9865377f4b430acc4ac5845c6b4339ce2bb9228fc76947904e3b02207530da05e41c522a6385d0cb586cb459305e98b45d32d0decc078081781986ae", + "3045022100f5787e5fc18bc219b57473e67254c174f39343a27ee990b19b23dc675cc2b4f30220161eea61a585d8669db6b82c707401e505e252e1927edae7c3f452d4bd4c5ca7", }, { label: "Approval expire", path: "deadline", signature: - "30440220641f8f08fd8041a66afbeaced49baebf1b9da777154391dc73c65bea935579c1022042d5bd8a956823bf2640618c1ec9781e198ff2e139674c9cff1ea5c795219cd0", + "304402204404e9657ca1d7063fcdd08c35c4ae36acfacecf7f9ba0a1e77ff12118b2b1a4022071188357bd1aa16a3b78f77b56dd1fd5b395be876b8dd9e77fc12dfd5774c855", }, ], }, @@ -636,44 +652,44 @@ export const v1 = { contractName: { label: "1inch Order", signature: - "30440220295e0aeb17ca0929b2a94c324d67d0b5528aba268177f3ac297b563141e0002702203ac360d9fd0c9c0c12279d1e73bea5d549a1e8141f454d88fbe1e8ef970e6802", + "304402206cfe6a9208d04c77b8791386f5fcbb70756bdcdde0a0c20e7339bf571fcffec1022060361f073a31b833dc2f4c4064e2a2bb060f52a58db0e966b2e87a02bf01ea50", }, fields: [ { label: "From", path: "maker", signature: - "3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44", + "304402200b8b50b3b13c63d2cc6242ad5644dc5f20bc919f57e266293824d0f555a20ae202206626bf02d487f4496c7423760ce4ed0de810bc11ee207ceec8b66d6c2de7bf9d", }, { label: "Send", path: "makerAsset", signature: - "304402201500b44b1eb5b016ebe5bd7d5cc74b011544b357411a608c3a9f14f259ccfd1c0220617cdeaf7b72edc69aa4ce33828b2ae1bf9d80f62af064ed206d348de5ce67dc", + "304402201e1dd801072f94f61704adaacb9ea01dd21458c9de339002225d172d2b5b9a3c0220778208c477b131762c2b9fca09bd1f0eb7ae584842315fa8d769ea68a483d3c9", }, { label: "Send", path: "makingAmount", signature: - "3045022100b1df6581805f596ed6ead231bad279f2f512ed1fffdc2ff082c381b63b5eeb7a02201363fe8f5b9904f338bc1e7d2dc9adece3d33c224c68f2fd669dd943ccd32080", + "3044022071e175465cd3d6857aa51d30290891ac3a9e8593596173a659dcc1ab3c4654dd0220291d813961ed5b08e62e13fa7267b13337a85fd7eaf5667b6d7604dfe6b5207b", }, { label: "Receive minimum", path: "takerAsset", signature: - "304402203329dae6e283d1b00829fd0fdbd4f753ebdf2bd911183af250bacc80341dd3d302205de19c3a200b3e49597a9f02664a262827a64e28d8f24b37808c7c78f727588b", + "3045022100ef1b0a3e910d423c86a5e73967d7d8825556c6a368e4b6cc33c8daf81e128925022054dd1af1b80e7eacbbab74ab07ab7ea8a4b7545349783da60ad60440e4669823", }, { label: "Receive minimum", path: "takingAmount", signature: - "3044022019d6a6cd953447adf2cb0202ecfb0282d3d4bee6aec4c1a2a14e1e8a1e7f732b02201dd3a8b47cda33159a331335c5ac1136e36b5d8e4b29edd99f65cdaf5f5e0c4a", + "30440220036abcafa7461d22947f975a4376b1662ae641a19f2764cd4096267ba7e41eea0220211f14028774e1ec57837c27d390c110d50ba3421a7fa7e5c17cc6b9d1dde726", }, { label: "To", path: "receiver", signature: - "304402205c5b1740d2e74513a9332e3160ebfe5996186c68141055a95d733d51eb51dff402201a1e085dcd9487bdabe9e04426cd8b043c5bf158843fed944affdeef0768ad43", + "3044022020eb170b9844e3c6c3b61d34887bb3a3acb4ea9f8ac01600927f8e83916020cf0220603cbbdf91a5488a63673343279030cc04c477ec6a558c10d4507c71b4da3881", }, ], }, @@ -685,20 +701,22 @@ export const v2 = { contractName: { label: "Anakin", signature: - "3044022063587552c233fa3a5cadbd298f6120cb77e29f4d4a2483831e9fb732edabe7f8022034a88f97e8fdc208800960968f7fbcc0c1d3b71aecdb241b2dd36dfca7ea6b32", + "30440220014ab9506fa7ea26d6f695ea2ce2cd3742852c54ce1793cfd1ca462aabd93d39022033e3b7d399cec2eaabc0e9f595f20dea2182fe9915a0fcde266de068a788a149", }, fields: [ { + format: "raw", label: "From", path: "from.name", signature: - "3045022100f915a23c2654d761fb810d16c05757e8c1663c99a457b3903d1a5a76fbcb058d02205636516e2e5ab90d5879ad141c329f828d576b5c4cbdf7938b2cf86cb153dce5", + "304402204184ab24eef5044a949d9dd4ab32daa7707633f40025c9ac93501b54a533742b0220125da8ac33437eadcc3128ae41190c2fd62e01921bfd4fc8821dd52ebe1cbf2e", }, { + format: "raw", label: "To", path: "to.name", signature: - "3046022100df57f9370b82d1a144d988d085e721cc5e45ec5dab85c906787ed3d6c72d6e22022100cbe041b439cca1784299f42b0e646e03f7c5795f48645c60a0f3b21224167d0c", + "3044022057d81ea65f2a51d88cfee2f567fc8eb4d416cc2036a0473342c082ef1b36a225022026ffe715e5e8e6b1da399a5197ef8bb77a64bf7ff93849a01c160d0ef928106e", }, ], }, @@ -707,26 +725,29 @@ export const v2 = { contractName: { label: "Chewie", signature: - "304402200a68076edda783f20939d29795a2fa64a822ebfb06bf06af9c4deca472fd908002201c7e72fcb7e38bfcefb674cdcdc6a42beabb2d6557b18df9293eb2dea8994bd9", + "30440220695783f5cdb6f7df8c12af70dce746d72eea3e8db2aa4da6883f3ecd0e18114f022069b9a8f51bb2369b950702b29f31594dfe24a1c7aa5471f0f682a7f63cefaef4", }, fields: [ { + format: "raw", label: "Sender", path: "from.name", signature: - "304402200c8991afadb1dbf395edaec90a709e3b4659794ec3f759b5f08e0b25d0656f9802201f50addfd159f669d8c2eb6273fb3c366ee8c5c707c9a59089bbc9f2b15304ac", + "30440220415f936aa7869609af6bf29f03a6af995657fda1d53465b9b301c484bcdf80790220732c4c0dde743d51bef4a1a3289729aa178e6e2ee336826b2dc26b794d6eebef", }, { + format: "raw", label: "Recipients", path: "to.[].wallets.[]", signature: - "3044022022827c43a60563768826f7d1003273828f373b2ddac58fab7f46398133b4e2360220293e311194fc604aac695663c0768e5174dbc82588a3ba445ade5a0513a6569d", + "3045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0", }, { + format: "raw", label: "Message", path: "contents", signature: - "3045022074c6e91513f214590fb7ca8e62a207f6c945a0a02ab96010d8e401eb391f2a36022100f5cfd20bb8903cbc1d6a686ab23764fae1319a6e10856443faaf1953ac9c6b7f", + "304402201a75a81563b580604c43bc51e004f41ec9f45dad9daac80de760bc641e475cfd02200b284e2ce760c24b14709f03630efdc86826d606511820cf15baf56be601b587", }, ], }, @@ -735,14 +756,15 @@ export const v2 = { contractName: { label: "Padme", signature: - "3045022100d68fd98d552a9e28ae4eadb265346b6a9a512ce7d9e64ab5281ab2db8a690bc502201f360b06b06a4b669f54bb632d4b84c155b173b6cce6793cb0ba4ed52dcd3afa", + "3045022100bd6de7636bb63affd2a0e89dae3f7bc89a7f597abf57b8500713a98bdb8b71b0022067651fab5182a96804b8b072804daba643f3485e28662c34be21e566b6208150", }, fields: [ { + format: "raw", label: "Value ma man", path: "val", signature: - "3044022020f273ed63ba6c5699829a8e40ec675d3ada63d50eb76a0dfbdf2a4b7ed0240402206f467c1fcef99b15206ba2ce88b4cf1c43df9da953868b9d4fb69ff8e1b69600", + "30440220056eed97085e204cbb98ee6550e6dd4601bdbb488715e7a4c467a01516743f8502204d3ce91c60ec345036fd5c61dbfcd3b0cddec5aa9d303e98add16f94f84a2bcc", }, ], }, @@ -751,32 +773,36 @@ export const v2 = { contractName: { label: "Darth Vador", signature: - "304402200f1c42bb335dabf7d4e70aff3c694acd5d583c55f67ac69353c7089c2f331008022027c8b41271e2d9a49cf7b8ea1f051446fde487cfddb6ae596af2339e547b7cb9", + "3045022100e07b22754b0a822a1985c9a3435aff753beffb5adf4157356c4f8b35a57fd7d402200a87c7c4ccaeab7b32b5569012dcf166c027382155f5f4f6cb347762294351a2", }, fields: [ { + format: "raw", label: "Sender", path: "from.name", signature: - "3045022067c2da84e35ab7150d9b811ec10ee98c5a58927b7310cc1616be33672e4d0390022100f22b136e7cc5ec18001564749e773a209c9ccd09a097aba8ac29b43746dd976e", + "3045022100de57b2e02bf337b5892d9a2c088ca4155538c81f439e372966b962c6c93492ad022046fdde6973a3d7ea4d5d431aed73b420fccbba1bf687fd6864039591a453625a", }, { + format: "raw", label: "Recipient", path: "to.members.[].name", signature: - "3045022048084193d682f4085080db8f4878926ecda16ee99d8880f6fe8aec0ae82326f6022100983a85b4ccde51b6b6054207cde57af6e32ea0a69b997bad175bf02e28611173", + "3045022100e417d5ad99d507a14e48077f4210bd217f5dbd25afdb14d318cd9f4e3c68789f02203dcff6332826d34aeb1dfb2e064dc8eee803b34de47175403ae7ba5f936315f2", }, { + format: "raw", label: "Message", path: "contents", signature: - "304502206ac58f2720209633e0d7183b3e7d9aaf12fb99009ee865dcff2b528ecc6cdb31022100bee53af9d3d0b68a84bd72e772538af3def78e59ee70dec5a1c6df35dbf9e4f0", + "304402206393b2dd0bed33d4e9e19b6f1089c1ca269df6746df9bdc04d0d1e05239ae281022003177fd79ce85556a3b900a35dadae29bb9212eaa64c90428698e49be3695e86", }, { + format: "raw", label: "Attachment", path: "attach.list.[].name", signature: - "3045022013d1ea505a8b651a073781b134228c5945c30525ae1dbb90b60729cccae4cd6b0221008cd417efdd6e31f491354a3cad5e8aa3cc707081d83a13c0f4250ca793c0da6f", + "3045022100e7e1454fb07ff84e8d768597e6ff7c01191d58e18ea6a691b5019fa24f9cc41c0220499ac0405908d84d97ce6615185c32b06505243ddf703f02db08dff177d4c3e0", }, ], }, @@ -785,20 +811,22 @@ export const v2 = { contractName: { label: "Palpatine", signature: - "3046022100cb0d41cb506d27433d8ca3ca5c0888bced039de132adedca66895a5116c3af9f022100e22b6902aa07a68d71da702dcc8d44deec0d5483f8e29ed5d0e830e40a95892e", + "304502210091f9ebbc812a20f1a575f64ade029f49e0442f6a88def31c7cf74a9ad7d9fd40022012e210516f01c8e12bc1a73c84b3511f663b0e48d7bf1b533f14e90db2725aec", }, fields: [ { + format: "raw", label: "Timestamp", path: "curDate", signature: - "3045022100e9e974f4c04bdce33b81e5bc71d3b9d2f1c63d47f7b092d1cc0b5c52fb5d145f02204edacacfae8dc62c83836f31d3665a9104d40f2c1d34c24f3e4335eb493675de", + "3044022079158841df478fe788b50fe38ea80bac2903f862734b07285f69a92278ece9f9022065fe071875c34897f3c896e278c64eda264b72fac95937400bd40499491f52e3", }, { + format: "raw", label: "Identifier", path: "id", signature: - "3045022100dd2ae125d66c0d53b8ff1cd869506aca393d7763766906894e072a9a0bccc6eb022056812867e63e2b81db36690111e922085db2d6390d6a5454c9ec3f248d969323", + "304402201f96f470b926b453cdb43bd6638807ab0e2691f639f68ea3caf7e84810fe7219022057feae8e954a40e86db68c68324ab3fed7e69c098ff5835da543c23297228acc", }, ], }, @@ -807,80 +835,92 @@ export const v2 = { contractName: { label: "Dark Maul", signature: - "3046022100a1ee24c39a79d92bf33f1018fa04721e52db94501e9d1d52d28d08860c7a807d0221008ca107c6a0bf1a560f471959e2641105eb3cd7ea6ed0eb386d9508c3a55f554b", + "3045022100daffe0f32905a3d5951c475f50a1d49c97c168e39582894a5a44c3b24739f3d60220478f167f2cfa44e8b36050715f918343f0dd514e264adde70d6122aa6ba75ecc", }, fields: [ { + format: "raw", label: "Negative 256", path: "neg256", signature: - "3046022100d4223b3a49c2719723fce18f32f1610d1af84f5a1e6cacd9f2ea31a08f25a3a5022100ff8be6d7bada8a9f991ebad771c4197a8d50b875b3794830bd9202ecf7dee291", + "30450221008a61ebf1d0e41ea583fc3520249a223b6028a6aaa7f4715b5f6ed64305eed887022041718d2e529976df0d00f4ae1ece50901c9865caf26426af0337f99785079aaa", }, { + format: "raw", label: "Positive 256", path: "pos256", signature: - "3045022100812f27a5e993e89cbe2bf1662b226357272cbb6d37bec17ab1ccaf6666de1b48022078823c8c73802362e930146beee375bb6acdb6579c18a459b235e135a6197509", + "3044022021afa673b6653a2f5723201f7831698165d6c8b4817f4082cd5592a1649769ce022006988f97bbbbd647d67a200a28fa1e570cf6f0d51d87bf4e9223f81aca9052f8", }, { + format: "raw", label: "Negative 128", path: "neg128", signature: - "3046022100b34cb6b2300217ef2a1281bc69f89430735787637624861aa7848fdaa94ff5e102210099ad54641ec415e7ae26245f8eea52c7c4e97ee14ce9cb55505c80588df1de8f", + "3044022012df54253d5b4146ecaa3f6f15828e90091c9eef3ed76942b47eafc2b164eb1302207907191856b58ed69c703219ec4c1141bf598605737d8555a8abafabf7aba5cf", }, { + format: "raw", label: "Positive 128", path: "pos128", signature: - "304502210080453b062c7f7a47e1c4e58774682dde0023ad8646664a26fdb25e1de84c7392022069ade1e93ee8318d2c392b51fa6d088b19d8634188d792be58723a4dd5d2fde2", + "304402203793e717c4eb6f4590ee94c0ed3d7d9d0d4c352e98485199cbe884cf1fa2dc8c022052fce5794e965db53493b20349bdc1b5f00963ced271666e9106a588201cad44", }, { + format: "raw", label: "Negative 64", path: "neg64", signature: - "3045022022233aa92cd4deddfb1c09806e80cfabb238c2a5672c244d9af3778140e0f65f0221009ae16aee5f1b3b2bdfa1e2ec0518249333335584015ed444eafab4b3f1dba078", + "304402200c77f00b91d2af7b20f5785bf6b80880b3329abf59ecbc31ec539feb20bb21c302203e8a7b96e86fb95605956006943fdf95733da70fe107b8efb3330e409ce968bf", }, { + format: "raw", label: "Positive 64", path: "pos64", signature: - "3044022024c209ad119ddd0939febd8eafd15e95f8e8923c7b35b4ca44206804f05eca7b0220665dfd4d143f497e263da7142ece011e3221d3acfb864e992d4e86df185331b0", + "3045022100eca15cfe664e675898cb75ad5d6119a5dbc2db7bccd51b510b4d1362e47a1e310220787bc9e8a8545340d0c411edba3cedeee1969057c6ca5c10551ad0ac3d2ce697", }, { + format: "raw", label: "Negative 32", path: "neg32", signature: - "3045022057c12e49d1a688ff7f1b4322015882b3c5bd6e7984d38d80b1659e4a8b736c0d022100fa74d3a71e237bfe46202b95afb2fe6ff93e7fd64a6a2b14a31465aec965bcb4", + "304402204c1de916521b4e3041cefbd787ea7c17d73e4f7d7b997440c1cf0aa7256c35c70220231937d691154f9f9d1c94d6d9b11565d4d4c4a0cda652405429904c6aaa05cb", }, { + format: "raw", label: "Positive 32", path: "pos32", signature: - "304502203b1ed09e5c5a892219b90f0b15894d516ab3f92d07c3d26dcc68e0630f4ec416022100eef30902bc4b97799ec60b5e8cf97209d93880bb3051f9e5d8c3182e9a98770a", + "3045022100da5034823340f1588a816ba514e03b5d0af03f0d78eda8fdc7a8214e0e271efb02200b6bc4a650fde5fb7794bc048ef7e391bb2e182cc17d9b53cd294583cd283d98", }, { + format: "raw", label: "Negative 16", path: "neg16", signature: - "304502210083072d1598238548b2dafb28ff8ed9f69ba039a0e202063b10d8f0825a106bd102202a98bd6012f2ece91be71e98e503614506aff3a9425e121fd00b87a69a5251d6", + "30440220099a84a2f9fc7181f4597842b93db7ec8e4090a3b62dbda8facd9eab06d0e9ae02202c83bf02d4ef497d97e843b12caaac9cb755d16e61b690dbe55d0ca4e04e8cf5", }, { + format: "raw", label: "Positive 16", path: "pos16", signature: - "304402203f64e6f523779ce67e0b8aa3eef15093eebb9f1d9455e616d46faeb07e75d65602204fb4d652999e8be22acf7feb5014c5e2c8da6017bbed19239231b8a61194e528", + "3044022043b00eeecf90639640fbf8f1a26bfefea6161cc8fb5481205203149eccff7554022012742ff0240b45dafe01db746159185e66eecfd9c8271ac19c1cc2c3f899d0c9", }, { + format: "raw", label: "Negative 8", path: "neg8", signature: - "3045022100e750bf41c848674a13aed18ec7675edad8d6e8e10428ebc6ba55eb764d74affd022050cbc317f5e062f7a8231cf810a854d1376c8cedc529d48ac5147c2430625a31", + "3045022100e1e3d137c59ea844d91cd4e6db4c884a63dbb361b887601c7889be951223c7e30220096a8c6722a5e5b6d67be6a8c409b661017927beefc29130b218e86880253248", }, { + format: "raw", label: "Positive 8", path: "pos8", signature: - "30450221009ac6447ea324722a93d97e0476e103d2e35401f9152693241f70777d215a320e02201c0a1ad742f3abde26ff1711fbf5d1d7a49765b074c812bbd94a0593dfbcac55", + "304402202544e902c2d379b67582f9ba5abaa196c18d6656c61da0c4dfe07963dcad16850220312bcc15c52b87903a706bb6970cdc4693f4132abcf79f8c00e1ca1e8e8b495a", }, ], }, @@ -889,32 +929,36 @@ export const v2 = { contractName: { label: "Mace Windu", signature: - "304502205098e783a362b1e3d33ae4d8a6ad4073dd5ad97da72d7ffe6ad41af17869a1f0022100c50ba9335788f82a2ef6d0d5e8b29ea83990346cccb73e887398b0a72ed4a2a1", + "3044022073cc8d51f50a641c5f649816afe149d68b4fe1991184d589bc11512b83fd0e6c0220520a66870d5a2965ffbbae7bf834ea2d66a45ebd92b28b44b675ed0538507b75", }, fields: [ { + format: "raw", label: "Maker", path: "maker", signature: - "30450220476cc3309dd8104c87102df5fda3c6a760492676c2da3a9f4b4763156c97cf31022100bdaee8bcce4123b59d177ff9e15acfdc8d9a4286b4812479a0f3667ed5cefa4f", + "3044022045440d9956eab04674470ecf319d5957997088afccad4ac24f4c2938f4527d10022051273e6710f1487fc02c178c8705817432994b87b1557d036f8df156443a6c10", }, { + format: "raw", label: "Taker", path: "taker", signature: - "3045022100ad6d6a772ddea2ad4ed7f1e2799846f8d520200418fb435eeb34ea35c46c445502200e602c58f398e5eefa8eef759940ceafd51bdc79b85b5b510dd48dccafe0660c", + "3045022100edb53ae572766258aafd3c1b2fd646a188b675ed6d7c2e91d4f30196074fc9300220521129fc3b4d7ff6a4a862a7e3b12c936da8e2f2d62eaf058d56738ded66bde2", }, { + format: "raw", label: "Base Price", path: "basePrice", signature: - "3045022100dfead31f8603678ae2eed97f0ea35963f7a00701067be4a58a9c95a03ce73c7702200ed8e835bfbfd336cc047341e7782c0e917ebc4768bdb59b594bf7edbf71885f", + "3045022100909a48f16e71b423a7e7109d8fc513a8a3b6cc038e103aa957f081a4cb39c137022002c7792cbeaacffad1376f5cc0463c2e2f3c28fbf349ba22e5ae4abeb281b1ad", }, { + format: "raw", label: "Expiration Time", path: "expirationTime", signature: - "304402207221ee5c1ad62447ae56bc01dd27057bdfd1e807deeaa335f225bc080b9f304f022030a6b8e6eb42287f757e3eac9695abfc68f31c8c358dbd814a4df62bb547ff1d", + "3045022100963ea1d26292e612d6e1657d3613efceb4287e121ce86c9e9430f7ad98adc19f02206507c40721500c3a5b15aa342767c3e01708b37feab8b3283c61ce951902d31d", }, ], }, @@ -923,32 +967,36 @@ export const v2 = { contractName: { label: "Yoda", signature: - "304402204a67f5c38317705c31acd936153d627756202370e6412bea13cd43e3cd7d5da802200e8debc34e70160ccc192e92d720d42399faad243740673e945ab3438f6a2ff6", + "304502210082879b74f069c55b3785dad1667203fc35a4265f30d02b0f73643abb6b9bc0d002203c538793004a4adecde735f9397887ac7ea1ac22e04d8e5d29ebf7b438ce31a2", }, fields: [ { + format: "raw", label: "Sender", path: "from", signature: - "30450220277c73383cfe014c12504b991339378123b9a339f005470060747b8ddb2ecfb1022100e29196c745c3b3fb4b6eab097e8972f06a390a2d31ff8deafde2f4ab4bb47392", + "304402207521eb52ad759e37117db390d1b71838dbdcc9191b28c7030a5dcc44321e075b02207266ddebda9ed2b254dafff991c6b016956265b1672df98db2085c52b49cffd2", }, { + format: "raw", label: "Recipients", path: "to.[]", signature: - "304502203f4c1125e3133841e17fb6b579b69c4274d38eb2ca363cb0a2c52b30c52a53f7022100bbd38ad455363801af516ad7fc2dccbdf163cc547d1476113928c23079c67bcd", + "3045022100d55e2a2ac4cf2f0c0fc9ef822b69176e22b7c8bc7c9fc2ea417ea84e1c164c3902204ceffd11ba5979d767b9ded852705ec41e3133e3d95a7188e9039b038288509c", }, { + format: "raw", label: "Message", path: "contents", signature: - "304502206cc88eb3eab3b55d5e6358d46e0fbbaefbd1590d01e77396a15a9f7887bbaaae02210080fab66195f75656134c67007761abfcc207afc075aaf3894e30fdf29e3daa7d", + "3045022100eec10ea4eb0846466871a8d256dde530b17b404fe7722736282c425e964762a702205f60d8e7760c16a8502caeec97ac17b224353cdaac115d09aa5e071917ea43c2", }, { + format: "raw", label: "Hello this is ID", path: "id", signature: - "30450221008dcd615a78440f0ce412717d47903f71b7e0131766a72ef6ab189b02af36ac2802205f9ad7f6688f6e36f96442202f2d9f46532319ebf5f12ba3c92ca263ff08143a", + "3045022100c57245b7832fb5cbae86bd35b3dd4c9f93a88b903285bc18f0db67a7133a29990220500b475c779985dd222b64cd76f93d6e08aefc21f356d29762c5b31da281ee93", }, ], }, @@ -957,20 +1005,22 @@ export const v2 = { contractName: { label: "Boba", signature: - "304502202f9e99e99544e9971c6e8c1f58901debd762fc96b6c388c24e921a72f3588a4a022100a9f80217965c99362424017d0fedfd25060fd4e5aae2daf85ac8cbef033fe7e2", + "3045022100ff890837754849bac57d6109f2dcc05a6222417501e7dea899865af11a12f0ca02204dac269e4c9e4c4496c5bcc958477dd808a30a29aa87382a3d130545574a3f87", }, fields: [ { + format: "raw", label: "Maker", path: "maker", signature: - "3045022100a2dd1bab1c723f5c4978ddfc3416bc32a3e665e1a2a798061ace5a171a821e66022012cd32cbb142b366548c46c0ae4688a174da5f63ece1ac88db5e9d82627daf8e", + "304402201c4ce72a81bf1808ba5b0c797eccfbb625d673f817c73c0532cc57863c94447302205321f3c48855d22caf3e81c5de27d87a5175369fdaa3940054d3e33b73bb60ea", }, { + format: "raw", label: "Taker", path: "taker", signature: - "3046022100cb5a8695a4c498dfd5e44b6af9238efb7baed439870b7534c81fd70cea8d4b23022100a49eec86927485697a41362455972926a7b6312ad78c1352f3051b69c1dc4f4f", + "3044022100ff48fa8b4c0269b9029d758e6af195a3e9891938fb49bc9a702bd7b0afb98ba0021f5249c69cc859839101abdee4a173c85606a1c2a0a0c63ebdfc8619a1f51328", }, ], }, @@ -979,26 +1029,29 @@ export const v2 = { contractName: { label: "R2D2", signature: - "3044022056df947a834ef2bf6502e3e1ce611a34ff1b959c0ae366c2d1c8c361077d5a2d022045e7f8afc13d6cde7da3e0d95d834c2ce2d7cab49483d96b14cc35f1150f7215", + "3045022100ab5dc977a4b06ad45aa15497fe6dbde7104392c4cb8cec5204cd7f0fdc12adff022072b90de52f617c88b2d31cc31ff7a944997e9d626727f4ebaff73e5b19f8217d", }, fields: [ { + format: "raw", label: "Document", path: "document.[].[]", signature: - "3044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b", + "30440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249", }, { + format: "raw", label: "Proof", path: "proof.[].[]", signature: - "3046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f", + "30450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef", }, { + format: "raw", label: "Depth", path: "depthy.[].[].[].[]", signature: - "304402207a5f12624b8f5f6628f64520246d31ac24893876a33010307f8b500d212088be02205ea516cde61a61d6dece3d33949b91bfebf31427e199b7c6f94746bb2e81b7d8", + "3045022100a8957fb0acabb7b011250321403ca4cab82c03cc321aff2f9935e89b7ba6934402202ad7e3225f3f4a9099abef2af765949cbdef744cc912917e5978dc486cd3ee85", }, ], }, @@ -1007,32 +1060,36 @@ export const v2 = { contractName: { label: "C3P0", signature: - "304502203b0768bde7f99183d3687336d63e314ea6806bf125dfa9261d55b7319ee18fa3022100f9b711b626ec116318ef2ee2ac96a31746cd071c5caac3655adfcc1934161d51", + "304402204a84b6192451644adf47eac6c022a92a4eb0fe33849a8db84d9979f35a3261470220704a2da9a4e9f5f438fec1aaf328a94ce0962c5bb2b2cbf7ce5a85af0552968a", }, fields: [ { + format: "raw", label: "Sender", path: "from.name", signature: - "3045022100ced76e0e61411b1ef5642586834e29ae9189974ce4338a9a9a2516e43edbde7302200a36170372164d778f873a4f5e95923ab09f48ac0cb9fa106f7f7d097e891eb9", + "3044022061102a17459e3eb33ea99f875a6e1a0bf32059752e858b8a714080c667d8adcb02204ed10e590bf7a29a417ca56b9484fc14d0a7c4f0d86e7ce24fb5ccf0556633c1", }, { + format: "raw", label: "Recipient", path: "to.members.[].name", signature: - "3044022100a9a05f12fbe643750f0c8a60b30dbc793077c2104dcf999a62303dba8458d65d021f6edd5f71a9c32b411f17df3fb1aa4721b356259cf77a48c4a44319806a5435", + "3045022100da0d2991bb43f2f15750c506fe6de293403ac8554abba91a42a17b9bd606d28a022000eb1dc52e27f1787ad7974dc2c46b8d3e2b6a21a7d29b59dae6cd5950dd3ad7", }, { + format: "raw", label: "Message", path: "contents", signature: - "304502200f6f7be32f617791e4ed639ba294b8ab38e9a4f9c39e3fe415c4e03ab4674168022100853409de5fc10e80c2a406439ba184b28762dc74797e1e383b167676d8fae959", + "3045022100b8eb78af1926c0f467a9eaae8bddfc9809142457b274e569c47ba67ea6e3670302204849783769cfd8db7881dc218cbd6ce68065daa7c91a86dac801450d794b4f27", }, { + format: "raw", label: "Attachment", path: "attach.list.[].name", signature: - "304502206650c083b2c895fba0fdb8edf952f56f443a6cdde0086aab469c38032f7aeb320221009c7acee25f280180c8cbf0038c1b3692a671cdab0651501948e6a2b59783c539", + "3045022100b01fb7a24c68490b628a2733399d50325ef77fcd23937c47b621b2d081fbf29f02204194a21dc935f873172928cdd13e30cbdef28c08f1bae37b51d78355b0df5561", }, ], }, @@ -1041,26 +1098,29 @@ export const v2 = { contractName: { label: "Leia", signature: - "3046022100d786a7581ca1bd313e8271cca5635e4b35ae69c13cce9664b2f61886979a5e94022100a45a87afd52f3ae630510dcde9139e98f1979f84efba29b85b5dac583605e225", + "304402206aade75a0906c6c6f47080a195d32bcc9d2ca44d9e1fe7c936a8f2040f10722a0220378e54fc0b9b6cccab50bd3c43cf0ed034ffbaba834dd18246289b26fe8ebb3e", }, fields: [ { + format: "raw", label: "Sender", path: "from.name", signature: - "3046022100fdf2641839d9eb35211a1dff0a642efffcdada1b4a735fed1dc8286cfef3a69f0221009ab91a098be77ed3fa385bb33300c3f6050f1871c2df1a420411b9049e018cf2", + "304402205d72013185f9324c724f1456214818daa52778282f39f9511a197bef9266e91002205564bcfeb4bfbb13596e2c4cf86a602b01e8cea41abb6bb36fc5276142bb7844", }, { + format: "raw", label: "Should be Alice & Bob", path: "to.[].name", signature: - "3046022100ec0bb0ee7962ea0b89a4c1b81e7141c38f4fb3841dc254611b39357e98fa13710221009d38375810801157565b9e7338feb8f44babf4c3bfd46f9dff7be412684323d9", + "3044022024e948f1f8206bea3eee90636526d33565df61271fa2c2acebd9d5f5778fa42002206a2d68bb87a13008bcc735de5a238b67e6d2b7df91236bc50f8eb6cd58749193", }, { + format: "raw", label: "Message", path: "contents", signature: - "304502210084741fe267c0e68f588c2b46b7e9a33490912bfff0075fa0f35ea807707beba802204692e9380005cd613e0bd8177de9a9189fef1bbeee77a483df65f87b86dfc5a3", + "30450221009e6d3ceb72239082bb60202a3b095bb308f41d8a6b63360c487b8798e1dd2d24022006ef5ddfffaa1acd0911c64ae7a00adad98ab82a57d6d010906df496511213a6", }, ], }, @@ -1069,26 +1129,46 @@ export const v2 = { contractName: { label: "Han", signature: - "304602210090e6002a4b5b2a96409fbbfce11510a5ec3efc52139b43fb313e195ad7cab1a2022100eccaf2257b8f9e35c42c064ade707bfff9e04399730efa4e1460ccd444cdad1f", + "304402207ea368d6351bf9718c16f588592cac7f62c291aa944883788135165ee8c3490b02204039f684a10f75c474fb1be52a28cff3e1c2cbe82873179c6bc34c2b256d7ca3", }, fields: [ { + format: "raw", label: "Sender", path: "from.name", signature: - "3045022076c5578debbf0c30422d46f546272bbee51d1983691b7f24098991b892f0fb05022100ee5aee20b96e7b60e8cb9d95a185140c5427d7f3b8c8795c9267cc5c52e0a962", + "304402206ace512db580330cba97a8519e888ac75968a88868bb76956bf23aac2c40d4d902202f8b91e8733799d2dce389a34b67d1e95f55d1d69c760a4ff6fdc98441648d70", }, { + format: "raw", label: "Recipients", path: "to.[].wallets.[]", signature: - "3046022100ba2e37ab42de23f088924639d0c340352a013dd8258882f2fed42d2516313b68022100ec2474e9d083a7935251da520b35b08fe125d2153c7102afc8572135b42c3d0d", + "3045022100a35791e52689caef688b4c11da7472d94460f714076c796cf210d5319bc232d60220692feb421e1dcb694ca03ce6f783d2403c24c25a63720cdcdf8786f7848bc579", }, { + format: "raw", label: "Message", path: "contents", signature: - "3044022052996b835132bf8248277b443439382bd3af11d4614052e9e03e22ab093a36dc02201ed76b7f35f1fd8d61a36abd65d70295d7db02a8e89623ecf4fbe0d01ef1106a", + "3045022100d6095472a275cf338b4d83b5c7c50da3ef60f482c665b14be25c16fe4e04dc1a02204a5371fe846ba16360ff55ddb85cf2bb79b9db305c863d4a06e168e766ee13de", + }, + ], + }, + "0:0x0000000000000000000000000000000000000000:cf5a5f8e4ae5baff4e1dd4d767b839464ba1bc26c84228d89955de54": + { + contractName: { + label: "Warrick", + signature: + "3045022100f1af490dc8b60d080fe2488ea720f2d305d60fcce71bf73609d432be64cbfc0f022046e68ffa02041b8677f73a922d2a077831195ab2067a37dcc2219e5e991efb14", + }, + fields: [ + { + format: "raw", + label: "New Threshold", + path: "newThreshold", + signature: + "3044022026d6cdb4b241594798d40203d787eb948f6513f665178de17a6044b8e4b084d30220575dab77928807a6b80a0d0e72b45c33e501a4d2e5c999fb33c4a2ac670f9e5c", }, ], }, @@ -1097,86 +1177,99 @@ export const v2 = { contractName: { label: "Dark Maul", signature: - "3045022100de39788362c05cb30910cb4c19968fa560b4542fb423cc235a544fce6f959a6902207cc3ee39f5f34ea6a653188ae6fc189b27950c837bedf7e6d243d904b3fc2bf5", + "3045022100d9f6612aa98300474292182491148326e8e377b5584ca47f8f766b974bfce124022068409e7ef96e2312694e081449ae703a9b26bdd3eec2332f18156a5326a7b9f2", }, fields: [ { + format: "raw", label: "Max UInt256", path: "max", signature: - "3044022078c0dffd20a30d109a239d75967c72d3dc32992a202fecb66bef6392e6f9d537022071643b9700dc7a1306b1829fe66a583dda4db0d0980d273aade56ac917db89ff", + "304402202338f93fac8fe95ce7fac892fffe6e99d5ed3453b82429893bbddf68cede1abc0220712eec364c5e73cf81474530dea84835e639f5c58cdfef27fc7a42e5c09f6414", }, { + format: "raw", label: "Min Int256", path: "neg256", signature: - "3045022006564e0dfc69b6c264d591b8240225364b1b2ca59aa659fab9aa840894f17cf5022100b59e14e66978f433938ff6e267e8b3677e69265b30379e65a16458694586067c", + "3045022100b4a931fcfab181c760817ec86262336033c9d296f8f68aed04766fd8e7a506c8022014abf7617ec659497c75914a3e6ee13c7356c625ad7e3e641a7187fed8fe5502", }, { + format: "raw", label: "Max Int256", path: "pos256", signature: - "3046022100b400948769b2315d2eaa2b2cf1a954b939ea72633333eacd7eb48a4049d16668022100c303719ad330dda6b351aab92648d0b64c992229c657265bc0d338cc1987f0de", + "3045022100de1ea9d3db73089a8e9885b94652ff0a84fee2991352ed6711be82a410593aaf02202f04c7654037225fba8b8bbcb2d4becc091a6b36eb1fa373d6b7844c24d40787", }, { + format: "raw", label: "Min Int128", path: "neg128", signature: - "3046022100a93da4fcbae42bdadabfd71d3e0ee2b01c5e444b389e67dbe27f5ec82bdc2c2b0221009f7bd6f88501340b627a04bdd7478e4bc93c0be206b9c3def2c9b07d6591d033", + "3044022035616f2cf0eaac3a0d075ba69a85362b9f7348c051904466a4bf65f88a6d36d502200c9c5736f4800bae51890d7721fe534d798472f61f839a7b585854ca403a4b1c", }, { + format: "raw", label: "Max Int128", path: "pos128", signature: - "30460221009a7fef85d6c57a40ad0b7661322809a03fd62153277999688b54324f91245357022100923e53738e94b99af01819ad36c3f095fde94d7cf859118fbfa40ac25c3f422b", + "3045022100fac114b732aa682525ca014b2e8cb36a23ea882c55a7173c4fbf2657cfeb094702203a1fb3460878c5a775977555718fb9d16a3b972a441fee23a000a90a0b81fea2", }, { + format: "raw", label: "Min Int64", path: "neg64", signature: - "3045022100e159a15b0366603cb28f4a9646daab4ab42fd3fb4e0590b32f88192465df358702205cc164b3fe6bfe24007cd804f8d8053a51f53ff9f066e9c5cb9612c0ea69f240", + "304402203771ba95ab8b4f673b31c0ad63495f40acb95df743707ccdda32a7fa32ec59d30220340e906465992877840a4e179c41cfaa78f352767c9acae55eb585eab99de28b", }, { + format: "raw", label: "Max Int64", path: "pos64", signature: - "30450221008a99fedd95c0c9f112b3448ebded92d031d000c9373eb85570ed0399d0fbe54d0220152e20a2ab45c88fd46de66b4a48f06eb2069285513849dce3240df048a42a93", + "3044022068c50782a96e92e85e8027a892383395c183c797a410da981a89f761ceed16f702207ce1ab44a6125f0f1d16f94ae5165af5c7064e4cbe094fd830cebba2af7d1eba", }, { + format: "raw", label: "Min Int32", path: "neg32", signature: - "3046022100dd364ea2741d7acaa54ba20319ac066bcbd0051841547efa3e902dd7ae139149022100eea484a02cda9ec353f4cbbd58e61f7514f3ae4e6c52e31ad111d4f1ad22627b", + "304402202dbe56656795e5a3732186851ad56675d46c053233610f3dbfbdd1287d9f7dbc022066a396e10450912d03911dc54e4479f85c7447acd98719a7ad5e1b5ec006d0bb", }, { + format: "raw", label: "Max Int32", path: "pos32", signature: - "3046022100d989e8e665d4490fc5aead1c4580b594335a520edfb355eae7f861a2a479f69f022100aaea7e95cd9851fac86eb67cdbad1865d74dbb6e8655ea92814a7acf8c682e16", + "304402200c3f65b45e88fd78d45a66ac4a7db9837eb9c8f1d7165e6c48623291218f7373022049f6c49c7bac26b82de50392f0354380da7c9aeb26660fd34227415374f9cd85", }, { + format: "raw", label: "Min Int16", path: "neg16", signature: - "3046022100a9c3972100875d2ee99d9c7c4087cbc3d808650d73d48fd68bc42c4061317906022100f90ce13f28e4af7fe040b849ba89eb153a230e54439d313c1432234a81ffa2fe", + "30440220304c255c31b96173db32434550e2c9e580f2e66036cbdba6352a2c0f02dc92ec02200d752473b881502c6c024ccdfb7523072da676a15f77c19729305eebb0001321", }, { + format: "raw", label: "Max Int16", path: "pos16", signature: - "3045022100ef489d1df222497dce64426a13c8fd78530eb22719eebcce1ee77ac745e77009022000b03f51200cc8c8e90a6d25d6f4ad82b3e5da70ce6e806386bce621e38d8a26", + "3044022019d155f12a3d4e4bf463954227c4978fad9bfa4c36c2b28eca459133d0c40136022028e6c4f0f223f9a74c15d3fb98baffa10aa2aec850ed42813301cbfb751ffbe0", }, { + format: "raw", label: "Min Int8", path: "neg8", signature: - "3046022100a3c1c24fd5b3705cbdc2e35e4de49147cd178554f32d33ef78b538c01e8c73d9022100aeb71d657345b52bd06a42d1a2099f5a9a6f42d5d06a9b50581e1959ab6ac772", + "304402204cd508c120bba2708c00c947711b106944e014d3322b6d018fca849219ff641f0220296c4c72b1a9d6f40f1c4c768d3dae3c4dd49d3b3dae95b64561f33d48793246", }, { + format: "raw", label: "Max Int8", path: "pos8", signature: - "3046022100c2761449f313cbfc55376fb31c12283833dfd5a49273a5ff4022645043a2a64b0221009640e0d52de7f9481b3157fa1b3ad05a7fc0b018d1539d526fbd299d9ba6471d", + "30440220606bab0c711597bc314b28b1395b88cf4008f686d4a52f743485837e61f2adf602203f5f452a06ef1a3acf66542473745165a7a9e6310db827038d02a23a50c84bdf", }, ], }, @@ -1185,7 +1278,7 @@ export const v2 = { contractName: { label: "Permit USDC transfers", signature: - "30440220206a52ce36fb75683481981c6f1f2e1cc405da8b7172b4fe3b465b19139bd66602200d5d2a800a253881fe4d87ebaf57fffbc7fbb8591ebe251ac69d650469b51d16", + "3045022100a79de252776cf2fe2758823fb523414e483420c9645466dd18189bd05376c527022076222d6e261689e5b25214562a75cd173dba49b20b923084dcd60ced2b0719ff", }, fields: [ { @@ -1193,14 +1286,14 @@ export const v2 = { label: "From", path: "owner", signature: - "3044022048b3e79d00220b5fb5908cb13264f0a10ab1faa1f9c95702c4dcb91aefa2475a02204096676422035d37f30a9fea09553d5d1751413e5a2cb60d1b9919aa33e166b1", + "30440220785a896fb5465f02c9e5dfb3d94e4d9455e2beb788be5ab7f6cdb7f30f2c6bd8022017ee7bf88e02635841692eac82e40cb1642264e83af05bdf490eeed3c9e7c8d7", }, { format: "raw", label: "Approve to spender", path: "spender", signature: - "3045022100da7a47dbc3c943c29f2211e139c5dc43b6c54d79d4aec205694155a8a2bed5b902202f1a885a2a6de6b705f8cfe87d6994e470c779f8bb8e6e52166c4e41437e605f", + "3045022100cd3d674ab32ea5ce0755a0447df2d4216367e4a53b9132743e3c5a34a79240920220363230a8e765d42c7b60ff265297f865e7548fe34afc5a03294800a54ca885f1", }, { coin_ref: 255, @@ -1208,14 +1301,14 @@ export const v2 = { label: "Amount allowance", path: "value", signature: - "304402204051e74e9df5f2f42d4f41e3753ceed3cd98a7061c64caf7d6042de668e6b26e02204a277db67a39a5db5aee910a4086482c76e13fe39793049c40514be6dcde27b0", + "3045022100ddb1f28019136896db0901806ded2a372500bb83c153dafdc28f214292cdda3802201b562d0a01a5c6dc905766b760231c71f7b53df0aaa2773e8c0c6da1a3176e61", }, { format: "datetime", label: "Approval expire", path: "deadline", signature: - "304402204c15b30fec2f9f4724326abaa390a08ec626b4ada487d0ed3c6adb32a54da73f02205c6484d3e5ebb3d5a05d5286bc1443c69960771e44d392a16f6cf029325adc62", + "3045022100ca28b0acda246fbd00c79250a4c0146197b63f7695269b2fd053af71fa24313802203bdc4420daeb08f26a5a4177ae9e1e5307562e5d3dd410c5a147671f5cd9c63d", }, ], }, @@ -1224,7 +1317,7 @@ export const v2 = { contractName: { label: "Permit2", signature: - "3045022100d259cbf0306cda1fbd842725394b29020aaa05159884cdff8c256ad87e6d55ea02205e5c7bbbbc030c2e1362e41185312aa8140802495fed2325031da2af79dde7a4", + "304402207b4555721d2144f142052d1f323429d542961573e0a0f3c5e87aa5aeded6b3f70220546903db2f0633c2f36c5398eedac02e71c18ab311f916ed9b28787552e49ca3", }, fields: [ { @@ -1233,7 +1326,7 @@ export const v2 = { label: "Amount allowance", path: "details.token", signature: - "3044022078ff4404d1d554e4d48af1b36b116389dfc385ed212c5ae51cf0218ea7f2aeb20220420d390f654485f830075770a5383f1f79d6557f5c9553e9006e289d4b1ac225", + "3045022100f443a122573bc88adb3a774cfcf7c7772d9ab11ee8d04c1b4aaa1f169b63211c0220742d14ea921358e7777d9c53666a8661897c7a6f9405db347845073873be929c", }, { coin_ref: 0, @@ -1241,30 +1334,30 @@ export const v2 = { label: "Amount allowance", path: "details.amount", signature: - "3045022100f3d322f11e7ed81304baaee25ca2991ad339be783a3f5ff60b0fad3edad3291002201a396f507b590d56d8af66999fafdfc6aaadc75e0e2c9d558b90d5320bdb21a8", + "3045022100a25bcfd5a5a3df6d873874eeb417ff9fc451f3002aee73cee9b8b0bc1e8ef68d02201836220f0d030d953d44d9141b38c050517bc29967c31941c9bd7eb485d5e694", }, { format: "raw", label: "Approve to spender", path: "spender", signature: - "304402207d9c68450fd568c07e5b5ecffe29747c64d247cc1ccc8cce83d4112d029317d202206c631ddb8ea90ad75aa1339f2e966b72193758615f303af6c8f94c733f6e877c", + "3045022100a4f400735e562a75688eb30ff2535c73ba91505bc0b70004e3118ef186789918022030db9543fcf5bea2866649757de7f007a87e7e292780ec2a5d585b9b326c84fb", }, { format: "datetime", label: "Approval expire", path: "details.expiration", signature: - "3045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a", + "3045022100dfeb0c1b415264ad40024f0c11a9d9a491d252bb99a6a257ac9db36d4214e87402207d0a838e62ad6f8148b04849d7a2dc5c75491ac445371498a5971c8ec2b6d7ac", }, ], }, - "42161:0x000000000022d473030f116ddee9f6b43ac78ba3:a35a03a79619e46c3773d8880c952f7caeea45674557cfd2470e8fc5": + "1:0x000000000022d473030f116ddee9f6b43ac78ba3:a35a03a79619e46c3773d8880c952f7caeea45674557cfd2470e8fc5": { contractName: { label: "UniswapX Exclusive Dutch Order", signature: - "304502210087b5fd4ca85d8d902459aabf0cfb97c676809c967b84c8a8301838f54d2f144602200d268e03f892d81b35ac1bd493310f4fb65a202c2ad2ebec3f427978756b3106", + "30440220133222a33ac1797d287d213d9af3292534915e481edbc9002d4f1ec91452ad4902203223d57b5284dea9497286becc5aeef54760fb7a64b12019175f9df90f40c3fe", }, fields: [ { @@ -1272,7 +1365,7 @@ export const v2 = { label: "Approve to spender", path: "spender", signature: - "3045022100b5e936abd5df8c51ae2ee04b8f06e58162c5702083fddce3494b19c9bc9c2e01022032e9c8fdfd04c78d70d0f1e03e1fe716afc7bb2d2f643cb4586316e87a7c2150", + "304402203a66cd6d84b6b24faeba9a5049dce8f43591e028214bd133de39f73c6fc5ce89022072a91ff94c52aaed99b6f09a98251b6a25a301755c961e8801a79a466129ee3f", }, { coin_ref: 0, @@ -1280,7 +1373,7 @@ export const v2 = { label: "Amount allowance", path: "permitted.token", signature: - "30440220125f3c8832b05bc42e224f0607516500d37871d13a417b5726995fcc2d046370022072bb072b344a1b426a8d2d80572e95bba4e3113f73e32d5da63243847068dced", + "30440220087564cbfcaa383760331291b08e940b137d5ab7e6585fd21460ff8a2bc962a202202039dc9e8a9175ac7d397268f600e4cc34d8692548e893aba315a83eb6b3764f", }, { coin_ref: 0, @@ -1288,7 +1381,7 @@ export const v2 = { label: "Amount allowance", path: "permitted.amount", signature: - "30450221008b6d55b1299546ce1c95f1c2aa9ac5587a565f8972d16af11d0818a42ab01f2e02200120350300078049199f8429ac0dcd326f17aa76890c4e5b033ec976cfab1819", + "3045022100f81546f3be85c23f4f4583b225ee650cf183aa463236c43305a93090a2472ccd02201b6ff2a84877caee2f49a694ab8f3b163d055f28e0789496300fb01c7fda6157", }, { coin_ref: 1, @@ -1296,7 +1389,7 @@ export const v2 = { label: "To swap", path: "witness.inputToken", signature: - "304402205298d4af21719f53590aece55ed00ddead2c2d779e07543100d7444e3633088402205e956e92d57fb05cf467c331c59cbb067ed1f5bbf75eeaa9b1875a0970c14354", + "3044022001b973eae56269f1973398aa53db8e2bba657d81bda9f772bd1103884fb63b950220073ca0844bf7d613b51a96e01a22f5b34f3a5fe4f45ed98d2c45314e5f2eea71", }, { coin_ref: 1, @@ -1304,35 +1397,35 @@ export const v2 = { label: "To swap", path: "witness.inputStartAmount", signature: - "3044022070db1a59aa095548e0c834d7e9181d3df598f01432ce1fac9dd92f6d09d8954c022003f24e083a744c767f7b693b2f05988d57b8746750013eb4bba5071a1bf75f1e", + "3045022100dfd4251280d6c2f5cedd28eecd270d6140a9642456c8de317d288493d478e87f02201cfd53b321b426eb0d28e879af1ce9dd59259b9f5bfe3d7e165efa7a5f200b88", }, { format: "raw", label: "Tokens to receive", - path: "witness.outputs.[].tokens", + path: "witness.outputs.[].token", signature: - "3044022012200dbd0f9badcb2b27407289e2f87db36900cbc885e4f5cf70def72af8a83c022042d69ea567ec837c8efd443c135b2f807715dd64fb04900d95515530373f36ff", + "304402200518911aed49f8972b543fa71c3ccf0d3029800fff13ce27bb2981f19d3bdc4902200a7cb06951e60c69e4c7c41717687e47f2a1d49f04f82eb4bb19de2abc9d8ee8", }, { format: "raw", label: "Minimum amounts to receive", - path: "witness.outputs.[].amount", + path: "witness.outputs.[].endAmount", signature: - "3045022100b98951b5fdd4b51aafac8ca1f2c9d186be8d52eb989f8e8b8d6937964a30e7ef02201f974191cc577b7ed3221e5dfee07aeee19bd361418c95e76589ada56b3e3b76", + "30440220095fc59a5c1b65fb19886025eff26d4627d574489a2d41e1050105c1579da4e102206c3f08ee24c44c87eb0e513c42ff65ba4875ae3603f7f5245b0aa5f85a8c6ac2", }, { format: "raw", label: "On Addresses", path: "witness.outputs.[].recipient", signature: - "3045022100eb5d8a309b9b9865377f4b430acc4ac5845c6b4339ce2bb9228fc76947904e3b02207530da05e41c522a6385d0cb586cb459305e98b45d32d0decc078081781986ae", + "3045022100f5787e5fc18bc219b57473e67254c174f39343a27ee990b19b23dc675cc2b4f30220161eea61a585d8669db6b82c707401e505e252e1927edae7c3f452d4bd4c5ca7", }, { format: "datetime", label: "Approval expire", path: "deadline", signature: - "30450221009f9fcc4fd4ede454b777009af42cbf3ef775c25093569172de07e54cf5adab82022032c15d56b5d2168a5412645f45af3b1cfb37afe499798561e4269ff4be8db15e", + "304402206f7d715a5486e518edca9ada72137cbbb52192e4be80b5b34c8345485b5cfd470220304e412971df7c7fb62f4b33435bbed359abc760c16eab35c82dce6ce59f6ab1", }, ], }, @@ -1341,7 +1434,7 @@ export const v2 = { contractName: { label: "1inch Order", signature: - "30440220295e0aeb17ca0929b2a94c324d67d0b5528aba268177f3ac297b563141e0002702203ac360d9fd0c9c0c12279d1e73bea5d549a1e8141f454d88fbe1e8ef970e6802", + "304402206cfe6a9208d04c77b8791386f5fcbb70756bdcdde0a0c20e7339bf571fcffec1022060361f073a31b833dc2f4c4064e2a2bb060f52a58db0e966b2e87a02bf01ea50", }, fields: [ { @@ -1349,7 +1442,7 @@ export const v2 = { label: "From", path: "maker", signature: - "3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44", + "304402200b8b50b3b13c63d2cc6242ad5644dc5f20bc919f57e266293824d0f555a20ae202206626bf02d487f4496c7423760ce4ed0de810bc11ee207ceec8b66d6c2de7bf9d", }, { coin_ref: 0, @@ -1357,7 +1450,7 @@ export const v2 = { label: "Send", path: "makerAsset", signature: - "30440220015921d09f25c9affdb99c858b4ed07cab1a8c81674094bbc35720303a676d7b02201fc7c60bacf6d32d89d3196801d5c8bed45156d6a012f222deee6aa4d9e37d8f", + "304402204c2f225cf542e142dede6da5e51216053023e093748b457be37168ed87d63d4d022018cf762c9f6fe16d30899decb58037abb7c11f115f8b550c08b1f4005d444461", }, { coin_ref: 0, @@ -1365,7 +1458,7 @@ export const v2 = { label: "Send", path: "makingAmount", signature: - "3045022100caf1b5544825ee057566f9adc1c9ce4c4063936114c89b2a003ae42b2df0ed6f022059c98d1dfd79b83f325cf2e787d66b18c28413c66e8d805463e077ec534f7609", + "304502210091612542ceb9c385829f068e290f24c3375ebe0a990fbc67bd1543410c01497a02201cb25ec9aa00fc327d08fabb8946c151dfbb94ec8dcf6c48b90d367e17f0d7eb", }, { coin_ref: 1, @@ -1373,7 +1466,7 @@ export const v2 = { label: "Receive minimum", path: "takerAsset", signature: - "3045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28", + "304402204d6075e9943d3a692612d07658a28361f389c1fc2d82ac2515526789e26d562b022015b1b2df1d1add3c686459ab0956559b77ffd2e3d0dc0a7178bc6ee185c6d5cc", }, { coin_ref: 1, @@ -1381,14 +1474,14 @@ export const v2 = { label: "Receive minimum", path: "takingAmount", signature: - "3045022100a59dc479a838a813909c140a15e6b65bc58c5633284bf973c436de5a592634e202201e038fc7995d939fccd546e4c85e793c0ad451216e36a4edfc7bce5be27808cb", + "3045022100f00a9be55f05be21fc8206b025683f32558827ba42b3fea4ab09b2a9a5fb3b68022066ec1859e1ecee756a1f1b02d9056b68cd5cc5dd2390f5f4a4e7c1f0564dd7f0", }, { format: "raw", label: "To", path: "receiver", signature: - "304402205c5b1740d2e74513a9332e3160ebfe5996186c68141055a95d733d51eb51dff402201a1e085dcd9487bdabe9e04426cd8b043c5bf158843fed944affdeef0768ad43", + "3044022020eb170b9844e3c6c3b61d34887bb3a3acb4ea9f8ac01600927f8e83916020cf0220603cbbdf91a5488a63673343279030cc04c477ec6a558c10d4507c71b4da3881", }, ], }, diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/0-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/0-filtered-v1.apdus similarity index 66% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/0-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/0-filtered-v1.apdus index f2cbf6f0e715..e9cc118bfca6 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/0-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/0-filtered-v1.apdus @@ -22,7 +22,7 @@ <= 9000 => e01a00ff0b8301000777616c6c657473 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -34,11 +34,11 @@ <= 9000 => e01c00ff160014cccccccccccccccccccccccccccccccccccccccc <= 9000 -=> e01e000f4f06416e616b696e02463044022063587552c233fa3a5cadbd298f6120cb77e29f4d4a2483831e9fb732edabe7f8022034a88f97e8fdc208800960968f7fbcc0c1d3b71aecdb241b2dd36dfca7ea6b32 +=> e01e000f4f06416e616b696e024630440220014ab9506fa7ea26d6f695ea2ce2cd3742852c54ce1793cfd1ca462aabd93d39022033e3b7d399cec2eaabc0e9f595f20dea2182fe9915a0fcde266de068a788a149 <= 9000 => e01c0000044d61696c <= 9000 -=> e01e00ff4d0446726f6d473045022100f915a23c2654d761fb810d16c05757e8c1663c99a457b3903d1a5a76fbcb058d02205636516e2e5ab90d5879ad141c329f828d576b5c4cbdf7938b2cf86cb153dce5 +=> e01e00ff4c0446726f6d46304402204184ab24eef5044a949d9dd4ab32daa7707633f40025c9ac93501b54a533742b0220125da8ac33437eadcc3128ae41190c2fd62e01921bfd4fc8821dd52ebe1cbf2e <= 9000 => e01c00ff050003436f77 <= 9000 @@ -48,7 +48,7 @@ <= 9000 => e01c00ff160014deadbeefdeadbeefdeadbeefdeadbeefdeadbeef <= 9000 -=> e01e00ff4c02546f483046022100df57f9370b82d1a144d988d085e721cc5e45ec5dab85c906787ed3d6c72d6e22022100cbe041b439cca1784299f42b0e646e03f7c5795f48645c60a0f3b21224167d0c +=> e01e00ff4a02546f463044022057d81ea65f2a51d88cfee2f567fc8eb4d416cc2036a0473342c082ef1b36a225022026ffe715e5e8e6b1da399a5197ef8bb77a64bf7ff93849a01c160d0ef928106e <= 9000 => e01c00ff050003426f62 <= 9000 @@ -63,4 +63,4 @@ => e01c00ff0d000b48656c6c6f2c20426f6221 <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1c8a540510e13b0f2b11a451275716d29e08caad07e89a1c84964782fb5e1ad78864a0de235b270fbe81e8e40688f4a9f9ad9d283d690552c9331d7773ceafa5139000 \ No newline at end of file +<= 1cb1a7312afb06c47b56d25475bdfdf37d907c84e6c1143825f85136062e941ff7759c2298e0dba1792facd2e579eda48109e4640f4227575bf60db9b06f6e78c89000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-empty-array-1-level-v2.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-empty-array-1-level-v2.apdus new file mode 100644 index 000000000000..4a6b63d4e0a5 --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-empty-array-1-level-v2.apdus @@ -0,0 +1,72 @@ +=> e01a00000c454950373132446f6d61696e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff09050776657273696f6e +<= 9000 +=> e01a00ff0a422007636861696e4964 +<= 9000 +=> e01a00ff130311766572696679696e67436f6e7472616374 +<= 9000 +=> e01a00000547726f7570 +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff128006506572736f6e0100076d656d62657273 +<= 9000 +=> e01a0000044d61696c +<= 9000 +=> e01a00ff0d0006506572736f6e0466726f6d +<= 9000 +=> e01a00ff0d8006506572736f6e010002746f +<= 9000 +=> e01a00ff0a0508636f6e74656e7473 +<= 9000 +=> e01a000006506572736f6e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff0b8301000777616c6c657473 +<= 9000 +=> e01e010000 +<= 9000 +=> e01c00000c454950373132446f6d61696e +<= 9000 +=> e01c00ff0c000a4574686572204d61696c +<= 9000 +=> e01c00ff03000131 +<= 9000 +=> e01c00ff03000105 +<= 9000 +=> e01c00ff160014cccccccccccccccccccccccccccccccccccccccc +<= 9000 +=> e01e000f4f06436865776965034630440220695783f5cdb6f7df8c12af70dce746d72eea3e8db2aa4da6883f3ecd0e18114f022069b9a8f51bb2369b950702b29f31594dfe24a1c7aa5471f0f682a7f63cefaef4 +<= 9000 +=> e01c0000044d61696c +<= 9000 +=> e01e00ff4e0653656e6465724630440220415f936aa7869609af6bf29f03a6af995657fda1d53465b9b301c484bcdf80790220732c4c0dde743d51bef4a1a3289729aa178e6e2ee336826b2dc26b794d6eebef +<= 9000 +=> e01c00ff050003436f77 +<= 9000 +=> e01c000f0102 +<= 9000 +=> e01c00ff160014cd2a3d9f938e13cd947ec05abc7fe734df8dd826 +<= 9000 +=> e01c00ff160014deadbeefdeadbeefdeadbeefdeadbeefdeadbeef +<= 9000 +=> e01c000f0101 +<= 9000 +=> e01c00ff050003426f62 +<= 9000 +=> e01c000f0100 +<= 9000 +=> e01e00011110746f2e5b5d2e77616c6c6574732e5b5d +<= 9000 +=> e01e01ff530a526563697069656e7473473045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0 +<= 9000 +=> e01e00ff4f074d65737361676546304402201a75a81563b580604c43bc51e004f41ec9f45dad9daac80de760bc641e475cfd02200b284e2ce760c24b14709f03630efdc86826d606511820cf15baf56be601b587 +<= 9000 +=> e01c00ff0d000b48656c6c6f2c20426f6221 +<= 9000 +=> e00c000115058000002c8000003c800000000000000000000000 +<= 1bd564c78ed10b539ca83410d9deca79fdaaa250ad53c4dc41433ba55d02a26d2550d3ed7f9c66b3f2c60ffb9b6c696b8f06cd88cafe4ae8371642ab7771827c3a9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-empty-array-2-levels-v2.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-empty-array-2-levels-v2.apdus new file mode 100644 index 000000000000..81a5ec9340cd --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-empty-array-2-levels-v2.apdus @@ -0,0 +1,68 @@ +=> e01a00000c454950373132446f6d61696e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff09050776657273696f6e +<= 9000 +=> e01a00ff0a422007636861696e4964 +<= 9000 +=> e01a00ff130311766572696679696e67436f6e7472616374 +<= 9000 +=> e01a00000547726f7570 +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff128006506572736f6e0100076d656d62657273 +<= 9000 +=> e01a0000044d61696c +<= 9000 +=> e01a00ff0d0006506572736f6e0466726f6d +<= 9000 +=> e01a00ff0d8006506572736f6e010002746f +<= 9000 +=> e01a00ff0a0508636f6e74656e7473 +<= 9000 +=> e01a000006506572736f6e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff0b8301000777616c6c657473 +<= 9000 +=> e01e010000 +<= 9000 +=> e01c00000c454950373132446f6d61696e +<= 9000 +=> e01c00ff0c000a4574686572204d61696c +<= 9000 +=> e01c00ff03000131 +<= 9000 +=> e01c00ff03000105 +<= 9000 +=> e01c00ff160014cccccccccccccccccccccccccccccccccccccccc +<= 9000 +=> e01e000f4f06436865776965034630440220695783f5cdb6f7df8c12af70dce746d72eea3e8db2aa4da6883f3ecd0e18114f022069b9a8f51bb2369b950702b29f31594dfe24a1c7aa5471f0f682a7f63cefaef4 +<= 9000 +=> e01c0000044d61696c +<= 9000 +=> e01e00ff4e0653656e6465724630440220415f936aa7869609af6bf29f03a6af995657fda1d53465b9b301c484bcdf80790220732c4c0dde743d51bef4a1a3289729aa178e6e2ee336826b2dc26b794d6eebef +<= 9000 +=> e01c00ff050003436f77 +<= 9000 +=> e01c000f0102 +<= 9000 +=> e01c00ff160014cd2a3d9f938e13cd947ec05abc7fe734df8dd826 +<= 9000 +=> e01c00ff160014deadbeefdeadbeefdeadbeefdeadbeefdeadbeef +<= 9000 +=> e01c000f0100 +<= 9000 +=> e01e00011110746f2e5b5d2e77616c6c6574732e5b5d +<= 9000 +=> e01e01ff530a526563697069656e7473473045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0 +<= 9000 +=> e01e00ff4f074d65737361676546304402201a75a81563b580604c43bc51e004f41ec9f45dad9daac80de760bc641e475cfd02200b284e2ce760c24b14709f03630efdc86826d606511820cf15baf56be601b587 +<= 9000 +=> e01c00ff0d000b48656c6c6f2c20426f6221 +<= 9000 +=> e00c000115058000002c8000003c800000000000000000000000 +<= 1c4217052c28965d9d1cdba00a65b5d9a18c41e0ea60161cd5f3b0ccffd2d4a536589c87ae016194d0981925d203d203390e6f706e270a7b4ba579a106539ade089000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-v1.apdus similarity index 55% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-v1.apdus index 32a35d354be4..5d5aaa82deae 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/1-filtered-v1.apdus @@ -28,7 +28,7 @@ <= 9000 => e01a00ff0b8301000777616c6c657473 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -40,11 +40,11 @@ <= 9000 => e01c00ff160014cccccccccccccccccccccccccccccccccccccccc <= 9000 -=> e01e000f4f064368657769650346304402200a68076edda783f20939d29795a2fa64a822ebfb06bf06af9c4deca472fd908002201c7e72fcb7e38bfcefb674cdcdc6a42beabb2d6557b18df9293eb2dea8994bd9 +=> e01e000f4f06436865776965034630440220695783f5cdb6f7df8c12af70dce746d72eea3e8db2aa4da6883f3ecd0e18114f022069b9a8f51bb2369b950702b29f31594dfe24a1c7aa5471f0f682a7f63cefaef4 <= 9000 => e01c0000044d61696c <= 9000 -=> e01e00ff4e0653656e64657246304402200c8991afadb1dbf395edaec90a709e3b4659794ec3f759b5f08e0b25d0656f9802201f50addfd159f669d8c2eb6273fb3c366ee8c5c707c9a59089bbc9f2b15304ac +=> e01e00ff4e0653656e6465724630440220415f936aa7869609af6bf29f03a6af995657fda1d53465b9b301c484bcdf80790220732c4c0dde743d51bef4a1a3289729aa178e6e2ee336826b2dc26b794d6eebef <= 9000 => e01c00ff050003436f77 <= 9000 @@ -60,21 +60,21 @@ <= 9000 => e01c000f0103 <= 9000 -=> e01e00ff520a526563697069656e7473463044022022827c43a60563768826f7d1003273828f373b2ddac58fab7f46398133b4e2360220293e311194fc604aac695663c0768e5174dbc82588a3ba445ade5a0513a6569d +=> e01e00ff530a526563697069656e7473473045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0 <= 9000 => e01c00ff160014bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb <= 9000 -=> e01e00ff520a526563697069656e7473463044022022827c43a60563768826f7d1003273828f373b2ddac58fab7f46398133b4e2360220293e311194fc604aac695663c0768e5174dbc82588a3ba445ade5a0513a6569d +=> e01e00ff530a526563697069656e7473473045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0 <= 9000 => e01c00ff160014b0bdabea57b0bdabea57b0bdabea57b0bdabea57 <= 9000 -=> e01e00ff520a526563697069656e7473463044022022827c43a60563768826f7d1003273828f373b2ddac58fab7f46398133b4e2360220293e311194fc604aac695663c0768e5174dbc82588a3ba445ade5a0513a6569d +=> e01e00ff530a526563697069656e7473473045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0 <= 9000 => e01c00ff160014b0b0b0b0b0b0b000000000000000000000000000 <= 9000 -=> e01e00ff50074d657373616765473045022074c6e91513f214590fb7ca8e62a207f6c945a0a02ab96010d8e401eb391f2a36022100f5cfd20bb8903cbc1d6a686ab23764fae1319a6e10856443faaf1953ac9c6b7f +=> e01e00ff4f074d65737361676546304402201a75a81563b580604c43bc51e004f41ec9f45dad9daac80de760bc641e475cfd02200b284e2ce760c24b14709f03630efdc86826d606511820cf15baf56be601b587 <= 9000 => e01c00ff0d000b48656c6c6f2c20426f6221 <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1c66ab3c335fa92801af51551371a95a898a6d862bae2087e0d4074cedb48f9d9371aac1298822efc8b86b5d4618e7b0b91d73813b150645118414f40d06b2465a9000 \ No newline at end of file +<= 1cea66f747173762715751c889fea8722acac3fc35db2c226d37a2e58815398f6452d8ba9153de9255da220ffd36762c0b027701a3b5110f0a765f94b16a9dfb559000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/10-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/10-filtered-v1.apdus similarity index 56% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/10-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/10-filtered-v1.apdus index f0d83354c80e..12a15b5ee7bd 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/10-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/10-filtered-v1.apdus @@ -12,7 +12,7 @@ <= 9000 => e01a00ff0646040376616c <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -24,13 +24,13 @@ <= 9000 => e01c00ff160014cccccccccccccccccccccccccccccccccccccccc <= 9000 -=> e01e000f4f055061646d6501473045022100d68fd98d552a9e28ae4eadb265346b6a9a512ce7d9e64ab5281ab2db8a690bc502201f360b06b06a4b669f54bb632d4b84c155b173b6cce6793cb0ba4ed52dcd3afa +=> e01e000f4f055061646d6501473045022100bd6de7636bb63affd2a0e89dae3f7bc89a7f597abf57b8500713a98bdb8b71b0022067651fab5182a96804b8b072804daba643f3485e28662c34be21e566b6208150 <= 9000 => e01c00000454657374 <= 9000 -=> e01e00ff540c56616c7565206d61206d616e463044022020f273ed63ba6c5699829a8e40ec675d3ada63d50eb76a0dfbdf2a4b7ed0240402206f467c1fcef99b15206ba2ce88b4cf1c43df9da953868b9d4fb69ff8e1b69600 +=> e01e00ff540c56616c7565206d61206d616e4630440220056eed97085e204cbb98ee6550e6dd4601bdbb488715e7a4c467a01516743f8502204d3ce91c60ec345036fd5c61dbfcd3b0cddec5aa9d303e98add16f94f84a2bcc <= 9000 => e01c00ff060004973bb640 <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1bbd1a1bd027e9922fba0b5f298791c70074c4fa5564b024833e885872cc6a187c256485b3fba419e3454006353d2de19390f0c2fc11dc819cf297bc3b7aa6a0059000 \ No newline at end of file +<= 1caaa9e17e5cb7d8a7d0ecc832a883254599909d8123d846aa6f3f63f47ab787042b7e6adaeb26906e6577efa04c1733a19169ee2747020b73f8f309ca8c2ccc1f9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/11-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/11-filtered-v1.apdus similarity index 59% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/11-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/11-filtered-v1.apdus index f5f121b0840c..0c3cf303dadd 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/11-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/11-filtered-v1.apdus @@ -40,7 +40,7 @@ <= 9000 => e01a00ff0b8301000777616c6c657473 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -52,11 +52,11 @@ <= 9000 => e01c00ff160014cccccccccccccccccccccccccccccccccccccccc <= 9000 -=> e01e000f540b4461727468205661646f720446304402200f1c42bb335dabf7d4e70aff3c694acd5d583c55f67ac69353c7089c2f331008022027c8b41271e2d9a49cf7b8ea1f051446fde487cfddb6ae596af2339e547b7cb9 +=> e01e000f550b4461727468205661646f7204473045022100e07b22754b0a822a1985c9a3435aff753beffb5adf4157356c4f8b35a57fd7d402200a87c7c4ccaeab7b32b5569012dcf166c027382155f5f4f6cb347762294351a2 <= 9000 => e01c0000044d61696c <= 9000 -=> e01e00ff4f0653656e646572473045022067c2da84e35ab7150d9b811ec10ee98c5a58927b7310cc1616be33672e4d0390022100f22b136e7cc5ec18001564749e773a209c9ccd09a097aba8ac29b43746dd976e +=> e01e00ff4f0653656e646572473045022100de57b2e02bf337b5892d9a2c088ca4155538c81f439e372966b962c6c93492ad022046fdde6973a3d7ea4d5d431aed73b420fccbba1bf687fd6864039591a453625a <= 9000 => e01c00ff050003436f77 <= 9000 @@ -70,7 +70,7 @@ <= 9000 => e01c000f0102 <= 9000 -=> e01e00ff5209526563697069656e74473045022048084193d682f4085080db8f4878926ecda16ee99d8880f6fe8aec0ae82326f6022100983a85b4ccde51b6b6054207cde57af6e32ea0a69b997bad175bf02e28611173 +=> e01e00ff5209526563697069656e74473045022100e417d5ad99d507a14e48077f4210bd217f5dbd25afdb14d318cd9f4e3c68789f02203dcff6332826d34aeb1dfb2e064dc8eee803b34de47175403ae7ba5f936315f2 <= 9000 => e01c00ff050003426f62 <= 9000 @@ -80,7 +80,7 @@ <= 9000 => e01c00ff160014b0b0b0b0b0b0b000000000000000000000000000 <= 9000 -=> e01e00ff5209526563697069656e74473045022048084193d682f4085080db8f4878926ecda16ee99d8880f6fe8aec0ae82326f6022100983a85b4ccde51b6b6054207cde57af6e32ea0a69b997bad175bf02e28611173 +=> e01e00ff5209526563697069656e74473045022100e417d5ad99d507a14e48077f4210bd217f5dbd25afdb14d318cd9f4e3c68789f02203dcff6332826d34aeb1dfb2e064dc8eee803b34de47175403ae7ba5f936315f2 <= 9000 => e01c00ff070005416c696365 <= 9000 @@ -88,23 +88,23 @@ <= 9000 => e01c00ff160014b0bdabea57b0bdabea57b0bdabea57b0bdabea57 <= 9000 -=> e01e00ff50074d65737361676547304502206ac58f2720209633e0d7183b3e7d9aaf12fb99009ee865dcff2b528ecc6cdb31022100bee53af9d3d0b68a84bd72e772538af3def78e59ee70dec5a1c6df35dbf9e4f0 +=> e01e00ff4f074d65737361676546304402206393b2dd0bed33d4e9e19b6f1089c1ca269df6746df9bdc04d0d1e05239ae281022003177fd79ce85556a3b900a35dadae29bb9212eaa64c90428698e49be3695e86 <= 9000 => e01c00ff0d000b48656c6c6f2c20426f6221 <= 9000 => e01c000f0102 <= 9000 -=> e01e00ff530a4174746163686d656e74473045022013d1ea505a8b651a073781b134228c5945c30525ae1dbb90b60729cccae4cd6b0221008cd417efdd6e31f491354a3cad5e8aa3cc707081d83a13c0f4250ca793c0da6f +=> e01e00ff530a4174746163686d656e74473045022100e7e1454fb07ff84e8d768597e6ff7c01191d58e18ea6a691b5019fa24f9cc41c0220499ac0405908d84d97ce6615185c32b06505243ddf703f02db08dff177d4c3e0 <= 9000 => e01c00ff0700056669727374 <= 9000 => e01c00ff03000164 <= 9000 -=> e01e00ff530a4174746163686d656e74473045022013d1ea505a8b651a073781b134228c5945c30525ae1dbb90b60729cccae4cd6b0221008cd417efdd6e31f491354a3cad5e8aa3cc707081d83a13c0f4250ca793c0da6f +=> e01e00ff530a4174746163686d656e74473045022100e7e1454fb07ff84e8d768597e6ff7c01191d58e18ea6a691b5019fa24f9cc41c0220499ac0405908d84d97ce6615185c32b06505243ddf703f02db08dff177d4c3e0 <= 9000 => e01c00ff0800067365636f6e64 <= 9000 => e01c00ff0400020d48 <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1cd0259bc5208c369532c6161486d7533966d382fc725bcb781a190c0f1a53f7717ebbf21c5569d2d2a480615d529b431d3b0dfce863f723d21e3370e860a8965c9000 \ No newline at end of file +<= 1ccce2e63aaac6a5f9a74684d8fdddcbc7f3b27aa17235bfab89226821ead933b63f3c93977abcc3f8cc9a3dc1ecc02dbca14aca1a6ecb2fb6ca3d7c713ace1ec49000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/12-filtered-v1.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/12-filtered-v1.apdus new file mode 100644 index 000000000000..80a0e42cc61f --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/12-filtered-v1.apdus @@ -0,0 +1,38 @@ +=> e01a00000441757468 +<= 9000 +=> e01a00ff08050662616e6e6572 +<= 9000 +=> e01a00ff0a42040763757244617465 +<= 9000 +=> e01a00ff054201026964 +<= 9000 +=> e01a00000c454950373132446f6d61696e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff09050776657273696f6e +<= 9000 +=> e01e010000 +<= 9000 +=> e01c00000c454950373132446f6d61696e +<= 9000 +=> e01c00ff0e000c57686f2061726520596f753f +<= 9000 +=> e01c00ff03000131 +<= 9000 +=> e01e000f530950616c706174696e650247304502210091f9ebbc812a20f1a575f64ade029f49e0442f6a88def31c7cf74a9ad7d9fd40022012e210516f01c8e12bc1a73c84b3511f663b0e48d7bf1b533f14e90db2725aec +<= 9000 +=> e01c00000441757468 +<= 9000 +=> e01c00ff2b0029506c65617365207369676e2074686973206d657373616765207769746820796f75722077616c6c6574 +<= 9000 +=> e01e00ff510954696d657374616d70463044022079158841df478fe788b50fe38ea80bac2903f862734b07285f69a92278ece9f9022065fe071875c34897f3c896e278c64eda264b72fac95937400bd40499491f52e3 +<= 9000 +=> e01c00ff06000462fba83d +<= 9000 +=> e01e00ff520a4964656e74696669657246304402201f96f470b926b453cdb43bd6638807ab0e2691f639f68ea3caf7e84810fe7219022057feae8e954a40e86db68c68324ab3fed7e69c098ff5835da543c23297228acc +<= 9000 +=> e01c00ff03000126 +<= 9000 +=> e00c000115058000002c8000003c800000000000000000000000 +<= 1b7be1671577753c13bfd1da8b234b6df8484daf47351c2366637fd291dd4aa4d91a7ffbb01dc8a64e9ee97d19b8f154e9eecbe0b1bfb9dcfa781a65e4745739639000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/12-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/12-filtered.apdus deleted file mode 100644 index 93f609ccac2e..000000000000 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/12-filtered.apdus +++ /dev/null @@ -1,38 +0,0 @@ -=> e01a00000441757468 -<= 9000 -=> e01a00ff08050662616e6e6572 -<= 9000 -=> e01a00ff0a42040763757244617465 -<= 9000 -=> e01a00ff054201026964 -<= 9000 -=> e01a00000c454950373132446f6d61696e -<= 9000 -=> e01a00ff0605046e616d65 -<= 9000 -=> e01a00ff09050776657273696f6e -<= 9000 -=> e01e000000 -<= 9000 -=> e01c00000c454950373132446f6d61696e -<= 9000 -=> e01c00ff0e000c57686f2061726520596f753f -<= 9000 -=> e01c00ff03000131 -<= 9000 -=> e01e000f540950616c706174696e6502483046022100cb0d41cb506d27433d8ca3ca5c0888bced039de132adedca66895a5116c3af9f022100e22b6902aa07a68d71da702dcc8d44deec0d5483f8e29ed5d0e830e40a95892e -<= 9000 -=> e01c00000441757468 -<= 9000 -=> e01c00ff2b0029506c65617365207369676e2074686973206d657373616765207769746820796f75722077616c6c6574 -<= 9000 -=> e01e00ff520954696d657374616d70473045022100e9e974f4c04bdce33b81e5bc71d3b9d2f1c63d47f7b092d1cc0b5c52fb5d145f02204edacacfae8dc62c83836f31d3665a9104d40f2c1d34c24f3e4335eb493675de -<= 9000 -=> e01c00ff06000462fba83d -<= 9000 -=> e01e00ff530a4964656e746966696572473045022100dd2ae125d66c0d53b8ff1cd869506aca393d7763766906894e072a9a0bccc6eb022056812867e63e2b81db36690111e922085db2d6390d6a5454c9ec3f248d969323 -<= 9000 -=> e01c00ff03000126 -<= 9000 -=> e00c000115058000002c8000003c800000000000000000000000 -<= 1c4aef3aaff62fa0731f4e661c4dbb92a48f8c12d7225219fad74b55ef2ad0045b46d7e01804c33a99c4dc7dd7b2ac5e63d07ee4641b01cd3a598cc91d74bbe3e09000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/13-filtered-v1.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/13-filtered-v1.apdus new file mode 100644 index 000000000000..d2dbb2b22c7a --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/13-filtered-v1.apdus @@ -0,0 +1,108 @@ +=> e01a00000c454950373132446f6d61696e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff09050776657273696f6e +<= 9000 +=> e01a00ff0a422007636861696e4964 +<= 9000 +=> e01a00ff130311766572696679696e67436f6e7472616374 +<= 9000 +=> e01a00000454657374 +<= 9000 +=> e01a00ff064220036d6178 +<= 9000 +=> e01a00ff094120066e6567323536 +<= 9000 +=> e01a00ff09412006706f73323536 +<= 9000 +=> e01a00ff094110066e6567313238 +<= 9000 +=> e01a00ff09411006706f73313238 +<= 9000 +=> e01a00ff084108056e65673634 +<= 9000 +=> e01a00ff08410805706f733634 +<= 9000 +=> e01a00ff084104056e65673332 +<= 9000 +=> e01a00ff08410405706f733332 +<= 9000 +=> e01a00ff084102056e65673136 +<= 9000 +=> e01a00ff08410205706f733136 +<= 9000 +=> e01a00ff074101046e656738 +<= 9000 +=> e01a00ff07410104706f7338 +<= 9000 +=> e01e010000 +<= 9000 +=> e01c00000c454950373132446f6d61696e +<= 9000 +=> e01c00ff1200105369676e656420496e74732074657374 +<= 9000 +=> e01c00ff03000131 +<= 9000 +=> e01c00ff03000101 +<= 9000 +=> e01c00ff160014cccccccccccccccccccccccccccccccccccccccc +<= 9000 +=> e01e000f53094461726b204d61756c0d473045022100d9f6612aa98300474292182491148326e8e377b5584ca47f8f766b974bfce124022068409e7ef96e2312694e081449ae703a9b26bdd3eec2332f18156a5326a7b9f2 +<= 9000 +=> e01c00000454657374 +<= 9000 +=> e01e00ff530b4d61782055496e7432353646304402202338f93fac8fe95ce7fac892fffe6e99d5ed3453b82429893bbddf68cede1abc0220712eec364c5e73cf81474530dea84835e639f5c58cdfef27fc7a42e5c09f6414 +<= 9000 +=> e01c00ff220020ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +<= 9000 +=> e01e00ff530a4d696e20496e74323536473045022100b4a931fcfab181c760817ec86262336033c9d296f8f68aed04766fd8e7a506c8022014abf7617ec659497c75914a3e6ee13c7356c625ad7e3e641a7187fed8fe5502 +<= 9000 +=> e01c00ff2200208000000000000000000000000000000000000000000000000000000000000000 +<= 9000 +=> e01e00ff530a4d617820496e74323536473045022100de1ea9d3db73089a8e9885b94652ff0a84fee2991352ed6711be82a410593aaf02202f04c7654037225fba8b8bbcb2d4becc091a6b36eb1fa373d6b7844c24d40787 +<= 9000 +=> e01c00ff2200207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +<= 9000 +=> e01e00ff520a4d696e20496e74313238463044022035616f2cf0eaac3a0d075ba69a85362b9f7348c051904466a4bf65f88a6d36d502200c9c5736f4800bae51890d7721fe534d798472f61f839a7b585854ca403a4b1c +<= 9000 +=> e01c00ff12001080000000000000000000000000000000 +<= 9000 +=> e01e00ff530a4d617820496e74313238473045022100fac114b732aa682525ca014b2e8cb36a23ea882c55a7173c4fbf2657cfeb094702203a1fb3460878c5a775977555718fb9d16a3b972a441fee23a000a90a0b81fea2 +<= 9000 +=> e01c00ff1200107fffffffffffffffffffffffffffffff +<= 9000 +=> e01e00ff51094d696e20496e74363446304402203771ba95ab8b4f673b31c0ad63495f40acb95df743707ccdda32a7fa32ec59d30220340e906465992877840a4e179c41cfaa78f352767c9acae55eb585eab99de28b +<= 9000 +=> e01c00ff0a00088000000000000000 +<= 9000 +=> e01e00ff51094d617820496e743634463044022068c50782a96e92e85e8027a892383395c183c797a410da981a89f761ceed16f702207ce1ab44a6125f0f1d16f94ae5165af5c7064e4cbe094fd830cebba2af7d1eba +<= 9000 +=> e01c00ff0a00087fffffffffffffff +<= 9000 +=> e01e00ff51094d696e20496e74333246304402202dbe56656795e5a3732186851ad56675d46c053233610f3dbfbdd1287d9f7dbc022066a396e10450912d03911dc54e4479f85c7447acd98719a7ad5e1b5ec006d0bb +<= 9000 +=> e01c00ff06000480000000 +<= 9000 +=> e01e00ff51094d617820496e74333246304402200c3f65b45e88fd78d45a66ac4a7db9837eb9c8f1d7165e6c48623291218f7373022049f6c49c7bac26b82de50392f0354380da7c9aeb26660fd34227415374f9cd85 +<= 9000 +=> e01c00ff0600047fffffff +<= 9000 +=> e01e00ff51094d696e20496e7431364630440220304c255c31b96173db32434550e2c9e580f2e66036cbdba6352a2c0f02dc92ec02200d752473b881502c6c024ccdfb7523072da676a15f77c19729305eebb0001321 +<= 9000 +=> e01c00ff0400028000 +<= 9000 +=> e01e00ff51094d617820496e743136463044022019d155f12a3d4e4bf463954227c4978fad9bfa4c36c2b28eca459133d0c40136022028e6c4f0f223f9a74c15d3fb98baffa10aa2aec850ed42813301cbfb751ffbe0 +<= 9000 +=> e01c00ff0400027fff +<= 9000 +=> e01e00ff50084d696e20496e743846304402204cd508c120bba2708c00c947711b106944e014d3322b6d018fca849219ff641f0220296c4c72b1a9d6f40f1c4c768d3dae3c4dd49d3b3dae95b64561f33d48793246 +<= 9000 +=> e01c00ff03000180 +<= 9000 +=> e01e00ff50084d617820496e74384630440220606bab0c711597bc314b28b1395b88cf4008f686d4a52f743485837e61f2adf602203f5f452a06ef1a3acf66542473745165a7a9e6310db827038d02a23a50c84bdf +<= 9000 +=> e01c00ff0300017f +<= 9000 +=> e00c000115058000002c8000003c800000000000000000000000 +<= 1cfde9bc1860bae0b867b66176ca654578530edf97771c714cc7bb146943443ef306f92884f1de6fe75c4a650b0fe88d0c185af9943a95dc1c4b3045ae0f81edfe9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/13-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/13-filtered.apdus deleted file mode 100644 index 37ec48a2b5ac..000000000000 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/13-filtered.apdus +++ /dev/null @@ -1,108 +0,0 @@ -=> e01a00000c454950373132446f6d61696e -<= 9000 -=> e01a00ff0605046e616d65 -<= 9000 -=> e01a00ff09050776657273696f6e -<= 9000 -=> e01a00ff0a422007636861696e4964 -<= 9000 -=> e01a00ff130311766572696679696e67436f6e7472616374 -<= 9000 -=> e01a00000454657374 -<= 9000 -=> e01a00ff064220036d6178 -<= 9000 -=> e01a00ff094120066e6567323536 -<= 9000 -=> e01a00ff09412006706f73323536 -<= 9000 -=> e01a00ff094110066e6567313238 -<= 9000 -=> e01a00ff09411006706f73313238 -<= 9000 -=> e01a00ff084108056e65673634 -<= 9000 -=> e01a00ff08410805706f733634 -<= 9000 -=> e01a00ff084104056e65673332 -<= 9000 -=> e01a00ff08410405706f733332 -<= 9000 -=> e01a00ff084102056e65673136 -<= 9000 -=> e01a00ff08410205706f733136 -<= 9000 -=> e01a00ff074101046e656738 -<= 9000 -=> e01a00ff07410104706f7338 -<= 9000 -=> e01e000000 -<= 9000 -=> e01c00000c454950373132446f6d61696e -<= 9000 -=> e01c00ff1200105369676e656420496e74732074657374 -<= 9000 -=> e01c00ff03000131 -<= 9000 -=> e01c00ff03000101 -<= 9000 -=> e01c00ff160014cccccccccccccccccccccccccccccccccccccccc -<= 9000 -=> e01e000f53094461726b204d61756c0d473045022100de39788362c05cb30910cb4c19968fa560b4542fb423cc235a544fce6f959a6902207cc3ee39f5f34ea6a653188ae6fc189b27950c837bedf7e6d243d904b3fc2bf5 -<= 9000 -=> e01c00000454657374 -<= 9000 -=> e01e00ff530b4d61782055496e74323536463044022078c0dffd20a30d109a239d75967c72d3dc32992a202fecb66bef6392e6f9d537022071643b9700dc7a1306b1829fe66a583dda4db0d0980d273aade56ac917db89ff -<= 9000 -=> e01c00ff220020ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -<= 9000 -=> e01e00ff530a4d696e20496e74323536473045022006564e0dfc69b6c264d591b8240225364b1b2ca59aa659fab9aa840894f17cf5022100b59e14e66978f433938ff6e267e8b3677e69265b30379e65a16458694586067c -<= 9000 -=> e01c00ff2200208000000000000000000000000000000000000000000000000000000000000000 -<= 9000 -=> e01e00ff540a4d617820496e74323536483046022100b400948769b2315d2eaa2b2cf1a954b939ea72633333eacd7eb48a4049d16668022100c303719ad330dda6b351aab92648d0b64c992229c657265bc0d338cc1987f0de -<= 9000 -=> e01c00ff2200207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -<= 9000 -=> e01e00ff540a4d696e20496e74313238483046022100a93da4fcbae42bdadabfd71d3e0ee2b01c5e444b389e67dbe27f5ec82bdc2c2b0221009f7bd6f88501340b627a04bdd7478e4bc93c0be206b9c3def2c9b07d6591d033 -<= 9000 -=> e01c00ff12001080000000000000000000000000000000 -<= 9000 -=> e01e00ff540a4d617820496e743132384830460221009a7fef85d6c57a40ad0b7661322809a03fd62153277999688b54324f91245357022100923e53738e94b99af01819ad36c3f095fde94d7cf859118fbfa40ac25c3f422b -<= 9000 -=> e01c00ff1200107fffffffffffffffffffffffffffffff -<= 9000 -=> e01e00ff52094d696e20496e743634473045022100e159a15b0366603cb28f4a9646daab4ab42fd3fb4e0590b32f88192465df358702205cc164b3fe6bfe24007cd804f8d8053a51f53ff9f066e9c5cb9612c0ea69f240 -<= 9000 -=> e01c00ff0a00088000000000000000 -<= 9000 -=> e01e00ff52094d617820496e7436344730450221008a99fedd95c0c9f112b3448ebded92d031d000c9373eb85570ed0399d0fbe54d0220152e20a2ab45c88fd46de66b4a48f06eb2069285513849dce3240df048a42a93 -<= 9000 -=> e01c00ff0a00087fffffffffffffff -<= 9000 -=> e01e00ff53094d696e20496e743332483046022100dd364ea2741d7acaa54ba20319ac066bcbd0051841547efa3e902dd7ae139149022100eea484a02cda9ec353f4cbbd58e61f7514f3ae4e6c52e31ad111d4f1ad22627b -<= 9000 -=> e01c00ff06000480000000 -<= 9000 -=> e01e00ff53094d617820496e743332483046022100d989e8e665d4490fc5aead1c4580b594335a520edfb355eae7f861a2a479f69f022100aaea7e95cd9851fac86eb67cdbad1865d74dbb6e8655ea92814a7acf8c682e16 -<= 9000 -=> e01c00ff0600047fffffff -<= 9000 -=> e01e00ff53094d696e20496e743136483046022100a9c3972100875d2ee99d9c7c4087cbc3d808650d73d48fd68bc42c4061317906022100f90ce13f28e4af7fe040b849ba89eb153a230e54439d313c1432234a81ffa2fe -<= 9000 -=> e01c00ff0400028000 -<= 9000 -=> e01e00ff52094d617820496e743136473045022100ef489d1df222497dce64426a13c8fd78530eb22719eebcce1ee77ac745e77009022000b03f51200cc8c8e90a6d25d6f4ad82b3e5da70ce6e806386bce621e38d8a26 -<= 9000 -=> e01c00ff0400027fff -<= 9000 -=> e01e00ff52084d696e20496e7438483046022100a3c1c24fd5b3705cbdc2e35e4de49147cd178554f32d33ef78b538c01e8c73d9022100aeb71d657345b52bd06a42d1a2099f5a9a6f42d5d06a9b50581e1959ab6ac772 -<= 9000 -=> e01c00ff03000180 -<= 9000 -=> e01e00ff52084d617820496e7438483046022100c2761449f313cbfc55376fb31c12283833dfd5a49273a5ff4022645043a2a64b0221009640e0d52de7f9481b3157fa1b3ad05a7fc0b018d1539d526fbd299d9ba6471d -<= 9000 -=> e01c00ff0300017f -<= 9000 -=> e00c000115058000002c8000003c800000000000000000000000 -<= 1cdaf758e25d9d7769adcab19c4d64953983d29fb44041e0ba4263a9d4686a3de303c52a566b18568ba71576e768ed321a6a90605365fe9766387db3bd24bebe969000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/14-filtered-v1.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/14-filtered-v1.apdus new file mode 100644 index 000000000000..0172c5eebed4 --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/14-filtered-v1.apdus @@ -0,0 +1,28 @@ +=> e01a0000144368616e67654f776e65725468726573686f6c64 +<= 9000 +=> e01a00ff0f42200c6e65775468726573686f6c64 +<= 9000 +=> e01a00000c454950373132446f6d61696e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff09050776657273696f6e +<= 9000 +=> e01e010000 +<= 9000 +=> e01c00000c454950373132446f6d61696e +<= 9000 +=> e01c00ff1600144368616e67654f776e65725468726573686f6c64 +<= 9000 +=> e01c00ff03000131 +<= 9000 +=> e01e000f51075761727269636b01473045022100f1af490dc8b60d080fe2488ea720f2d305d60fcce71bf73609d432be64cbfc0f022046e68ffa02041b8677f73a922d2a077831195ab2067a37dcc2219e5e991efb14 +<= 9000 +=> e01c0000144368616e67654f776e65725468726573686f6c64 +<= 9000 +=> e01e00ff550d4e6577205468726573686f6c64463044022026d6cdb4b241594798d40203d787eb948f6513f665178de17a6044b8e4b084d30220575dab77928807a6b80a0d0e72b45c33e501a4d2e5c999fb33c4a2ac670f9e5c +<= 9000 +=> e01c00ff03000103 +<= 9000 +=> e00c000115058000002c8000003c800000000000000000000000 +<= 1c55ad4a9295fd8e64082f751f19f158db34de2a9072c0b348483ca4a303cf0cb069d732a52e29963a23d7c6ca032e46ae452cc2e3d9487952567ae4bffd14e2379000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/15-filtered-v1.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/15-filtered-v1.apdus index 9a6506563db0..2d9fa4f705d3 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/15-filtered-v1.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/15-filtered-v1.apdus @@ -20,7 +20,7 @@ <= 9000 => e01a00ff0b422008646561646c696e65 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -32,25 +32,25 @@ <= 9000 => e01c00ff160014a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 <= 9000 -=> e01e000f5e155065726d69742055534443207472616e7366657273044630440220206a52ce36fb75683481981c6f1f2e1cc405da8b7172b4fe3b465b19139bd66602200d5d2a800a253881fe4d87ebaf57fffbc7fbb8591ebe251ac69d650469b51d16 +=> e01e000f5f155065726d69742055534443207472616e736665727304473045022100a79de252776cf2fe2758823fb523414e483420c9645466dd18189bd05376c527022076222d6e261689e5b25214562a75cd173dba49b20b923084dcd60ced2b0719ff <= 9000 => e01c0000065065726d6974 <= 9000 -=> e01e00ff4c0446726f6d463044022048b3e79d00220b5fb5908cb13264f0a10ab1faa1f9c95702c4dcb91aefa2475a02204096676422035d37f30a9fea09553d5d1751413e5a2cb60d1b9919aa33e166b1 +=> e01e00ff4c0446726f6d4630440220785a896fb5465f02c9e5dfb3d94e4d9455e2beb788be5ab7f6cdb7f30f2c6bd8022017ee7bf88e02635841692eac82e40cb1642264e83af05bdf490eeed3c9e7c8d7 <= 9000 => e01c00ff1600146cbcd73cd8e8a42844662f0a0e76d7f79afd933d <= 9000 -=> e01e00ff5b12417070726f766520746f207370656e646572473045022100da7a47dbc3c943c29f2211e139c5dc43b6c54d79d4aec205694155a8a2bed5b902202f1a885a2a6de6b705f8cfe87d6994e470c779f8bb8e6e52166c4e41437e605f +=> e01e00ff5b12417070726f766520746f207370656e646572473045022100cd3d674ab32ea5ce0755a0447df2d4216367e4a53b9132743e3c5a34a79240920220363230a8e765d42c7b60ff265297f865e7548fe34afc5a03294800a54ca885f1 <= 9000 => e01c00ff160014111111125421ca6dc452d289314280a0f8842a65 <= 9000 -=> e01e00ff5910416d6f756e7420616c6c6f77616e6365473045022100fc3e850699e3abfcbca2f4258f248573b43c91b2dd8d59d423804518b2e5f79502200868300f4a75b3f77b35e7f45511fdd4e7717604d416841052b9a0a27b1087e1 +=> e01e00ff5910416d6f756e7420616c6c6f77616e6365473045022100e9bbc349b93502ffbdd714179d909d14a43c9c97e44017628be3cf0c6699d4710220064d25e9b636307ef43a2b89c9732e2646ba9dbebed68b13b7dabe244426fe42 <= 9000 => e01c00ff220020ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff <= 9000 => e01c00ff03000100 <= 9000 -=> e01e00ff580f417070726f76616c20657870697265473045022100e809928ed622936a7a8d03141dd7b477ec92243918293e6ea48d32c0f90b70ea022054065681702e458131a18cb8e8eb588618bda83b1a24ff5bddacdfc060ce851d +=> e01e00ff580f417070726f76616c20657870697265473045022100c37a7e1e4d7a45544728dea6410ed07297e74840afba73f7c0802d9a7e46d243022064c0d57ff2e4815769800b361d6657f697dc0f9ec19f4a6f40e9f20221841d8a <= 9000 => e01c00ff0600046675bcb3 <= 9000 diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/15-filtered-v2.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/15-filtered-v2.apdus index 19f15ad66a07..2e60f8e0a924 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/15-filtered-v2.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/15-filtered-v2.apdus @@ -20,7 +20,7 @@ <= 9000 => e01a00ff0b422008646561646c696e65 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -32,27 +32,27 @@ <= 9000 => e01c00ff160014a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 <= 9000 -=> e01e000f5e155065726d69742055534443207472616e7366657273044630440220206a52ce36fb75683481981c6f1f2e1cc405da8b7172b4fe3b465b19139bd66602200d5d2a800a253881fe4d87ebaf57fffbc7fbb8591ebe251ac69d650469b51d16 +=> e01e000f5f155065726d69742055534443207472616e736665727304473045022100a79de252776cf2fe2758823fb523414e483420c9645466dd18189bd05376c527022076222d6e261689e5b25214562a75cd173dba49b20b923084dcd60ced2b0719ff <= 9000 => e01c0000065065726d6974 <= 9000 -=> e01e00ff4c0446726f6d463044022048b3e79d00220b5fb5908cb13264f0a10ab1faa1f9c95702c4dcb91aefa2475a02204096676422035d37f30a9fea09553d5d1751413e5a2cb60d1b9919aa33e166b1 +=> e01e00ff4c0446726f6d4630440220785a896fb5465f02c9e5dfb3d94e4d9455e2beb788be5ab7f6cdb7f30f2c6bd8022017ee7bf88e02635841692eac82e40cb1642264e83af05bdf490eeed3c9e7c8d7 <= 9000 => e01c00ff1600146cbcd73cd8e8a42844662f0a0e76d7f79afd933d <= 9000 -=> e01e00ff5b12417070726f766520746f207370656e646572473045022100da7a47dbc3c943c29f2211e139c5dc43b6c54d79d4aec205694155a8a2bed5b902202f1a885a2a6de6b705f8cfe87d6994e470c779f8bb8e6e52166c4e41437e605f +=> e01e00ff5b12417070726f766520746f207370656e646572473045022100cd3d674ab32ea5ce0755a0447df2d4216367e4a53b9132743e3c5a34a79240920220363230a8e765d42c7b60ff265297f865e7548fe34afc5a03294800a54ca885f1 <= 9000 => e01c00ff160014111111125421ca6dc452d289314280a0f8842a65 <= 9000 -=> e00a0000680455534443a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000006000000013045022100b2e358726e4e6a6752cf344017c0e9d45b9a904120758d45f61b2804f9ad5299022015161ef28d8c4481bd9432c13562def9cce688bcfec896ef244c9a213f106cdd +=> e00a0000670455534443a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000006000000013044022053d12e654cbe62a6eb2d165dec3fb76c3cb176416680c9a5e0de2590b0b9cd8a022050476a169155846100c62c338c7679142d060ff554f765bc9c18d31ebb32e360 <= 009000 -=> e01e00fe5910416d6f756e7420616c6c6f77616e6365ff46304402204051e74e9df5f2f42d4f41e3753ceed3cd98a7061c64caf7d6042de668e6b26e02204a277db67a39a5db5aee910a4086482c76e13fe39793049c40514be6dcde27b0 +=> e01e00fe5a10416d6f756e7420616c6c6f77616e6365ff473045022100ddb1f28019136896db0901806ded2a372500bb83c153dafdc28f214292cdda3802201b562d0a01a5c6dc905766b760231c71f7b53df0aaa2773e8c0c6da1a3176e61 <= 9000 => e01c00ff220020ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff <= 9000 => e01c00ff03000100 <= 9000 -=> e01e00fc570f417070726f76616c2065787069726546304402204c15b30fec2f9f4724326abaa390a08ec626b4ada487d0ed3c6adb32a54da73f02205c6484d3e5ebb3d5a05d5286bc1443c69960771e44d392a16f6cf029325adc62 +=> e01e00fc580f417070726f76616c20657870697265473045022100ca28b0acda246fbd00c79250a4c0146197b63f7695269b2fd053af71fa24313802203bdc4420daeb08f26a5a4177ae9e1e5307562e5d3dd410c5a147671f5cd9c63d <= 9000 => e01c00ff0600046675bcb3 <= 9000 diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/16-filtered-v1.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/16-filtered-v1.apdus index 383d35bc796d..513cc36c0918 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/16-filtered-v1.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/16-filtered-v1.apdus @@ -24,7 +24,7 @@ <= 9000 => e01a00ff0e42200b736967446561646c696e65 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -34,25 +34,25 @@ <= 9000 => e01c00ff160014000000000022d473030f116ddee9f6b43ac78ba3 <= 9000 -=> e01e000f51075065726d69743204473045022100d259cbf0306cda1fbd842725394b29020aaa05159884cdff8c256ad87e6d55ea02205e5c7bbbbc030c2e1362e41185312aa8140802495fed2325031da2af79dde7a4 +=> e01e000f50075065726d6974320446304402207b4555721d2144f142052d1f323429d542961573e0a0f3c5e87aa5aeded6b3f70220546903db2f0633c2f36c5398eedac02e71c18ab311f916ed9b28787552e49ca3 <= 9000 => e01c00000c5065726d697453696e676c65 <= 9000 -=> e01e00ff5910416d6f756e7420616c6c6f77616e6365473045022100b0c62b0c9e085b87332b8a32a7106ca20027f41501abf28f2ef6eddcfee70cb2022048fc3ff7d0e8840f4f6581f0026d2099034011b572a9b87804e2e5b4559a708e +=> e01e00ff5910416d6f756e7420616c6c6f77616e6365473045022100a7c66fce7e291eb0e3d64a95a8794dd19a205c9b19d343920ecc06228cba6d4b022052b86d00e19e4f8ec8a71ced44baa5340a0c379e0b74dc5864d9395717a790a3 <= 9000 => e01c00ff1600147ceb23fd6bc0add59e62ac25578270cff1b9f619 <= 9000 -=> e01e00ff5810416d6f756e7420616c6c6f77616e636546304402206f542985fa2aa16417942f0daceb72b951c2c485088cb8dfa79cba7358f1cc0a02202d31f11b13df2f15c143c727dafc2aee2c34d6df8eba28e8c44d9a5d16493c49 +=> e01e00ff5910416d6f756e7420616c6c6f77616e6365473045022100d0a303974f5821109b72fe89ed708014fa078a4814c492d81d85f70f9bd5410e02201e2a39a4982f9e1ddb2715e3f6c6c7c50842a10923609db54c3b2e098cb5bac1 <= 9000 => e01c00ff0b000903c3656232739e0000 <= 9000 -=> e01e00ff570f417070726f76616c2065787069726546304402206a2fffb754431f7c4bccf3e9e4d0685d90717e995e4c719dcf56fa55d0601dad022021f53e18abaa4ac5ecbccbe2e87d16acae1883e78ff6de3427ba0c2a306bae81 +=> e01e00ff580f417070726f76616c206578706972654730450221008946ceda75026d2dac97cf4d1826e7e6333489839a3793d3d22c6b6638e5194902201acd183f3e178e23773707df03a43326d470b4d1aab732917d1409aeadb545a7 <= 9000 => e01c00ff06000466696939 <= 9000 => e01c00ff03000100 <= 9000 -=> e01e00ff5a12417070726f766520746f207370656e64657246304402207d9c68450fd568c07e5b5ecffe29747c64d247cc1ccc8cce83d4112d029317d202206c631ddb8ea90ad75aa1339f2e966b72193758615f303af6c8f94c733f6e877c +=> e01e00ff5b12417070726f766520746f207370656e646572473045022100a4f400735e562a75688eb30ff2535c73ba91505bc0b70004e3118ef186789918022030db9543fcf5bea2866649757de7f007a87e7e292780ec2a5d585b9b326c84fb <= 9000 => e01c00ff160014ec7be89e9d109e7e3fec59c222cf297125fefda2 <= 9000 diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/16-filtered-v2.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/16-filtered-v2.apdus index 8d2c9bd1de42..8e5b3b0c1cb6 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/16-filtered-v2.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/16-filtered-v2.apdus @@ -24,7 +24,7 @@ <= 9000 => e01a00ff0e42200b736967446561646c696e65 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -34,27 +34,27 @@ <= 9000 => e01c00ff160014000000000022d473030f116ddee9f6b43ac78ba3 <= 9000 -=> e01e000f51075065726d69743204473045022100d259cbf0306cda1fbd842725394b29020aaa05159884cdff8c256ad87e6d55ea02205e5c7bbbbc030c2e1362e41185312aa8140802495fed2325031da2af79dde7a4 +=> e01e000f50075065726d6974320446304402207b4555721d2144f142052d1f323429d542961573e0a0f3c5e87aa5aeded6b3f70220546903db2f0633c2f36c5398eedac02e71c18ab311f916ed9b28787552e49ca3 <= 9000 => e01c00000c5065726d697453696e676c65 <= 9000 -=> e00a00006704574554487ceb23fd6bc0add59e62ac25578270cff1b9f6190000001200000089304402207b674dc939fc9958aef413f7e1b3d755ffbcc8240933d7b6d888e4adeae5c8a802206dd9b1c0c8291e28977497ac8139902446fbb770cd82f6aad7eb7c7b72d69b50 +=> e00a00006704574554487ceb23fd6bc0add59e62ac25578270cff1b9f6190000001200000089304402205051d2f6c33be2adb01abceb850433a3fcfba53d8ed67cd0c0b34498bd302a6c0220224b2f917bccf8b4d3ccc0987befcaafd3835a75651d40af247f36361240be5a <= 009000 -=> e01e00fd4800463044022078ff4404d1d554e4d48af1b36b116389dfc385ed212c5ae51cf0218ea7f2aeb20220420d390f654485f830075770a5383f1f79d6557f5c9553e9006e289d4b1ac225 +=> e01e00fd4900473045022100f443a122573bc88adb3a774cfcf7c7772d9ab11ee8d04c1b4aaa1f169b63211c0220742d14ea921358e7777d9c53666a8661897c7a6f9405db347845073873be929c <= 9000 => e01c00ff1600147ceb23fd6bc0add59e62ac25578270cff1b9f619 <= 9000 -=> e01e00fe5a10416d6f756e7420616c6c6f77616e636500473045022100f3d322f11e7ed81304baaee25ca2991ad339be783a3f5ff60b0fad3edad3291002201a396f507b590d56d8af66999fafdfc6aaadc75e0e2c9d558b90d5320bdb21a8 +=> e01e00fe5a10416d6f756e7420616c6c6f77616e636500473045022100a25bcfd5a5a3df6d873874eeb417ff9fc451f3002aee73cee9b8b0bc1e8ef68d02201836220f0d030d953d44d9141b38c050517bc29967c31941c9bd7eb485d5e694 <= 9000 => e01c00ff0b000903c3656232739e0000 <= 9000 -=> e01e00fc580f417070726f76616c20657870697265473045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a +=> e01e00fc580f417070726f76616c20657870697265473045022100dfeb0c1b415264ad40024f0c11a9d9a491d252bb99a6a257ac9db36d4214e87402207d0a838e62ad6f8148b04849d7a2dc5c75491ac445371498a5971c8ec2b6d7ac <= 9000 => e01c00ff06000466696939 <= 9000 => e01c00ff03000100 <= 9000 -=> e01e00ff5a12417070726f766520746f207370656e64657246304402207d9c68450fd568c07e5b5ecffe29747c64d247cc1ccc8cce83d4112d029317d202206c631ddb8ea90ad75aa1339f2e966b72193758615f303af6c8f94c733f6e877c +=> e01e00ff5b12417070726f766520746f207370656e646572473045022100a4f400735e562a75688eb30ff2535c73ba91505bc0b70004e3118ef186789918022030db9543fcf5bea2866649757de7f007a87e7e292780ec2a5d585b9b326c84fb <= 9000 => e01c00ff160014ec7be89e9d109e7e3fec59c222cf297125fefda2 <= 9000 diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered-v1.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered-v1.apdus new file mode 100644 index 000000000000..25dbb3d51691 --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered-v1.apdus @@ -0,0 +1,164 @@ +=> e01a00000b44757463684f7574707574 +<= 9000 +=> e01a00ff070305746f6b656e +<= 9000 +=> e01a00ff0e42200b7374617274416d6f756e74 +<= 9000 +=> e01a00ff0c422009656e64416d6f756e74 +<= 9000 +=> e01a00ff0b0309726563697069656e74 +<= 9000 +=> e01a00000c454950373132446f6d61696e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff0a422007636861696e4964 +<= 9000 +=> e01a00ff130311766572696679696e67436f6e7472616374 +<= 9000 +=> e01a0000134578636c757369766544757463684f72646572 +<= 9000 +=> e01a00ff1000094f72646572496e666f04696e666f +<= 9000 +=> e01a00ff1142200e6465636179537461727454696d65 +<= 9000 +=> e01a00ff0f42200c6465636179456e6454696d65 +<= 9000 +=> e01a00ff11030f6578636c757369766546696c6c6572 +<= 9000 +=> e01a00ff194220166578636c757369766974794f76657272696465427073 +<= 9000 +=> e01a00ff0c030a696e707574546f6b656e +<= 9000 +=> e01a00ff13422010696e7075745374617274416d6f756e74 +<= 9000 +=> e01a00ff1142200e696e707574456e64416d6f756e74 +<= 9000 +=> e01a00ff17800b44757463684f75747075740100076f757470757473 +<= 9000 +=> e01a0000094f72646572496e666f +<= 9000 +=> e01a00ff09030772656163746f72 +<= 9000 +=> e01a00ff09030773776170706572 +<= 9000 +=> e01a00ff084220056e6f6e6365 +<= 9000 +=> e01a00ff0b422008646561646c696e65 +<= 9000 +=> e01a00ff1e031c6164646974696f6e616c56616c69646174696f6e436f6e7472616374 +<= 9000 +=> e01a00ff1a07186164646974696f6e616c56616c69646174696f6e44617461 +<= 9000 +=> e01a0000195065726d69745769746e6573735472616e7366657246726f6d +<= 9000 +=> e01a00ff1c0010546f6b656e5065726d697373696f6e73097065726d6974746564 +<= 9000 +=> e01a00ff0903077370656e646572 +<= 9000 +=> e01a00ff084220056e6f6e6365 +<= 9000 +=> e01a00ff0b422008646561646c696e65 +<= 9000 +=> e01a00ff1d00134578636c757369766544757463684f72646572077769746e657373 +<= 9000 +=> e01a000010546f6b656e5065726d697373696f6e73 +<= 9000 +=> e01a00ff070305746f6b656e +<= 9000 +=> e01a00ff09422006616d6f756e74 +<= 9000 +=> e01e010000 +<= 9000 +=> e01c00000c454950373132446f6d61696e +<= 9000 +=> e01c00ff0900075065726d697432 +<= 9000 +=> e01c00ff03000101 +<= 9000 +=> e01c00ff160014000000000022d473030f116ddee9f6b43ac78ba3 +<= 9000 +=> e01e000f671e556e697377617058204578636c7573697665204475746368204f72646572094630440220133222a33ac1797d287d213d9af3292534915e481edbc9002d4f1ec91452ad4902203223d57b5284dea9497286becc5aeef54760fb7a64b12019175f9df90f40c3fe +<= 9000 +=> e01c0000195065726d69745769746e6573735472616e7366657246726f6d +<= 9000 +=> e01e00ff5810416d6f756e7420616c6c6f77616e6365463044022056c647b6ff1a72a4aebddadf8a45e28a5884ac40fe45bd8ae79bc1e997dd89e3022066e77ae8105aba3ee9d9646c5743927f12585435a374f2f900196fb16bc36afa +<= 9000 +=> e01c00ff160014c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 +<= 9000 +=> e01e00ff5810416d6f756e7420616c6c6f77616e6365463044022005f3b9faf97fc508487e4895560ffe234073b3513cd157d406f2207d511aec130220412b05e0cd35c9495520d3795ec476b0f4abc7cf0f9c8e721cb150fe5fd86d5d +<= 9000 +=> e01c00ff0a0008016345785d8a0000 +<= 9000 +=> e01e00ff5a12417070726f766520746f207370656e64657246304402203a66cd6d84b6b24faeba9a5049dce8f43591e028214bd133de39f73c6fc5ce89022072a91ff94c52aaed99b6f09a98251b6a25a301755c961e8801a79a466129ee3f +<= 9000 +=> e01c00ff1600146000da47483062a0d734ba3dc7576ce6a0b645c4 +<= 9000 +=> e01c00ff220020046832d5460b1e3ded505a7b75452a48a1ef52283c2dd2afd878e8a0bdefcb01 +<= 9000 +=> e01e00ff570f417070726f76616c2065787069726546304402204404e9657ca1d7063fcdd08c35c4ae36acfacecf7f9ba0a1e77ff12118b2b1a4022071188357bd1aa16a3b78f77b56dd1fd5b395be876b8dd9e77fc12dfd5774c855 +<= 9000 +=> e01c00ff060004666dba18 +<= 9000 +=> e01c00ff1600146000da47483062a0d734ba3dc7576ce6a0b645c4 +<= 9000 +=> e01c00ff160014224cbc440944c72e951507e97d8bf5ffa2e3d2b9 +<= 9000 +=> e01c00ff220020046832d5460b1e3ded505a7b75452a48a1ef52283c2dd2afd878e8a0bdefcb01 +<= 9000 +=> e01c00ff060004666dba18 +<= 9000 +=> e01c00ff1600140000000000000000000000000000000000000000 +<= 9000 +=> e01c00ff020000 +<= 9000 +=> e01c00ff060004666db9d0 +<= 9000 +=> e01c00ff060004666dba0c +<= 9000 +=> e01c00ff160014ff8ba4d1fc3762f6154cc942ccf30049a2a0cec6 +<= 9000 +=> e01c00ff03000164 +<= 9000 +=> e01e00ff5007546f2073776170473045022100c7996111dbcdce34c0e3f8c74f0b155308708c16ac60ca3b42961a4c07878f2a0220672111b4935ff21d3901414723fee7501c9923f164f2453ac95f60df97787bed +<= 9000 +=> e01c00ff160014c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 +<= 9000 +=> e01e00ff4f07546f207377617046304402203b5c7c7c71e2d342f76bdd652d55c73c61e1685773f621d25821e69ec0fbe6fd022059ae5049d1ed5a7be82585219e239a8adc3dfbbb57406ddf87ea919c409daf6c +<= 9000 +=> e01c00ff0a0008016345785d8a0000 +<= 9000 +=> e01c00ff0a0008016345785d8a0000 +<= 9000 +=> e01c000f0102 +<= 9000 +=> e01e00ff5911546f6b656e7320746f207265636569766546304402200518911aed49f8972b543fa71c3ccf0d3029800fff13ce27bb2981f19d3bdc4902200a7cb06951e60c69e4c7c41717687e47f2a1d49f04f82eb4bb19de2abc9d8ee8 +<= 9000 +=> e01c00ff160014a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 +<= 9000 +=> e01c00ff06000414c6caa7 +<= 9000 +=> e01e00ff621a4d696e696d756d20616d6f756e747320746f20726563656976654630440220095fc59a5c1b65fb19886025eff26d4627d574489a2d41e1050105c1579da4e102206c3f08ee24c44c87eb0e513c42ff65ba4875ae3603f7f5245b0aa5f85a8c6ac2 +<= 9000 +=> e01c00ff06000413d0d0ac +<= 9000 +=> e01e00ff550c4f6e20416464726573736573473045022100f5787e5fc18bc219b57473e67254c174f39343a27ee990b19b23dc675cc2b4f30220161eea61a585d8669db6b82c707401e505e252e1927edae7c3f452d4bd4c5ca7 +<= 9000 +=> e01c00ff160014224cbc440944c72e951507e97d8bf5ffa2e3d2b9 +<= 9000 +=> e01e00ff5911546f6b656e7320746f207265636569766546304402200518911aed49f8972b543fa71c3ccf0d3029800fff13ce27bb2981f19d3bdc4902200a7cb06951e60c69e4c7c41717687e47f2a1d49f04f82eb4bb19de2abc9d8ee8 +<= 9000 +=> e01c00ff160014a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 +<= 9000 +=> e01c00ff0500030d548e +<= 9000 +=> e01e00ff621a4d696e696d756d20616d6f756e747320746f20726563656976654630440220095fc59a5c1b65fb19886025eff26d4627d574489a2d41e1050105c1579da4e102206c3f08ee24c44c87eb0e513c42ff65ba4875ae3603f7f5245b0aa5f85a8c6ac2 +<= 9000 +=> e01c00ff0500030cb6bd +<= 9000 +=> e01e00ff550c4f6e20416464726573736573473045022100f5787e5fc18bc219b57473e67254c174f39343a27ee990b19b23dc675cc2b4f30220161eea61a585d8669db6b82c707401e505e252e1927edae7c3f452d4bd4c5ca7 +<= 9000 +=> e01c00ff16001427213e28d7fda5c57fe9e5dd923818dbccf71c47 +<= 9000 +=> e00c000115058000002c8000003c800000000000000000000000 +<= 1b63e951154de94e9f81ecefa38c0f11c2e4a9bfbaa3524b6c9744161211d6cc3b62480171ceb1f39f2c41ff06a2ecd483c0faaaf459063b278c09803b8bef3e4d9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered-v2.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered-v2.apdus new file mode 100644 index 000000000000..bd7165cf76de --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered-v2.apdus @@ -0,0 +1,168 @@ +=> e01a00000b44757463684f7574707574 +<= 9000 +=> e01a00ff070305746f6b656e +<= 9000 +=> e01a00ff0e42200b7374617274416d6f756e74 +<= 9000 +=> e01a00ff0c422009656e64416d6f756e74 +<= 9000 +=> e01a00ff0b0309726563697069656e74 +<= 9000 +=> e01a00000c454950373132446f6d61696e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff0a422007636861696e4964 +<= 9000 +=> e01a00ff130311766572696679696e67436f6e7472616374 +<= 9000 +=> e01a0000134578636c757369766544757463684f72646572 +<= 9000 +=> e01a00ff1000094f72646572496e666f04696e666f +<= 9000 +=> e01a00ff1142200e6465636179537461727454696d65 +<= 9000 +=> e01a00ff0f42200c6465636179456e6454696d65 +<= 9000 +=> e01a00ff11030f6578636c757369766546696c6c6572 +<= 9000 +=> e01a00ff194220166578636c757369766974794f76657272696465427073 +<= 9000 +=> e01a00ff0c030a696e707574546f6b656e +<= 9000 +=> e01a00ff13422010696e7075745374617274416d6f756e74 +<= 9000 +=> e01a00ff1142200e696e707574456e64416d6f756e74 +<= 9000 +=> e01a00ff17800b44757463684f75747075740100076f757470757473 +<= 9000 +=> e01a0000094f72646572496e666f +<= 9000 +=> e01a00ff09030772656163746f72 +<= 9000 +=> e01a00ff09030773776170706572 +<= 9000 +=> e01a00ff084220056e6f6e6365 +<= 9000 +=> e01a00ff0b422008646561646c696e65 +<= 9000 +=> e01a00ff1e031c6164646974696f6e616c56616c69646174696f6e436f6e7472616374 +<= 9000 +=> e01a00ff1a07186164646974696f6e616c56616c69646174696f6e44617461 +<= 9000 +=> e01a0000195065726d69745769746e6573735472616e7366657246726f6d +<= 9000 +=> e01a00ff1c0010546f6b656e5065726d697373696f6e73097065726d6974746564 +<= 9000 +=> e01a00ff0903077370656e646572 +<= 9000 +=> e01a00ff084220056e6f6e6365 +<= 9000 +=> e01a00ff0b422008646561646c696e65 +<= 9000 +=> e01a00ff1d00134578636c757369766544757463684f72646572077769746e657373 +<= 9000 +=> e01a000010546f6b656e5065726d697373696f6e73 +<= 9000 +=> e01a00ff070305746f6b656e +<= 9000 +=> e01a00ff09422006616d6f756e74 +<= 9000 +=> e01e010000 +<= 9000 +=> e01c00000c454950373132446f6d61696e +<= 9000 +=> e01c00ff0900075065726d697432 +<= 9000 +=> e01c00ff03000101 +<= 9000 +=> e01c00ff160014000000000022d473030f116ddee9f6b43ac78ba3 +<= 9000 +=> e01e000f671e556e697377617058204578636c7573697665204475746368204f72646572094630440220133222a33ac1797d287d213d9af3292534915e481edbc9002d4f1ec91452ad4902203223d57b5284dea9497286becc5aeef54760fb7a64b12019175f9df90f40c3fe +<= 9000 +=> e01c0000195065726d69745769746e6573735472616e7366657246726f6d +<= 9000 +=> e00a0000680457455448c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000012000000013045022100c6352418d00f7326b8f0b66c71c5d09f306e0ece00493cba9ea8ea177b4a48ed0220646631a1c683daceac152037e79142ee8c328cd37c83a78ecb805e138e3f3af7 +<= 009000 +=> e01e00fd48004630440220087564cbfcaa383760331291b08e940b137d5ab7e6585fd21460ff8a2bc962a202202039dc9e8a9175ac7d397268f600e4cc34d8692548e893aba315a83eb6b3764f +<= 9000 +=> e01c00ff160014c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 +<= 9000 +=> e01e00fe5a10416d6f756e7420616c6c6f77616e636500473045022100f81546f3be85c23f4f4583b225ee650cf183aa463236c43305a93090a2472ccd02201b6ff2a84877caee2f49a694ab8f3b163d055f28e0789496300fb01c7fda6157 +<= 9000 +=> e01c00ff0a0008016345785d8a0000 +<= 9000 +=> e01e00ff5a12417070726f766520746f207370656e64657246304402203a66cd6d84b6b24faeba9a5049dce8f43591e028214bd133de39f73c6fc5ce89022072a91ff94c52aaed99b6f09a98251b6a25a301755c961e8801a79a466129ee3f +<= 9000 +=> e01c00ff1600146000da47483062a0d734ba3dc7576ce6a0b645c4 +<= 9000 +=> e01c00ff220020046832d5460b1e3ded505a7b75452a48a1ef52283c2dd2afd878e8a0bdefcb01 +<= 9000 +=> e01e00fc570f417070726f76616c2065787069726546304402206f7d715a5486e518edca9ada72137cbbb52192e4be80b5b34c8345485b5cfd470220304e412971df7c7fb62f4b33435bbed359abc760c16eab35c82dce6ce59f6ab1 +<= 9000 +=> e01c00ff060004666dba18 +<= 9000 +=> e01c00ff1600146000da47483062a0d734ba3dc7576ce6a0b645c4 +<= 9000 +=> e01c00ff160014224cbc440944c72e951507e97d8bf5ffa2e3d2b9 +<= 9000 +=> e01c00ff220020046832d5460b1e3ded505a7b75452a48a1ef52283c2dd2afd878e8a0bdefcb01 +<= 9000 +=> e01c00ff060004666dba18 +<= 9000 +=> e01c00ff1600140000000000000000000000000000000000000000 +<= 9000 +=> e01c00ff020000 +<= 9000 +=> e01c00ff060004666db9d0 +<= 9000 +=> e01c00ff060004666dba0c +<= 9000 +=> e01c00ff160014ff8ba4d1fc3762f6154cc942ccf30049a2a0cec6 +<= 9000 +=> e01c00ff03000164 +<= 9000 +=> e00a0000680457455448c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000012000000013045022100c6352418d00f7326b8f0b66c71c5d09f306e0ece00493cba9ea8ea177b4a48ed0220646631a1c683daceac152037e79142ee8c328cd37c83a78ecb805e138e3f3af7 +<= 019000 +=> e01e00fd4801463044022001b973eae56269f1973398aa53db8e2bba657d81bda9f772bd1103884fb63b950220073ca0844bf7d613b51a96e01a22f5b34f3a5fe4f45ed98d2c45314e5f2eea71 +<= 9000 +=> e01c00ff160014c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 +<= 9000 +=> e01e00fe5107546f207377617001473045022100dfd4251280d6c2f5cedd28eecd270d6140a9642456c8de317d288493d478e87f02201cfd53b321b426eb0d28e879af1ce9dd59259b9f5bfe3d7e165efa7a5f200b88 +<= 9000 +=> e01c00ff0a0008016345785d8a0000 +<= 9000 +=> e01c00ff0a0008016345785d8a0000 +<= 9000 +=> e01c000f0102 +<= 9000 +=> e01e00ff5911546f6b656e7320746f207265636569766546304402200518911aed49f8972b543fa71c3ccf0d3029800fff13ce27bb2981f19d3bdc4902200a7cb06951e60c69e4c7c41717687e47f2a1d49f04f82eb4bb19de2abc9d8ee8 +<= 9000 +=> e01c00ff160014a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 +<= 9000 +=> e01c00ff06000414c6caa7 +<= 9000 +=> e01e00ff621a4d696e696d756d20616d6f756e747320746f20726563656976654630440220095fc59a5c1b65fb19886025eff26d4627d574489a2d41e1050105c1579da4e102206c3f08ee24c44c87eb0e513c42ff65ba4875ae3603f7f5245b0aa5f85a8c6ac2 +<= 9000 +=> e01c00ff06000413d0d0ac +<= 9000 +=> e01e00ff550c4f6e20416464726573736573473045022100f5787e5fc18bc219b57473e67254c174f39343a27ee990b19b23dc675cc2b4f30220161eea61a585d8669db6b82c707401e505e252e1927edae7c3f452d4bd4c5ca7 +<= 9000 +=> e01c00ff160014224cbc440944c72e951507e97d8bf5ffa2e3d2b9 +<= 9000 +=> e01e00ff5911546f6b656e7320746f207265636569766546304402200518911aed49f8972b543fa71c3ccf0d3029800fff13ce27bb2981f19d3bdc4902200a7cb06951e60c69e4c7c41717687e47f2a1d49f04f82eb4bb19de2abc9d8ee8 +<= 9000 +=> e01c00ff160014a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 +<= 9000 +=> e01c00ff0500030d548e +<= 9000 +=> e01e00ff621a4d696e696d756d20616d6f756e747320746f20726563656976654630440220095fc59a5c1b65fb19886025eff26d4627d574489a2d41e1050105c1579da4e102206c3f08ee24c44c87eb0e513c42ff65ba4875ae3603f7f5245b0aa5f85a8c6ac2 +<= 9000 +=> e01c00ff0500030cb6bd +<= 9000 +=> e01e00ff550c4f6e20416464726573736573473045022100f5787e5fc18bc219b57473e67254c174f39343a27ee990b19b23dc675cc2b4f30220161eea61a585d8669db6b82c707401e505e252e1927edae7c3f452d4bd4c5ca7 +<= 9000 +=> e01c00ff16001427213e28d7fda5c57fe9e5dd923818dbccf71c47 +<= 9000 +=> e00c000115058000002c8000003c800000000000000000000000 +<= 1b63e951154de94e9f81ecefa38c0f11c2e4a9bfbaa3524b6c9744161211d6cc3b62480171ceb1f39f2c41ff06a2ecd483c0faaaf459063b278c09803b8bef3e4d9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/17-filtered.apdus deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/18-filtered-v1.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/18-filtered-v1.apdus index ffd362e24794..f4dbc77b8a54 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/18-filtered-v1.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/18-filtered-v1.apdus @@ -26,7 +26,7 @@ <= 9000 => e01a00ff0e42200b6d616b6572547261697473 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -38,33 +38,33 @@ <= 9000 => e01c00ff160014111111125421ca6dc452d289314280a0f8842a65 <= 9000 -=> e01e000f540b31696e6368204f72646572064630440220295e0aeb17ca0929b2a94c324d67d0b5528aba268177f3ac297b563141e0002702203ac360d9fd0c9c0c12279d1e73bea5d549a1e8141f454d88fbe1e8ef970e6802 +=> e01e000f540b31696e6368204f726465720646304402206cfe6a9208d04c77b8791386f5fcbb70756bdcdde0a0c20e7339bf571fcffec1022060361f073a31b833dc2f4c4064e2a2bb060f52a58db0e966b2e87a02bf01ea50 <= 9000 => e01c0000054f72646572 <= 9000 => e01c00ff220020e26b9977a477a09114d8b36effd41bd0dcef1df7944a0451599b62e5d94880c8 <= 9000 -=> e01e00ff4d0446726f6d473045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44 +=> e01e00ff4c0446726f6d46304402200b8b50b3b13c63d2cc6242ad5644dc5f20bc919f57e266293824d0f555a20ae202206626bf02d487f4496c7423760ce4ed0de810bc11ee207ceec8b66d6c2de7bf9d <= 9000 => e01c00ff1600146cbcd73cd8e8a42844662f0a0e76d7f79afd933d <= 9000 -=> e01e00ff4a02546f46304402205c5b1740d2e74513a9332e3160ebfe5996186c68141055a95d733d51eb51dff402201a1e085dcd9487bdabe9e04426cd8b043c5bf158843fed944affdeef0768ad43 +=> e01e00ff4a02546f463044022020eb170b9844e3c6c3b61d34887bb3a3acb4ea9f8ac01600927f8e83916020cf0220603cbbdf91a5488a63673343279030cc04c477ec6a558c10d4507c71b4da3881 <= 9000 => e01c00ff160014d8da6bf26964af9d7eed9e03e53415d37aa96045 <= 9000 -=> e01e00ff4c0453656e6446304402201500b44b1eb5b016ebe5bd7d5cc74b011544b357411a608c3a9f14f259ccfd1c0220617cdeaf7b72edc69aa4ce33828b2ae1bf9d80f62af064ed206d348de5ce67dc +=> e01e00ff4c0453656e6446304402201e1dd801072f94f61704adaacb9ea01dd21458c9de339002225d172d2b5b9a3c0220778208c477b131762c2b9fca09bd1f0eb7ae584842315fa8d769ea68a483d3c9 <= 9000 => e01c00ff1600142791bca1f2de4661ed88a30c99a7a9449aa84174 <= 9000 -=> e01e00ff570f52656365697665206d696e696d756d46304402203329dae6e283d1b00829fd0fdbd4f753ebdf2bd911183af250bacc80341dd3d302205de19c3a200b3e49597a9f02664a262827a64e28d8f24b37808c7c78f727588b +=> e01e00ff580f52656365697665206d696e696d756d473045022100ef1b0a3e910d423c86a5e73967d7d8825556c6a368e4b6cc33c8daf81e128925022054dd1af1b80e7eacbbab74ab07ab7ea8a4b7545349783da60ad60440e4669823 <= 9000 => e01c00ff1600140d500b1d8e8ef31e21c99d1db9a6444d3adf1270 <= 9000 -=> e01e00ff4d0453656e64473045022100b1df6581805f596ed6ead231bad279f2f512ed1fffdc2ff082c381b63b5eeb7a02201363fe8f5b9904f338bc1e7d2dc9adece3d33c224c68f2fd669dd943ccd32080 +=> e01e00ff4c0453656e64463044022071e175465cd3d6857aa51d30290891ac3a9e8593596173a659dcc1ab3c4654dd0220291d813961ed5b08e62e13fa7267b13337a85fd7eaf5667b6d7604dfe6b5207b <= 9000 => e01c00ff06000417d78400 <= 9000 -=> e01e00ff570f52656365697665206d696e696d756d463044022019d6a6cd953447adf2cb0202ecfb0282d3d4bee6aec4c1a2a14e1e8a1e7f732b02201dd3a8b47cda33159a331335c5ac1136e36b5d8e4b29edd99f65cdaf5f5e0c4a +=> e01e00ff570f52656365697665206d696e696d756d4630440220036abcafa7461d22947f975a4376b1662ae641a19f2764cd4096267ba7e41eea0220211f14028774e1ec57837c27d390c110d50ba3421a7fa7e5c17cc6b9d1dde726 <= 9000 => e01c00ff0b000925a57ffab9586a22a8 <= 9000 diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/18-filtered-v2.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/18-filtered-v2.apdus index 102c1a8edf55..49939558949a 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/18-filtered-v2.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/18-filtered-v2.apdus @@ -26,7 +26,7 @@ <= 9000 => e01a00ff0e42200b6d616b6572547261697473 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -38,37 +38,37 @@ <= 9000 => e01c00ff160014111111125421ca6dc452d289314280a0f8842a65 <= 9000 -=> e01e000f540b31696e6368204f72646572064630440220295e0aeb17ca0929b2a94c324d67d0b5528aba268177f3ac297b563141e0002702203ac360d9fd0c9c0c12279d1e73bea5d549a1e8141f454d88fbe1e8ef970e6802 +=> e01e000f540b31696e6368204f726465720646304402206cfe6a9208d04c77b8791386f5fcbb70756bdcdde0a0c20e7339bf571fcffec1022060361f073a31b833dc2f4c4064e2a2bb060f52a58db0e966b2e87a02bf01ea50 <= 9000 => e01c0000054f72646572 <= 9000 => e01c00ff220020e26b9977a477a09114d8b36effd41bd0dcef1df7944a0451599b62e5d94880c8 <= 9000 -=> e01e00ff4d0446726f6d473045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44 +=> e01e00ff4c0446726f6d46304402200b8b50b3b13c63d2cc6242ad5644dc5f20bc919f57e266293824d0f555a20ae202206626bf02d487f4496c7423760ce4ed0de810bc11ee207ceec8b66d6c2de7bf9d <= 9000 => e01c00ff1600146cbcd73cd8e8a42844662f0a0e76d7f79afd933d <= 9000 -=> e01e00ff4a02546f46304402205c5b1740d2e74513a9332e3160ebfe5996186c68141055a95d733d51eb51dff402201a1e085dcd9487bdabe9e04426cd8b043c5bf158843fed944affdeef0768ad43 +=> e01e00ff4a02546f463044022020eb170b9844e3c6c3b61d34887bb3a3acb4ea9f8ac01600927f8e83916020cf0220603cbbdf91a5488a63673343279030cc04c477ec6a558c10d4507c71b4da3881 <= 9000 => e01c00ff160014d8da6bf26964af9d7eed9e03e53415d37aa96045 <= 9000 -=> e00a00006704555344432791bca1f2de4661ed88a30c99a7a9449aa841740000000600000089304402200ef170e3f0a71b03ad7758e201d9861102f78cabcbbc5dbfecc5a946236438c7022043c591264f57cf3026f12f98e9b5112d2dd2e7b2d6c04206ace2475ed21e80f4 +=> e00a00006704555344432791bca1f2de4661ed88a30c99a7a9449aa8417400000006000000893044022063c521ab0bf0b898f494b60e9c54c1a982893066654da5d9dcd2b91f84bd9cd602200fe0aa7032fd31609f7f36e895b8b5a160132ffe4fdc5d5858fbeb2c668b1b4d <= 009000 -=> e01e00fd48004630440220015921d09f25c9affdb99c858b4ed07cab1a8c81674094bbc35720303a676d7b02201fc7c60bacf6d32d89d3196801d5c8bed45156d6a012f222deee6aa4d9e37d8f +=> e01e00fd480046304402204c2f225cf542e142dede6da5e51216053023e093748b457be37168ed87d63d4d022018cf762c9f6fe16d30899decb58037abb7c11f115f8b550c08b1f4005d444461 <= 9000 => e01c00ff1600142791bca1f2de4661ed88a30c99a7a9449aa84174 <= 9000 -=> e00a00006a06574d415449430d500b1d8e8ef31e21c99d1db9a6444d3adf12700000001200000089304502210083ae7e7508bbe06a1b6c59543e62a3dcb2e825a6c39c1adc9ccd439253ac7f4d02201f60dcd93ad430b79b4b0b39571f5f15988233c04e5d2e45a4ecce1639fabf07 +=> e00a00006906574d415449430d500b1d8e8ef31e21c99d1db9a6444d3adf12700000001200000089304402203353385a6c21a8b0be403e4d832a53201a4ac9c48f16987799d3134a6eb487190220408793d6e82ca08643ec9ff91d97fa5a627dc86fc245dbe2f3c2eb71ca0cf417 <= 019000 -=> e01e00fd4901473045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28 +=> e01e00fd480146304402204d6075e9943d3a692612d07658a28361f389c1fc2d82ac2515526789e26d562b022015b1b2df1d1add3c686459ab0956559b77ffd2e3d0dc0a7178bc6ee185c6d5cc <= 9000 => e01c00ff1600140d500b1d8e8ef31e21c99d1db9a6444d3adf1270 <= 9000 -=> e01e00fe4e0453656e6400473045022100caf1b5544825ee057566f9adc1c9ce4c4063936114c89b2a003ae42b2df0ed6f022059c98d1dfd79b83f325cf2e787d66b18c28413c66e8d805463e077ec534f7609 +=> e01e00fe4e0453656e640047304502210091612542ceb9c385829f068e290f24c3375ebe0a990fbc67bd1543410c01497a02201cb25ec9aa00fc327d08fabb8946c151dfbb94ec8dcf6c48b90d367e17f0d7eb <= 9000 => e01c00ff06000417d78400 <= 9000 -=> e01e00fe590f52656365697665206d696e696d756d01473045022100a59dc479a838a813909c140a15e6b65bc58c5633284bf973c436de5a592634e202201e038fc7995d939fccd546e4c85e793c0ad451216e36a4edfc7bce5be27808cb +=> e01e00fe590f52656365697665206d696e696d756d01473045022100f00a9be55f05be21fc8206b025683f32558827ba42b3fea4ab09b2a9a5fb3b68022066ec1859e1ecee756a1f1b02d9056b68cd5cc5dd2390f5f4a4e7c1f0564dd7f0 <= 9000 => e01c00ff0b000925a57ffab9586a22a8 <= 9000 diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/2-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/2-filtered-v1.apdus similarity index 78% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/2-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/2-filtered-v1.apdus index d38dfdb00b61..42ae591289a0 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/2-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/2-filtered-v1.apdus @@ -58,7 +58,7 @@ <= 9000 => e01a00ff084220056e6f6e6365 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -70,17 +70,17 @@ <= 9000 => e01c00ff1600147f268357a8c2552623316e2562d90e642bb538e5 <= 9000 -=> e01e000f540a4d6163652057696e64750447304502205098e783a362b1e3d33ae4d8a6ad4073dd5ad97da72d7ffe6ad41af17869a1f0022100c50ba9335788f82a2ef6d0d5e8b29ea83990346cccb73e887398b0a72ed4a2a1 +=> e01e000f530a4d6163652057696e647504463044022073cc8d51f50a641c5f649816afe149d68b4fe1991184d589bc11512b83fd0e6c0220520a66870d5a2965ffbbae7bf834ea2d66a45ebd92b28b44b675ed0538507b75 <= 9000 => e01c0000054f72646572 <= 9000 => e01c00ff1600147f268357a8c2552623316e2562d90e642bb538e5 <= 9000 -=> e01e00ff4e054d616b65724730450220476cc3309dd8104c87102df5fda3c6a760492676c2da3a9f4b4763156c97cf31022100bdaee8bcce4123b59d177ff9e15acfdc8d9a4286b4812479a0f3667ed5cefa4f +=> e01e00ff4d054d616b6572463044022045440d9956eab04674470ecf319d5957997088afccad4ac24f4c2938f4527d10022051273e6710f1487fc02c178c8705817432994b87b1557d036f8df156443a6c10 <= 9000 => e01c00ff160014112f0732e59e7600768dfc35ba744b89f2356cd8 <= 9000 -=> e01e00ff4e0554616b6572473045022100ad6d6a772ddea2ad4ed7f1e2799846f8d520200418fb435eeb34ea35c46c445502200e602c58f398e5eefa8eef759940ceafd51bdc79b85b5b510dd48dccafe0660c +=> e01e00ff4e0554616b6572473045022100edb53ae572766258aafd3c1b2fd646a188b675ed6d7c2e91d4f30196074fc9300220521129fc3b4d7ff6a4a862a7e3b12c936da8e2f2d62eaf058d56738ded66bde2 <= 9000 => e01c00ff1600140000000000000000000000000000000000000000 <= 9000 @@ -118,7 +118,7 @@ <= 9000 => e01c00ff1600140000000000000000000000000000000000000000 <= 9000 -=> e01e00ff530a42617365205072696365473045022100dfead31f8603678ae2eed97f0ea35963f7a00701067be4a58a9c95a03ce73c7702200ed8e835bfbfd336cc047341e7782c0e917ebc4768bdb59b594bf7edbf71885f +=> e01e00ff530a42617365205072696365473045022100909a48f16e71b423a7e7109d8fc513a8a3b6cc038e103aa957f081a4cb39c137022002c7792cbeaacffad1376f5cc0463c2e2f3c28fbf349ba22e5ae4abeb281b1ad <= 9000 => e01c00ff0a00081bc16d674ec80000 <= 9000 @@ -126,7 +126,7 @@ <= 9000 => e01c00ff060004621419fd <= 9000 -=> e01e00ff570f45787069726174696f6e2054696d6546304402207221ee5c1ad62447ae56bc01dd27057bdfd1e807deeaa335f225bc080b9f304f022030a6b8e6eb42287f757e3eac9695abfc68f31c8c358dbd814a4df62bb547ff1d +=> e01e00ff580f45787069726174696f6e2054696d65473045022100963ea1d26292e612d6e1657d3613efceb4287e121ce86c9e9430f7ad98adc19f02206507c40721500c3a5b15aa342767c3e01708b37feab8b3283c61ce951902d31d <= 9000 => e01c00ff060004621d54db <= 9000 @@ -135,4 +135,4 @@ => e01c00ff03000100 <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1c5e729ca9970c6436cfb23d50b93c5674aa87adeed4010d89a8e9926732e012fa5bb260889e3bacdb322c46343bc38366b0456d36b16a452317f1361cd9ed9e9b9000 \ No newline at end of file +<= 1b1539547ae7cf8ebcd3eabfb57cd2b1fb7775ce757c3f4a307c7425d35b7bfff747248cb61e554c1f90af6331d9c9e51cbb8655667514194f509abe097a0323199000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/3-filtered-v1.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/3-filtered-v1.apdus new file mode 100644 index 000000000000..6be8e9851626 --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/3-filtered-v1.apdus @@ -0,0 +1,60 @@ +=> e01a00000c454950373132446f6d61696e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a00ff09050776657273696f6e +<= 9000 +=> e01a00ff0a422007636861696e4964 +<= 9000 +=> e01a00ff130311766572696679696e67436f6e7472616374 +<= 9000 +=> e01a0000044d61696c +<= 9000 +=> e01a00ff06030466726f6d +<= 9000 +=> e01a00ff0683010002746f +<= 9000 +=> e01a00ff0a0508636f6e74656e7473 +<= 9000 +=> e01a00ff054220026964 +<= 9000 +=> e01e010000 +<= 9000 +=> e01c00000c454950373132446f6d61696e +<= 9000 +=> e01c00ff0c000a4574686572204d61696c +<= 9000 +=> e01c00ff03000131 +<= 9000 +=> e01c00ff0400020504 +<= 9000 +=> e01c00ff160014cccccccccccccccccccccccccccccccccccccccc +<= 9000 +=> e01e000f4e04596f64610447304502210082879b74f069c55b3785dad1667203fc35a4265f30d02b0f73643abb6b9bc0d002203c538793004a4adecde735f9397887ac7ea1ac22e04d8e5d29ebf7b438ce31a2 +<= 9000 +=> e01c0000044d61696c +<= 9000 +=> e01e00ff4e0653656e64657246304402207521eb52ad759e37117db390d1b71838dbdcc9191b28c7030a5dcc44321e075b02207266ddebda9ed2b254dafff991c6b016956265b1672df98db2085c52b49cffd2 +<= 9000 +=> e01c00ff160014cd2a3d9f938e13cd947ec05abc7fe734df8dd826 +<= 9000 +=> e01c000f0102 +<= 9000 +=> e01e00ff530a526563697069656e7473473045022100d55e2a2ac4cf2f0c0fc9ef822b69176e22b7c8bc7c9fc2ea417ea84e1c164c3902204ceffd11ba5979d767b9ded852705ec41e3133e3d95a7188e9039b038288509c +<= 9000 +=> e01c00ff160014b0bdabea57b0bdabea57b0bdabea57b0bdabea57 +<= 9000 +=> e01e00ff530a526563697069656e7473473045022100d55e2a2ac4cf2f0c0fc9ef822b69176e22b7c8bc7c9fc2ea417ea84e1c164c3902204ceffd11ba5979d767b9ded852705ec41e3133e3d95a7188e9039b038288509c +<= 9000 +=> e01c00ff160014b1a22cc48f6784f629a994917cd6474923630c48 +<= 9000 +=> e01e00ff50074d657373616765473045022100eec10ea4eb0846466871a8d256dde530b17b404fe7722736282c425e964762a702205f60d8e7760c16a8502caeec97ac17b224353cdaac115d09aa5e071917ea43c2 +<= 9000 +=> e01c00ff0d000b48656c6c6f2c20426f6221 +<= 9000 +=> e01e00ff591048656c6c6f2074686973206973204944473045022100c57245b7832fb5cbae86bd35b3dd4c9f93a88b903285bc18f0db67a7133a29990220500b475c779985dd222b64cd76f93d6e08aefc21f356d29762c5b31da281ee93 +<= 9000 +=> e01c00ff03000107 +<= 9000 +=> e00c000115058000002c8000003c800000000000000000000000 +<= 1b5677fec212710c03127cc58c2b0ce31885f6147bc807cdd94de1343c1396d4526624ddd7e50c1185f91d80ce4ef7adc96adb8c73e74cd8cb5087a44d3a134c8f9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/3-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/3-filtered.apdus deleted file mode 100644 index 2ba272be9170..000000000000 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/3-filtered.apdus +++ /dev/null @@ -1,60 +0,0 @@ -=> e01a00000c454950373132446f6d61696e -<= 9000 -=> e01a00ff0605046e616d65 -<= 9000 -=> e01a00ff09050776657273696f6e -<= 9000 -=> e01a00ff0a422007636861696e4964 -<= 9000 -=> e01a00ff130311766572696679696e67436f6e7472616374 -<= 9000 -=> e01a0000044d61696c -<= 9000 -=> e01a00ff06030466726f6d -<= 9000 -=> e01a00ff0683010002746f -<= 9000 -=> e01a00ff0a0508636f6e74656e7473 -<= 9000 -=> e01a00ff054220026964 -<= 9000 -=> e01e000000 -<= 9000 -=> e01c00000c454950373132446f6d61696e -<= 9000 -=> e01c00ff0c000a4574686572204d61696c -<= 9000 -=> e01c00ff03000131 -<= 9000 -=> e01c00ff0400020504 -<= 9000 -=> e01c00ff160014cccccccccccccccccccccccccccccccccccccccc -<= 9000 -=> e01e000f4d04596f64610446304402204a67f5c38317705c31acd936153d627756202370e6412bea13cd43e3cd7d5da802200e8debc34e70160ccc192e92d720d42399faad243740673e945ab3438f6a2ff6 -<= 9000 -=> e01c0000044d61696c -<= 9000 -=> e01e00ff4f0653656e6465724730450220277c73383cfe014c12504b991339378123b9a339f005470060747b8ddb2ecfb1022100e29196c745c3b3fb4b6eab097e8972f06a390a2d31ff8deafde2f4ab4bb47392 -<= 9000 -=> e01c00ff160014cd2a3d9f938e13cd947ec05abc7fe734df8dd826 -<= 9000 -=> e01c000f0102 -<= 9000 -=> e01e00ff530a526563697069656e747347304502203f4c1125e3133841e17fb6b579b69c4274d38eb2ca363cb0a2c52b30c52a53f7022100bbd38ad455363801af516ad7fc2dccbdf163cc547d1476113928c23079c67bcd -<= 9000 -=> e01c00ff160014b0bdabea57b0bdabea57b0bdabea57b0bdabea57 -<= 9000 -=> e01e00ff530a526563697069656e747347304502203f4c1125e3133841e17fb6b579b69c4274d38eb2ca363cb0a2c52b30c52a53f7022100bbd38ad455363801af516ad7fc2dccbdf163cc547d1476113928c23079c67bcd -<= 9000 -=> e01c00ff160014b1a22cc48f6784f629a994917cd6474923630c48 -<= 9000 -=> e01e00ff50074d65737361676547304502206cc88eb3eab3b55d5e6358d46e0fbbaefbd1590d01e77396a15a9f7887bbaaae02210080fab66195f75656134c67007761abfcc207afc075aaf3894e30fdf29e3daa7d -<= 9000 -=> e01c00ff0d000b48656c6c6f2c20426f6221 -<= 9000 -=> e01e00ff591048656c6c6f20746869732069732049444730450221008dcd615a78440f0ce412717d47903f71b7e0131766a72ef6ab189b02af36ac2802205f9ad7f6688f6e36f96442202f2d9f46532319ebf5f12ba3c92ca263ff08143a -<= 9000 -=> e01c00ff03000107 -<= 9000 -=> e00c000115058000002c8000003c800000000000000000000000 -<= 1ca032f358f76041e239d34a449d859742d79ede0705e294552e68c6f6345cd9a65d14e1607eca346db7a1b4ded81c8dcc82821a8f2ceb24803b611095cf68d3209000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/4-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/4-filtered-v1.apdus similarity index 78% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/4-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/4-filtered-v1.apdus index 69be3f74b241..9054cc138760 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/4-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/4-filtered-v1.apdus @@ -40,7 +40,7 @@ <= 9000 => e01a00ff06070464617461 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -52,11 +52,11 @@ <= 9000 => e01c00ff1600149757f2d2b135150bbeb65308d4a91804107cd8d6 <= 9000 -=> e01e000f4e04426f62610247304502202f9e99e99544e9971c6e8c1f58901debd762fc96b6c388c24e921a72f3588a4a022100a9f80217965c99362424017d0fedfd25060fd4e5aae2daf85ac8cbef033fe7e2 +=> e01e000f4e04426f626102473045022100ff890837754849bac57d6109f2dcc05a6222417501e7dea899865af11a12f0ca02204dac269e4c9e4c4496c5bcc958477dd808a30a29aa87382a3d130545574a3f87 <= 9000 => e01c0000054f72646572 <= 9000 -=> e01e00ff4e054d616b6572473045022100a2dd1bab1c723f5c4978ddfc3416bc32a3e665e1a2a798061ace5a171a821e66022012cd32cbb142b366548c46c0ae4688a174da5f63ece1ac88db5e9d82627daf8e +=> e01e00ff4d054d616b657246304402201c4ce72a81bf1808ba5b0c797eccfbb625d673f817c73c0532cc57863c94447302205321f3c48855d22caf3e81c5de27d87a5175369fdaa3940054d3e33b73bb60ea <= 9000 => e01c00ff160014112f0732e59e7600768dfc35ba744b89f2356cd8 <= 9000 @@ -66,7 +66,7 @@ <= 9000 => e01c00ff03000101 <= 9000 -=> e01e00ff4f0554616b6572483046022100cb5a8695a4c498dfd5e44b6af9238efb7baed439870b7534c81fd70cea8d4b23022100a49eec86927485697a41362455972926a7b6312ad78c1352f3051b69c1dc4f4f +=> e01e00ff4d0554616b6572463044022100ff48fa8b4c0269b9029d758e6af195a3e9891938fb49bc9a702bd7b0afb98ba0021f5249c69cc859839101abdee4a173c85606a1c2a0a0c63ebdfc8619a1f51328 <= 9000 => e01c00ff1600140000000000000000000000000000000000000000 <= 9000 @@ -89,4 +89,4 @@ => e01c00ff030000fa <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1bc5de7830122a8f8cb769bc22b5c1a1ff56e5afa820125b6d67ac6813614099461bf9da83833f445e80a5aa1b04afe62b66f8210cf4ce77281d98dc9596af32949000 \ No newline at end of file +<= 1c341bca1c0dfd805d4befc21500084424dbe559c7aafd78d8fb461c0c76dfea1d33ebb7b6fe0691961cd8b263faac20ecbbdcaef3febb57eb76614cad629080ea9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/5-filtered-v1.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/5-filtered-v1.apdus new file mode 100644 index 000000000000..c0edd0a825e5 --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/5-filtered-v1.apdus @@ -0,0 +1,176 @@ +=> e01a00000c454950373132446f6d61696e +<= 9000 +=> e01a00ff0605046e616d65 +<= 9000 +=> e01a0000114c44505369676e696e6752657175657374 +<= 9000 +=> e01a00ff0e850201030008646f63756d656e74 +<= 9000 +=> e01a00ff0b85020001040570726f6f66 +<= 9000 +=> e01a00ff0ec201040000000006646570746879 +<= 9000 +=> e01e010000 +<= 9000 +=> e01c00000c454950373132446f6d61696e +<= 9000 +=> e01c00ff1200104569703731324d6574686f6432303231 +<= 9000 +=> e01e000f4e045232443203473045022100ab5dc977a4b06ad45aa15497fe6dbde7104392c4cb8cec5204cd7f0fdc12adff022072b90de52f617c88b2d31cc31ff7a944997e9d626727f4ebaff73e5b19f8217d +<= 9000 +=> e01c0000114c44505369676e696e6752657175657374 +<= 9000 +=> e01c000f0105 +<= 9000 +=> e01c000f0103 +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff3c003a3c6469643a6b65793a7a364d6b67466e6561614d6a4e367a7962714c4e5867743459666d567832585a687a506444796b345a4b38316461485a3e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff2d002b3c68747470733a2f2f7777772e77332e6f72672f54522f6f776c2d7265662f2373616d6541732d6465663e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff370035226469643a657468723a30786637333938626163663631306262346533623536373831313237396663623363343139313966383922 +<= 9000 +=> e01c000f0103 +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff31002f3c75726e3a757569643a31346162363034372d626632642d346664652d393536342d3531646561643132366666623e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff3900373c68747470733a2f2f7777772e77332e6f72672f323031382f63726564656e7469616c732363726564656e7469616c5375626a6563743e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff3c003a3c6469643a6b65793a7a364d6b67466e6561614d6a4e367a7962714c4e5867743459666d567832585a687a506444796b345a4b38316461485a3e +<= 9000 +=> e01c000f0103 +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff31002f3c75726e3a757569643a31346162363034372d626632642d346664652d393536342d3531646561643132366666623e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff3400323c68747470733a2f2f7777772e77332e6f72672f323031382f63726564656e7469616c732369737375616e6365446174653e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff49004722323032312d30332d30345432313a30383a32322e3631355a225e5e3c687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61236461746554696d653e +<= 9000 +=> e01c000f0103 +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff31002f3c75726e3a757569643a31346162363034372d626632642d346664652d393536342d3531646561643132366666623e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff2e002c3c68747470733a2f2f7777772e77332e6f72672f323031382f63726564656e7469616c73236973737565723e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff3700353c6469643a657468723a3078663733393862616366363130626234653362353637383131323739666362336334313931396638393e +<= 9000 +=> e01c000f0103 +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff31002f3c75726e3a757569643a31346162363034372d626632642d346664652d393536342d3531646561643132366666623e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff3300313c687474703a2f2f7777772e77332e6f72672f313939392f30322f32322d7264662d73796e7461782d6e7323747970653e +<= 9000 +=> e01e00ff5008446f63756d656e744630440220048c28c88191b962fbd365e6545490a3ced9d48b3bc4703ba99b2ffeffa2584202200847b0e3636d8ed2d2966f8e87e76f7b29c4a5705f34caa3723012d92c29d249 +<= 9000 +=> e01c00ff3c003a3c68747470733a2f2f7777772e77332e6f72672f323031382f63726564656e7469616c732356657269666961626c6543726564656e7469616c3e +<= 9000 +=> e01c000f0104 +<= 9000 +=> e01c000f0103 +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff0900075f3a6331346e30 +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff2400223c687474703a2f2f7075726c2e6f72672f64632f7465726d732f637265617465643e +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff49004722323032312d30332d30345432313a30383a32322e3631365a225e5e3c687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61236461746554696d653e +<= 9000 +=> e01c000f0103 +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff0900075f3a6331346e30 +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff2a00283c68747470733a2f2f773369642e6f72672f73656375726974792370726f6f66507572706f73653e +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff2d002b3c68747470733a2f2f773369642e6f72672f736563757269747923617373657274696f6e4d6574686f643e +<= 9000 +=> e01c000f0103 +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff0900075f3a6331346e30 +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff30002e3c68747470733a2f2f773369642e6f72672f736563757269747923766572696669636174696f6e4d6574686f643e +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff4800463c6469643a657468723a307866373339386261636636313062623465336235363738313132373966636233633431393139663839234569703731324d6574686f64323032313e +<= 9000 +=> e01c000f0103 +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff0900075f3a6331346e30 +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff3300313c687474703a2f2f7777772e77332e6f72672f313939392f30322f32322d7264662d73796e7461782d6e7323747970653e +<= 9000 +=> e01e00ff4e0550726f6f664730450221009107ff404875b9ae10e71898c72cbd9d0a377226400837dcd01f46ef03ca33c202207cdbbfdd440c2abebed092ffdbee847aafcd54279e7e889a372a6ea1517220ef +<= 9000 +=> e01c00ff31002f3c68747470733a2f2f773369642e6f72672f7365637572697479234569703731325369676e6174757265323032313e +<= 9000 +=> e01c000f0101 +<= 9000 +=> e01c000f0101 +<= 9000 +=> e01c000f0102 +<= 9000 +=> e01c000f0102 +<= 9000 +=> e01e00ff4e054465707468473045022100a8957fb0acabb7b011250321403ca4cab82c03cc321aff2f9935e89b7ba6934402202ad7e3225f3f4a9099abef2af765949cbdef744cc912917e5978dc486cd3ee85 +<= 9000 +=> e01c00ff03000101 +<= 9000 +=> e01e00ff4e054465707468473045022100a8957fb0acabb7b011250321403ca4cab82c03cc321aff2f9935e89b7ba6934402202ad7e3225f3f4a9099abef2af765949cbdef744cc912917e5978dc486cd3ee85 +<= 9000 +=> e01c00ff03000102 +<= 9000 +=> e01c000f0101 +<= 9000 +=> e01e00ff4e054465707468473045022100a8957fb0acabb7b011250321403ca4cab82c03cc321aff2f9935e89b7ba6934402202ad7e3225f3f4a9099abef2af765949cbdef744cc912917e5978dc486cd3ee85 +<= 9000 +=> e01c00ff03000103 +<= 9000 +=> e00c000115058000002c8000003c800000000000000000000000 +<= 1ce42c7fad36f615a566be673ecbd0542f83addf76ffa97af30acda06b3443ceca72ca3cd5b3c9790e2a199c9d03342db7be374794d8bbffa2c4cb2aa1a16389e19000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/5-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/5-filtered.apdus deleted file mode 100644 index bfd82c7a0443..000000000000 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/5-filtered.apdus +++ /dev/null @@ -1,176 +0,0 @@ -=> e01a00000c454950373132446f6d61696e -<= 9000 -=> e01a00ff0605046e616d65 -<= 9000 -=> e01a0000114c44505369676e696e6752657175657374 -<= 9000 -=> e01a00ff0e850201030008646f63756d656e74 -<= 9000 -=> e01a00ff0b85020001040570726f6f66 -<= 9000 -=> e01a00ff0ec201040000000006646570746879 -<= 9000 -=> e01e000000 -<= 9000 -=> e01c00000c454950373132446f6d61696e -<= 9000 -=> e01c00ff1200104569703731324d6574686f6432303231 -<= 9000 -=> e01e000f4d045232443203463044022056df947a834ef2bf6502e3e1ce611a34ff1b959c0ae366c2d1c8c361077d5a2d022045e7f8afc13d6cde7da3e0d95d834c2ce2d7cab49483d96b14cc35f1150f7215 -<= 9000 -=> e01c0000114c44505369676e696e6752657175657374 -<= 9000 -=> e01c000f0105 -<= 9000 -=> e01c000f0103 -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff3c003a3c6469643a6b65793a7a364d6b67466e6561614d6a4e367a7962714c4e5867743459666d567832585a687a506444796b345a4b38316461485a3e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff2d002b3c68747470733a2f2f7777772e77332e6f72672f54522f6f776c2d7265662f2373616d6541732d6465663e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff370035226469643a657468723a30786637333938626163663631306262346533623536373831313237396663623363343139313966383922 -<= 9000 -=> e01c000f0103 -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff31002f3c75726e3a757569643a31346162363034372d626632642d346664652d393536342d3531646561643132366666623e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff3900373c68747470733a2f2f7777772e77332e6f72672f323031382f63726564656e7469616c732363726564656e7469616c5375626a6563743e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff3c003a3c6469643a6b65793a7a364d6b67466e6561614d6a4e367a7962714c4e5867743459666d567832585a687a506444796b345a4b38316461485a3e -<= 9000 -=> e01c000f0103 -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff31002f3c75726e3a757569643a31346162363034372d626632642d346664652d393536342d3531646561643132366666623e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff3400323c68747470733a2f2f7777772e77332e6f72672f323031382f63726564656e7469616c732369737375616e6365446174653e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff49004722323032312d30332d30345432313a30383a32322e3631355a225e5e3c687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61236461746554696d653e -<= 9000 -=> e01c000f0103 -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff31002f3c75726e3a757569643a31346162363034372d626632642d346664652d393536342d3531646561643132366666623e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff2e002c3c68747470733a2f2f7777772e77332e6f72672f323031382f63726564656e7469616c73236973737565723e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff3700353c6469643a657468723a3078663733393862616366363130626234653362353637383131323739666362336334313931396638393e -<= 9000 -=> e01c000f0103 -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff31002f3c75726e3a757569643a31346162363034372d626632642d346664652d393536342d3531646561643132366666623e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff3300313c687474703a2f2f7777772e77332e6f72672f313939392f30322f32322d7264662d73796e7461782d6e7323747970653e -<= 9000 -=> e01e00ff5008446f63756d656e74463044022045a0a7d7b9a85be7b63e17872f1155be77330e2b3da5c892bc22baf853f9de4d022050136b6b284c317158e9c83135c83d3d9a692acfbc2a2e12c460878b260a4b5b -<= 9000 -=> e01c00ff3c003a3c68747470733a2f2f7777772e77332e6f72672f323031382f63726564656e7469616c732356657269666961626c6543726564656e7469616c3e -<= 9000 -=> e01c000f0104 -<= 9000 -=> e01c000f0103 -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff0900075f3a6331346e30 -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff2400223c687474703a2f2f7075726c2e6f72672f64632f7465726d732f637265617465643e -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff49004722323032312d30332d30345432313a30383a32322e3631365a225e5e3c687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61236461746554696d653e -<= 9000 -=> e01c000f0103 -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff0900075f3a6331346e30 -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff2a00283c68747470733a2f2f773369642e6f72672f73656375726974792370726f6f66507572706f73653e -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff2d002b3c68747470733a2f2f773369642e6f72672f736563757269747923617373657274696f6e4d6574686f643e -<= 9000 -=> e01c000f0103 -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff0900075f3a6331346e30 -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff30002e3c68747470733a2f2f773369642e6f72672f736563757269747923766572696669636174696f6e4d6574686f643e -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff4800463c6469643a657468723a307866373339386261636636313062623465336235363738313132373966636233633431393139663839234569703731324d6574686f64323032313e -<= 9000 -=> e01c000f0103 -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff0900075f3a6331346e30 -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff3300313c687474703a2f2f7777772e77332e6f72672f313939392f30322f32322d7264662d73796e7461782d6e7323747970653e -<= 9000 -=> e01e00ff4f0550726f6f66483046022100940e7b62f50c6dfc4944e381e218bb928190978ff5b131cb942a5d96be59bd3402210086e99e21dfdd95d4c6e3414e3e58e4a693e928c46ffa21bc768a9027ef1bd09f -<= 9000 -=> e01c00ff31002f3c68747470733a2f2f773369642e6f72672f7365637572697479234569703731325369676e6174757265323032313e -<= 9000 -=> e01c000f0101 -<= 9000 -=> e01c000f0101 -<= 9000 -=> e01c000f0102 -<= 9000 -=> e01c000f0102 -<= 9000 -=> e01e00ff4d05446570746846304402207a5f12624b8f5f6628f64520246d31ac24893876a33010307f8b500d212088be02205ea516cde61a61d6dece3d33949b91bfebf31427e199b7c6f94746bb2e81b7d8 -<= 9000 -=> e01c00ff03000101 -<= 9000 -=> e01e00ff4d05446570746846304402207a5f12624b8f5f6628f64520246d31ac24893876a33010307f8b500d212088be02205ea516cde61a61d6dece3d33949b91bfebf31427e199b7c6f94746bb2e81b7d8 -<= 9000 -=> e01c00ff03000102 -<= 9000 -=> e01c000f0101 -<= 9000 -=> e01e00ff4d05446570746846304402207a5f12624b8f5f6628f64520246d31ac24893876a33010307f8b500d212088be02205ea516cde61a61d6dece3d33949b91bfebf31427e199b7c6f94746bb2e81b7d8 -<= 9000 -=> e01c00ff03000103 -<= 9000 -=> e00c000115058000002c8000003c800000000000000000000000 -<= 1c23c178dc4b78a8c6b6fc87c295927673b22862f7fbabebbeaa9b546e47c241a33efa002b0409d9538ad73638baa7dbe4d2dd760f278c84fbce81ff2c06dee3d59000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/6-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/6-filtered-v1.apdus similarity index 59% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/6-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/6-filtered-v1.apdus index 514ae13ffdc7..eb14c6c1d301 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/6-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/6-filtered-v1.apdus @@ -40,7 +40,7 @@ <= 9000 => e01a00ff0b8301000777616c6c657473 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -52,11 +52,11 @@ <= 9000 => e01c00ff160014cccccccccccccccccccccccccccccccccccccccc <= 9000 -=> e01e000f4e04433350300447304502203b0768bde7f99183d3687336d63e314ea6806bf125dfa9261d55b7319ee18fa3022100f9b711b626ec116318ef2ee2ac96a31746cd071c5caac3655adfcc1934161d51 +=> e01e000f4d04433350300446304402204a84b6192451644adf47eac6c022a92a4eb0fe33849a8db84d9979f35a3261470220704a2da9a4e9f5f438fec1aaf328a94ce0962c5bb2b2cbf7ce5a85af0552968a <= 9000 => e01c0000044d61696c <= 9000 -=> e01e00ff4f0653656e646572473045022100ced76e0e61411b1ef5642586834e29ae9189974ce4338a9a9a2516e43edbde7302200a36170372164d778f873a4f5e95923ab09f48ac0cb9fa106f7f7d097e891eb9 +=> e01e00ff4e0653656e646572463044022061102a17459e3eb33ea99f875a6e1a0bf32059752e858b8a714080c667d8adcb02204ed10e590bf7a29a417ca56b9484fc14d0a7c4f0d86e7ce24fb5ccf0556633c1 <= 9000 => e01c00ff050003436f77 <= 9000 @@ -70,7 +70,7 @@ <= 9000 => e01c000f0102 <= 9000 -=> e01e00ff5109526563697069656e74463044022100a9a05f12fbe643750f0c8a60b30dbc793077c2104dcf999a62303dba8458d65d021f6edd5f71a9c32b411f17df3fb1aa4721b356259cf77a48c4a44319806a5435 +=> e01e00ff5209526563697069656e74473045022100da0d2991bb43f2f15750c506fe6de293403ac8554abba91a42a17b9bd606d28a022000eb1dc52e27f1787ad7974dc2c46b8d3e2b6a21a7d29b59dae6cd5950dd3ad7 <= 9000 => e01c00ff050003426f62 <= 9000 @@ -80,7 +80,7 @@ <= 9000 => e01c00ff160014b0b0b0b0b0b0b000000000000000000000000000 <= 9000 -=> e01e00ff5109526563697069656e74463044022100a9a05f12fbe643750f0c8a60b30dbc793077c2104dcf999a62303dba8458d65d021f6edd5f71a9c32b411f17df3fb1aa4721b356259cf77a48c4a44319806a5435 +=> e01e00ff5209526563697069656e74473045022100da0d2991bb43f2f15750c506fe6de293403ac8554abba91a42a17b9bd606d28a022000eb1dc52e27f1787ad7974dc2c46b8d3e2b6a21a7d29b59dae6cd5950dd3ad7 <= 9000 => e01c00ff070005416c696365 <= 9000 @@ -88,23 +88,23 @@ <= 9000 => e01c00ff160014b0bdabea57b0bdabea57b0bdabea57b0bdabea57 <= 9000 -=> e01e00ff50074d65737361676547304502200f6f7be32f617791e4ed639ba294b8ab38e9a4f9c39e3fe415c4e03ab4674168022100853409de5fc10e80c2a406439ba184b28762dc74797e1e383b167676d8fae959 +=> e01e00ff50074d657373616765473045022100b8eb78af1926c0f467a9eaae8bddfc9809142457b274e569c47ba67ea6e3670302204849783769cfd8db7881dc218cbd6ce68065daa7c91a86dac801450d794b4f27 <= 9000 => e01c00ff0d000b48656c6c6f2c20426f6221 <= 9000 => e01c000f0102 <= 9000 -=> e01e00ff530a4174746163686d656e7447304502206650c083b2c895fba0fdb8edf952f56f443a6cdde0086aab469c38032f7aeb320221009c7acee25f280180c8cbf0038c1b3692a671cdab0651501948e6a2b59783c539 +=> e01e00ff530a4174746163686d656e74473045022100b01fb7a24c68490b628a2733399d50325ef77fcd23937c47b621b2d081fbf29f02204194a21dc935f873172928cdd13e30cbdef28c08f1bae37b51d78355b0df5561 <= 9000 => e01c00ff0700056669727374 <= 9000 => e01c00ff03000164 <= 9000 -=> e01e00ff530a4174746163686d656e7447304502206650c083b2c895fba0fdb8edf952f56f443a6cdde0086aab469c38032f7aeb320221009c7acee25f280180c8cbf0038c1b3692a671cdab0651501948e6a2b59783c539 +=> e01e00ff530a4174746163686d656e74473045022100b01fb7a24c68490b628a2733399d50325ef77fcd23937c47b621b2d081fbf29f02204194a21dc935f873172928cdd13e30cbdef28c08f1bae37b51d78355b0df5561 <= 9000 => e01c00ff0800067365636f6e64 <= 9000 => e01c00ff0400020d48 <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1b0e178627d230e134ade95f4d828050bb5906d42605c085d9512ca0cb80efa3b020e280cee0a50fa349a1d95708419f29ae03d34d25edd71a5faffdcfe79352519000 \ No newline at end of file +<= 1bd10f6b61205cf5c5ec45735d7f7186afb7e454212102883caf9b6fd2ebdf9fd32d9c1af9ded7ddb0237c0b67b6a1a2c98fc73af8ff0bf6c43b356a79bbc929f39000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/7-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/7-filtered-v1.apdus similarity index 58% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/7-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/7-filtered-v1.apdus index ce7b8b2a15b2..a66729e87bf1 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/7-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/7-filtered-v1.apdus @@ -28,7 +28,7 @@ <= 9000 => e01a00ff0b8301000777616c6c657473 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -40,11 +40,11 @@ <= 9000 => e01c00ff160014ccccccccccccccccccccccccccccccccccccccc1 <= 9000 -=> e01e000f4f044c65696103483046022100d786a7581ca1bd313e8271cca5635e4b35ae69c13cce9664b2f61886979a5e94022100a45a87afd52f3ae630510dcde9139e98f1979f84efba29b85b5dac583605e225 +=> e01e000f4d044c6569610346304402206aade75a0906c6c6f47080a195d32bcc9d2ca44d9e1fe7c936a8f2040f10722a0220378e54fc0b9b6cccab50bd3c43cf0ed034ffbaba834dd18246289b26fe8ebb3e <= 9000 => e01c0000044d61696c <= 9000 -=> e01e00ff500653656e646572483046022100fdf2641839d9eb35211a1dff0a642efffcdada1b4a735fed1dc8286cfef3a69f0221009ab91a098be77ed3fa385bb33300c3f6050f1871c2df1a420411b9049e018cf2 +=> e01e00ff4e0653656e64657246304402205d72013185f9324c724f1456214818daa52778282f39f9511a197bef9266e91002205564bcfeb4bfbb13596e2c4cf86a602b01e8cea41abb6bb36fc5276142bb7844 <= 9000 => e01c00ff050003436f77 <= 9000 @@ -56,7 +56,7 @@ <= 9000 => e01c000f0102 <= 9000 -=> e01e00ff5f1553686f756c6420626520416c696365202620426f62483046022100ec0bb0ee7962ea0b89a4c1b81e7141c38f4fb3841dc254611b39357e98fa13710221009d38375810801157565b9e7338feb8f44babf4c3bfd46f9dff7be412684323d9 +=> e01e00ff5d1553686f756c6420626520416c696365202620426f62463044022024e948f1f8206bea3eee90636526d33565df61271fa2c2acebd9d5f5778fa42002206a2d68bb87a13008bcc735de5a238b67e6d2b7df91236bc50f8eb6cd58749193 <= 9000 => e01c00ff070005416c696365 <= 9000 @@ -66,7 +66,7 @@ <= 9000 => e01c00ff160014b0b0b0b0b0b0b000000000000000000000000000 <= 9000 -=> e01e00ff5f1553686f756c6420626520416c696365202620426f62483046022100ec0bb0ee7962ea0b89a4c1b81e7141c38f4fb3841dc254611b39357e98fa13710221009d38375810801157565b9e7338feb8f44babf4c3bfd46f9dff7be412684323d9 +=> e01e00ff5d1553686f756c6420626520416c696365202620426f62463044022024e948f1f8206bea3eee90636526d33565df61271fa2c2acebd9d5f5778fa42002206a2d68bb87a13008bcc735de5a238b67e6d2b7df91236bc50f8eb6cd58749193 <= 9000 => e01c00ff050003426f62 <= 9000 @@ -74,9 +74,9 @@ <= 9000 => e01c00ff160014b0bdabea57b0bdabea57b0bdabea57b0bdabea57 <= 9000 -=> e01e00ff50074d65737361676547304502210084741fe267c0e68f588c2b46b7e9a33490912bfff0075fa0f35ea807707beba802204692e9380005cd613e0bd8177de9a9189fef1bbeee77a483df65f87b86dfc5a3 +=> e01e00ff50074d6573736167654730450221009e6d3ceb72239082bb60202a3b095bb308f41d8a6b63360c487b8798e1dd2d24022006ef5ddfffaa1acd0911c64ae7a00adad98ab82a57d6d010906df496511213a6 <= 9000 => e01c00ff0d000b48656c6c6f2c20426f6221 <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1b9d94c45d9fed0c7804c8acae6a51c1f955e26f9b97dbb0bb086ec432f6890c0563484ac40b7cf6d71f6764625a6eb5204554efc16fcb4990011ae9801dd5362d9000 \ No newline at end of file +<= 1bdf9e8b6b94a196b5b5608d8a83ad5479f050bbdfb301d4d3f4e2bfb30497fd441bd7074ce7035305a091b2f9994854fec0ceb2b11cf2620b93b76c1723029f6f9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/8-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/8-filtered-v1.apdus similarity index 63% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/8-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/8-filtered-v1.apdus index c92666297ae8..13e6bfa127a6 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/8-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/8-filtered-v1.apdus @@ -28,7 +28,7 @@ <= 9000 => e01a00ff0b8301000777616c6c657473 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -40,11 +40,11 @@ <= 9000 => e01c00ff160014cccccccccccccccccccccccccccccccccccccccc <= 9000 -=> e01e000f4f064368657769650346304402200a68076edda783f20939d29795a2fa64a822ebfb06bf06af9c4deca472fd908002201c7e72fcb7e38bfcefb674cdcdc6a42beabb2d6557b18df9293eb2dea8994bd9 +=> e01e000f4f06436865776965034630440220695783f5cdb6f7df8c12af70dce746d72eea3e8db2aa4da6883f3ecd0e18114f022069b9a8f51bb2369b950702b29f31594dfe24a1c7aa5471f0f682a7f63cefaef4 <= 9000 => e01c0000044d61696c <= 9000 -=> e01e00ff4e0653656e64657246304402200c8991afadb1dbf395edaec90a709e3b4659794ec3f759b5f08e0b25d0656f9802201f50addfd159f669d8c2eb6273fb3c366ee8c5c707c9a59089bbc9f2b15304ac +=> e01e00ff4e0653656e6465724630440220415f936aa7869609af6bf29f03a6af995657fda1d53465b9b301c484bcdf80790220732c4c0dde743d51bef4a1a3289729aa178e6e2ee336826b2dc26b794d6eebef <= 9000 => e01c00ff050003436f77 <= 9000 @@ -60,23 +60,23 @@ <= 9000 => e01c000f0103 <= 9000 -=> e01e00ff520a526563697069656e7473463044022022827c43a60563768826f7d1003273828f373b2ddac58fab7f46398133b4e2360220293e311194fc604aac695663c0768e5174dbc82588a3ba445ade5a0513a6569d +=> e01e00ff530a526563697069656e7473473045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0 <= 9000 => e01c00ff160014bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb <= 9000 -=> e01e00ff520a526563697069656e7473463044022022827c43a60563768826f7d1003273828f373b2ddac58fab7f46398133b4e2360220293e311194fc604aac695663c0768e5174dbc82588a3ba445ade5a0513a6569d +=> e01e00ff530a526563697069656e7473473045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0 <= 9000 => e01c00ff160014b0bdabea57b0bdabea57b0bdabea57b0bdabea57 <= 9000 -=> e01e00ff520a526563697069656e7473463044022022827c43a60563768826f7d1003273828f373b2ddac58fab7f46398133b4e2360220293e311194fc604aac695663c0768e5174dbc82588a3ba445ade5a0513a6569d +=> e01e00ff530a526563697069656e7473473045022100e220a1b0ffad989dcd4f11ce8ba49438d7685e04d512f447a9ba3f9b28caff3202202bcefa78626d00332f6586affe06fcba38d76fe643d1035f5d7ef2184f0307b0 <= 9000 => e01c00ff160014b0b0b0b0b0b0b000000000000000000000000000 <= 9000 -=> e01e00ff50074d657373616765473045022074c6e91513f214590fb7ca8e62a207f6c945a0a02ab96010d8e401eb391f2a36022100f5cfd20bb8903cbc1d6a686ab23764fae1319a6e10856443faaf1953ac9c6b7f +=> e01e00ff4f074d65737361676546304402201a75a81563b580604c43bc51e004f41ec9f45dad9daac80de760bc641e475cfd02200b284e2ce760c24b14709f03630efdc86826d606511820cf15baf56be601b587 <= 9000 => e01c01ffff014248656c6c6f2c20426f62212030313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536373830313233343536 <= 9000 => e01c00ff45373830313233343536373830313233343536373830313233343536373839393939393939393939393939393939393939393939393939393939393930313233343536373839 <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1b72cd1152bbd5513ebfc9cd2550395de96597bcfde23e79650caae9197f4da51a630f3daba6843aa7cb4f14af72648c0a40e1a96bb33e9f46288333b00662cac79000 \ No newline at end of file +<= 1c59adf8ab1d0e87d2623747eac10d5ef23d0145d7f30e2960cba3503b28add2d3109f81625ca7a9bb448fa58325b2f08d7f7141b14a20e363d7ea10a9483b780d9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/9-filtered.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/9-filtered-v1.apdus similarity index 65% rename from libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/9-filtered.apdus rename to libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/9-filtered-v1.apdus index 71e83615094f..454cd8448305 100644 --- a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/9-filtered.apdus +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/9-filtered-v1.apdus @@ -28,7 +28,7 @@ <= 9000 => e01a00ff0b8301000777616c6c657473 <= 9000 -=> e01e000000 +=> e01e010000 <= 9000 => e01c00000c454950373132446f6d61696e <= 9000 @@ -40,11 +40,11 @@ <= 9000 => e01c00ff160014cccccccccccccccccccccccccccccccccccccccc <= 9000 -=> e01e000f4e0348616e0348304602210090e6002a4b5b2a96409fbbfce11510a5ec3efc52139b43fb313e195ad7cab1a2022100eccaf2257b8f9e35c42c064ade707bfff9e04399730efa4e1460ccd444cdad1f +=> e01e000f4c0348616e0346304402207ea368d6351bf9718c16f588592cac7f62c291aa944883788135165ee8c3490b02204039f684a10f75c474fb1be52a28cff3e1c2cbe82873179c6bc34c2b256d7ca3 <= 9000 => e01c0000044d61696c <= 9000 -=> e01e00ff4f0653656e646572473045022076c5578debbf0c30422d46f546272bbee51d1983691b7f24098991b892f0fb05022100ee5aee20b96e7b60e8cb9d95a185140c5427d7f3b8c8795c9267cc5c52e0a962 +=> e01e00ff4e0653656e64657246304402206ace512db580330cba97a8519e888ac75968a88868bb76956bf23aac2c40d4d902202f8b91e8733799d2dce389a34b67d1e95f55d1d69c760a4ff6fdc98441648d70 <= 9000 => e01c00ff050003436f77 <= 9000 @@ -60,23 +60,23 @@ <= 9000 => e01c000f0103 <= 9000 -=> e01e00ff540a526563697069656e7473483046022100ba2e37ab42de23f088924639d0c340352a013dd8258882f2fed42d2516313b68022100ec2474e9d083a7935251da520b35b08fe125d2153c7102afc8572135b42c3d0d +=> e01e00ff530a526563697069656e7473473045022100a35791e52689caef688b4c11da7472d94460f714076c796cf210d5319bc232d60220692feb421e1dcb694ca03ce6f783d2403c24c25a63720cdcdf8786f7848bc579 <= 9000 => e01c00ff160014bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb <= 9000 -=> e01e00ff540a526563697069656e7473483046022100ba2e37ab42de23f088924639d0c340352a013dd8258882f2fed42d2516313b68022100ec2474e9d083a7935251da520b35b08fe125d2153c7102afc8572135b42c3d0d +=> e01e00ff530a526563697069656e7473473045022100a35791e52689caef688b4c11da7472d94460f714076c796cf210d5319bc232d60220692feb421e1dcb694ca03ce6f783d2403c24c25a63720cdcdf8786f7848bc579 <= 9000 => e01c00ff160014b0bdabea57b0bdabea57b0bdabea57b0bdabea57 <= 9000 -=> e01e00ff540a526563697069656e7473483046022100ba2e37ab42de23f088924639d0c340352a013dd8258882f2fed42d2516313b68022100ec2474e9d083a7935251da520b35b08fe125d2153c7102afc8572135b42c3d0d +=> e01e00ff530a526563697069656e7473473045022100a35791e52689caef688b4c11da7472d94460f714076c796cf210d5319bc232d60220692feb421e1dcb694ca03ce6f783d2403c24c25a63720cdcdf8786f7848bc579 <= 9000 => e01c00ff160014b0b0b0b0b0b0b000000000000000000000000000 <= 9000 -=> e01e00ff4f074d657373616765463044022052996b835132bf8248277b443439382bd3af11d4614052e9e03e22ab093a36dc02201ed76b7f35f1fd8d61a36abd65d70295d7db02a8e89623ecf4fbe0d01ef1106a +=> e01e00ff50074d657373616765473045022100d6095472a275cf338b4d83b5c7c50da3ef60f482c665b14be25c16fe4e04dc1a02204a5371fe846ba16360ff55ddb85cf2bb79b9db305c863d4a06e168e766ee13de <= 9000 => e01c01ffff01a411234567891234567891234536789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789912345678923456789912345678923456789912345678923456789912345678923456789912345678923456789123456789234567891123456789123456789123453678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678991234567892345678991234567892345678991234567892345678 <= 9000 => e01c00ffa79912345678923456789912345678923456789123456789234567891123456789123456789123453678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678991234567892345678991234567892345678991234567892345678991234567892345678991234567892345678912345678923456789 <= 9000 => e00c000115058000002c8000003c800000000000000000000000 -<= 1cb1e40db9bd432986de0013a55d0564a1bfc232fb25b3c3da19db3d867df2d5516941ad66c0ec9100f3676a4f61761509c1345fe73df16d84053420008c8d73b79000 \ No newline at end of file +<= 1c87698ac1d846331b4b393417353dd20c60b9401a407d76db52fb9e45844aab3011b09b38be74fbf2cb5851470d4f70bf0cccaf1bea00ff28e16ca914deba15ce9000 \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/version-1.12.0.apdus b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/version-1.12.0.apdus new file mode 100644 index 000000000000..aca7379a4927 --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/apdus/version-1.12.0.apdus @@ -0,0 +1,2 @@ +=> b001000000 +<= 0108457468657265756d06312e31322e3001009000 diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/messages/1-empty-array-1-level.json b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/messages/1-empty-array-1-level.json new file mode 100644 index 000000000000..a4fb31df00b2 --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/messages/1-empty-array-1-level.json @@ -0,0 +1,79 @@ +{ + "domain": { + "chainId": 5, + "name": "Ether Mail", + "verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", + "version": "1" + }, + "message": { + "contents": "Hello, Bob!", + "from": { + "name": "Cow", + "wallets": [ + "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", + "0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF" + ] + }, + "to": [ + { + "name": "Bob", + "wallets": [] + } + ] + }, + "primaryType": "Mail", + "types": { + "EIP712Domain": [ + { + "name": "name", + "type": "string" + }, + { + "name": "version", + "type": "string" + }, + { + "name": "chainId", + "type": "uint256" + }, + { + "name": "verifyingContract", + "type": "address" + } + ], + "Group": [ + { + "name": "name", + "type": "string" + }, + { + "name": "members", + "type": "Person[]" + } + ], + "Mail": [ + { + "name": "from", + "type": "Person" + }, + { + "name": "to", + "type": "Person[]" + }, + { + "name": "contents", + "type": "string" + } + ], + "Person": [ + { + "name": "name", + "type": "string" + }, + { + "name": "wallets", + "type": "address[]" + } + ] + } +} \ No newline at end of file diff --git a/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/messages/1-empty-array-2-levels.json b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/messages/1-empty-array-2-levels.json new file mode 100644 index 000000000000..53a970f42e4e --- /dev/null +++ b/libs/ledgerjs/packages/hw-app-eth/tests/fixtures/messages/1-empty-array-2-levels.json @@ -0,0 +1,74 @@ +{ + "domain": { + "chainId": 5, + "name": "Ether Mail", + "verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", + "version": "1" + }, + "message": { + "contents": "Hello, Bob!", + "from": { + "name": "Cow", + "wallets": [ + "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", + "0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF" + ] + }, + "to": [] + }, + "primaryType": "Mail", + "types": { + "EIP712Domain": [ + { + "name": "name", + "type": "string" + }, + { + "name": "version", + "type": "string" + }, + { + "name": "chainId", + "type": "uint256" + }, + { + "name": "verifyingContract", + "type": "address" + } + ], + "Group": [ + { + "name": "name", + "type": "string" + }, + { + "name": "members", + "type": "Person[]" + } + ], + "Mail": [ + { + "name": "from", + "type": "Person" + }, + { + "name": "to", + "type": "Person[]" + }, + { + "name": "contents", + "type": "string" + } + ], + "Person": [ + { + "name": "name", + "type": "string" + }, + { + "name": "wallets", + "type": "address[]" + } + ] + } +} \ No newline at end of file From 3a77c3728b1ed823c7975d37d1db0c9d33d4a816 Mon Sep 17 00:00:00 2001 From: Kevin Le Seigle Date: Tue, 1 Oct 2024 14:48:31 +0200 Subject: [PATCH 58/94] fix: load react-devtools dynamically --- apps/ledger-live-desktop/package.json | 3 +-- apps/ledger-live-desktop/src/main/index.ts | 17 +++++++++-------- pnpm-lock.yaml | 5 ----- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/apps/ledger-live-desktop/package.json b/apps/ledger-live-desktop/package.json index 2c4905e1cd61..d376c2772aa7 100644 --- a/apps/ledger-live-desktop/package.json +++ b/apps/ledger-live-desktop/package.json @@ -163,7 +163,6 @@ "@ledgerhq/esbuild-utils": "workspace:*", "@ledgerhq/hw-transport-mocker": "workspace:^", "@ledgerhq/native-modules-tools": "workspace:*", - "@ledgerhq/react-devtools": "workspace:^", "@ledgerhq/speculos-transport": "workspace:^", "@ledgerhq/test-utils": "workspace:^", "@octokit/rest": "^18.12.0", @@ -232,4 +231,4 @@ "vite-plugin-electron": "0.4.9", "yargs": "^17.0.0" } -} \ No newline at end of file +} diff --git a/apps/ledger-live-desktop/src/main/index.ts b/apps/ledger-live-desktop/src/main/index.ts index b07babbb15b0..73326b0a73e4 100644 --- a/apps/ledger-live-desktop/src/main/index.ts +++ b/apps/ledger-live-desktop/src/main/index.ts @@ -2,7 +2,6 @@ import "./setup"; // Needs to be imported first import { app, Menu, ipcMain, session, webContents, shell, BrowserWindow, dialog } from "electron"; import Store from "electron-store"; import menu from "./menu"; -import path from "path"; import { createMainWindow, getMainWindow, @@ -238,21 +237,23 @@ async function installExtensions() { // eslint-disable-next-line @typescript-eslint/no-var-requires const installer = require("electron-devtools-installer"); const forceDownload = true; // process.env.UPGRADE_EXTENSIONS - const extensions = [/*"REACT_DEVELOPER_TOOLS",*/ "REDUX_DEVTOOLS"]; - // Temporary solution while Electron doesn't support manifest V3 extensions - // https://github.com/electron/electron/issues/36545 - const reactDevToolsPath = path.dirname(require.resolve("@ledgerhq/react-devtools/package.json")); - session.defaultSession.loadExtension(reactDevToolsPath); - return Promise.all( + const extensions = ["REACT_DEVELOPER_TOOLS", "REDUX_DEVTOOLS"]; + await Promise.all( extensions.map(name => installer.default(installer[name], { + forceDownload, loadExtensionOptions: { allowFileAccess: true, - forceDownload, }, }), ), ).catch(console.error); + //Hack to load React devtools extension without a reload due to this issue: https://github.com/MarshallOfSound/electron-devtools-installer/issues/244 + return session.defaultSession.getAllExtensions().map(e => { + if (e.name === "React Developer Tools") { + session.defaultSession.loadExtension(e.path); + } + }); } function clearSessionCache(session: Electron.Session): Promise { return session.clearCache(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9107c46762e3..ba18cbf24a56 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -590,9 +590,6 @@ importers: '@ledgerhq/native-modules-tools': specifier: workspace:* version: link:../../tools/native-modules-tools - '@ledgerhq/react-devtools': - specifier: workspace:^ - version: link:../../tools/react-dev-tools '@ledgerhq/speculos-transport': specifier: workspace:^ version: link:../../libs/speculos-transport @@ -7323,8 +7320,6 @@ importers: tools/pnpm-utils: {} - tools/react-dev-tools: {} - packages: 7zip-bin@5.2.0: From 0c58de73f5010ddc78e5a3fc01c6a64cd1c9f066 Mon Sep 17 00:00:00 2001 From: Kevin Le Seigle Date: Tue, 1 Oct 2024 14:52:16 +0200 Subject: [PATCH 59/94] fix: remove local version of react-devtools --- .../tools/config/main.esbuild.js | 2 +- tools/react-dev-tools/build/background.js | 243 - tools/react-dev-tools/build/contentScript.js | 155 - .../build/importFile.worker.worker.js | 4784 - .../react-dev-tools/build/injectGlobalHook.js | 13227 --- tools/react-dev-tools/build/main.js | 54810 ---------- tools/react-dev-tools/build/panel.js | 110 - .../build/parseHookNames.chunk.js | 490 - .../parseSourceAndMetadata.worker.worker.js | 87708 ---------------- .../build/react_devtools_backend.js | 16538 --- tools/react-dev-tools/build/renderer.js | 12540 --- .../build/vendors~parseHookNames.chunk.js | 2095 - tools/react-dev-tools/icons/128-deadcode.png | Bin 2101 -> 0 bytes .../react-dev-tools/icons/128-development.png | Bin 2101 -> 0 bytes tools/react-dev-tools/icons/128-disabled.png | Bin 1936 -> 0 bytes tools/react-dev-tools/icons/128-outdated.png | Bin 1992 -> 0 bytes .../react-dev-tools/icons/128-production.png | Bin 1920 -> 0 bytes .../react-dev-tools/icons/128-restricted.png | Bin 1936 -> 0 bytes .../react-dev-tools/icons/128-unminified.png | Bin 2101 -> 0 bytes tools/react-dev-tools/icons/16-deadcode.png | Bin 338 -> 0 bytes .../react-dev-tools/icons/16-development.png | Bin 338 -> 0 bytes tools/react-dev-tools/icons/16-disabled.png | Bin 288 -> 0 bytes tools/react-dev-tools/icons/16-outdated.png | Bin 313 -> 0 bytes tools/react-dev-tools/icons/16-production.png | Bin 272 -> 0 bytes tools/react-dev-tools/icons/16-restricted.png | Bin 288 -> 0 bytes tools/react-dev-tools/icons/16-unminified.png | Bin 338 -> 0 bytes tools/react-dev-tools/icons/32-deadcode.png | Bin 561 -> 0 bytes .../react-dev-tools/icons/32-development.png | Bin 561 -> 0 bytes tools/react-dev-tools/icons/32-disabled.png | Bin 490 -> 0 bytes tools/react-dev-tools/icons/32-outdated.png | Bin 550 -> 0 bytes tools/react-dev-tools/icons/32-production.png | Bin 474 -> 0 bytes tools/react-dev-tools/icons/32-restricted.png | Bin 490 -> 0 bytes tools/react-dev-tools/icons/32-unminified.png | Bin 561 -> 0 bytes tools/react-dev-tools/icons/48-deadcode.png | Bin 826 -> 0 bytes .../react-dev-tools/icons/48-development.png | Bin 826 -> 0 bytes tools/react-dev-tools/icons/48-disabled.png | Bin 730 -> 0 bytes tools/react-dev-tools/icons/48-outdated.png | Bin 787 -> 0 bytes tools/react-dev-tools/icons/48-production.png | Bin 714 -> 0 bytes tools/react-dev-tools/icons/48-restricted.png | Bin 730 -> 0 bytes tools/react-dev-tools/icons/48-unminified.png | Bin 826 -> 0 bytes tools/react-dev-tools/icons/deadcode.svg | 1 - tools/react-dev-tools/icons/development.svg | 1 - tools/react-dev-tools/icons/disabled.svg | 1 - tools/react-dev-tools/icons/outdated.svg | 1 - tools/react-dev-tools/icons/production.svg | 1 - tools/react-dev-tools/icons/restricted.svg | 1 - tools/react-dev-tools/main.html | 9 - tools/react-dev-tools/manifest.json | 53 - tools/react-dev-tools/package.json | 5 - tools/react-dev-tools/panel.html | 32 - tools/react-dev-tools/popups/deadcode.html | 28 - tools/react-dev-tools/popups/development.html | 24 - tools/react-dev-tools/popups/disabled.html | 17 - tools/react-dev-tools/popups/outdated.html | 25 - tools/react-dev-tools/popups/production.html | 17 - tools/react-dev-tools/popups/restricted.html | 14 - tools/react-dev-tools/popups/shared.css | 7 - tools/react-dev-tools/popups/shared.js | 25 - tools/react-dev-tools/popups/unminified.html | 31 - 59 files changed, 1 insertion(+), 192994 deletions(-) delete mode 100644 tools/react-dev-tools/build/background.js delete mode 100644 tools/react-dev-tools/build/contentScript.js delete mode 100644 tools/react-dev-tools/build/importFile.worker.worker.js delete mode 100644 tools/react-dev-tools/build/injectGlobalHook.js delete mode 100644 tools/react-dev-tools/build/main.js delete mode 100644 tools/react-dev-tools/build/panel.js delete mode 100644 tools/react-dev-tools/build/parseHookNames.chunk.js delete mode 100644 tools/react-dev-tools/build/parseSourceAndMetadata.worker.worker.js delete mode 100644 tools/react-dev-tools/build/react_devtools_backend.js delete mode 100644 tools/react-dev-tools/build/renderer.js delete mode 100644 tools/react-dev-tools/build/vendors~parseHookNames.chunk.js delete mode 100644 tools/react-dev-tools/icons/128-deadcode.png delete mode 100644 tools/react-dev-tools/icons/128-development.png delete mode 100644 tools/react-dev-tools/icons/128-disabled.png delete mode 100644 tools/react-dev-tools/icons/128-outdated.png delete mode 100644 tools/react-dev-tools/icons/128-production.png delete mode 100644 tools/react-dev-tools/icons/128-restricted.png delete mode 100644 tools/react-dev-tools/icons/128-unminified.png delete mode 100644 tools/react-dev-tools/icons/16-deadcode.png delete mode 100644 tools/react-dev-tools/icons/16-development.png delete mode 100644 tools/react-dev-tools/icons/16-disabled.png delete mode 100644 tools/react-dev-tools/icons/16-outdated.png delete mode 100644 tools/react-dev-tools/icons/16-production.png delete mode 100644 tools/react-dev-tools/icons/16-restricted.png delete mode 100644 tools/react-dev-tools/icons/16-unminified.png delete mode 100644 tools/react-dev-tools/icons/32-deadcode.png delete mode 100644 tools/react-dev-tools/icons/32-development.png delete mode 100644 tools/react-dev-tools/icons/32-disabled.png delete mode 100644 tools/react-dev-tools/icons/32-outdated.png delete mode 100644 tools/react-dev-tools/icons/32-production.png delete mode 100644 tools/react-dev-tools/icons/32-restricted.png delete mode 100644 tools/react-dev-tools/icons/32-unminified.png delete mode 100644 tools/react-dev-tools/icons/48-deadcode.png delete mode 100644 tools/react-dev-tools/icons/48-development.png delete mode 100644 tools/react-dev-tools/icons/48-disabled.png delete mode 100644 tools/react-dev-tools/icons/48-outdated.png delete mode 100644 tools/react-dev-tools/icons/48-production.png delete mode 100644 tools/react-dev-tools/icons/48-restricted.png delete mode 100644 tools/react-dev-tools/icons/48-unminified.png delete mode 100644 tools/react-dev-tools/icons/deadcode.svg delete mode 100644 tools/react-dev-tools/icons/development.svg delete mode 100644 tools/react-dev-tools/icons/disabled.svg delete mode 100644 tools/react-dev-tools/icons/outdated.svg delete mode 100644 tools/react-dev-tools/icons/production.svg delete mode 100644 tools/react-dev-tools/icons/restricted.svg delete mode 100644 tools/react-dev-tools/main.html delete mode 100644 tools/react-dev-tools/manifest.json delete mode 100644 tools/react-dev-tools/package.json delete mode 100644 tools/react-dev-tools/panel.html delete mode 100644 tools/react-dev-tools/popups/deadcode.html delete mode 100644 tools/react-dev-tools/popups/development.html delete mode 100644 tools/react-dev-tools/popups/disabled.html delete mode 100644 tools/react-dev-tools/popups/outdated.html delete mode 100644 tools/react-dev-tools/popups/production.html delete mode 100644 tools/react-dev-tools/popups/restricted.html delete mode 100644 tools/react-dev-tools/popups/shared.css delete mode 100644 tools/react-dev-tools/popups/shared.js delete mode 100644 tools/react-dev-tools/popups/unminified.html diff --git a/apps/ledger-live-desktop/tools/config/main.esbuild.js b/apps/ledger-live-desktop/tools/config/main.esbuild.js index 5ff9cf92c4b5..9cc7be6cecf7 100644 --- a/apps/ledger-live-desktop/tools/config/main.esbuild.js +++ b/apps/ledger-live-desktop/tools/config/main.esbuild.js @@ -15,7 +15,7 @@ module.exports = { // Picking the the main field first is safer. // See this comment: https://github.com/webpack/webpack/issues/4742#issuecomment-295115576 mainFields: ["main", "module"], - external: [...electronMainExternals, "@ledgerhq/react-devtools/package.json"], + external: [...electronMainExternals], plugins: [ ...common.plugins, CopyPlugin({ diff --git a/tools/react-dev-tools/build/background.js b/tools/react-dev-tools/build/background.js deleted file mode 100644 index 381ed0f22241..000000000000 --- a/tools/react-dev-tools/build/background.js +++ /dev/null @@ -1,243 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/build/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 115); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ 115: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* global chrome */ - - -const ports = {}; -const IS_FIREFOX = navigator.userAgent.indexOf('Firefox') >= 0; -chrome.runtime.onConnect.addListener(function (port) { - let tab = null; - let name = null; - - if (isNumeric(port.name)) { - tab = port.name; - name = 'devtools'; - installContentScript(+port.name); - } else { - tab = port.sender.tab.id; - name = 'content-script'; - } - - if (!ports[tab]) { - ports[tab] = { - devtools: null, - 'content-script': null - }; - } - - ports[tab][name] = port; - - if (ports[tab].devtools && ports[tab]['content-script']) { - doublePipe(ports[tab].devtools, ports[tab]['content-script']); - } -}); - -function isNumeric(str) { - return +str + '' === str; -} - -function installContentScript(tabId) { - chrome.tabs.executeScript(tabId, { - file: '/build/contentScript.js' - }, function () {}); -} - -function doublePipe(one, two) { - one.onMessage.addListener(lOne); - - function lOne(message) { - two.postMessage(message); - } - - two.onMessage.addListener(lTwo); - - function lTwo(message) { - one.postMessage(message); - } - - function shutdown() { - one.onMessage.removeListener(lOne); - two.onMessage.removeListener(lTwo); - one.disconnect(); - two.disconnect(); - } - - one.onDisconnect.addListener(shutdown); - two.onDisconnect.addListener(shutdown); -} - -function setIconAndPopup(reactBuildType, tabId) { - chrome.browserAction.setIcon({ - tabId: tabId, - path: { - '16': 'icons/16-' + reactBuildType + '.png', - '32': 'icons/32-' + reactBuildType + '.png', - '48': 'icons/48-' + reactBuildType + '.png', - '128': 'icons/128-' + reactBuildType + '.png' - } - }); - chrome.browserAction.setPopup({ - tabId: tabId, - popup: 'popups/' + reactBuildType + '.html' - }); -} - -function isRestrictedBrowserPage(url) { - return !url || new URL(url).protocol === 'chrome:'; -} - -function checkAndHandleRestrictedPageIfSo(tab) { - if (tab && isRestrictedBrowserPage(tab.url)) { - setIconAndPopup('restricted', tab.id); - } -} // update popup page of any existing open tabs, if they are restricted browser pages. -// we can't update for any other types (prod,dev,outdated etc) -// as the content script needs to be injected at document_start itself for those kinds of detection -// TODO: Show a different popup page(to reload current page probably) for old tabs, opened before the extension is installed - - -if (!IS_FIREFOX) { - chrome.tabs.query({}, tabs => tabs.forEach(checkAndHandleRestrictedPageIfSo)); - chrome.tabs.onCreated.addListener((tabId, changeInfo, tab) => checkAndHandleRestrictedPageIfSo(tab)); -} // Listen to URL changes on the active tab and update the DevTools icon. - - -chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { - if (IS_FIREFOX) { - // We don't properly detect protected URLs in Firefox at the moment. - // However we can reset the DevTools icon to its loading state when the URL changes. - // It will be updated to the correct icon by the onMessage callback below. - if (tab.active && changeInfo.status === 'loading') { - setIconAndPopup('disabled', tabId); - } - } else { - // Don't reset the icon to the loading state for Chrome or Edge. - // The onUpdated callback fires more frequently for these browsers, - // often after onMessage has been called. - checkAndHandleRestrictedPageIfSo(tab); - } -}); -chrome.runtime.onMessage.addListener((request, sender) => { - var _request$payload, _ports$id; - - const tab = sender.tab; - - if (tab) { - const id = tab.id; // This is sent from the hook content script. - // It tells us a renderer has attached. - - if (request.hasDetectedReact) { - // We use browserAction instead of pageAction because this lets us - // display a custom default popup when React is *not* detected. - // It is specified in the manifest. - setIconAndPopup(request.reactBuildType, id); - } else { - switch ((_request$payload = request.payload) === null || _request$payload === void 0 ? void 0 : _request$payload.type) { - case 'fetch-file-with-cache-complete': - case 'fetch-file-with-cache-error': - // Forward the result of fetch-in-page requests back to the extension. - const devtools = (_ports$id = ports[id]) === null || _ports$id === void 0 ? void 0 : _ports$id.devtools; - - if (devtools) { - devtools.postMessage(request); - } - - break; - } - } - } -}); - -/***/ }) - -/******/ }); \ No newline at end of file diff --git a/tools/react-dev-tools/build/contentScript.js b/tools/react-dev-tools/build/contentScript.js deleted file mode 100644 index f3191adfa9e1..000000000000 --- a/tools/react-dev-tools/build/contentScript.js +++ /dev/null @@ -1,155 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/build/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 116); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ 116: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* global chrome */ - - -let backendDisconnected = false; -let backendInitialized = false; - -function sayHelloToBackend() { - window.postMessage({ - source: 'react-devtools-content-script', - hello: true - }, '*'); -} - -function handleMessageFromDevtools(message) { - window.postMessage({ - source: 'react-devtools-content-script', - payload: message - }, '*'); -} - -function handleMessageFromPage(event) { - if (event.source === window && event.data && event.data.source === 'react-devtools-bridge') { - backendInitialized = true; - port.postMessage(event.data.payload); - } -} - -function handleDisconnect() { - backendDisconnected = true; - window.removeEventListener('message', handleMessageFromPage); - window.postMessage({ - source: 'react-devtools-content-script', - payload: { - type: 'event', - event: 'shutdown' - } - }, '*'); -} // proxy from main page to devtools (via the background page) - - -const port = chrome.runtime.connect({ - name: 'content-script' -}); -port.onMessage.addListener(handleMessageFromDevtools); -port.onDisconnect.addListener(handleDisconnect); -window.addEventListener('message', handleMessageFromPage); -sayHelloToBackend(); // The backend waits to install the global hook until notified by the content script. -// In the event of a page reload, the content script might be loaded before the backend is injected. -// Because of this we need to poll the backend until it has been initialized. - -if (!backendInitialized) { - const intervalID = setInterval(() => { - if (backendInitialized || backendDisconnected) { - clearInterval(intervalID); - } else { - sayHelloToBackend(); - } - }, 500); -} - -/***/ }) - -/******/ }); \ No newline at end of file diff --git a/tools/react-dev-tools/build/importFile.worker.worker.js b/tools/react-dev-tools/build/importFile.worker.worker.js deleted file mode 100644 index 3b1f3318e22f..000000000000 --- a/tools/react-dev-tools/build/importFile.worker.worker.js +++ /dev/null @@ -1,4784 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/build/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 13); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.decodeBase64 = exports.lazyStatic = exports.memoizeByReference = exports.memoizeByShallowEquality = exports.objectsHaveShallowEquality = exports.noop = exports.binarySearch = exports.triangle = exports.fract = exports.formatPercent = exports.zeroPad = exports.itReduce = exports.itForEach = exports.itMap = exports.KeyedSet = exports.getOrThrow = exports.getOrElse = exports.getOrInsert = exports.sortBy = exports.lastOf = void 0; - -function lastOf(ts) { - return ts[ts.length - 1] || null; -} - -exports.lastOf = lastOf; - -function sortBy(ts, key) { - function comparator(a, b) { - const keyA = key(a); - const keyB = key(b); - return keyA < keyB ? -1 : keyA > keyB ? 1 : 0; - } - - ts.sort(comparator); -} - -exports.sortBy = sortBy; - -function getOrInsert(map, k, fallback) { - if (!map.has(k)) map.set(k, fallback(k)); - return map.get(k); -} - -exports.getOrInsert = getOrInsert; - -function getOrElse(map, k, fallback) { - if (!map.has(k)) return fallback(k); - return map.get(k); -} - -exports.getOrElse = getOrElse; - -function getOrThrow(map, k) { - if (!map.has(k)) { - throw new Error(`Expected key ${k}`); - } - - return map.get(k); -} - -exports.getOrThrow = getOrThrow; - -class KeyedSet { - constructor() { - this.map = new Map(); - } - - getOrInsert(t) { - const key = t.key; - const existing = this.map.get(key); - if (existing) return existing; - this.map.set(key, t); - return t; - } - - forEach(fn) { - this.map.forEach(fn); - } - - [Symbol.iterator]() { - return this.map.values(); - } - -} - -exports.KeyedSet = KeyedSet; - -function* itMap(it, f) { - for (let t of it) { - yield f(t); - } -} - -exports.itMap = itMap; - -function itForEach(it, f) { - for (let t of it) { - f(t); - } -} - -exports.itForEach = itForEach; - -function itReduce(it, f, init) { - let accum = init; - - for (let t of it) { - accum = f(accum, t); - } - - return accum; -} - -exports.itReduce = itReduce; - -function zeroPad(s, width) { - return new Array(Math.max(width - s.length, 0) + 1).join('0') + s; -} - -exports.zeroPad = zeroPad; - -function formatPercent(percent) { - let formattedPercent = `${percent.toFixed(0)}%`; - if (percent === 100) formattedPercent = '100%';else if (percent > 99) formattedPercent = '>99%';else if (percent < 0.01) formattedPercent = '<0.01%';else if (percent < 1) formattedPercent = `${percent.toFixed(2)}%`;else if (percent < 10) formattedPercent = `${percent.toFixed(1)}%`; - return formattedPercent; -} - -exports.formatPercent = formatPercent; - -function fract(x) { - return x - Math.floor(x); -} - -exports.fract = fract; - -function triangle(x) { - return 2.0 * Math.abs(fract(x) - 0.5) - 1.0; -} - -exports.triangle = triangle; - -function binarySearch(lo, hi, f, target, targetRangeSize = 1) { - console.assert(!isNaN(targetRangeSize) && !isNaN(target)); - - while (true) { - if (hi - lo <= targetRangeSize) return [lo, hi]; - const mid = (hi + lo) / 2; - const val = f(mid); - if (val < target) lo = mid;else hi = mid; - } -} - -exports.binarySearch = binarySearch; - -function noop(...args) {} - -exports.noop = noop; - -function objectsHaveShallowEquality(a, b) { - for (let key in a) { - if (a[key] !== b[key]) return false; - } - - for (let key in b) { - if (a[key] !== b[key]) return false; - } - - return true; -} - -exports.objectsHaveShallowEquality = objectsHaveShallowEquality; - -function memoizeByShallowEquality(cb) { - let last = null; - return args => { - let result; - - if (last == null) { - result = cb(args); - last = { - args, - result - }; - return result; - } else if (objectsHaveShallowEquality(last.args, args)) { - return last.result; - } else { - last.args = args; - last.result = cb(args); - return last.result; - } - }; -} - -exports.memoizeByShallowEquality = memoizeByShallowEquality; - -function memoizeByReference(cb) { - let last = null; - return args => { - let result; - - if (last == null) { - result = cb(args); - last = { - args, - result - }; - return result; - } else if (last.args === args) { - return last.result; - } else { - last.args = args; - last.result = cb(args); - return last.result; - } - }; -} - -exports.memoizeByReference = memoizeByReference; - -function lazyStatic(cb) { - let last = null; - return () => { - if (last == null) { - last = { - result: cb() - }; - } - - return last.result; - }; -} - -exports.lazyStatic = lazyStatic; -const base64lookupTable = lazyStatic(() => { - const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - const ret = new Map(); - - for (let i = 0; i < alphabet.length; i++) { - ret.set(alphabet.charAt(i), i); - } - - ret.set('=', -1); - return ret; -}); // NOTE: There are probably simpler solutions to this problem, but I have this written already, so -// until we run into problems with this, let's just use this. -// -// See: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem#The_Unicode_Problem - -function decodeBase64(encoded) { - // Reference: https://www.rfc-editor.org/rfc/rfc4648.txt - const lookupTable = base64lookupTable(); // 3 byte groups are represented as sequneces of 4 characters. - // - // "The encoding process represents 24-bit groups of input bits as output - // strings of 4 encoded characters." - // - // "Special processing is performed if fewer than 24 bits are available - // at the end of the data being encoded. A full encoding quantum is - // always completed at the end of a quantity. When fewer than 24 input - // bits are available in an input group bits with value zero are added - // (on the right) to form an integral number of 6-bit groups." - - if (encoded.length % 4 !== 0) { - throw new Error(`Invalid length for base64 encoded string. Expected length % 4 = 0, got length = ${encoded.length}`); - } - - const quartetCount = encoded.length / 4; - let byteCount; // Special processing is performed if fewer than 24 bits are available - // at the end of the data being encoded. A full encoding quantum is - // always completed at the end of a quantity. When fewer than 24 input - // bits are available in an input group, bits with value zero are added - // (on the right) to form an integral number of 6-bit groups. Padding - // at the end of the data is performed using the '=' character. Since - // all base 64 input is an integral number of octets, only the following - // cases can arise: - // - // (1) The final quantum of encoding input is an integral multiple of 24 - // bits; here, the final unit of encoded output will be an integral - // multiple of 4 characters with no "=" padding. - // - // (2) The final quantum of encoding input is exactly 8 bits; here, the - // final unit of encoded output will be two characters followed by - // two "=" padding characters. - // - // (3) The final quantum of encoding input is exactly 16 bits; here, the - // final unit of encoded output will be three characters followed by - // one "=" padding character. - - if (encoded.length >= 4) { - if (encoded.charAt(encoded.length - 1) === '=') { - if (encoded.charAt(encoded.length - 2) === '=') { - // Case (2) - byteCount = quartetCount * 3 - 2; - } else { - // Case (3) - byteCount = quartetCount * 3 - 1; - } - } else { - // Case (1) - byteCount = quartetCount * 3; - } - } else { - // Case (1) - byteCount = quartetCount * 3; - } - - const bytes = new Uint8Array(byteCount); - let offset = 0; - - for (let i = 0; i < quartetCount; i++) { - const enc1 = encoded.charAt(i * 4 + 0); - const enc2 = encoded.charAt(i * 4 + 1); - const enc3 = encoded.charAt(i * 4 + 2); - const enc4 = encoded.charAt(i * 4 + 3); - const sextet1 = lookupTable.get(enc1); - const sextet2 = lookupTable.get(enc2); - const sextet3 = lookupTable.get(enc3); - const sextet4 = lookupTable.get(enc4); - - if (sextet1 == null || sextet2 == null || sextet3 == null || sextet4 == null) { - throw new Error(`Invalid quartet at indices ${i * 4} .. ${i * 4 + 3}: ${encoded.substring(i * 4, i * 4 + 3)}`); - } - - bytes[offset++] = sextet1 << 2 | sextet2 >> 4; - - if (enc3 !== '=') { - bytes[offset++] = (sextet2 & 15) << 4 | sextet3 >> 2; - } - - if (enc4 !== '=') { - bytes[offset++] = (sextet3 & 7) << 6 | sextet4; - } - } - - if (offset !== byteCount) { - throw new Error(`Expected to decode ${byteCount} bytes, but only decoded ${offset})`); - } - - return bytes; -} - -exports.decodeBase64 = decodeBase64; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : 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" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -__exportStar(__webpack_require__(6), exports); - -__exportStar(__webpack_require__(10), exports); - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ByteFormatter = exports.TimeFormatter = exports.RawValueFormatter = void 0; - -const utils_1 = __webpack_require__(0); - -class RawValueFormatter { - constructor() { - this.unit = 'none'; - } - - format(v) { - return v.toLocaleString(); - } - -} - -exports.RawValueFormatter = RawValueFormatter; - -class TimeFormatter { - constructor(unit) { - this.unit = unit; - if (unit === 'nanoseconds') this.multiplier = 1e-9;else if (unit === 'microseconds') this.multiplier = 1e-6;else if (unit === 'milliseconds') this.multiplier = 1e-3;else this.multiplier = 1; - } - - formatUnsigned(v) { - const s = v * this.multiplier; - - if (s / 60 >= 1) { - const minutes = Math.floor(s / 60); - const seconds = Math.floor(s - minutes * 60).toString(); - return `${minutes}:${utils_1.zeroPad(seconds, 2)}`; - } - - if (s / 1 >= 1) return `${s.toFixed(2)}s`; - if (s / 1e-3 >= 1) return `${(s / 1e-3).toFixed(2)}ms`; - if (s / 1e-6 >= 1) return `${(s / 1e-6).toFixed(2)}µs`;else return `${(s / 1e-9).toFixed(2)}ns`; - } - - format(v) { - return `${v < 0 ? '-' : ''}${this.formatUnsigned(Math.abs(v))}`; - } - -} - -exports.TimeFormatter = TimeFormatter; - -class ByteFormatter { - constructor() { - this.unit = 'bytes'; - } - - format(v) { - if (v < 1024) return `${v.toFixed(0)} B`; - v /= 1024; - if (v < 1024) return `${v.toFixed(2)} KB`; - v /= 1024; - if (v < 1024) return `${v.toFixed(2)} MB`; - v /= 1024; - return `${v.toFixed(2)} GB`; - } - -} - -exports.ByteFormatter = ByteFormatter; - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. - - /* istanbul ignore next */ - - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(12)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})(this, function ErrorStackParser(StackFrame) { - 'use strict'; - - var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/; - var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m; - var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/; - return { - /** - * Given an Error object, extract the most information from it. - * - * @param {Error} error object - * @return {Array} of StackFrames - */ - parse: function ErrorStackParser$$parse(error) { - if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') { - return this.parseOpera(error); - } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) { - return this.parseV8OrIE(error); - } else if (error.stack) { - return this.parseFFOrSafari(error); - } else { - throw new Error('Cannot parse given Error object'); - } - }, - // Separate line and column numbers from a string of the form: (URI:Line:Column) - extractLocation: function ErrorStackParser$$extractLocation(urlLike) { - // Fail-fast but return locations like "(native)" - if (urlLike.indexOf(':') === -1) { - return [urlLike]; - } - - var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/; - var parts = regExp.exec(urlLike.replace(/[()]/g, '')); - return [parts[1], parts[2] || undefined, parts[3] || undefined]; - }, - parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(CHROME_IE_STACK_REGEXP); - }, this); - return filtered.map(function (line) { - if (line.indexOf('(eval ') > -1) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, ''); - } - - var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in - // case it has spaces in it, as the string is split on \s+ later on - - var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); // remove the parenthesized location from the line, if it was matched - - sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine; - var tokens = sanitizedLine.split(/\s+/).slice(1); // if a location was matched, pass it to extractLocation() otherwise pop the last token - - var locationParts = this.extractLocation(location ? location[1] : tokens.pop()); - var functionName = tokens.join(' ') || undefined; - var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0]; - return new StackFrame({ - functionName: functionName, - fileName: fileName, - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - }, this); - }, - parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !line.match(SAFARI_NATIVE_CODE_REGEXP); - }, this); - return filtered.map(function (line) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - if (line.indexOf(' > eval') > -1) { - line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1'); - } - - if (line.indexOf('@') === -1 && line.indexOf(':') === -1) { - // Safari eval frames only have function names and nothing else - return new StackFrame({ - functionName: line - }); - } else { - var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; - var matches = line.match(functionNameRegex); - var functionName = matches && matches[1] ? matches[1] : undefined; - var locationParts = this.extractLocation(line.replace(functionNameRegex, '')); - return new StackFrame({ - functionName: functionName, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - } - }, this); - }, - parseOpera: function ErrorStackParser$$parseOpera(e) { - if (!e.stacktrace || e.message.indexOf('\n') > -1 && e.message.split('\n').length > e.stacktrace.split('\n').length) { - return this.parseOpera9(e); - } else if (!e.stack) { - return this.parseOpera10(e); - } else { - return this.parseOpera11(e); - } - }, - parseOpera9: function ErrorStackParser$$parseOpera9(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; - var lines = e.message.split('\n'); - var result = []; - - for (var i = 2, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - - if (match) { - result.push(new StackFrame({ - fileName: match[2], - lineNumber: match[1], - source: lines[i] - })); - } - } - - return result; - }, - parseOpera10: function ErrorStackParser$$parseOpera10(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; - var lines = e.stacktrace.split('\n'); - var result = []; - - for (var i = 0, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - - if (match) { - result.push(new StackFrame({ - functionName: match[3] || undefined, - fileName: match[2], - lineNumber: match[1], - source: lines[i] - })); - } - } - - return result; - }, - // Opera 10.65+ Error.stack very similar to FF/Safari - parseOpera11: function ErrorStackParser$$parseOpera11(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/); - }, this); - return filtered.map(function (line) { - var tokens = line.split('@'); - var locationParts = this.extractLocation(tokens.pop()); - var functionCall = tokens.shift() || ''; - var functionName = functionCall.replace(//, '$2').replace(/\([^)]*\)/g, '') || undefined; - var argsRaw; - - if (functionCall.match(/\(([^)]*)\)/)) { - argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1'); - } - - var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(','); - return new StackFrame({ - functionName: functionName, - args: args, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - }, this); - } - }; -}); - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function nullthrows(x, message) { - if (x != null) { - return x; - } - - var error = new Error(message !== undefined ? message : 'Got unexpected ' + x); - error.framesToPop = 1; // Skip nullthrows's own stack frame. - - throw error; -} - -module.exports = nullthrows; -module.exports.default = nullthrows; -Object.defineProperty(module.exports, '__esModule', { - value: true -}); - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var runtime = function (exports) { - "use strict"; - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - function define(obj, key, value) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - return obj[key]; - } - - try { - // IE 8 has a broken Object.defineProperty that only works on DOM objects. - define({}, ""); - } catch (err) { - define = function (obj, key, value) { - return obj[key] = value; - }; - } - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - - generator._invoke = makeInvokeMethod(innerFn, self, context); - return generator; - } - - exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - - function tryCatch(fn, obj, arg) { - try { - return { - type: "normal", - arg: fn.call(obj, arg) - }; - } catch (err) { - return { - type: "throw", - arg: err - }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - - var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - - function Generator() {} - - function GeneratorFunction() {} - - function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - - - var IteratorPrototype = {}; - - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - - if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function (method) { - define(prototype, method, function (arg) { - return this._invoke(method, arg); - }); - }); - } - - exports.isGeneratorFunction = function (genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" : false; - }; - - exports.mark = function (genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - define(genFun, toStringTagSymbol, "GeneratorFunction"); - } - - genFun.prototype = Object.create(Gp); - return genFun; - }; // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - - - exports.awrap = function (arg) { - return { - __await: arg - }; - }; - - function AsyncIterator(generator, PromiseImpl) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - - if (value && typeof value === "object" && hasOwn.call(value, "__await")) { - return PromiseImpl.resolve(value.__await).then(function (value) { - invoke("next", value, resolve, reject); - }, function (err) { - invoke("throw", err, resolve, reject); - }); - } - - return PromiseImpl.resolve(value).then(function (unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. - result.value = unwrapped; - resolve(result); - }, function (error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. - return invoke("throw", error, resolve, reject); - }); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new PromiseImpl(function (resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); - } // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - - - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - - exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - - exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { - if (PromiseImpl === void 0) PromiseImpl = Promise; - var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); - return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function (result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - - - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - var record = tryCatch(innerFn, self, context); - - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done ? GenStateCompleted : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - } else if (record.type === "throw") { - state = GenStateCompleted; // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - - - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - // Note: ["return"] must be used for ES3 parsing compatibility. - if (delegate.iterator["return"]) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError("The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (!info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). - - context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - } else { - // Re-yield the result returned by the delegate method. - return info; - } // The delegate iterator is finished, so forget it and continue with - // the outer generator. - - - context.delegate = null; - return ContinueSentinel; - } // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - - - defineIteratorMethods(Gp); - define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - - Gp[iteratorSymbol] = function () { - return this; - }; - - Gp.toString = function () { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { - tryLoc: locs[0] - }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ - tryLoc: "root" - }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - exports.keys = function (object) { - var keys = []; - - for (var key in object) { - keys.push(key); - } - - keys.reverse(); // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - - return function next() { - while (keys.length) { - var key = keys.pop(); - - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - - - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, - next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - return next; - }; - - return next.next = next; - } - } // Return an iterator with no values. - - - return { - next: doneResult - }; - } - - exports.values = values; - - function doneResult() { - return { - value: undefined, - done: true - }; - } - - Context.prototype = { - constructor: Context, - reset: function (skipTempReset) { - this.prev = 0; - this.next = 0; // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - this.method = "next"; - this.arg = undefined; - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - stop: function () { - this.done = true; - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - dispatchException: function (exception) { - if (this.done) { - throw exception; - } - - var context = this; - - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - - return !!caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - abrupt: function (type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - - if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - complete: function (record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - finish: function (finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - "catch": function (tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - - return thrown; - } - } // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - - - throw new Error("illegal catch attempt"); - }, - delegateYield: function (iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - - return ContinueSentinel; - } - }; // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - - return exports; -}( // If this script is executing as a CommonJS module, use module.exports -// as the regeneratorRuntime namespace. Otherwise create a new empty -// object. Either way, the resulting object will be used to initialize -// the regeneratorRuntime variable at the top of this file. - true ? module.exports : undefined); - -try { - regeneratorRuntime = runtime; -} catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - Function("r", "regeneratorRuntime = r")(runtime); -} - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.importFromOldV8CPUProfile = exports.importFromChromeCPUProfile = exports.importFromChromeTimeline = exports.isChromeTimeline = void 0; - -const profile_1 = __webpack_require__(7); - -const utils_1 = __webpack_require__(0); - -const value_formatters_1 = __webpack_require__(2); - -const v8cpuFormatter_1 = __webpack_require__(9); - -function isChromeTimeline(rawProfile) { - if (!Array.isArray(rawProfile)) return false; - if (rawProfile.length < 1) return false; - const first = rawProfile[0]; - if (!('pid' in first && 'tid' in first && 'ph' in first && 'cat' in first)) return false; - if (!rawProfile.find(e => e.name === 'CpuProfile' || e.name === 'Profile' || e.name === 'ProfileChunk')) return false; - return true; -} - -exports.isChromeTimeline = isChromeTimeline; - -function importFromChromeTimeline(events, fileName) { - // It seems like sometimes Chrome timeline files contain multiple CpuProfiles? - // For now, choose the first one in the list. - const cpuProfileByID = new Map(); // Maps profile IDs (like "0x3") to pid/tid pairs formatted as `${pid}:${tid}` - - const pidTidById = new Map(); // Maps pid/tid pairs to thread names - - const threadNameByPidTid = new Map(); // The events aren't necessarily recorded in chronological order. Sort them so - // that they are. - - utils_1.sortBy(events, e => e.ts); - - for (let event of events) { - if (event.name === 'CpuProfile') { - const pidTid = `${event.pid}:${event.tid}`; - const id = event.id || pidTid; - cpuProfileByID.set(id, event.args.data.cpuProfile); - pidTidById.set(id, pidTid); - } - - if (event.name === 'Profile') { - const pidTid = `${event.pid}:${event.tid}`; - cpuProfileByID.set(event.id || pidTid, Object.assign({ - startTime: 0, - endTime: 0, - nodes: [], - samples: [], - timeDeltas: [] - }, event.args.data)); - - if (event.id) { - pidTidById.set(event.id, `${event.pid}:${event.tid}`); - } - } - - if (event.name === 'thread_name') { - threadNameByPidTid.set(`${event.pid}:${event.tid}`, event.args.name); - } - - if (event.name === 'ProfileChunk') { - const pidTid = `${event.pid}:${event.tid}`; - const cpuProfile = cpuProfileByID.get(event.id || pidTid); - - if (cpuProfile) { - const chunk = event.args.data; - - if (chunk.cpuProfile) { - if (chunk.cpuProfile.nodes) { - cpuProfile.nodes = cpuProfile.nodes.concat(chunk.cpuProfile.nodes); - } - - if (chunk.cpuProfile.samples) { - cpuProfile.samples = cpuProfile.samples.concat(chunk.cpuProfile.samples); - } - } - - if (chunk.timeDeltas) { - cpuProfile.timeDeltas = cpuProfile.timeDeltas.concat(chunk.timeDeltas); - } - - if (chunk.startTime != null) { - cpuProfile.startTime = chunk.startTime; - } - - if (chunk.endTime != null) { - cpuProfile.endTime = chunk.endTime; - } - } else { - console.warn(`Ignoring ProfileChunk for undeclared Profile with id ${event.id || pidTid}`); - } - } - } - - if (cpuProfileByID.size > 0) { - const profiles = []; - let indexToView = 0; - utils_1.itForEach(cpuProfileByID.keys(), profileId => { - let threadName = null; - let pidTid = pidTidById.get(profileId); - - if (pidTid) { - threadName = threadNameByPidTid.get(pidTid) || null; - - if (threadName) {} - } - - const profile = importFromChromeCPUProfile(cpuProfileByID.get(profileId)); - - if (threadName && cpuProfileByID.size > 1) { - profile.setName(`${fileName} - ${threadName}`); - - if (threadName === 'CrRendererMain') { - indexToView = profiles.length; - } - } else { - profile.setName(`${fileName}`); - } - - profiles.push(profile); - }); - return { - name: fileName, - indexToView, - profiles - }; - } else { - throw new Error('Could not find CPU profile in Timeline'); - } -} - -exports.importFromChromeTimeline = importFromChromeTimeline; -const callFrameToFrameInfo = new Map(); - -function frameInfoForCallFrame(callFrame) { - return utils_1.getOrInsert(callFrameToFrameInfo, callFrame, callFrame => { - const name = callFrame.functionName || '(anonymous)'; - const file = callFrame.url; - const line = callFrame.lineNumber; - const col = callFrame.columnNumber; - return { - key: `${name}:${file}:${line}:${col}`, - name, - file, - line, - col - }; - }); -} - -function shouldIgnoreFunction(callFrame) { - const { - functionName, - url - } = callFrame; - - if (url === 'native dummy.js') { - // I'm not really sure what this is about, but this seems to be used - // as a way of avoiding edge cases in V8's implementation. - // See: https://github.com/v8/v8/blob/b8626ca4/tools/js2c.py#L419-L424 - return true; - } - - return functionName === '(root)' || functionName === '(idle)'; -} - -function shouldPlaceOnTopOfPreviousStack(functionName) { - return functionName === '(garbage collector)' || functionName === '(program)'; -} - -function importFromChromeCPUProfile(chromeProfile) { - const profile = new profile_1.CallTreeProfileBuilder(chromeProfile.endTime - chromeProfile.startTime); - const nodeById = new Map(); - - for (let node of chromeProfile.nodes) { - nodeById.set(node.id, node); - } - - for (let node of chromeProfile.nodes) { - if (typeof node.parent === 'number') { - node.parent = nodeById.get(node.parent); - } - - if (!node.children) continue; - - for (let childId of node.children) { - const child = nodeById.get(childId); - if (!child) continue; - child.parent = node; - } - } - - const samples = []; - const sampleTimes = []; // The first delta is relative to the profile startTime. - // Ref: https://github.com/v8/v8/blob/44bd8fd7/src/inspector/js_protocol.json#L1485 - - let elapsed = chromeProfile.timeDeltas[0]; // Prevents negative time deltas from causing bad data. See - // https://github.com/jlfwong/speedscope/pull/305 for details. - - let lastValidElapsed = elapsed; - let lastNodeId = NaN; // The chrome CPU profile format doesn't collapse identical samples. We'll do that - // here to save a ton of work later doing mergers. - - for (let i = 0; i < chromeProfile.samples.length; i++) { - const nodeId = chromeProfile.samples[i]; - - if (nodeId != lastNodeId) { - samples.push(nodeId); - - if (elapsed < lastValidElapsed) { - sampleTimes.push(lastValidElapsed); - } else { - sampleTimes.push(elapsed); - lastValidElapsed = elapsed; - } - } - - if (i === chromeProfile.samples.length - 1) { - if (!isNaN(lastNodeId)) { - samples.push(lastNodeId); - - if (elapsed < lastValidElapsed) { - sampleTimes.push(lastValidElapsed); - } else { - sampleTimes.push(elapsed); - lastValidElapsed = elapsed; - } - } - } else { - const timeDelta = chromeProfile.timeDeltas[i + 1]; - elapsed += timeDelta; - lastNodeId = nodeId; - } - } - - let prevStack = []; - - for (let i = 0; i < samples.length; i++) { - const value = sampleTimes[i]; - const nodeId = samples[i]; - let stackTop = nodeById.get(nodeId); - if (!stackTop) continue; // Find lowest common ancestor of the current stack and the previous one - - let lca = null; // This is O(n^2), but n should be relatively small here (stack height), - // so hopefully this isn't much of a problem - - for (lca = stackTop; lca && prevStack.indexOf(lca) === -1; lca = shouldPlaceOnTopOfPreviousStack(lca.callFrame.functionName) ? utils_1.lastOf(prevStack) : lca.parent || null) {} // Close frames that are no longer open - - - while (prevStack.length > 0 && utils_1.lastOf(prevStack) != lca) { - const closingNode = prevStack.pop(); - const frame = frameInfoForCallFrame(closingNode.callFrame); - profile.leaveFrame(frame, value); - } // Open frames that are now becoming open - - - const toOpen = []; - - for (let node = stackTop; node && node != lca && !shouldIgnoreFunction(node.callFrame); // Place Chrome internal functions on top of the previous call stack - node = shouldPlaceOnTopOfPreviousStack(node.callFrame.functionName) ? utils_1.lastOf(prevStack) : node.parent || null) { - toOpen.push(node); - } - - toOpen.reverse(); - - for (let node of toOpen) { - profile.enterFrame(frameInfoForCallFrame(node.callFrame), value); - } - - prevStack = prevStack.concat(toOpen); - } // Close frames that are open at the end of the trace - - - for (let i = prevStack.length - 1; i >= 0; i--) { - profile.leaveFrame(frameInfoForCallFrame(prevStack[i].callFrame), utils_1.lastOf(sampleTimes)); - } - - profile.setValueFormatter(new value_formatters_1.TimeFormatter('microseconds')); - return profile.build(); -} - -exports.importFromChromeCPUProfile = importFromChromeCPUProfile; - -function importFromOldV8CPUProfile(content) { - return importFromChromeCPUProfile(v8cpuFormatter_1.chromeTreeToNodes(content)); -} - -exports.importFromOldV8CPUProfile = importFromOldV8CPUProfile; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : 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 (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function (resolve) { - resolve(value); - }); - } - - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CallTreeProfileBuilder = exports.StackListProfileBuilder = exports.Profile = exports.CallTreeNode = exports.Frame = exports.HasWeights = void 0; - -const utils_1 = __webpack_require__(0); - -const value_formatters_1 = __webpack_require__(2); - -const demangleCppModule = Promise.resolve().then(() => __importStar(__webpack_require__(8))); // Force eager loading of the module - -demangleCppModule.then(() => {}); - -class HasWeights { - constructor() { - this.selfWeight = 0; - this.totalWeight = 0; - } - - getSelfWeight() { - return this.selfWeight; - } - - getTotalWeight() { - return this.totalWeight; - } - - addToTotalWeight(delta) { - this.totalWeight += delta; - } - - addToSelfWeight(delta) { - this.selfWeight += delta; - } - - overwriteWeightWith(other) { - this.selfWeight = other.selfWeight; - this.totalWeight = other.totalWeight; - } - -} - -exports.HasWeights = HasWeights; - -let Frame = -/** @class */ -(() => { - class Frame extends HasWeights { - constructor(info) { - super(); - this.key = info.key; - this.name = info.name; - this.file = info.file; - this.line = info.line; - this.col = info.col; - } - - static getOrInsert(set, info) { - return set.getOrInsert(new Frame(info)); - } - - } - - Frame.root = new Frame({ - key: '(speedscope root)', - name: '(speedscope root)' - }); - return Frame; -})(); - -exports.Frame = Frame; - -class CallTreeNode extends HasWeights { - constructor(frame, parent) { - super(); - this.frame = frame; - this.parent = parent; - this.children = []; // If a node is "frozen", it means it should no longer be mutated. - - this.frozen = false; - } - - isRoot() { - return this.frame === Frame.root; - } - - isFrozen() { - return this.frozen; - } - - freeze() { - this.frozen = true; - } - -} - -exports.CallTreeNode = CallTreeNode; - -class Profile { - constructor(totalWeight = 0) { - this.name = ''; - this.frames = new utils_1.KeyedSet(); // Profiles store two call-trees. - // - // The "append order" call tree is the one in which nodes are ordered in - // whatever order they were appended to their parent. - // - // The "grouped" call tree is one in which each node has at most one child per - // frame. Nodes are ordered in decreasing order of weight - - this.appendOrderCalltreeRoot = new CallTreeNode(Frame.root, null); - this.groupedCalltreeRoot = new CallTreeNode(Frame.root, null); // List of references to CallTreeNodes at the top of the - // stack at the time of the sample. - - this.samples = []; - this.weights = []; - this.valueFormatter = new value_formatters_1.RawValueFormatter(); - this.totalNonIdleWeight = null; - this.totalWeight = totalWeight; - } - - getAppendOrderCalltreeRoot() { - return this.appendOrderCalltreeRoot; - } - - getGroupedCalltreeRoot() { - return this.groupedCalltreeRoot; - } - - formatValue(v) { - return this.valueFormatter.format(v); - } - - setValueFormatter(f) { - this.valueFormatter = f; - } - - getWeightUnit() { - return this.valueFormatter.unit; - } - - getName() { - return this.name; - } - - setName(name) { - this.name = name; - } - - getTotalWeight() { - return this.totalWeight; - } - - getTotalNonIdleWeight() { - if (this.totalNonIdleWeight === null) { - this.totalNonIdleWeight = this.groupedCalltreeRoot.children.reduce((n, c) => n + c.getTotalWeight(), 0); - } - - return this.totalNonIdleWeight; - } // This is private because it should only be called in the ProfileBuilder - // classes. Once a Profile instance has been constructed, it should be treated - // as immutable. - - - sortGroupedCallTree() { - function visit(node) { - node.children.sort((a, b) => -(a.getTotalWeight() - b.getTotalWeight())); - node.children.forEach(visit); - } - - visit(this.groupedCalltreeRoot); - } - - forEachCallGrouped(openFrame, closeFrame) { - function visit(node, start) { - if (node.frame !== Frame.root) { - openFrame(node, start); - } - - let childTime = 0; - node.children.forEach(function (child) { - visit(child, start + childTime); - childTime += child.getTotalWeight(); - }); - - if (node.frame !== Frame.root) { - closeFrame(node, start + node.getTotalWeight()); - } - } - - visit(this.groupedCalltreeRoot, 0); - } - - forEachCall(openFrame, closeFrame) { - let prevStack = []; - let value = 0; - let sampleIndex = 0; - - for (let stackTop of this.samples) { - // Find lowest common ancestor of the current stack and the previous one - let lca = null; // This is O(n^2), but n should be relatively small here (stack height), - // so hopefully this isn't much of a problem - - for (lca = stackTop; lca && lca.frame != Frame.root && prevStack.indexOf(lca) === -1; lca = lca.parent) {} // Close frames that are no longer open - - - while (prevStack.length > 0 && utils_1.lastOf(prevStack) != lca) { - const node = prevStack.pop(); - closeFrame(node, value); - } // Open frames that are now becoming open - - - const toOpen = []; - - for (let node = stackTop; node && node.frame != Frame.root && node != lca; node = node.parent) { - toOpen.push(node); - } - - toOpen.reverse(); - - for (let node of toOpen) { - openFrame(node, value); - } - - prevStack = prevStack.concat(toOpen); - value += this.weights[sampleIndex++]; - } // Close frames that are open at the end of the trace - - - for (let i = prevStack.length - 1; i >= 0; i--) { - closeFrame(prevStack[i], value); - } - } - - forEachFrame(fn) { - this.frames.forEach(fn); - } - - getProfileWithRecursionFlattened() { - const builder = new CallTreeProfileBuilder(); - const stack = []; - const framesInStack = new Set(); - - function openFrame(node, value) { - if (framesInStack.has(node.frame)) { - stack.push(null); - } else { - framesInStack.add(node.frame); - stack.push(node); - builder.enterFrame(node.frame, value); - } - } - - function closeFrame(node, value) { - const stackTop = stack.pop(); - - if (stackTop) { - framesInStack.delete(stackTop.frame); - builder.leaveFrame(stackTop.frame, value); - } - } - - this.forEachCall(openFrame, closeFrame); - const flattenedProfile = builder.build(); - flattenedProfile.name = this.name; - flattenedProfile.valueFormatter = this.valueFormatter; // When constructing a profile with recursion flattened, - // counter-intuitive things can happen to "self time" measurements - // for functions. - // For example, given the following list of stacks w/ weights: - // - // a 1 - // a;b;a 1 - // a;b;a;b;a 1 - // a;b;a 1 - // - // The resulting profile with recursion flattened out will look like this: - // - // a 1 - // a;b 3 - // - // Which is useful to view, but it's counter-intuitive to move self-time - // for frames around, since analyzing the self-time of functions is an important - // thing to be able to do accurately, and we don't want this to change when recursion - // is flattened. To work around that, we'll just copy the weights directly from the - // un-flattened profile. - - this.forEachFrame(f => { - flattenedProfile.frames.getOrInsert(f).overwriteWeightWith(f); - }); - return flattenedProfile; - } - - getInvertedProfileForCallersOf(focalFrameInfo) { - const focalFrame = Frame.getOrInsert(this.frames, focalFrameInfo); - const builder = new StackListProfileBuilder(); // TODO(jlfwong): Could construct this at profile - // construction time rather than on demand. - - const nodes = []; - - function visit(node) { - if (node.frame === focalFrame) { - nodes.push(node); - } else { - for (let child of node.children) { - visit(child); - } - } - } - - visit(this.appendOrderCalltreeRoot); - - for (let node of nodes) { - const stack = []; - - for (let n = node; n != null && n.frame !== Frame.root; n = n.parent) { - stack.push(n.frame); - } - - builder.appendSampleWithWeight(stack, node.getTotalWeight()); - } - - const ret = builder.build(); - ret.name = this.name; - ret.valueFormatter = this.valueFormatter; - return ret; - } - - getProfileForCalleesOf(focalFrameInfo) { - const focalFrame = Frame.getOrInsert(this.frames, focalFrameInfo); - const builder = new StackListProfileBuilder(); - - function recordSubtree(focalFrameNode) { - const stack = []; - - function visit(node) { - stack.push(node.frame); - builder.appendSampleWithWeight(stack, node.getSelfWeight()); - - for (let child of node.children) { - visit(child); - } - - stack.pop(); - } - - visit(focalFrameNode); - } - - function findCalls(node) { - if (node.frame === focalFrame) { - recordSubtree(node); - } else { - for (let child of node.children) { - findCalls(child); - } - } - } - - findCalls(this.appendOrderCalltreeRoot); - const ret = builder.build(); - ret.name = this.name; - ret.valueFormatter = this.valueFormatter; - return ret; - } // Demangle symbols for readability - - - demangle() { - return __awaiter(this, void 0, void 0, function* () { - let demangleCpp = null; - - for (let frame of this.frames) { - // This function converts a mangled C++ name such as "__ZNK7Support6ColorFeqERKS0_" - // into a human-readable symbol (in this case "Support::ColorF::==(Support::ColorF&)") - if (frame.name.startsWith('__Z')) { - if (!demangleCpp) { - demangleCpp = (yield demangleCppModule).demangleCpp; - } - - frame.name = demangleCpp(frame.name); - } - } - }); - } - - remapNames(callback) { - for (let frame of this.frames) { - frame.name = callback(frame.name); - } - } - -} - -exports.Profile = Profile; - -class StackListProfileBuilder extends Profile { - constructor() { - super(...arguments); - this.pendingSample = null; - } - - _appendSample(stack, weight, useAppendOrder) { - if (isNaN(weight)) throw new Error('invalid weight'); - let node = useAppendOrder ? this.appendOrderCalltreeRoot : this.groupedCalltreeRoot; - let framesInStack = new Set(); - - for (let frameInfo of stack) { - const frame = Frame.getOrInsert(this.frames, frameInfo); - const last = useAppendOrder ? utils_1.lastOf(node.children) : node.children.find(c => c.frame === frame); - - if (last && !last.isFrozen() && last.frame == frame) { - node = last; - } else { - const parent = node; - node = new CallTreeNode(frame, node); - parent.children.push(node); - } - - node.addToTotalWeight(weight); // It's possible for the same frame to occur multiple - // times in the same call stack due to either direct - // or indirect recursion. We want to avoid counting that - // frame multiple times for a single sample, we so just - // track all of the unique frames that participated in - // this call stack, then add to their weight at the end. - - framesInStack.add(node.frame); - } - - node.addToSelfWeight(weight); - - if (useAppendOrder) { - for (let child of node.children) { - child.freeze(); - } - } - - if (useAppendOrder) { - node.frame.addToSelfWeight(weight); - - for (let frame of framesInStack) { - frame.addToTotalWeight(weight); - } - - if (node === utils_1.lastOf(this.samples)) { - this.weights[this.weights.length - 1] += weight; - } else { - this.samples.push(node); - this.weights.push(weight); - } - } - } - - appendSampleWithWeight(stack, weight) { - if (weight === 0) { - // Samples with zero weight have no effect, so let's ignore them - return; - } - - if (weight < 0) { - throw new Error('Samples must have positive weights'); - } - - this._appendSample(stack, weight, true); - - this._appendSample(stack, weight, false); - } - - appendSampleWithTimestamp(stack, timestamp) { - if (this.pendingSample) { - if (timestamp < this.pendingSample.centralTimestamp) { - throw new Error('Timestamps received out of order'); - } - - const endTimestamp = (timestamp + this.pendingSample.centralTimestamp) / 2; - this.appendSampleWithWeight(this.pendingSample.stack, endTimestamp - this.pendingSample.startTimestamp); - this.pendingSample = { - stack, - startTimestamp: endTimestamp, - centralTimestamp: timestamp - }; - } else { - this.pendingSample = { - stack, - startTimestamp: timestamp, - centralTimestamp: timestamp - }; - } - } - - build() { - if (this.pendingSample) { - if (this.samples.length > 0) { - this.appendSampleWithWeight(this.pendingSample.stack, this.pendingSample.centralTimestamp - this.pendingSample.startTimestamp); - } else { - // There is only a single sample. In this case, units will be meaningless, - // so we'll append with a weight of 1 and also clear any value formatter - this.appendSampleWithWeight(this.pendingSample.stack, 1); - this.setValueFormatter(new value_formatters_1.RawValueFormatter()); - } - } - - this.totalWeight = Math.max(this.totalWeight, this.weights.reduce((a, b) => a + b, 0)); - this.sortGroupedCallTree(); - return this; - } - -} - -exports.StackListProfileBuilder = StackListProfileBuilder; // As an alternative API for importing profiles more efficiently, provide a -// way to open & close frames directly without needing to construct tons of -// arrays as intermediaries. - -class CallTreeProfileBuilder extends Profile { - constructor() { - super(...arguments); - this.appendOrderStack = [this.appendOrderCalltreeRoot]; - this.groupedOrderStack = [this.groupedCalltreeRoot]; - this.framesInStack = new Map(); - this.stack = []; - this.lastValue = 0; - } - - addWeightsToFrames(value) { - const delta = value - this.lastValue; - - for (let frame of this.framesInStack.keys()) { - frame.addToTotalWeight(delta); - } - - const stackTop = utils_1.lastOf(this.stack); - - if (stackTop) { - stackTop.addToSelfWeight(delta); - } - } - - addWeightsToNodes(value, stack) { - const delta = value - this.lastValue; - - for (let node of stack) { - node.addToTotalWeight(delta); - } - - const stackTop = utils_1.lastOf(stack); - - if (stackTop) { - stackTop.addToSelfWeight(delta); - } - } - - _enterFrame(frame, value, useAppendOrder) { - let stack = useAppendOrder ? this.appendOrderStack : this.groupedOrderStack; - this.addWeightsToNodes(value, stack); - let prevTop = utils_1.lastOf(stack); - - if (prevTop) { - if (useAppendOrder) { - const delta = value - this.lastValue; - - if (delta > 0) { - this.samples.push(prevTop); - this.weights.push(value - this.lastValue); - } else if (delta < 0) { - throw new Error(`Samples must be provided in increasing order of cumulative value. Last sample was ${this.lastValue}, this sample was ${value}`); - } - } - - const last = useAppendOrder ? utils_1.lastOf(prevTop.children) : prevTop.children.find(c => c.frame === frame); - let node; - - if (last && !last.isFrozen() && last.frame == frame) { - node = last; - } else { - node = new CallTreeNode(frame, prevTop); - prevTop.children.push(node); - } - - stack.push(node); - } - } - - enterFrame(frameInfo, value) { - const frame = Frame.getOrInsert(this.frames, frameInfo); - this.addWeightsToFrames(value); - - this._enterFrame(frame, value, true); - - this._enterFrame(frame, value, false); - - this.stack.push(frame); - const frameCount = this.framesInStack.get(frame) || 0; - this.framesInStack.set(frame, frameCount + 1); - this.lastValue = value; - } - - _leaveFrame(frame, value, useAppendOrder) { - let stack = useAppendOrder ? this.appendOrderStack : this.groupedOrderStack; - this.addWeightsToNodes(value, stack); - - if (useAppendOrder) { - const leavingStackTop = this.appendOrderStack.pop(); - - if (leavingStackTop == null) { - throw new Error(`Trying to leave ${frame.key} when stack is empty`); - } - - if (this.lastValue == null) { - throw new Error(`Trying to leave a ${frame.key} before any have been entered`); - } - - leavingStackTop.freeze(); - - if (leavingStackTop.frame.key !== frame.key) { - throw new Error(`Tried to leave frame "${frame.name}" while frame "${leavingStackTop.frame.name}" was at the top at ${value}`); - } - - const delta = value - this.lastValue; - - if (delta > 0) { - this.samples.push(leavingStackTop); - this.weights.push(value - this.lastValue); - } else if (delta < 0) { - throw new Error(`Samples must be provided in increasing order of cumulative value. Last sample was ${this.lastValue}, this sample was ${value}`); - } - } else { - this.groupedOrderStack.pop(); - } - } - - leaveFrame(frameInfo, value) { - const frame = Frame.getOrInsert(this.frames, frameInfo); - this.addWeightsToFrames(value); - - this._leaveFrame(frame, value, true); - - this._leaveFrame(frame, value, false); - - this.stack.pop(); - const frameCount = this.framesInStack.get(frame); - if (frameCount == null) return; - - if (frameCount === 1) { - this.framesInStack.delete(frame); - } else { - this.framesInStack.set(frame, frameCount - 1); - } - - this.lastValue = value; - this.totalWeight = Math.max(this.totalWeight, this.lastValue); - } - - build() { - // Each stack is expected to contain a single node which we initialize to be - // the root node. - if (this.appendOrderStack.length > 1 || this.groupedOrderStack.length > 1) { - throw new Error('Tried to complete profile construction with a non-empty stack'); - } - - this.sortGroupedCallTree(); - return this; - } - -} - -exports.CallTreeProfileBuilder = CallTreeProfileBuilder; - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.demangleCpp = void 0; -let cppfilt; -const cache = new Map(); // This function converts a mangled C++ name such as "__ZNK7Support6ColorFeqERKS0_" -// into a human-readable symbol (in this case "Support::ColorF::==(Support::ColorF&)") - -function demangleCpp(name) { - if (name.startsWith('__Z')) { - let result = cache.get(name); - - if (result !== undefined) { - name = result; - } else { - if (!cppfilt) { - cppfilt = new Function('exports', code)(); - } - - result = cppfilt(name.slice(1)); - result = result === '(null)' ? name : result; - cache.set(name, result); - name = result; - } - } - - return name; -} - -exports.demangleCpp = demangleCpp; // This was taken from https://d.fuqu.jp/c++filtjs/ - -const code = ` -return function(){function r(r){eval.call(null,r)}function a(r){throw print(r+":\\n"+(new Error).stack),ke=!0,"Assertion: "+r}function e(r,e){r||a("Assertion failed: "+e)}function i(r,a,i,v){function t(r,a){if("string"==a){var e=Oe;return le.stackAlloc(r.length+1),A(r,e),e}return r}function f(r,a){return"string"==a?s(r):r}try{func=ce.Module["_"+r]}catch(r){}e(func,"Cannot call unknown function "+r+" (perhaps LLVM optimizations or closure removed it?)");var _=0,n=v?v.map(function(r){return t(r,i[_++])}):[];return f(func.apply(null,n),a)}function v(r,a,e){return function(){return i(r,a,e,Array.prototype.slice.call(arguments))}}function t(r,e,i,v){switch(i=i||"i8","*"===i[i.length-1]&&(i="i32"),i){case"i1":Ae[r]=e;break;case"i8":Ae[r]=e;break;case"i16":ye[r>>1]=e;break;case"i32":Se[r>>2]=e;break;case"i64":Se[r>>2]=e;break;case"float":Ce[r>>2]=e;break;case"double":ze[0]=e,Se[r>>2]=xe[0],Se[r+4>>2]=xe[1];break;default:a("invalid type for setValue: "+i)}}function f(r,e,i){switch(e=e||"i8","*"===e[e.length-1]&&(e="i32"),e){case"i1":return Ae[r];case"i8":return Ae[r];case"i16":return ye[r>>1];case"i32":return Se[r>>2];case"i64":return Se[r>>2];case"float":return Ce[r>>2];case"double":return xe[0]=Se[r>>2],xe[1]=Se[r+4>>2],ze[0];default:a("invalid type for setValue: "+e)}return null}function _(r,a,e){var i,v;"number"==typeof r?(i=!0,v=r):(i=!1,v=r.length);var f="string"==typeof a?a:null,_=[Jr,le.stackAlloc,le.staticAlloc][void 0===e?we:e](Math.max(v,f?1:a.length));if(i)return Fa(_,0,v),_;for(var s,n=0;n>12<<12}function l(){for(;Le<=Ie;)Le=o(2*Le);var r=Ae,a=new ArrayBuffer(Le);Ae=new Int8Array(a),ye=new Int16Array(a),Se=new Int32Array(a),ge=new Uint8Array(a),me=new Uint16Array(a),Me=new Uint32Array(a),Ce=new Float32Array(a),Re=new Float64Array(a),Ae.set(r)}function b(r){for(;r.length>0;){var a=r.shift(),e=a.func;"number"==typeof e&&(e=pe[e]),e(void 0===a.arg?null:a.arg)}}function k(){b(Ve)}function u(){b(Be),be.print()}function c(r,a){return Array.prototype.slice.call(Ae.subarray(r,r+a))}function h(r,a){for(var e=new Uint8Array(a),i=0;i255&&(v&=255),e.push(v),i+=1}return a||e.push(0),e}function E(r){for(var a=[],e=0;e255&&(i&=255),a.push(String.fromCharCode(i))}return a.join("")}function A(r,a,e){for(var i=0;i255&&(v&=255),Ae[a+i]=v,i+=1}e||(Ae[a+i]=0)}function g(r,a,e,i){return r>=0?r:a<=32?2*Math.abs(1<=v&&(a<=32||r>v)&&(r=-2*v+r),r}function m(r,a,e){if(0==(0|r)|0==(0|a)|0==(0|e))var i=0;else{Se[r>>2]=0,Se[r+4>>2]=a,Se[r+8>>2]=e;var i=1}var i;return i}function S(r,a,e){if(0==(0|r)|(0|a)<0|0==(0|e))var i=0;else{Se[r>>2]=41,Se[r+4>>2]=a,Se[r+8>>2]=e;var i=1}var i;return i}function M(r,a,e){if(0==(0|r)|0==(0|e))var i=0;else{Se[r>>2]=6,Se[r+4>>2]=a,Se[r+8>>2]=e;var i=1}var i;return i}function C(r,a,e){if(0==(0|r)|0==(0|e))var i=0;else{Se[r>>2]=7,Se[r+4>>2]=a,Se[r+8>>2]=e;var i=1}var i;return i}function R(r,a){var e,i=0==(0|a);do if(i)var v=0;else{var e=(r+32|0)>>2,t=Se[e];if((0|t)>=(0|Se[r+36>>2])){var v=0;break}var f=(t<<2)+Se[r+28>>2]|0;Se[f>>2]=a;var _=Se[e]+1|0;Se[e]=_;var v=1}while(0);var v;return v}function T(r,a){var e,e=(r+12|0)>>2,i=Se[e],v=i+1|0;Se[e]=v;var t=Ae[i]<<24>>24==95;do if(t){var f=i+2|0;if(Se[e]=f,Ae[v]<<24>>24!=90){var _=0;break}var s=O(r,a),_=s}else var _=0;while(0);var _;return _}function O(r,a){var e=r+12|0,i=Ae[Se[e>>2]];r:do if(i<<24>>24==71||i<<24>>24==84)var v=Tr(r),t=v;else{var f=Ar(r),_=0==(0|f)|0==(0|a);do if(!_){if(0!=(1&Se[r+8>>2]|0))break;var s=Me[f>>2],n=(s-25|0)>>>0<3;a:do if(n)for(var o=f;;){var o,l=Me[o+4>>2],b=Me[l>>2];if((b-25|0)>>>0>=3){var k=l,u=b;break a}var o=l}else var k=f,u=s;while(0);var u,k;if(2!=(0|u)){var t=k;break r}var c=k+8|0,h=Me[c>>2],d=(Se[h>>2]-25|0)>>>0<3;a:do if(d)for(var w=h;;){var w,p=Me[w+4>>2];if((Se[p>>2]-25|0)>>>0>=3){var E=p;break a}var w=p}else var E=h;while(0);var E;Se[c>>2]=E;var t=k;break r}while(0);var A=Ae[Se[e>>2]];if(A<<24>>24==0||A<<24>>24==69){var t=f;break}var g=Or(f),y=Sr(r,g),m=D(r,3,f,y),t=m}while(0);var t;return t}function N(r){var a,e,i=Oe;Oe+=4;var v=i,e=v>>2,a=(r+12|0)>>2,t=Me[a],f=Ae[t],_=f<<24>>24;r:do if(f<<24>>24==114||f<<24>>24==86||f<<24>>24==75){var s=I(r,v,0);if(0==(0|s)){var n=0;break}var o=N(r);Se[s>>2]=o;var l=Se[e],b=R(r,l);if(0==(0|b)){var n=0;break}var n=Se[e]}else{do{if(97==(0|_)||98==(0|_)||99==(0|_)||100==(0|_)||101==(0|_)||102==(0|_)||103==(0|_)||104==(0|_)||105==(0|_)||106==(0|_)||108==(0|_)||109==(0|_)||110==(0|_)||111==(0|_)||115==(0|_)||116==(0|_)||118==(0|_)||119==(0|_)||120==(0|_)||121==(0|_)||122==(0|_)){var k=ai+20*(_-97)|0,u=P(r,k);Se[e]=u;var c=r+48|0,h=Se[c>>2]+Se[Se[u+4>>2]+4>>2]|0;Se[c>>2]=h;var d=Se[a]+1|0;Se[a]=d;var n=u;break r}if(117==(0|_)){Se[a]=t+1|0;var w=L(r),p=D(r,34,w,0);Se[e]=p;var E=p}else if(70==(0|_)){var A=F(r);Se[e]=A;var E=A}else if(48==(0|_)||49==(0|_)||50==(0|_)||51==(0|_)||52==(0|_)||53==(0|_)||54==(0|_)||55==(0|_)||56==(0|_)||57==(0|_)||78==(0|_)||90==(0|_)){var g=X(r);Se[e]=g;var E=g}else if(65==(0|_)){var y=j(r);Se[e]=y;var E=y}else if(77==(0|_)){var m=U(r);Se[e]=m;var E=m}else if(84==(0|_)){var S=x(r);if(Se[e]=S,Ae[Se[a]]<<24>>24!=73){var E=S;break}var M=R(r,S);if(0==(0|M)){var n=0;break r}var C=Se[e],T=z(r),O=D(r,4,C,T);Se[e]=O;var E=O}else if(83==(0|_)){var B=ge[t+1|0];if((B-48&255&255)<10|B<<24>>24==95|(B-65&255&255)<26){var H=V(r,0);if(Se[e]=H,Ae[Se[a]]<<24>>24!=73){var n=H;break r}var K=z(r),Y=D(r,4,H,K);Se[e]=Y;var E=Y}else{var G=X(r);if(Se[e]=G,0==(0|G)){var E=0;break}if(21==(0|Se[G>>2])){var n=G;break r}var E=G}}else if(80==(0|_)){Se[a]=t+1|0;var W=N(r),Z=D(r,29,W,0);Se[e]=Z;var E=Z}else if(82==(0|_)){Se[a]=t+1|0;var Q=N(r),q=D(r,30,Q,0);Se[e]=q;var E=q}else if(67==(0|_)){Se[a]=t+1|0;var $=N(r),J=D(r,31,$,0);Se[e]=J;var E=J}else if(71==(0|_)){Se[a]=t+1|0;var rr=N(r),ar=D(r,32,rr,0);Se[e]=ar;var E=ar}else{if(85!=(0|_)){var n=0;break r}Se[a]=t+1|0;var er=L(r);Se[e]=er;var ir=N(r),vr=Se[e],tr=D(r,28,ir,vr);Se[e]=tr;var E=tr}}while(0);var E,fr=R(r,E);if(0==(0|fr)){var n=0;break}var n=Se[e]}while(0);var n;return Oe=i,n}function I(r,a,e){for(var i,v=r+12|0,t=0!=(0|e),f=t?25:22,i=(r+48|0)>>2,_=t?26:23,s=t?27:24,n=a;;){var n,o=Se[v>>2],l=Ae[o];if(l<<24>>24!=114&&l<<24>>24!=86&&l<<24>>24!=75){var b=n;break}var k=o+1|0;if(Se[v>>2]=k,l<<24>>24==114){var u=Se[i]+9|0;Se[i]=u;var c=f}else if(l<<24>>24==86){var h=Se[i]+9|0;Se[i]=h;var c=_}else{var d=Se[i]+6|0;Se[i]=d;var c=s}var c,w=D(r,c,0,0);if(Se[n>>2]=w,0==(0|w)){var b=0;break}var n=w+4|0}var b;return b}function P(r,a){var e=0==(0|a);do if(e)var i=0;else{var v=J(r);if(0==(0|v)){var i=0;break}Se[v>>2]=33,Se[v+4>>2]=a;var i=v}while(0);var i;return i}function D(r,a,e,i){var v,t;do{if(1==(0|a)||2==(0|a)||3==(0|a)||4==(0|a)||10==(0|a)||28==(0|a)||37==(0|a)||43==(0|a)||44==(0|a)||45==(0|a)||46==(0|a)||47==(0|a)||48==(0|a)||49==(0|a)||50==(0|a)){if(0==(0|e)|0==(0|i)){var f=0;t=7;break}t=5;break}if(8==(0|a)||9==(0|a)||11==(0|a)||12==(0|a)||13==(0|a)||14==(0|a)||15==(0|a)||16==(0|a)||17==(0|a)||18==(0|a)||19==(0|a)||20==(0|a)||29==(0|a)||30==(0|a)||31==(0|a)||32==(0|a)||34==(0|a)||38==(0|a)||39==(0|a)||42==(0|a)){if(0==(0|e)){var f=0;t=7;break}t=5;break}if(36==(0|a)){if(0==(0|i)){var f=0;t=7;break}t=5;break}if(35==(0|a)||22==(0|a)||23==(0|a)||24==(0|a)||25==(0|a)||26==(0|a)||27==(0|a))t=5;else{var f=0;t=7}}while(0);do if(5==t){var _=J(r),v=_>>2;if(0==(0|_)){var f=0;break}Se[v]=a,Se[v+1]=e,Se[v+2]=i;var f=_}while(0);var f;return f}function L(r){var a=sr(r);if((0|a)<1)var e=0;else{var i=Rr(r,a);Se[r+44>>2]=i;var e=i}var e;return e}function F(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;if(Se[a]=i,Ae[e]<<24>>24==70){if(Ae[i]<<24>>24==89){var v=e+2|0;Se[a]=v}var t=Sr(r,1),f=Se[a],_=f+1|0;Se[a]=_;var s=Ae[f]<<24>>24==69?t:0,n=s}else var n=0;var n;return n}function X(r){var a=Ar(r);return a}function j(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;Se[a]=i;var v=Ae[e]<<24>>24==65;do if(v){var t=Ae[i];if(t<<24>>24==95)var f=0;else if((t-48&255&255)<10){for(var _=i;;){var _,s=_+1|0;if(Se[a]=s,(Ae[s]-48&255&255)>=10)break;var _=s}var n=s-i|0,o=lr(r,i,n);if(0==(0|o)){var l=0;break}var f=o}else{var b=nr(r);if(0==(0|b)){var l=0;break}var f=b}var f,k=Se[a],u=k+1|0;if(Se[a]=u,Ae[k]<<24>>24!=95){var l=0;break}var c=N(r),h=D(r,36,f,c),l=h}else var l=0;while(0);var l;return l}function U(r){var a=Oe;Oe+=4;var e=a,i=r+12|0,v=Se[i>>2],t=v+1|0;Se[i>>2]=t;var f=Ae[v]<<24>>24==77;r:do if(f){var _=N(r),s=I(r,e,1);if(0==(0|s)){var n=0;break}var o=N(r);Se[s>>2]=o;var l=(0|s)==(0|e);do if(!l){if(35==(0|Se[o>>2]))break;var b=Se[e>>2],k=R(r,b);if(0==(0|k)){var n=0;break r}}while(0);var u=Se[e>>2],c=D(r,37,_,u),n=c}else var n=0;while(0);var n;return Oe=a,n}function x(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;Se[a]=i;var v=Ae[e]<<24>>24==84;do if(v){if(Ae[i]<<24>>24==95)var t=0,f=i;else{var _=sr(r);if((0|_)<0){var s=0;break}var t=_+1|0,f=Se[a]}var f,t;if(Se[a]=f+1|0,Ae[f]<<24>>24!=95){var s=0;break}var n=r+40|0,o=Se[n>>2]+1|0;Se[n>>2]=o;var l=Er(r,t),s=l}else var s=0;while(0);var s;return s}function z(r){var a,e=Oe;Oe+=4;var i=e,v=r+44|0,t=Se[v>>2],a=(r+12|0)>>2,f=Se[a],_=f+1|0;Se[a]=_;var s=Ae[f]<<24>>24==73;r:do if(s){Se[i>>2]=0;for(var n=i;;){var n,o=_r(r);if(0==(0|o)){var l=0;break r}var b=D(r,39,o,0);if(Se[n>>2]=b,0==(0|b)){var l=0;break r}var k=Se[a];if(Ae[k]<<24>>24==69)break;var n=b+8|0}var u=k+1|0;Se[a]=u,Se[v>>2]=t;var l=Se[i>>2]}else var l=0;while(0);var l;return Oe=e,l}function V(r,a){var e,e=(r+12|0)>>2,i=Se[e],v=i+1|0;Se[e]=v;var t=Ae[i]<<24>>24==83;r:do if(t){var f=i+2|0;Se[e]=f;var _=ge[v];if(_<<24>>24==95)var s=0;else{if(!((_-48&255&255)<10|(_-65&255&255)<26)){var n=8&Se[r+8>>2],o=n>>>3,l=0!=(0|n)|0==(0|a);do if(l)var b=o;else{if((Ae[f]-67&255&255)>=2){var b=o;break}var b=1}while(0);for(var b,k=0|ei;;){var k;if(k>>>0>=(ei+196|0)>>>0){var u=0;break r}if(_<<24>>24==Ae[0|k]<<24>>24)break;var k=k+28|0}var c=Se[k+20>>2];if(0!=(0|c)){var h=Se[k+24>>2],d=fr(r,c,h);Se[r+44>>2]=d}if(0==(0|b))var w=k+8|0,p=k+4|0;else var w=k+16|0,p=k+12|0;var p,w,E=Se[w>>2],A=Se[p>>2],g=r+48|0,y=Se[g>>2]+E|0;Se[g>>2]=y;var m=fr(r,A,E),u=m;break}for(var S=_,M=0,C=f;;){var C,M,S;if((S-48&255&255)<10)var R=36*M-48|0;else{if((S-65&255&255)>=26){var u=0;break r}var R=36*M-55|0}var R,T=(S<<24>>24)+R|0;if((0|T)<0){var u=0;break r}var O=C+1|0;Se[e]=O;var N=ge[C];if(N<<24>>24==95)break;var S=N,M=T,C=O}var s=T+1|0}var s;if((0|s)>=(0|Se[r+32>>2])){var u=0;break}var I=r+40|0,P=Se[I>>2]+1|0;Se[I>>2]=P;var u=Se[Se[r+28>>2]+(s<<2)>>2]}else var u=0;while(0);var u;return u}function B(r,a,e,i){var v,t,f,_,s=Oe;Oe+=28;var n,o=s,_=o>>2;Se[_]=r;var l=e+1|0,f=(o+12|0)>>2;Se[f]=l;var b=Jr(l),t=(o+4|0)>>2;if(Se[t]=b,0==(0|b))var k=0,u=1;else{var v=(o+8|0)>>2;Se[v]=0,Se[_+4]=0,Se[_+5]=0;var c=o+24|0;Se[c>>2]=0,H(o,a);var h=Me[t],d=0==(0|h);do{if(!d){var w=Me[v];if(w>>>0>=Me[f]>>>0){n=5;break}Se[v]=w+1|0,Ae[h+w|0]=0,n=6;break}n=5}while(0);5==n&&Y(o,0);var p=Se[t],E=0==(0|p)?Se[c>>2]:Se[f],k=p,u=E}var u,k;return Se[i>>2]=u,Oe=s,k}function H(r,a){var e,i,v,t,f,_,s,n,o,l,b,k,u,c,h,d,w,p,E,A,g,y,m,S,M,C,R,T,O,N,I,P,D,L,F,X,j,U,x,z,V,B,K,G,W,J,vr,tr,fr,_r,sr,nr,or,lr,br,kr,ur,cr,hr,dr,wr,pr=a>>2,Er=r>>2,Ar=Oe;Oe+=184;var gr,yr=Ar,wr=yr>>2,mr=Ar+64,dr=mr>>2,Sr=Ar+72,Mr=Ar+88,Cr=Ar+104,hr=Cr>>2,Rr=Ar+168,Tr=0==(0|a);r:do if(Tr)Z(r);else{var cr=(r+4|0)>>2,Or=Me[cr];if(0==(0|Or))break;var Nr=0|a,Ir=Me[Nr>>2];a:do{if(0==(0|Ir)){if(0!=(4&Se[Er]|0)){var Pr=Se[pr+1],Dr=Se[pr+2];q(r,Pr,Dr);break r}var ur=(r+8|0)>>2,Lr=Me[ur],Fr=a+8|0,Xr=Me[Fr>>2];if((Xr+Lr|0)>>>0>Me[Er+3]>>>0){var jr=Se[pr+1];Q(r,jr,Xr);break r}var Ur=Or+Lr|0,xr=Se[pr+1];Pa(Ur,xr,Xr,1);var zr=Se[ur]+Se[Fr>>2]|0;Se[ur]=zr;break r}if(1==(0|Ir)||2==(0|Ir)){var Vr=Se[pr+1];H(r,Vr);var Br=0==(4&Se[Er]|0),Hr=Me[cr],Kr=0!=(0|Hr);e:do if(Br){do if(Kr){var kr=(r+8|0)>>2,Yr=Me[kr];if((Yr+2|0)>>>0>Me[Er+3]>>>0)break;var Gr=Hr+Yr|0;oe=14906,Ae[Gr]=255&oe,oe>>=8,Ae[Gr+1]=255&oe;var Wr=Se[kr]+2|0;Se[kr]=Wr;break e}while(0);Q(r,0|He.__str120,2)}else{do if(Kr){var Zr=r+8|0,Qr=Me[Zr>>2];if(Qr>>>0>=Me[Er+3]>>>0)break;Se[Zr>>2]=Qr+1|0,Ae[Hr+Qr|0]=46;break e}while(0);Y(r,46)}while(0);var qr=Se[pr+2];H(r,qr);break r}if(3==(0|Ir)){for(var br=(r+20|0)>>2,$r=Me[br],lr=(r+16|0)>>2,Jr=a,ra=0,aa=$r;;){var aa,ra,Jr,ea=Me[Jr+4>>2];if(0==(0|ea)){var ia=ra,va=0;gr=33;break}if(ra>>>0>3){Z(r);break r}var ta=(ra<<4)+yr|0;Se[ta>>2]=aa,Se[br]=ta,Se[((ra<<4)+4>>2)+wr]=ea,Se[((ra<<4)+8>>2)+wr]=0;var fa=Me[lr];Se[((ra<<4)+12>>2)+wr]=fa;var _a=ra+1|0,sa=0|ea,na=Me[sa>>2];if((na-25|0)>>>0>=3){gr=25;break}var Jr=ea,ra=_a,aa=ta}e:do if(25==gr){if(4==(0|na)){Se[dr]=fa,Se[lr]=mr,Se[dr+1]=ea;var oa=Se[sa>>2],la=mr}else var oa=na,la=fa;var la,oa;if(2!=(0|oa)){var ia=_a,va=sa;break}for(var ba=_a,ka=ea+8|0;;){var ka,ba,ua=Me[ka>>2];if((Se[ua>>2]-25|0)>>>0>=3){var ia=ba,va=sa;break e}if(ba>>>0>3)break;var ca=(ba<<4)+yr|0,ha=ba-1|0,da=(ha<<4)+yr|0,or=ca>>2,nr=da>>2;Se[or]=Se[nr],Se[or+1]=Se[nr+1],Se[or+2]=Se[nr+2],Se[or+3]=Se[nr+3],Se[ca>>2]=da,Se[br]=ca,Se[((ha<<4)+4>>2)+wr]=ua,Se[((ha<<4)+8>>2)+wr]=0,Se[((ha<<4)+12>>2)+wr]=la;var ba=ba+1|0,ka=ua+4|0}Z(r);break r}while(0);var va,ia,wa=Se[pr+2];if(H(r,wa),4==(0|Se[va>>2])){var pa=Se[dr];Se[lr]=pa}var Ea=0==(0|ia);e:do if(!Ea)for(var Aa=r+8|0,ga=r+12|0,ya=ia;;){var ya,ma=ya-1|0;if(0==(0|Se[((ma<<4)+8>>2)+wr])){var Sa=Me[cr],Ma=0==(0|Sa);do{if(!Ma){var Ca=Me[Aa>>2];if(Ca>>>0>=Me[ga>>2]>>>0){gr=41;break}Se[Aa>>2]=Ca+1|0,Ae[Sa+Ca|0]=32,gr=42;break}gr=41}while(0);41==gr&&Y(r,32);var Ra=Se[((ma<<4)+4>>2)+wr];$(r,Ra)}if(0==(0|ma))break e;var ya=ma}while(0);Se[br]=$r;break r}if(4==(0|Ir)){var sr=(r+20|0)>>2,Ta=Se[sr];Se[sr]=0;var Oa=Se[pr+1];H(r,Oa);var Na=Me[cr],Ia=0==(0|Na);do{if(!Ia){var _r=(r+8|0)>>2,Da=Me[_r],La=0==(0|Da);do if(!La){if(Ae[Na+(Da-1)|0]<<24>>24!=60)break;Da>>>0>>0?(Se[_r]=Da+1|0,Ae[Na+Da|0]=32):Y(r,32)}while(0);var Fa=Me[cr];if(0==(0|Fa)){gr=54;break}var Xa=Me[_r];if(Xa>>>0>=Me[Er+3]>>>0){gr=54;break}Se[_r]=Xa+1|0,Ae[Fa+Xa|0]=60,gr=55;break}gr=54}while(0);54==gr&&Y(r,60);var ja=Se[pr+2];H(r,ja);var Ua=Me[cr],xa=0==(0|Ua);do{if(!xa){var fr=(r+8|0)>>2,za=Me[fr],Va=0==(0|za);do if(!Va){if(Ae[Ua+(za-1)|0]<<24>>24!=62)break;za>>>0>>0?(Se[fr]=za+1|0,Ae[Ua+za|0]=32):Y(r,32)}while(0);var Ba=Me[cr];if(0==(0|Ba)){gr=64;break}var Ha=Me[fr];if(Ha>>>0>=Me[Er+3]>>>0){gr=64;break}Se[fr]=Ha+1|0,Ae[Ba+Ha|0]=62,gr=65;break}gr=64}while(0);64==gr&&Y(r,62),Se[sr]=Ta;break r}if(5==(0|Ir)){var tr=(r+16|0)>>2,Ka=Me[tr];if(0==(0|Ka)){Z(r);break r}for(var Ya=Se[pr+1],Ga=Se[Ka+4>>2];;){var Ga,Ya,Wa=Se[Ga+8>>2];if(0==(0|Wa))break;if(39!=(0|Se[Wa>>2])){Z(r);break r}if((0|Ya)<1){if(0!=(0|Ya))break;var Za=Se[Ka>>2];Se[tr]=Za;var Qa=Se[Wa+4>>2];H(r,Qa),Se[tr]=Ka;break r}var Ya=Ya-1|0,Ga=Wa}Z(r);break r}if(6==(0|Ir)){var qa=Se[pr+2];H(r,qa);break r}if(7==(0|Ir)){var $a=r+8|0,Ja=Me[$a>>2];Ja>>>0>>0?(Se[$a>>2]=Ja+1|0,Ae[Or+Ja|0]=126):Y(r,126);var re=Se[pr+2];H(r,re);break r}if(8==(0|Ir)){var vr=(r+8|0)>>2,ae=Me[vr];if((ae+11|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str121,11);else{for(var ee=Or+ae|0,ie=0|He.__str121,ve=ee,te=ie+11;ie>2,se=Me[J];if((se+8|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str122,8);else{var ne=Or+se|0,le=0|ne;oe=542397526,Ae[le]=255&oe,oe>>=8,Ae[le+1]=255&oe,oe>>=8,Ae[le+2]=255&oe,oe>>=8,Ae[le+3]=255&oe;var be=ne+4|0;oe=544370534,Ae[be]=255&oe,oe>>=8,Ae[be+1]=255&oe,oe>>=8,Ae[be+2]=255&oe,oe>>=8,Ae[be+3]=255&oe;var ke=Se[J]+8|0;Se[J]=ke}var ue=Se[pr+1];H(r,ue);break r}if(10==(0|Ir)){var W=(r+8|0)>>2,ce=Me[W],he=r+12|0;if((ce+24|0)>>>0>Me[he>>2]>>>0)Q(r,0|He.__str123,24);else{var de=Or+ce|0;Pa(de,0|He.__str123,24,1);var we=Se[W]+24|0;Se[W]=we}var pe=Se[pr+1];H(r,pe);var Ee=Me[cr],ge=0==(0|Ee);do{if(!ge){var ye=Me[W];if((ye+4|0)>>>0>Me[he>>2]>>>0){gr=96;break}var me=Ee+ye|0;oe=762210605,Ae[me]=255&oe,oe>>=8,Ae[me+1]=255&oe,oe>>=8,Ae[me+2]=255&oe,oe>>=8,Ae[me+3]=255&oe;var Ce=Se[W]+4|0;Se[W]=Ce,gr=97;break}gr=96}while(0);96==gr&&Q(r,0|He.__str124,4);var Re=Se[pr+2];H(r,Re);break r}if(11==(0|Ir)){var G=(r+8|0)>>2,Te=Me[G];if((Te+13|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str125,13);else{for(var Ne=Or+Te|0,ie=0|He.__str125,ve=Ne,te=ie+13;ie>2,De=Me[K];if((De+18|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str126,18);else{for(var Le=Or+De|0,ie=0|He.__str126,ve=Le,te=ie+18;ie>2,je=Me[B];if((je+16|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str127,16);else{for(var Ue=Or+je|0,ie=0|He.__str127,ve=Ue,te=ie+16;ie>2,Ve=Me[V];if((Ve+21|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str128,21);else{var Be=Or+Ve|0;Pa(Be,0|He.__str128,21,1);var Ke=Se[V]+21|0;Se[V]=Ke}var Ye=Se[pr+1];H(r,Ye);break r}if(15==(0|Ir)){var z=(r+8|0)>>2,Ge=Me[z];if((Ge+17|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str129,17);else{for(var We=Or+Ge|0,ie=0|He.__str129,ve=We,te=ie+17;ie>2,qe=Me[x];if((qe+26|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str130,26);else{var $e=Or+qe|0;Pa($e,0|He.__str130,26,1);var Je=Se[x]+26|0;Se[x]=Je}var ri=Se[pr+1];H(r,ri);break r}if(17==(0|Ir)){var U=(r+8|0)>>2,ai=Me[U];if((ai+15|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str131,15);else{for(var ei=Or+ai|0,ie=0|He.__str131,ve=ei,te=ie+15;ie>2,ti=Me[j];if((ti+19|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str132,19);else{for(var fi=Or+ti|0,ie=0|He.__str132,ve=fi,te=ie+19;ie>2,ni=Me[X];if((ni+24|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str133,24);else{var oi=Or+ni|0;Pa(oi,0|He.__str133,24,1);var li=Se[X]+24|0;Se[X]=li}var bi=Se[pr+1];H(r,bi);break r}if(20==(0|Ir)){var F=(r+8|0)>>2,ki=Me[F];if((ki+17|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str134,17);else{for(var ui=Or+ki|0,ie=0|He.__str134,ve=ui,te=ie+17;ie>2,di=Me[L],wi=a+8|0,pi=Me[wi>>2];if((pi+di|0)>>>0>Me[Er+3]>>>0){var Ei=Se[pr+1];Q(r,Ei,pi);break r}var Ai=Or+di|0,gi=Se[pr+1];Pa(Ai,gi,pi,1);var yi=Se[L]+Se[wi>>2]|0;Se[L]=yi;break r}if(22==(0|Ir)||23==(0|Ir)||24==(0|Ir)){for(var mi=r+20|0;;){var mi,Si=Me[mi>>2];if(0==(0|Si))break a;if(0==(0|Se[Si+8>>2])){var Mi=Me[Se[Si+4>>2]>>2];if((Mi-22|0)>>>0>=3)break a;if((0|Mi)==(0|Ir))break}var mi=0|Si}var Ci=Se[pr+1];H(r,Ci);break r}if(25!=(0|Ir)&&26!=(0|Ir)&&27!=(0|Ir)&&28!=(0|Ir)&&29!=(0|Ir)&&30!=(0|Ir)&&31!=(0|Ir)&&32!=(0|Ir)){if(33==(0|Ir)){var D=(r+8|0)>>2,Ri=Me[D],P=(a+4|0)>>2,I=Me[P]>>2;if(0==(4&Se[Er]|0)){var Ti=Me[I+1];if((Ti+Ri|0)>>>0>Me[Er+3]>>>0){var Oi=Se[I];Q(r,Oi,Ti);break r}var Ni=Or+Ri|0,Ii=Se[I];Pa(Ni,Ii,Ti,1);var Pi=Se[D]+Se[Se[P]+4>>2]|0;Se[D]=Pi;break r}var Di=Me[I+3];if((Di+Ri|0)>>>0>Me[Er+3]>>>0){var Li=Se[I+2];Q(r,Li,Di);break r}var Fi=Or+Ri|0,Xi=Se[I+2];Pa(Fi,Xi,Di,1);var ji=Se[D]+Se[Se[P]+12>>2]|0;Se[D]=ji;break r}if(34==(0|Ir)){var Ui=Se[pr+1];H(r,Ui);break r}if(35==(0|Ir)){var N=(0|r)>>2;if(0!=(32&Se[N]|0)){var xi=Se[Er+5];rr(r,a,xi)}var zi=a+4|0,Vi=0==(0|Se[zi>>2]);e:do if(!Vi){var O=(r+20|0)>>2,Bi=Se[O],Hi=0|Mr;Se[Hi>>2]=Bi,Se[O]=Mr,Se[Mr+4>>2]=a;var Ki=Mr+8|0;Se[Ki>>2]=0;var Yi=Se[Er+4];Se[Mr+12>>2]=Yi;var Gi=Se[zi>>2];H(r,Gi);var Wi=Se[Hi>>2];if(Se[O]=Wi,0!=(0|Se[Ki>>2]))break r;if(0!=(32&Se[N]|0))break;var Zi=Me[cr],Qi=0==(0|Zi);do if(!Qi){var qi=r+8|0,$i=Me[qi>>2];if($i>>>0>=Me[Er+3]>>>0)break;Se[qi>>2]=$i+1|0,Ae[Zi+$i|0]=32;break e}while(0);Y(r,32)}while(0);if(0!=(32&Se[N]|0))break r;var Ji=Se[Er+5];rr(r,a,Ji);break r}if(36==(0|Ir)){var T=(r+20|0)>>2,rv=Me[T],av=0|Cr;Se[hr]=rv,Se[T]=av,Se[hr+1]=a;var ev=Cr+8|0;Se[ev>>2]=0;var iv=Se[Er+4];Se[hr+3]=iv;for(var vv=rv,tv=1;;){var tv,vv;if(0==(0|vv))break;if((Se[Se[vv+4>>2]>>2]-22|0)>>>0>=3)break;var fv=vv+8|0;if(0==(0|Se[fv>>2])){if(tv>>>0>3){Z(r);break r}var _v=(tv<<4)+Cr|0,R=_v>>2,C=vv>>2;Se[R]=Se[C],Se[R+1]=Se[C+1],Se[R+2]=Se[C+2],Se[R+3]=Se[C+3];var sv=Se[T];Se[_v>>2]=sv,Se[T]=_v,Se[fv>>2]=1;var nv=tv+1|0}else var nv=tv;var nv,vv=Se[vv>>2],tv=nv}var ov=Se[pr+2];if(H(r,ov),Se[T]=rv,0!=(0|Se[ev>>2]))break r;if(tv>>>0>1){for(var lv=tv;;){var lv,bv=lv-1|0,kv=Se[((bv<<4)+4>>2)+hr];if($(r,kv),bv>>>0<=1)break;var lv=bv}var uv=Se[T]}else var uv=rv;var uv;ar(r,a,uv);break r}if(37==(0|Ir)){var M=(r+20|0)>>2,cv=Se[M],hv=0|Rr;Se[hv>>2]=cv,Se[M]=Rr,Se[Rr+4>>2]=a;var dv=Rr+8|0;Se[dv>>2]=0;var wv=Se[Er+4];Se[Rr+12>>2]=wv;var pv=a+4|0,Ev=Se[pr+2];H(r,Ev);var Av=0==(0|Se[dv>>2]);e:do if(Av){var gv=Me[cr],yv=0==(0|gv);do{if(!yv){var mv=r+8|0,Sv=Me[mv>>2];if(Sv>>>0>=Me[Er+3]>>>0){gr=187;break}Se[mv>>2]=Sv+1|0,Ae[gv+Sv|0]=32,gr=188;break}gr=187}while(0);187==gr&&Y(r,32);var Mv=Se[pv>>2];H(r,Mv);var Cv=Me[cr],Rv=0==(0|Cv);do if(!Rv){var S=(r+8|0)>>2,Tv=Me[S];if((Tv+3|0)>>>0>Me[Er+3]>>>0)break;var Ov=Cv+Tv|0;Ae[Ov]=Ae[0|He.__str135],Ae[Ov+1]=Ae[(0|He.__str135)+1],Ae[Ov+2]=Ae[(0|He.__str135)+2];var Nv=Se[S]+3|0;Se[S]=Nv;break e}while(0);Q(r,0|He.__str135,3)}while(0);var Iv=Se[hv>>2];Se[M]=Iv;break r}if(38==(0|Ir)||39==(0|Ir)){var Pv=Se[pr+1];H(r,Pv);var Dv=a+8|0;if(0==(0|Se[Dv>>2]))break r;var Lv=Me[cr],Fv=0==(0|Lv);do{if(!Fv){var m=(r+8|0)>>2,Xv=Me[m];if((Xv+2|0)>>>0>Me[Er+3]>>>0){gr=197;break}var jv=Lv+Xv|0;oe=8236,Ae[jv]=255&oe,oe>>=8,Ae[jv+1]=255&oe;var Uv=Se[m]+2|0;Se[m]=Uv,gr=198;break}gr=197}while(0);197==gr&&Q(r,0|He.__str136,2);var xv=Se[Dv>>2];H(r,xv);break r}if(40==(0|Ir)){var y=(r+8|0)>>2,zv=Me[y],g=(r+12|0)>>2;if((zv+8|0)>>>0>Me[g]>>>0)Q(r,0|He.__str137,8);else{var Vv=Or+zv|0,le=0|Vv;oe=1919250543,Ae[le]=255&oe,oe>>=8,Ae[le+1]=255&oe,oe>>=8,Ae[le+2]=255&oe,oe>>=8,Ae[le+3]=255&oe;var be=Vv+4|0;oe=1919906913,Ae[be]=255&oe,oe>>=8,Ae[be+1]=255&oe,oe>>=8,Ae[be+2]=255&oe,oe>>=8,Ae[be+3]=255&oe;var Bv=Se[y]+8|0;Se[y]=Bv}var A=(a+4|0)>>2,Hv=(Ae[Se[Se[A]+4>>2]]-97&255&255)<26;e:do if(Hv){var Kv=Me[cr],Yv=0==(0|Kv);do if(!Yv){var Gv=Me[y];if(Gv>>>0>=Me[g]>>>0)break;Se[y]=Gv+1|0,Ae[Kv+Gv|0]=32;break e}while(0);Y(r,32)}while(0);var Wv=Me[cr],Zv=0==(0|Wv);do{if(!Zv){var Qv=Me[y],qv=Me[A],$v=Me[qv+8>>2];if(($v+Qv|0)>>>0>Me[g]>>>0){var Jv=qv,rt=$v;break}var at=Wv+Qv|0,et=Se[qv+4>>2];Pa(at,et,$v,1);var it=Se[y]+Se[Se[A]+8>>2]|0;Se[y]=it;break r}var vt=Me[A],Jv=vt,rt=Se[vt+8>>2]}while(0);var rt,Jv,tt=Se[Jv+4>>2];Q(r,tt,rt);break r}if(41==(0|Ir)){var E=(r+8|0)>>2,ft=Me[E];if((ft+9|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str10180,9);else{for(var _t=Or+ft|0,ie=0|He.__str10180,ve=_t,te=ie+9;ie>2,ot=Me[p];if((ot+9|0)>>>0>Me[Er+3]>>>0)Q(r,0|He.__str10180,9);else{for(var lt=Or+ot|0,ie=0|He.__str10180,ve=lt,te=ie+9;ie>2],ct=42==(0|Se[ut>>2]);e:do if(ct){var w=(r+8|0)>>2,ht=Me[w],dt=r+12|0;ht>>>0>2]>>>0?(Se[w]=ht+1|0,Ae[Or+ht|0]=40):Y(r,40);var wt=Se[kt>>2];er(r,wt);var pt=Me[cr],Et=0==(0|pt);do if(!Et){var At=Me[w];if(At>>>0>=Me[dt>>2]>>>0)break;Se[w]=At+1|0,Ae[pt+At|0]=41;break e}while(0);Y(r,41)}else ir(r,ut);while(0);var gt=Me[cr],yt=0==(0|gt);do{if(!yt){var mt=r+8|0,St=Me[mt>>2];if(St>>>0>=Me[Er+3]>>>0){gr=232;break}Se[mt>>2]=St+1|0,Ae[gt+St|0]=40,gr=233;break}gr=232}while(0);232==gr&&Y(r,40);var Mt=Se[pr+2];H(r,Mt);var Ct=Me[cr],Rt=0==(0|Ct);do if(!Rt){var Tt=r+8|0,Ot=Me[Tt>>2];if(Ot>>>0>=Me[Er+3]>>>0)break;Se[Tt>>2]=Ot+1|0,Ae[Ct+Ot|0]=41;break r}while(0);Y(r,41);break r}if(44==(0|Ir)){var d=(a+8|0)>>2;if(45==(0|Se[Se[d]>>2])){var h=(a+4|0)>>2,Nt=Se[h],It=40==(0|Se[Nt>>2]);do if(It){var Pt=Se[Nt+4>>2];if(1!=(0|Se[Pt+8>>2]))break;if(Ae[Se[Pt+4>>2]]<<24>>24!=62)break;var Dt=r+8|0,Lt=Me[Dt>>2];Lt>>>0>>0?(Se[Dt>>2]=Lt+1|0,Ae[Or+Lt|0]=40):Y(r,40)}while(0);var Ft=Me[cr],Xt=0==(0|Ft);do{if(!Xt){var jt=r+8|0,Ut=Me[jt>>2];if(Ut>>>0>=Me[Er+3]>>>0){gr=248;break}Se[jt>>2]=Ut+1|0,Ae[Ft+Ut|0]=40,gr=249;break}gr=248}while(0);248==gr&&Y(r,40);var xt=Se[Se[d]+4>>2];H(r,xt);var zt=Me[cr],Vt=0==(0|zt);do{if(!Vt){var c=(r+8|0)>>2,Bt=Me[c];if((Bt+2|0)>>>0>Me[Er+3]>>>0){gr=252;break}var Ht=zt+Bt|0;oe=8233,Ae[Ht]=255&oe,oe>>=8,Ae[Ht+1]=255&oe;var Kt=Se[c]+2|0;Se[c]=Kt,gr=253;break}gr=252}while(0);252==gr&&Q(r,0|He.__str139,2);var Yt=Se[h];ir(r,Yt);var Gt=Me[cr],Wt=0==(0|Gt);do{if(!Wt){var u=(r+8|0)>>2,Zt=Me[u];if((Zt+2|0)>>>0>Me[Er+3]>>>0){gr=256;break}var Qt=Gt+Zt|0;oe=10272,Ae[Qt]=255&oe,oe>>=8,Ae[Qt+1]=255&oe;var qt=Se[u]+2|0;Se[u]=qt,gr=257;break}gr=256}while(0);256==gr&&Q(r,0|He.__str140,2);var $t=Se[Se[d]+8>>2];H(r,$t);var Jt=Me[cr],rf=0==(0|Jt);do{if(!rf){var af=r+8|0,ef=Me[af>>2];if(ef>>>0>=Me[Er+3]>>>0){gr=260;break}Se[af>>2]=ef+1|0,Ae[Jt+ef|0]=41,gr=261;break}gr=260}while(0);260==gr&&Y(r,41);var vf=Se[h];if(40!=(0|Se[vf>>2]))break r;var tf=Se[vf+4>>2];if(1!=(0|Se[tf+8>>2]))break r;if(Ae[Se[tf+4>>2]]<<24>>24!=62)break r;var ff=Me[cr],_f=0==(0|ff);do if(!_f){var sf=r+8|0,nf=Me[sf>>2];if(nf>>>0>=Me[Er+3]>>>0)break;Se[sf>>2]=nf+1|0,Ae[ff+nf|0]=41;break r}while(0);Y(r,41);break r}Z(r);break r}if(45==(0|Ir)){Z(r);break r}if(46==(0|Ir)){var of=a+4|0,k=(a+8|0)>>2,lf=Se[k],bf=47==(0|Se[lf>>2]);do if(bf){if(48!=(0|Se[Se[lf+8>>2]>>2]))break;var b=(r+8|0)>>2,kf=Me[b],l=(r+12|0)>>2;kf>>>0>>0?(Se[b]=kf+1|0,Ae[Or+kf|0]=40):Y(r,40);var uf=Se[Se[k]+4>>2];H(r,uf);var cf=Me[cr],hf=0==(0|cf);do{if(!hf){var df=Me[b];if((df+2|0)>>>0>Me[l]>>>0){gr=278;break}var wf=cf+df|0;oe=8233,Ae[wf]=255&oe,oe>>=8,Ae[wf+1]=255&oe;var pf=Se[b]+2|0;Se[b]=pf,gr=279;break}gr=278}while(0);278==gr&&Q(r,0|He.__str139,2);var Ef=Se[of>>2];ir(r,Ef);var Af=Me[cr],gf=0==(0|Af);do{if(!gf){var yf=Me[b];if((yf+2|0)>>>0>Me[l]>>>0){gr=282;break}var mf=Af+yf|0;oe=10272,Ae[mf]=255&oe,oe>>=8,Ae[mf+1]=255&oe;var Sf=Se[b]+2|0;Se[b]=Sf,gr=283;break}gr=282}while(0);282==gr&&Q(r,0|He.__str140,2);var Mf=Se[Se[Se[k]+8>>2]+4>>2];H(r,Mf);var Cf=Me[cr],Rf=0==(0|Cf);do{if(!Rf){var Tf=Me[b];if((Tf+5|0)>>>0>Me[l]>>>0){gr=286;break}var Of=Cf+Tf|0;Ae[Of]=Ae[0|He.__str141],Ae[Of+1]=Ae[(0|He.__str141)+1],Ae[Of+2]=Ae[(0|He.__str141)+2],Ae[Of+3]=Ae[(0|He.__str141)+3],Ae[Of+4]=Ae[(0|He.__str141)+4];var Nf=Se[b]+5|0;Se[b]=Nf,gr=287;break}gr=286}while(0);286==gr&&Q(r,0|He.__str141,5);var If=Se[Se[Se[k]+8>>2]+8>>2];H(r,If);var Pf=Me[cr],Df=0==(0|Pf);do if(!Df){var Lf=Me[b];if(Lf>>>0>=Me[l]>>>0)break;Se[b]=Lf+1|0,Ae[Pf+Lf|0]=41;break r}while(0);Y(r,41);break r}while(0);Z(r);break r}if(47==(0|Ir)||48==(0|Ir)){Z(r);break r}if(49==(0|Ir)||50==(0|Ir)){var Ff=a+4|0,Xf=Se[Ff>>2],jf=33==(0|Se[Xf>>2]);do{if(jf){var Uf=Me[Se[Xf+4>>2]+16>>2];if(1==(0|Uf)||2==(0|Uf)||3==(0|Uf)||4==(0|Uf)||5==(0|Uf)||6==(0|Uf)){var xf=a+8|0;if(0!=(0|Se[Se[xf>>2]>>2])){var zf=Uf;break}if(50==(0|Ir)){var Vf=r+8|0,Bf=Me[Vf>>2];Bf>>>0>>0?(Se[Vf>>2]=Bf+1|0,Ae[Or+Bf|0]=45):Y(r,45)}var Hf=Se[xf>>2];if(H(r,Hf),2==(0|Uf)){var Kf=Me[cr],Yf=0==(0|Kf);do if(!Yf){var Gf=r+8|0,Wf=Me[Gf>>2];if(Wf>>>0>=Me[Er+3]>>>0)break;Se[Gf>>2]=Wf+1|0,Ae[Kf+Wf|0]=117;break r}while(0);Y(r,117);break r}if(3==(0|Uf)){var Zf=Me[cr],Qf=0==(0|Zf);do if(!Qf){var qf=r+8|0,$f=Me[qf>>2];if($f>>>0>=Me[Er+3]>>>0)break;Se[qf>>2]=$f+1|0,Ae[Zf+$f|0]=108;break r}while(0);Y(r,108);break r}if(4==(0|Uf)){var Jf=Me[cr],r_=0==(0|Jf);do if(!r_){var o=(r+8|0)>>2,a_=Me[o];if((a_+2|0)>>>0>Me[Er+3]>>>0)break;var e_=Jf+a_|0;oe=27765,Ae[e_]=255&oe,oe>>=8,Ae[e_+1]=255&oe;var i_=Se[o]+2|0;Se[o]=i_;break r}while(0);Q(r,0|He.__str142,2);break r}if(5==(0|Uf)){var v_=Me[cr],t_=0==(0|v_);do if(!t_){var n=(r+8|0)>>2,f_=Me[n];if((f_+2|0)>>>0>Me[Er+3]>>>0)break;var __=v_+f_|0;oe=27756,Ae[__]=255&oe,oe>>=8,Ae[__+1]=255&oe;var s_=Se[n]+2|0;Se[n]=s_;break r}while(0);Q(r,0|He.__str143,2);break r}if(6==(0|Uf)){var n_=Me[cr],o_=0==(0|n_);do if(!o_){var s=(r+8|0)>>2,l_=Me[s];if((l_+3|0)>>>0>Me[Er+3]>>>0)break;var b_=n_+l_|0;Ae[b_]=Ae[0|He.__str144],Ae[b_+1]=Ae[(0|He.__str144)+1],Ae[b_+2]=Ae[(0|He.__str144)+2];var k_=Se[s]+3|0;Se[s]=k_;break r}while(0);Q(r,0|He.__str144,3);break r}break r}if(7==(0|Uf)){var _=Se[pr+2]>>2;if(0!=(0|Se[_])){var zf=7;break}if(!(1==(0|Se[_+2])&49==(0|Ir))){var zf=Uf;break}var u_=Ae[Se[_+1]]<<24>>24;if(48==(0|u_)){var f=(r+8|0)>>2,c_=Me[f];if((c_+5|0)>>>0>Me[Er+3]>>>0){Q(r,0|He.__str145,5);break r}var h_=Or+c_|0;Ae[h_]=Ae[0|He.__str145],Ae[h_+1]=Ae[(0|He.__str145)+1],Ae[h_+2]=Ae[(0|He.__str145)+2],Ae[h_+3]=Ae[(0|He.__str145)+3],Ae[h_+4]=Ae[(0|He.__str145)+4];var d_=Se[f]+5|0;Se[f]=d_;break r}if(49==(0|u_)){var t=(r+8|0)>>2,w_=Me[t];if((w_+4|0)>>>0>Me[Er+3]>>>0){Q(r,0|He.__str146,4);break r}var p_=Or+w_|0;oe=1702195828,Ae[p_]=255&oe,oe>>=8,Ae[p_+1]=255&oe,oe>>=8,Ae[p_+2]=255&oe,oe>>=8,Ae[p_+3]=255&oe;var E_=Se[t]+4|0;Se[t]=E_;break r}var zf=Uf;break}var zf=Uf;break}var zf=0}while(0);var zf,v=(r+8|0)>>2,A_=Me[v],i=(r+12|0)>>2;A_>>>0>>0?(Se[v]=A_+1|0,Ae[Or+A_|0]=40):Y(r,40);var g_=Se[Ff>>2];H(r,g_);var y_=Me[cr],m_=0==(0|y_);do{if(!m_){var S_=Me[v];if(S_>>>0>=Me[i]>>>0){gr=335;break}Se[v]=S_+1|0,Ae[y_+S_|0]=41,gr=336;break}gr=335}while(0);335==gr&&Y(r,41);var M_=50==(0|Se[Nr>>2]);e:do if(M_){var C_=Me[cr],R_=0==(0|C_);do if(!R_){var T_=Me[v];if(T_>>>0>=Me[i]>>>0)break;Se[v]=T_+1|0,Ae[C_+T_|0]=45;break e}while(0);Y(r,45)}while(0);if(8==(0|zf)){var O_=Me[cr],N_=0==(0|O_);do{if(!N_){var I_=Me[v];if(I_>>>0>=Me[i]>>>0){gr=345;break}Se[v]=I_+1|0,Ae[O_+I_|0]=91,gr=346;break}gr=345}while(0);345==gr&&Y(r,91);var P_=Se[pr+2];H(r,P_);var D_=Me[cr],L_=0==(0|D_);do if(!L_){var F_=Me[v];if(F_>>>0>=Me[i]>>>0)break;Se[v]=F_+1|0,Ae[D_+F_|0]=93;break r}while(0);Y(r,93);break r}var X_=Se[pr+2];H(r,X_);break r}Z(r);break r}}while(0);var e=(r+20|0)>>2,j_=Se[e],U_=0|Sr;Se[U_>>2]=j_,Se[e]=Sr,Se[Sr+4>>2]=a;var x_=Sr+8|0;Se[x_>>2]=0;var z_=Se[Er+4];Se[Sr+12>>2]=z_;var V_=Se[pr+1];H(r,V_),0==(0|Se[x_>>2])&&$(r,a);var B_=Se[U_>>2];Se[e]=B_}while(0);Oe=Ar}function K(r,a,e,i){var v=i>>2;Se[v]=r,Se[v+1]=r+e|0,Se[v+2]=a,Se[v+3]=r,Se[v+6]=e<<1,Se[v+5]=0,Se[v+9]=e,Se[v+8]=0,Se[v+10]=0,Se[v+11]=0,Se[v+12]=0}function Y(r,a){var e,i=r+4|0,v=Me[i>>2],t=0==(0|v);do if(!t){var e=(r+8|0)>>2,f=Me[e];if(f>>>0>2]>>>0)var _=v,s=f;else{tr(r,1);var n=Me[i>>2];if(0==(0|n))break;var _=n,s=Se[e]}var s,_;Ae[_+s|0]=255&a;var o=Se[e]+1|0;Se[e]=o}while(0)}function G(r,a,e,i){var v,t=i>>2,f=Oe;Oe+=4;var _=f,v=_>>2,s=0==(0|r);do if(s){if(0==(0|i)){var n=0;break}Se[t]=-3;var n=0}else{var o=0==(0|e);if(0!=(0|a)&o){if(0==(0|i)){var n=0;break}Se[t]=-3;var n=0}else{var l=W(r,_);if(0==(0|l)){if(0==(0|i)){var n=0;break}if(1==(0|Se[v])){Se[t]=-1;var n=0}else{Se[t]=-2;var n=0}}else{var b=0==(0|a);do if(b){if(o){var k=l;break}var u=Se[v];Se[e>>2]=u;var k=l}else{var c=Ca(l);if(c>>>0>2]>>>0){Ra(a,l);va(l);var k=a}else{va(a);var h=Se[v];Se[e>>2]=h;var k=l}}while(0);var k;if(0==(0|i)){var n=k;break}Se[t]=0;var n=k}}}while(0);var n;return Oe=f,n}function W(r,a){var e,i=Oe;Oe+=52;var v,t=i,e=t>>2;Se[a>>2]=0;var f=Ca(r),_=Ae[r]<<24>>24==95;do{if(_){if(Ae[r+1|0]<<24>>24==90){var s=0;v=13;break}v=3;break}v=3}while(0);do if(3==v){var n=Na(r,0|He.__str117,8);if(0!=(0|n)){var s=1;v=13;break}var o=Ae[r+8|0];if(o<<24>>24!=46&&o<<24>>24!=95&&o<<24>>24!=36){var s=1;v=13;break}var l=r+9|0,b=Ae[l];if(b<<24>>24!=68&&b<<24>>24!=73){ -var s=1;v=13;break}if(Ae[r+10|0]<<24>>24!=95){var s=1;v=13;break}var k=f+29|0,u=Jr(k);if(0==(0|u)){Se[a>>2]=1;var c=0;v=19;break}Ae[l]<<24>>24==73?Pa(u,0|He.__str118,30,1):Pa(u,0|He.__str119,29,1);var h=r+11|0,c=(Ia(u,h),u);v=19;break}while(0);if(13==v){var s;K(r,17,f,t);var d=Se[e+6],w=Ta(),p=Oe;Oe+=12*d,Oe=Oe+3>>2<<2;var E=Oe;if(Oe+=4*Se[e+9],Oe=Oe+3>>2<<2,Se[e+4]=p,Se[e+7]=E,s)var A=N(t),g=A;else var y=T(t,1),g=y;var g,m=Ae[Se[e+3]]<<24>>24==0?g:0,S=Se[e+12]+f+10*Se[e+10]|0;if(0==(0|m))var M=0;else var C=S/8+S|0,R=B(17,m,C,a),M=R;var M;Oa(w);var c=M}var c;return Oe=i,c}function Z(r){var a=r+4|0,e=Se[a>>2];va(e),Se[a>>2]=0}function Q(r,a,e){var i,v=r+4|0,t=Me[v>>2],f=0==(0|t);do if(!f){var i=(r+8|0)>>2,_=Me[i];if((_+e|0)>>>0>Me[r+12>>2]>>>0){tr(r,e);var s=Me[v>>2];if(0==(0|s))break;var n=s,o=Se[i]}else var n=t,o=_;var o,n;Pa(n+o|0,a,e,1);var l=Se[i]+e|0;Se[i]=l}while(0)}function q(r,a,e){var i,v,t=a+e|0,f=(0|e)>0;r:do if(f)for(var _=t,s=r+4|0,i=(r+8|0)>>2,n=r+12|0,o=a;;){var o,l=(_-o|0)>3;a:do{if(l){if(Ae[o]<<24>>24!=95){v=21;break}if(Ae[o+1|0]<<24>>24!=95){v=21;break}if(Ae[o+2|0]<<24>>24!=85){v=21;break}for(var b=o+3|0,k=0;;){var k,b;if(b>>>0>=t>>>0){v=21;break a}var u=ge[b],c=u<<24>>24;if((u-48&255&255)<10)var h=c-48|0;else if((u-65&255&255)<6)var h=c-55|0;else{if((u-97&255&255)>=6)break;var h=c-87|0}var h,b=b+1|0,k=(k<<4)+h|0}if(!(u<<24>>24==95&k>>>0<256)){v=21;break}var d=Me[s>>2],w=0==(0|d);do if(!w){var p=Me[i];if(p>>>0>=Me[n>>2]>>>0)break;Se[i]=p+1|0,Ae[d+p|0]=255&k;var E=b;v=25;break a}while(0);Y(r,k);var E=b;v=25;break}v=21}while(0);a:do if(21==v){var A=Me[s>>2],g=0==(0|A);do if(!g){var y=Me[i];if(y>>>0>=Me[n>>2]>>>0)break;var m=Ae[o];Se[i]=y+1|0,Ae[A+y|0]=m;var E=o;break a}while(0);var S=Ae[o]<<24>>24;Y(r,S);var E=o}while(0);var E,M=E+1|0;if(M>>>0>=t>>>0)break r;var o=M}while(0)}function $(r,a){var e,i,v,t,f,_,s,n=r>>2,o=Se[a>>2];r:do if(22==(0|o)||25==(0|o)){var l=Me[n+1],b=0==(0|l);do if(!b){var _=(r+8|0)>>2,k=Me[_];if((k+9|0)>>>0>Me[n+3]>>>0)break;for(var u=l+k|0,c=0|He.__str147,h=u,d=c+9;c>2,A=Me[f];if((A+9|0)>>>0>Me[n+3]>>>0)break;for(var g=p+A|0,c=0|He.__str148,h=g,d=c+9;c>2,M=Me[t];if((M+6|0)>>>0>Me[n+3]>>>0)break;var C=m+M|0;Ae[C]=Ae[0|He.__str149],Ae[C+1]=Ae[(0|He.__str149)+1],Ae[C+2]=Ae[(0|He.__str149)+2],Ae[C+3]=Ae[(0|He.__str149)+3],Ae[C+4]=Ae[(0|He.__str149)+4],Ae[C+5]=Ae[(0|He.__str149)+5];var R=Se[t]+6|0;Se[t]=R;break r}while(0);Q(r,0|He.__str149,6)}else if(28==(0|o)){var T=Me[n+1],O=0==(0|T);do{if(!O){var N=r+8|0,I=Me[N>>2];if(I>>>0>=Me[n+3]>>>0){s=17;break}Se[N>>2]=I+1|0,Ae[T+I|0]=32,s=18;break}s=17}while(0);17==s&&Y(r,32);var P=Se[a+8>>2];H(r,P)}else if(29==(0|o)){if(0!=(4&Se[n]|0))break;var D=Me[n+1],L=0==(0|D);do if(!L){var F=r+8|0,X=Me[F>>2];if(X>>>0>=Me[n+3]>>>0)break;Se[F>>2]=X+1|0,Ae[D+X|0]=42;break r}while(0);Y(r,42)}else if(30==(0|o)){var j=Me[n+1],U=0==(0|j);do if(!U){var x=r+8|0,z=Me[x>>2];if(z>>>0>=Me[n+3]>>>0)break;Se[x>>2]=z+1|0,Ae[j+z|0]=38;break r}while(0);Y(r,38)}else if(31==(0|o)){var V=Me[n+1],B=0==(0|V);do if(!B){var v=(r+8|0)>>2,K=Me[v];if((K+8|0)>>>0>Me[n+3]>>>0)break;var G=V+K|0,W=0|G;oe=1886220131,Ae[W]=255&oe,oe>>=8,Ae[W+1]=255&oe,oe>>=8,Ae[W+2]=255&oe,oe>>=8,Ae[W+3]=255&oe;var Z=G+4|0;oe=544761196,Ae[Z]=255&oe,oe>>=8,Ae[Z+1]=255&oe,oe>>=8,Ae[Z+2]=255&oe,oe>>=8,Ae[Z+3]=255&oe;var q=Se[v]+8|0;Se[v]=q;break r}while(0);Q(r,0|He.__str150,8)}else if(32==(0|o)){var $=Me[n+1],J=0==(0|$);do if(!J){var i=(r+8|0)>>2,rr=Me[i];if((rr+10|0)>>>0>Me[n+3]>>>0)break;for(var ar=$+rr|0,c=0|He.__str151,h=ar,d=c+10;c>2],tr=0==(0|vr);do{if(!tr){var fr=r+8|0,_r=Me[fr>>2];if(0!=(0|_r)&&Ae[vr+(_r-1)|0]<<24>>24==40){s=42;break}if(_r>>>0>=Me[n+3]>>>0){s=41;break}Se[fr>>2]=_r+1|0,Ae[vr+_r|0]=32,s=42;break}s=41}while(0);41==s&&Y(r,32);var sr=Se[a+4>>2];H(r,sr);var nr=Me[ir>>2],or=0==(0|nr);do if(!or){var e=(r+8|0)>>2,lr=Me[e];if((lr+3|0)>>>0>Me[n+3]>>>0)break;var br=nr+lr|0;Ae[br]=Ae[0|He.__str135],Ae[br+1]=Ae[(0|He.__str135)+1],Ae[br+2]=Ae[(0|He.__str135)+2];var kr=Se[e]+3|0;Se[e]=kr;break r}while(0);Q(r,0|He.__str135,3)}else if(3==(0|o)){var ur=Se[a+4>>2];H(r,ur)}else H(r,a);while(0)}function J(r){var a=r+20|0,e=Se[a>>2];if((0|e)<(0|Se[r+24>>2])){var i=Se[r+16>>2]+12*e|0,v=e+1|0;Se[a>>2]=v;var t=i}else var t=0;var t;return t}function rr(r,a,e){var i,v,t,f,_=r>>2,s=e,t=s>>2,n=0;r:for(;;){var n,s,o=0==(0|s);do if(!o){if(0!=(0|Se[t+2]))break;var l=Se[Se[t+1]>>2];if(29==(0|l)||30==(0|l)){f=9;break r}if(22==(0|l)||23==(0|l)||24==(0|l)||28==(0|l)||31==(0|l)||32==(0|l)||37==(0|l)){var b=Se[_+1];f=12;break r}var s=Se[t],t=s>>2,n=1;continue r}while(0);if(0!=(0|Se[a+4>>2])&0==(0|n)){f=9;break}var k=0,u=r+4|0,v=u>>2;f=22;break}do if(9==f){var c=Se[_+1];if(0==(0|c)){f=17;break}var h=Se[_+2];if(0==(0|h)){var d=c;f=13;break}var w=Ae[c+(h-1)|0];if(w<<24>>24==40||w<<24>>24==42){f=18;break}var b=c;f=12;break}while(0);do if(12==f){var b;if(0==(0|b)){f=17;break}var d=b;f=13;break}while(0);do if(13==f){var d,p=r+8|0,E=Me[p>>2];if(0!=(0|E)&&Ae[d+(E-1)|0]<<24>>24==32){f=18;break}if(E>>>0>=Me[_+3]>>>0){f=17;break}Se[p>>2]=E+1|0,Ae[d+E|0]=32,f=18;break}while(0);do if(17==f){Y(r,32),f=18;break}while(0);r:do if(18==f){var A=r+4|0,g=Me[A>>2],y=0==(0|g);do if(!y){var m=r+8|0,S=Me[m>>2];if(S>>>0>=Me[_+3]>>>0)break;Se[m>>2]=S+1|0,Ae[g+S|0]=40;var k=1,u=A,v=u>>2;break r}while(0);Y(r,40);var k=1,u=A,v=u>>2}while(0);var u,k,i=(r+20|0)>>2,M=Se[i];Se[i]=0,vr(r,e,0);r:do if(k){var C=Me[v],R=0==(0|C);do if(!R){var T=r+8|0,O=Me[T>>2];if(O>>>0>=Me[_+3]>>>0)break;Se[T>>2]=O+1|0,Ae[C+O|0]=41;break r}while(0);Y(r,41)}while(0);var N=Me[v],I=0==(0|N);do{if(!I){var P=r+8|0,D=Me[P>>2];if(D>>>0>=Me[_+3]>>>0){f=30;break}Se[P>>2]=D+1|0,Ae[N+D|0]=40,f=31;break}f=30}while(0);30==f&&Y(r,40);var L=Se[a+8>>2];0!=(0|L)&&H(r,L);var F=Me[v],X=0==(0|F);do{if(!X){var j=r+8|0,U=Me[j>>2];if(U>>>0>=Me[_+3]>>>0){f=36;break}Se[j>>2]=U+1|0,Ae[F+U|0]=41,f=37;break}f=36}while(0);36==f&&Y(r,41),vr(r,e,1),Se[i]=M}function ar(r,a,e){var i,v,t,f=r>>2,_=0==(0|e);do{if(!_){var s=e,v=s>>2;r:for(;;){var s;if(0==(0|s)){var n=1;t=14;break}if(0==(0|Se[v+2])){var o=36==(0|Se[Se[v+1]>>2]),l=1&o^1;if(o){var n=l;t=14;break}var b=r+4|0,k=Me[b>>2],u=0==(0|k);do{if(!u){var i=(r+8|0)>>2,c=Me[i];if((c+2|0)>>>0>Me[f+3]>>>0){t=9;break}var h=k+c|0;oe=10272,Ae[h]=255&oe,oe>>=8,Ae[h+1]=255&oe;var d=Se[i]+2|0;Se[i]=d,vr(r,e,0),t=10;break}t=9}while(0);9==t&&(Q(r,0|He.__str140,2),vr(r,e,0));var w=Me[b>>2],p=0==(0|w);do if(!p){var E=r+8|0,A=Me[E>>2];if(A>>>0>=Me[f+3]>>>0)break;Se[E>>2]=A+1|0,Ae[w+A|0]=41;var g=l;t=15;break r}while(0);Y(r,41);var g=l;t=15;break}var s=Se[v],v=s>>2}if(14==t){var n;vr(r,e,0);var g=n}var g;if(0!=(0|g)){t=17;break}var y=r+4|0;t=21;break}t=17}while(0);r:do if(17==t){var m=r+4|0,S=Me[m>>2],M=0==(0|S);do if(!M){var C=r+8|0,R=Me[C>>2];if(R>>>0>=Me[f+3]>>>0)break;Se[C>>2]=R+1|0,Ae[S+R|0]=32;var y=m;break r}while(0);Y(r,32);var y=m}while(0);var y,T=Me[y>>2],O=0==(0|T);do{if(!O){var N=r+8|0,I=Me[N>>2];if(I>>>0>=Me[f+3]>>>0){t=24;break}Se[N>>2]=I+1|0,Ae[T+I|0]=91,t=25;break}t=24}while(0);24==t&&Y(r,91);var P=Se[a+4>>2];0!=(0|P)&&H(r,P);var D=Me[y>>2],L=0==(0|D);do{if(!L){var F=r+8|0,X=Me[F>>2];if(X>>>0>=Me[f+3]>>>0){t=30;break}Se[F>>2]=X+1|0,Ae[D+X|0]=93,t=31;break}t=30}while(0);30==t&&Y(r,93)}function er(r,a){var e,i,v,t,f,_,s=Oe;Oe+=8;var n,o=s,_=(a+4|0)>>2,l=Se[_];if(4==(0|Se[l>>2])){var f=(r+20|0)>>2,b=Se[f];Se[f]=0;var t=(r+16|0)>>2,k=Se[t],u=0|o;Se[u>>2]=k,Se[t]=o;var c=Se[_];Se[o+4>>2]=c;var h=Se[c+4>>2];H(r,h);var d=Se[u>>2];Se[t]=d;var v=(r+4|0)>>2,w=Me[v],p=0==(0|w);do{if(!p){var i=(r+8|0)>>2,E=Me[i],A=0==(0|E);do if(!A){if(Ae[w+(E-1)|0]<<24>>24!=60)break;E>>>0>2]>>>0?(Se[i]=E+1|0,Ae[w+E|0]=32):Y(r,32)}while(0);var g=Me[v];if(0==(0|g)){n=12;break}var y=Me[i];if(y>>>0>=Me[r+12>>2]>>>0){n=12;break}Se[i]=y+1|0,Ae[g+y|0]=60,n=13;break}n=12}while(0);12==n&&Y(r,60);var m=Se[Se[_]+8>>2];H(r,m);var S=Me[v],M=0==(0|S);do{if(!M){var e=(r+8|0)>>2,C=Me[e],R=0==(0|C);do if(!R){if(Ae[S+(C-1)|0]<<24>>24!=62)break;C>>>0>2]>>>0?(Se[e]=C+1|0,Ae[S+C|0]=32):Y(r,32)}while(0);var T=Me[v];if(0==(0|T)){n=22;break}var O=Me[e];if(O>>>0>=Me[r+12>>2]>>>0){n=22;break}Se[e]=O+1|0,Ae[T+O|0]=62,n=23;break}n=22}while(0);22==n&&Y(r,62),Se[f]=b}else H(r,l);Oe=s}function ir(r,a){var e,i=40==(0|Se[a>>2]);r:do if(i){var v=Me[r+4>>2],t=0==(0|v);do{if(!t){var e=(r+8|0)>>2,f=Me[e],_=a+4|0,s=Me[_>>2],n=Me[s+8>>2];if((n+f|0)>>>0>Me[r+12>>2]>>>0){var o=s,l=n;break}var b=v+f|0,k=Se[s+4>>2];Pa(b,k,n,1);var u=Se[e]+Se[Se[_>>2]+8>>2]|0;Se[e]=u;break r}var c=Me[a+4>>2],o=c,l=Se[c+8>>2]}while(0);var l,o,h=Se[o+4>>2];Q(r,h,l)}else H(r,a);while(0)}function vr(r,a,e){var i,v,t,f,_,f=(r+4|0)>>2,s=0==(0|e),t=(r+16|0)>>2;r:do if(s)for(var n=a;;){var n;if(0==(0|n)){_=29;break r}if(0==(0|Se[f])){_=29;break r}var o=n+8|0,l=0==(0|Se[o>>2]);do if(l){var b=n+4|0;if((Se[Se[b>>2]>>2]-25|0)>>>0<3)break;Se[o>>2]=1;var k=Me[t],u=Se[n+12>>2];Se[t]=u;var c=Me[b>>2],h=Se[c>>2];if(35==(0|h)){var d=n,w=k,p=c;_=14;break r}if(36==(0|h)){var E=n,A=k,g=c;_=15;break r}if(2==(0|h)){var y=k,m=b;_=16;break r}$(r,c),Se[t]=k}while(0);var n=Se[n>>2]}else for(var S=a;;){var S;if(0==(0|S)){_=29;break r}if(0==(0|Se[f])){_=29;break r}var M=S+8|0;if(0==(0|Se[M>>2])){Se[M>>2]=1;var C=Me[t],R=Se[S+12>>2];Se[t]=R;var T=S+4|0,O=Me[T>>2],N=Se[O>>2];if(35==(0|N)){var d=S,w=C,p=O;_=14;break r}if(36==(0|N)){var E=S,A=C,g=O;_=15;break r}if(2==(0|N)){var y=C,m=T;_=16;break r}$(r,O),Se[t]=C}var S=Se[S>>2]}while(0);if(14==_){var p,w,d,I=Se[d>>2];rr(r,p,I),Se[t]=w}else if(15==_){var g,A,E,P=Se[E>>2];ar(r,g,P),Se[t]=A}else if(16==_){var m,y,v=(r+20|0)>>2,D=Se[v];Se[v]=0;var L=Se[Se[m>>2]+4>>2];H(r,L),Se[v]=D;var F=0==(4&Se[r>>2]|0),X=Me[f],j=0!=(0|X);r:do if(F){do if(j){var i=(r+8|0)>>2,U=Me[i];if((U+2|0)>>>0>Me[r+12>>2]>>>0)break;var x=X+U|0;oe=14906,Ae[x]=255&oe,oe>>=8,Ae[x+1]=255&oe;var z=Se[i]+2|0;Se[i]=z;break r}while(0);Q(r,0|He.__str120,2)}else{do if(j){var V=r+8|0,B=Me[V>>2];if(B>>>0>=Me[r+12>>2]>>>0)break;Se[V>>2]=B+1|0,Ae[X+B|0]=46;break r}while(0);Y(r,46)}while(0);var K=Me[Se[m>>2]+8>>2],G=(Se[K>>2]-25|0)>>>0<3;r:do if(G)for(var W=K;;){var W,Z=Me[W+4>>2];if((Se[Z>>2]-25|0)>>>0>=3){var q=Z;break r}var W=Z}else var q=K;while(0);var q;H(r,q),Se[t]=y}}function tr(r,a){var e,e=(r+4|0)>>2,i=Se[e],v=0==(0|i);r:do if(!v){for(var t=Se[r+8>>2]+a|0,f=r+12|0,_=Se[f>>2],s=i;;){var s,_;if(t>>>0<=_>>>0)break r;var n=_<<1,o=fa(s,n);if(0==(0|o))break;Se[e]=o,Se[f>>2]=n;var _=n,s=o}var l=Se[e];va(l),Se[e]=0,Se[r+24>>2]=1}while(0)}function fr(r,a,e){var i,v=J(r),i=v>>2;return 0!=(0|v)&&(Se[i]=21,Se[i+1]=a,Se[i+2]=e),v}function _r(r){var a,a=(r+12|0)>>2,e=Se[a],i=Ae[e]<<24>>24;if(88==(0|i)){var v=e+1|0;Se[a]=v;var t=nr(r),f=Se[a],_=f+1|0;Se[a]=_;var s=Ae[f]<<24>>24==69?t:0,n=s}else if(76==(0|i))var o=or(r),n=o;else var l=N(r),n=l;var n;return n}function sr(r){var a,a=(r+12|0)>>2,e=Se[a],i=Ae[e];if(i<<24>>24==110){var v=e+1|0;Se[a]=v;var t=1,f=Ae[v],_=v}else var t=0,f=i,_=e;var _,f,t,s=(f-48&255&255)<10;r:do if(s)for(var n=f,o=0,l=_;;){var l,o,n,b=(n<<24>>24)-48+10*o|0,k=l+1|0;Se[a]=k;var u=ge[k];if((u-48&255&255)>=10){var c=b;break r}var n=u,o=b,l=k}else var c=0;while(0);var c,h=0==(0|t)?c:0|-c;return h}function nr(r){var a,e,a=(r+12|0)>>2,i=Se[a],v=Ae[i];do{if(v<<24>>24==76){var t=or(r),f=t;e=21;break}if(v<<24>>24==84){var _=x(r),f=_;e=21;break}if(v<<24>>24==115){if(Ae[i+1|0]<<24>>24!=114){e=8;break}var s=i+2|0;Se[a]=s;var n=N(r),o=br(r);if(Ae[Se[a]]<<24>>24==73){var l=z(r),b=D(r,4,o,l),k=D(r,1,n,b),f=k;e=21;break}var u=D(r,1,n,o),f=u;e=21;break}e=8}while(0);r:do if(8==e){var c=kr(r);if(0==(0|c)){var f=0;break}var h=0|c,d=Se[h>>2],w=40==(0|d);do{if(w){var p=c+4|0,E=r+48|0,A=Se[Se[p>>2]+8>>2]-2+Se[E>>2]|0;Se[E>>2]=A;var g=Se[h>>2];if(40!=(0|g)){var y=g;e=13;break}var m=Se[p>>2],S=Se[m>>2],M=Da(S,0|He.__str90);if(0!=(0|M)){var C=m;e=15;break}var R=N(r),T=D(r,43,c,R),f=T;break r}var y=d;e=13}while(0);do if(13==e){var y;if(40==(0|y)){var C=Se[c+4>>2];e=15;break}if(41==(0|y)){var O=c+4|0;e=17;break}if(42==(0|y)){e=18;break}var f=0;break r}while(0);do if(15==e){var C,O=C+12|0;e=17;break}while(0);do if(17==e){var O,I=Se[O>>2];if(1==(0|I))break;if(2==(0|I)){var P=nr(r),L=nr(r),F=D(r,45,P,L),X=D(r,44,c,F);return X}if(3==(0|I)){var j=nr(r),U=nr(r),V=nr(r),B=D(r,48,U,V),H=D(r,47,j,B),K=D(r,46,c,H);return K}var f=0;break r}while(0);var Y=nr(r),G=D(r,43,c,Y);return G}while(0);var f;return f}function or(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;Se[a]=i;var v=Ae[e]<<24>>24==76;r:do if(v){if(Ae[i]<<24>>24==95)var t=T(r,0),f=t;else{var _=N(r);if(0==(0|_)){var s=0;break}var n=33==(0|Se[_>>2]);do if(n){var o=Se[_+4>>2];if(0==(0|Se[o+16>>2]))break;var l=r+48|0,b=Se[l>>2]-Se[o+4>>2]|0;Se[l>>2]=b}while(0);var k=Se[a];if(Ae[k]<<24>>24==110){var u=k+1|0;Se[a]=u;var c=50,h=u}else var c=49,h=k;for(var h,c,d=h;;){var d,w=Ae[d];if(w<<24>>24==69)break;if(w<<24>>24==0){var s=0;break r}var p=d+1|0;Se[a]=p;var d=p}var E=lr(r,h,d-h|0),A=D(r,c,_,E),f=A}var f,g=Se[a],y=g+1|0;Se[a]=y;var m=Ae[g]<<24>>24==69?f:0,s=m}else var s=0;while(0);var s;return s}function lr(r,a,e){var i=J(r),v=m(i,a,e),t=0==(0|v)?0:i;return t}function br(r){var a=r+12|0,e=Me[a>>2],i=ge[e],v=(i-48&255&255)<10;do if(v)var t=L(r),f=t;else if((i-97&255&255)<26){var _=kr(r);if(0==(0|_)){var f=0;break}if(40!=(0|Se[_>>2])){var f=_;break}var s=r+48|0,n=Se[Se[_+4>>2]+8>>2]+Se[s>>2]+7|0;Se[s>>2]=n;var f=_}else if(i<<24>>24==67||i<<24>>24==68)var o=hr(r),f=o;else{if(i<<24>>24!=76){var f=0;break}Se[a>>2]=e+1|0;var l=L(r);if(0==(0|l)){var f=0;break}var b=dr(r),k=0==(0|b)?0:l,f=k}while(0);var f;return f}function kr(r){var a,e,a=(r+12|0)>>2,i=Se[a],v=i+1|0;Se[a]=v;var t=ge[i],f=i+2|0;Se[a]=f;var _=ge[v];do{if(t<<24>>24==118){if((_-48&255&255)>=10){var s=49,n=0;e=6;break}var o=(_<<24>>24)-48|0,l=L(r),b=ur(r,o,l),k=b;e=14;break}if(t<<24>>24==99){if(_<<24>>24!=118){var s=49,n=0;e=6;break}var u=N(r),c=D(r,42,u,0),k=c;e=14;break}var s=49,n=0;e=6}while(0);r:do if(6==e){for(;;){var n,s,h=(s-n)/2+n|0,d=(h<<4)+ri|0,w=Se[d>>2],p=Ae[w],E=t<<24>>24==p<<24>>24;if(E&&_<<24>>24==Ae[w+1|0]<<24>>24)break;var A=t<<24>>24>24;do if(A)var g=h,y=n;else{if(E&&_<<24>>24>24){var g=h,y=n;break}var g=s,y=h+1|0}while(0);var y,g;if((0|y)==(0|g)){var k=0;break r}var s=g,n=y}var m=cr(r,d),k=m}while(0);var k;return k}function ur(r,a,e){var i=J(r),v=S(i,a,e),t=0==(0|v)?0:i;return t}function cr(r,a){var e=J(r);return 0!=(0|e)&&(Se[e>>2]=40,Se[e+4>>2]=a),e}function hr(r){var a,e,i=Se[r+44>>2],e=i>>2,v=0==(0|i);do if(!v){var t=Se[e];if(0==(0|t)){var f=r+48|0,_=Se[f>>2]+Se[e+2]|0;Se[f>>2]=_}else{if(21!=(0|t))break;var s=r+48|0,n=Se[s>>2]+Se[e+2]|0;Se[s>>2]=n}}while(0);var a=(r+12|0)>>2,o=Se[a],l=o+1|0;Se[a]=l;var b=Ae[o]<<24>>24;do if(67==(0|b)){var k=o+2|0;Se[a]=k;var u=Ae[l]<<24>>24;if(49==(0|u))var c=1;else if(50==(0|u))var c=2;else{if(51!=(0|u)){var h=0;break}var c=3}var c,d=wr(r,c,i),h=d}else if(68==(0|b)){var w=o+2|0;Se[a]=w;var p=Ae[l]<<24>>24;if(48==(0|p))var E=1;else if(49==(0|p))var E=2;else{if(50!=(0|p)){var h=0;break}var E=3}var E,A=pr(r,E,i),h=A}else var h=0;while(0);var h;return h}function dr(r){var a=r+12|0,e=Se[a>>2];if(Ae[e]<<24>>24==95){var i=e+1|0;Se[a>>2]=i;var v=sr(r),t=v>>>31^1}else var t=1;var t;return t}function wr(r,a,e){var i=J(r),v=M(i,a,e),t=0==(0|v)?0:i;return t}function pr(r,a,e){var i=J(r),v=C(i,a,e),t=0==(0|v)?0:i;return t}function Er(r,a){var e=J(r);return 0!=(0|e)&&(Se[e>>2]=5,Se[e+4>>2]=a),e}function Ar(r){var a,a=(r+12|0)>>2,e=Se[a],i=Ae[e]<<24>>24;do if(78==(0|i))var v=gr(r),t=v;else if(90==(0|i))var f=yr(r),t=f;else if(76==(0|i))var _=br(r),t=_;else if(83==(0|i)){if(Ae[e+1|0]<<24>>24==116){var s=e+2|0;Se[a]=s;var n=lr(r,0|He.__str152,3),o=br(r),l=D(r,1,n,o),b=r+48|0,k=Se[b>>2]+3|0;Se[b>>2]=k;var u=0,c=l}else var h=V(r,0),u=1,c=h;var c,u;if(Ae[Se[a]]<<24>>24!=73){var t=c;break}if(0==(0|u)){var d=R(r,c);if(0==(0|d)){var t=0;break}}var w=z(r),p=D(r,4,c,w),t=p}else{var E=br(r);if(Ae[Se[a]]<<24>>24!=73){var t=E;break}var A=R(r,E);if(0==(0|A)){var t=0;break}var g=z(r),y=D(r,4,E,g),t=y}while(0);var t;return t}function gr(r){var a,e=Oe;Oe+=4;var i=e,a=(r+12|0)>>2,v=Se[a],t=v+1|0;Se[a]=t;var f=Ae[v]<<24>>24==78;do if(f){var _=I(r,i,1);if(0==(0|_)){var s=0;break}var n=mr(r);if(Se[_>>2]=n,0==(0|n)){var s=0;break}var o=Se[a],l=o+1|0;if(Se[a]=l,Ae[o]<<24>>24!=69){var s=0;break}var s=Se[i>>2]}else var s=0;while(0);var s;return Oe=e,s}function yr(r){var a,a=(r+12|0)>>2,e=Se[a],i=e+1|0;Se[a]=i;var v=Ae[e]<<24>>24==90;do if(v){var t=O(r,0),f=Se[a],_=f+1|0;if(Se[a]=_,Ae[f]<<24>>24!=69){var s=0;break}if(Ae[_]<<24>>24==115){var n=f+2|0;Se[a]=n;var o=dr(r);if(0==(0|o)){var s=0;break}var l=lr(r,0|He.__str168,14),b=D(r,2,t,l),s=b}else{var k=Ar(r),u=dr(r);if(0==(0|u)){var s=0;break}var c=D(r,2,t,k),s=c}}else var s=0;while(0);var s;return s}function mr(r){var a,e=r+12|0,i=0;r:for(;;){var i,v=ge[Se[e>>2]];if(v<<24>>24==0){var t=0;break}var f=(v-48&255&255)<10|(v-97&255&255)<26;do{if(!f){if(v<<24>>24==76||v<<24>>24==68||v<<24>>24==67){a=5;break}if(v<<24>>24==83){var _=V(r,1),s=_;a=10;break}if(v<<24>>24==73){if(0==(0|i)){var t=0;break r}var n=z(r),o=4,l=n;a=11;break}if(v<<24>>24==84){var b=x(r),s=b;a=10;break}if(v<<24>>24==69){var t=i;break r}var t=0;break r}a=5}while(0);do if(5==a){var k=br(r),s=k;a=10;break}while(0);do if(10==a){var s;if(0==(0|i)){var u=s;a=12;break}var o=1,l=s;a=11;break}while(0);if(11==a)var l,o,c=D(r,o,i,l),u=c;var u;if(v<<24>>24!=83)if(Ae[Se[e>>2]]<<24>>24!=69){var h=R(r,u);if(0==(0|h)){var t=0;break}var i=u}else var i=u;else var i=u}var t;return t}function Sr(r,a){var e,i,v=Oe;Oe+=4;var t=v,i=t>>2,e=(r+12|0)>>2,f=Se[e];if(Ae[f]<<24>>24==74){var _=f+1|0;Se[e]=_;var s=1}else var s=a;var s;Se[i]=0;var n=s,o=0,l=t;r:for(;;)for(var l,o,n,b=n,k=o;;){var k,b,u=Ae[Se[e]];if(u<<24>>24==0||u<<24>>24==69){var c=Se[i];if(0==(0|c)){var h=0;break r}var d=0==(0|Se[c+8>>2]);do if(d){var w=Se[c+4>>2];if(33!=(0|Se[w>>2])){var p=c;break}var E=Se[w+4>>2];if(9!=(0|Se[E+16>>2])){var p=c;break}var A=r+48|0,g=Se[A>>2]-Se[E+4>>2]|0;Se[A>>2]=g,Se[i]=0;var p=0}else var p=c;while(0);var p,y=D(r,35,k,p),h=y;break r}var m=N(r);if(0==(0|m)){var h=0;break r}if(0==(0|b)){var S=D(r,38,m,0);if(Se[l>>2]=S,0==(0|S)){var h=0;break r}var n=0,o=k,l=S+8|0;continue r}var b=0,k=m}var h;return Oe=v,h}function Mr(r){for(var a=r;;){var a;if(0==(0|a)){var e=0;break}var i=Se[a>>2];if(1!=(0|i)&&2!=(0|i)){if(6==(0|i)||7==(0|i)||42==(0|i)){var e=1;break}var e=0;break}var a=Se[a+8>>2]}var e;return e}function Cr(r){var a=r>>2;Se[a+3]=0,Se[a+2]=0,Se[a+1]=0,Se[a]=0,Se[a+4]=0}function Rr(r,a){var e,e=(r+12|0)>>2,i=Se[e],v=(Se[r+4>>2]-i|0)<(0|a);r:do if(v)var t=0;else{var f=i+a|0;Se[e]=f;var _=0==(4&Se[r+8>>2]|0);do if(!_){if(Ae[f]<<24>>24!=36)break;var s=a+(i+1)|0;Se[e]=s}while(0);var n=(0|a)>9;do if(n){var o=La(i,0|He.__str117,8);if(0!=(0|o))break;var l=Ae[i+8|0];if(l<<24>>24!=46&&l<<24>>24!=95&&l<<24>>24!=36)break;if(Ae[i+9|0]<<24>>24!=78)break;var b=r+48|0,k=22-a+Se[b>>2]|0;Se[b>>2]=k;var u=lr(r,0|He.__str169,21),t=u;break r}while(0);var c=lr(r,i,a),t=c}while(0);var t;return t}function Tr(r){var a,e,e=(r+48|0)>>2,i=Se[e],v=i+20|0;Se[e]=v;var a=(r+12|0)>>2,t=Se[a],f=t+1|0;Se[a]=f;var _=Ae[t];do if(_<<24>>24==84){var s=t+2|0;Se[a]=s;var n=Ae[f]<<24>>24;if(86==(0|n)){var o=i+15|0;Se[e]=o;var l=N(r),b=D(r,8,l,0),k=b}else if(84==(0|n)){var u=i+10|0;Se[e]=u;var c=N(r),h=D(r,9,c,0),k=h}else if(73==(0|n))var d=N(r),w=D(r,11,d,0),k=w;else if(83==(0|n))var p=N(r),E=D(r,12,p,0),k=E;else if(104==(0|n)){var A=Nr(r,104);if(0==(0|A)){var k=0;break}var g=O(r,0),y=D(r,14,g,0),k=y}else if(118==(0|n)){var m=Nr(r,118);if(0==(0|m)){var k=0;break}var S=O(r,0),M=D(r,15,S,0),k=M}else if(99==(0|n)){var C=Nr(r,0);if(0==(0|C)){var k=0;break}var R=Nr(r,0);if(0==(0|R)){var k=0;break}var T=O(r,0),I=D(r,16,T,0),k=I}else if(67==(0|n)){var P=N(r),L=sr(r);if((0|L)<0){var k=0;break}var F=Se[a],X=F+1|0;if(Se[a]=X,Ae[F]<<24>>24!=95){var k=0;break}var j=N(r),U=Se[e]+5|0;Se[e]=U;var x=D(r,10,j,P),k=x}else if(70==(0|n))var z=N(r),V=D(r,13,z,0),k=V;else{if(74!=(0|n)){var k=0;break}var B=N(r),H=D(r,17,B,0),k=H}}else if(_<<24>>24==71){var K=t+2|0;Se[a]=K;var Y=Ae[f]<<24>>24;if(86==(0|Y))var G=Ar(r),W=D(r,18,G,0),k=W;else if(82==(0|Y))var Z=Ar(r),Q=D(r,19,Z,0),k=Q;else{if(65!=(0|Y)){var k=0;break}var q=O(r,0),$=D(r,20,q,0),k=$}}else var k=0;while(0);var k;return k}function Or(r){for(var a,e=r,a=e>>2;;){var e;if(0==(0|e)){var i=0;break}var v=Se[a];if(4==(0|v)){var t=Se[a+1],f=Mr(t),i=0==(0|f)&1;break}if(25!=(0|v)&&26!=(0|v)&&27!=(0|v)){var i=0;break}var e=Se[a+1],a=e>>2}var i;return i}function Nr(r,a){var e;if(0==(0|a)){var i=r+12|0,v=Se[i>>2],t=v+1|0;Se[i>>2]=t;var f=Ae[v]<<24>>24}else var f=a;var f;do{if(104==(0|f)){var _=(sr(r),r+12|0);e=7;break}if(118==(0|f)){var s=(sr(r),r+12|0),n=Se[s>>2],o=n+1|0;if(Se[s>>2]=o,Ae[n]<<24>>24!=95){var l=0;e=8;break}var _=(sr(r),s);e=7;break}var l=0;e=8}while(0);if(7==e){var _,b=Se[_>>2],k=b+1|0;Se[_>>2]=k;var l=Ae[b]<<24>>24==95&1}var l;return l}function Ir(r){var a,e,i=r>>2,v=Oe;Oe+=56;var t,f=v,_=v+8,s=v+16,n=v+36,e=(0|r)>>2,o=Se[e],l=0==(8192&o|0);r:do{if(l){var a=(r+12|0)>>2,b=Se[a];if(Ae[b]<<24>>24!=63){var k=0;t=111;break}var u=b+1|0;Se[a]=u;var c=Ae[u];do if(c<<24>>24==63){if(Ae[b+2|0]<<24>>24==36){var h=b+3|0;if(Ae[h]<<24>>24!=63){var d=5;t=90;break}Se[a]=h;var w=6,p=h}else var w=0,p=u;var p,w,E=p+1|0;Se[a]=E;var A=Ae[E]<<24>>24;do if(48==(0|A)){var g=1;t=81}else{if(49==(0|A)){var g=2;t=81;break}if(50!=(0|A)){if(51==(0|A)){var y=0|He.__str2172,m=E;t=82;break}if(52==(0|A)){var y=0|He.__str3173,m=E;t=82;break}if(53==(0|A)){var y=0|He.__str4174,m=E;t=82;break}if(54==(0|A)){var y=0|He.__str5175,m=E;t=82;break}if(55==(0|A)){var y=0|He.__str6176,m=E;t=82;break}if(56==(0|A)){var y=0|He.__str7177,m=E;t=82;break}if(57==(0|A)){var y=0|He.__str8178,m=E;t=82;break}if(65==(0|A)){var y=0|He.__str9179,m=E;t=82;break}if(66==(0|A)){Se[a]=p+2|0;var S=0|He.__str10180,M=3;t=88;break}if(67==(0|A)){var y=0|He.__str11181,m=E;t=82;break}if(68==(0|A)){var y=0|He.__str12182,m=E;t=82;break}if(69==(0|A)){var y=0|He.__str13183,m=E;t=82;break}if(70==(0|A)){var y=0|He.__str14184,m=E;t=82;break}if(71==(0|A)){var y=0|He.__str15185,m=E;t=82;break}if(72==(0|A)){var y=0|He.__str16186,m=E;t=82;break}if(73==(0|A)){var y=0|He.__str17187,m=E;t=82;break}if(74==(0|A)){var y=0|He.__str18188,m=E;t=82;break}if(75==(0|A)){var y=0|He.__str19189,m=E;t=82;break}if(76==(0|A)){var y=0|He.__str20190,m=E;t=82;break}if(77==(0|A)){var y=0|He.__str21191,m=E;t=82;break}if(78==(0|A)){var y=0|He.__str22192,m=E;t=82;break}if(79==(0|A)){var y=0|He.__str23193,m=E;t=82;break}if(80==(0|A)){var y=0|He.__str24194,m=E;t=82;break}if(81==(0|A)){var y=0|He.__str25195,m=E;t=82;break}if(82==(0|A)){var y=0|He.__str26196,m=E;t=82;break}if(83==(0|A)){var y=0|He.__str27197,m=E;t=82;break}if(84==(0|A)){var y=0|He.__str28198,m=E;t=82;break}if(85==(0|A)){var y=0|He.__str29199,m=E;t=82;break}if(86==(0|A)){var y=0|He.__str30200,m=E;t=82;break}if(87==(0|A)){var y=0|He.__str31201,m=E;t=82;break}if(88==(0|A)){var y=0|He.__str32202,m=E;t=82;break}if(89==(0|A)){var y=0|He.__str33203,m=E;t=82;break}if(90==(0|A)){var y=0|He.__str34204,m=E;t=82;break}if(95==(0|A)){var C=p+2|0;Se[a]=C;var R=Ae[C]<<24>>24;if(48==(0|R)){var y=0|He.__str35205,m=C;t=82;break}if(49==(0|R)){var y=0|He.__str36206,m=C;t=82;break}if(50==(0|R)){var y=0|He.__str37207,m=C;t=82;break}if(51==(0|R)){var y=0|He.__str38208,m=C;t=82;break}if(52==(0|R)){var y=0|He.__str39209,m=C;t=82;break}if(53==(0|R)){var y=0|He.__str40210,m=C;t=82;break}if(54==(0|R)){var y=0|He.__str41211,m=C;t=82;break}if(55==(0|R)){var y=0|He.__str42212,m=C;t=82;break}if(56==(0|R)){var y=0|He.__str43213,m=C;t=82;break}if(57==(0|R)){var y=0|He.__str44214,m=C;t=82;break}if(65==(0|R)){var y=0|He.__str45215,m=C;t=82;break}if(66==(0|R)){var y=0|He.__str46216,m=C;t=82;break}if(67==(0|R)){Se[a]=p+3|0;var T=0|He.__str47217;t=84;break}if(68==(0|R)){var y=0|He.__str48218,m=C;t=82;break}if(69==(0|R)){var y=0|He.__str49219,m=C;t=82;break}if(70==(0|R)){var y=0|He.__str50220,m=C;t=82;break}if(71==(0|R)){var y=0|He.__str51221,m=C;t=82;break}if(72==(0|R)){var y=0|He.__str52222,m=C;t=82;break}if(73==(0|R)){var y=0|He.__str53223,m=C;t=82;break}if(74==(0|R)){var y=0|He.__str54224,m=C;t=82;break}if(75==(0|R)){var y=0|He.__str55225,m=C;t=82;break}if(76==(0|R)){var y=0|He.__str56226,m=C;t=82;break}if(77==(0|R)){var y=0|He.__str57227,m=C;t=82;break}if(78==(0|R)){var y=0|He.__str58228,m=C;t=82;break}if(79==(0|R)){var y=0|He.__str59229,m=C;t=82;break}if(82==(0|R)){var O=4|o;Se[e]=O;var N=p+3|0;Se[a]=N;var I=Ae[N]<<24>>24;if(48==(0|I)){Se[a]=p+4|0,Cr(s);var P=(Pr(r,_,s,0),Se[_>>2]),D=Se[_+4>>2],L=Dr(r,0|He.__str60230,(ne=Oe,Oe+=8,Se[ne>>2]=P,Se[ne+4>>2]=D,ne)),F=Se[a]-1|0;Se[a]=F;var y=L,m=F;t=82;break}if(49==(0|I)){Se[a]=p+4|0;var X=Lr(r),j=Lr(r),U=Lr(r),x=Lr(r),z=Se[a]-1|0;Se[a]=z;var V=Dr(r,0|He.__str61231,(ne=Oe,Oe+=16,Se[ne>>2]=X,Se[ne+4>>2]=j,Se[ne+8>>2]=U,Se[ne+12>>2]=x,ne)),y=V,m=Se[a];t=82;break}if(50==(0|I)){var y=0|He.__str62232,m=N;t=82;break}if(51==(0|I)){var y=0|He.__str63233,m=N;t=82;break}if(52==(0|I)){var y=0|He.__str64234,m=N;t=82;break}var y=0,m=N;t=82;break}if(83==(0|R)){var y=0|He.__str65235,m=C;t=82;break}if(84==(0|R)){var y=0|He.__str66236,m=C;t=82;break}if(85==(0|R)){var y=0|He.__str67237,m=C;t=82;break}if(86==(0|R)){var y=0|He.__str68238,m=C;t=82;break}if(88==(0|R)){var y=0|He.__str69239,m=C;t=82;break}if(89==(0|R)){var y=0|He.__str70240,m=C;t=82;break}var k=0;t=111;break r}var k=0;t=111;break r}var y=0|He.__str1171,m=E;t=82}while(0);do{if(81==t){var g;Se[a]=p+2|0;var B=g;t=83;break}if(82==t){var m,y;if(Se[a]=m+1|0,1==(0|w)||2==(0|w)){var B=w;t=83;break}if(4==(0|w)){var T=y;t=84;break}if(6!=(0|w)){var S=y,M=w;t=88;break}Cr(n);var H=Xr(r,n,0,60,62);if(0==(0|H))var K=y;else var Y=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=y,Se[ne+4>>2]=H,ne)),K=Y;var K;Se[i+6]=0;var S=K,M=w;t=88;break}}while(0);if(83==t){var B,G=r+40|0,W=Fr(r,0|He._symbol_demangle_dashed_null,-1,G);if(0==(0|W)){var k=0;t=111;break r}var d=B;t=90;break}if(84==t){var T;Se[i+4]=T;var Z=1,Q=T;t=109;break r}if(88==t){var M,S,q=r+40|0,$=Fr(r,S,-1,q);if(0==(0|$)){var k=0;t=111;break r}var d=M;t=90;break}}else{if(c<<24>>24==36){var J=b+2|0;Se[a]=J;var rr=jr(r);Se[i+4]=rr;var ar=0!=(0|rr)&1;t=107;break}var d=0;t=90}while(0);if(90==t){var d,er=Me[a],ir=Ae[er]<<24>>24;if(64==(0|ir))Se[a]=er+1|0;else if(36==(0|ir))t=93;else{var vr=zr(r);if(0==(0|vr)){var k=-1;t=111;break}}if(5==(0|d)){var tr=r+20|0,fr=Se[tr>>2]+1|0;Se[tr>>2]=fr}else if(1==(0|d)||2==(0|d)){if(Me[i+11]>>>0<2){var k=-1;t=111;break}var _r=r+56|0,sr=Me[_r>>2],nr=Se[sr+4>>2];if(1==(0|d))Se[sr>>2]=nr;else{var or=Dr(r,0|He.__str71241,(ne=Oe,Oe+=4,Se[ne>>2]=nr,ne)),lr=Se[_r>>2];Se[lr>>2]=or}var br=4|Se[e];Se[e]=br}else if(3==(0|d)){var kr=Se[e]&-5;Se[e]=kr}var ur=ge[Se[a]];if((ur-48&255&255)<10)var cr=Vr(r),ar=cr;else if((ur-65&255&255)<26)var hr=Br(r,3==(0|d)&1),ar=hr;else{if(ur<<24>>24!=36){var k=-1;t=111;break}var dr=Hr(r),ar=dr}}var ar;if(0==(0|ar)){var k=-1;t=111;break}var Z=ar,Q=Se[i+4];t=109;break}var wr=Pr(r,f,0,0);if(0==(0|wr)){var k=-1;t=111;break}var pr=Se[f>>2],Er=Se[f+4>>2],Ar=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=pr,Se[ne+4>>2]=Er,ne));Se[i+4]=Ar;var Z=1,Q=Ar;t=109;break}while(0);do if(109==t){var Q,Z;if(0!=(0|Q)){var k=Z;break}Xa(0|He.__str72242,1499,0|He.___func___symbol_demangle,0|He.__str73243);var k=Z}while(0);var k;return Oe=v,k}function Pr(r,a,e,i){var v,t,f,_=Oe;Oe+=24;var s=_,n=_+4,o=_+8,l=_+16,b=_+20;0==(0|a)&&Xa(0|He.__str72242,829,0|He.___func___demangle_datatype,0|He.__str121291);var f=(a+4|0)>>2;Se[f]=0;var t=(0|a)>>2;Se[t]=0;var v=(r+12|0)>>2,k=Me[v],u=k+1|0;Se[v]=u;var c=Ae[k],h=c<<24>>24;do if(95==(0|h)){Se[v]=k+2|0;var d=Ae[u],w=Zr(d);Se[t]=w}else if(67==(0|h)||68==(0|h)||69==(0|h)||70==(0|h)||71==(0|h)||72==(0|h)||73==(0|h)||74==(0|h)||75==(0|h)||77==(0|h)||78==(0|h)||79==(0|h)||88==(0|h)||90==(0|h)){var p=Qr(c);Se[t]=p}else if(84==(0|h)||85==(0|h)||86==(0|h)||89==(0|h)){var E=qr(r);if(0==(0|E))break;var A=0==(32768&Se[r>>2]|0);do if(A)if(84==(0|h))var g=0|He.__str122292;else if(85==(0|h))var g=0|He.__str123293;else if(86==(0|h))var g=0|He.__str124294;else{if(89!=(0|h)){var g=0;break}var g=0|He.__str125295}else var g=0;while(0);var g,y=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=g,Se[ne+4>>2]=E,ne));Se[t]=y}else if(63==(0|h))if(0==(0|i))$r(a,r,e,63,0);else{var m=Lr(r);if(0==(0|m))break;var S=Dr(r,0|He.__str126296,(ne=Oe,Oe+=4,Se[ne>>2]=m,ne));Se[t]=S}else if(65==(0|h)||66==(0|h))$r(a,r,e,c,i);else if(81==(0|h)||82==(0|h)||83==(0|h)){var M=0==(0|i)?80:c;$r(a,r,e,M,i)}else if(80==(0|h))if(((Ae[u]<<24>>24)-48|0)>>>0<10){var C=k+2|0;if(Se[v]=C,Ae[u]<<24>>24!=54)break;var R=r+44|0,T=Se[R>>2];Se[v]=k+3|0;var O=Ae[C],N=Se[r>>2]&-17,I=Ur(O,s,n,N);if(0==(0|I))break;var P=Pr(r,o,e,0);if(0==(0|P))break;var D=Xr(r,e,1,40,41);if(0==(0|D))break;Se[R>>2]=T;var L=Se[o>>2],F=Se[o+4>>2],X=Se[s>>2],j=Dr(r,0|He.__str127297,(ne=Oe,Oe+=12,Se[ne>>2]=L,Se[ne+4>>2]=F,Se[ne+8>>2]=X,ne));Se[t]=j;var U=Dr(r,0|He.__str128298,(ne=Oe,Oe+=4,Se[ne>>2]=D,ne));Se[f]=U}else $r(a,r,e,80,i);else if(87==(0|h)){if(Ae[u]<<24>>24!=52)break;Se[v]=k+2|0;var x=qr(r);if(0==(0|x))break;if(0==(32768&Se[r>>2]|0)){var z=Dr(r,0|He.__str129299,(ne=Oe,Oe+=4,Se[ne>>2]=x,ne));Se[t]=z}else Se[t]=x}else if(48==(0|h)||49==(0|h)||50==(0|h)||51==(0|h)||52==(0|h)||53==(0|h)||54==(0|h)||55==(0|h)||56==(0|h)||57==(0|h)){var V=h<<1,B=V-96|0,H=Yr(e,B);Se[t]=H;var K=V-95|0,Y=Yr(e,K);Se[f]=Y}else if(36==(0|h)){var G=k+2|0;Se[v]=G;var W=Ae[u]<<24>>24;if(48==(0|W)){var Z=Lr(r);Se[t]=Z}else if(68==(0|W)){var Q=Lr(r);if(0==(0|Q))break;var q=Dr(r,0|He.__str130300,(ne=Oe,Oe+=4,Se[ne>>2]=Q,ne));Se[t]=q}else if(70==(0|W)){var $=Lr(r);if(0==(0|$))break;var J=Lr(r);if(0==(0|J))break;var rr=Dr(r,0|He.__str131301,(ne=Oe,Oe+=8,Se[ne>>2]=$,Se[ne+4>>2]=J,ne));Se[t]=rr}else if(71==(0|W)){var ar=Lr(r);if(0==(0|ar))break;var er=Lr(r);if(0==(0|er))break;var ir=Lr(r);if(0==(0|ir))break;var vr=Dr(r,0|He.__str132302,(ne=Oe,Oe+=12,Se[ne>>2]=ar,Se[ne+4>>2]=er,Se[ne+8>>2]=ir,ne));Se[t]=vr}else if(81==(0|W)){var tr=Lr(r);if(0==(0|tr))break;var fr=Dr(r,0|He.__str133303,(ne=Oe,Oe+=4,Se[ne>>2]=tr,ne));Se[t]=fr}else{if(36!=(0|W))break;if(Ae[G]<<24>>24!=67)break;Se[v]=k+3|0;var _r=xr(r,l,b);if(0==(0|_r))break;var sr=Pr(r,a,e,i);if(0==(0|sr))break;var nr=Se[t],or=Se[l>>2],lr=Dr(r,0|He.__str83253,(ne=Oe,Oe+=8,Se[ne>>2]=nr,Se[ne+4>>2]=or,ne));Se[t]=lr}}while(0);var br=0!=(0|Se[t])&1;return Oe=_,br}function Dr(r,a){var e,i=Oe;Oe+=4;var v=i,e=v>>2,t=v;Se[t>>2]=arguments[Dr.length];var f=1,_=0;r:for(;;){var _,f,s=Ae[a+_|0];do{if(s<<24>>24==0)break r;if(s<<24>>24==37){var n=_+1|0,o=Ae[a+n|0]<<24>>24;if(115==(0|o)){var l=Se[e],b=l,k=l+4|0;Se[e]=k;var u=Se[b>>2];if(0==(0|u)){var c=f,h=n;break}var d=Ca(u),c=d+f|0,h=n;break}if(99==(0|o)){var w=Se[e]+4|0;Se[e]=w;var c=f+1|0,h=n;break}if(37==(0|o))var p=n;else var p=_;var p,c=f+1|0,h=p}else var c=f+1|0,h=_}while(0);var h,c,f=c,_=h+1|0}var E=Wr(r,f);if(0==(0|E))var A=0;else{Se[t>>2]=arguments[Dr.length];var g=E,y=0;r:for(;;){var y,g,m=Ae[a+y|0];do{if(m<<24>>24==0)break r;if(m<<24>>24==37){var S=y+1|0,M=Ae[a+S|0]<<24>>24;if(115==(0|M)){var C=Se[e],R=C,T=C+4|0;Se[e]=T;var O=Se[R>>2];if(0==(0|O)){var N=g,I=S;break}var P=Ca(O);Pa(g,O,P,1);var N=g+P|0,I=S;break}if(99==(0|M)){var D=Se[e],L=D,F=D+4|0;Se[e]=F,Ae[g]=255&Se[L>>2];var N=g+1|0,I=S;break}if(37==(0|M))var X=S;else var X=y;var X;Ae[g]=37;var N=g+1|0,I=X}else{Ae[g]=m;var N=g+1|0,I=y}}while(0);var I,N,g=N,y=I+1|0}Ae[g]=0;var A=E}var A;return Oe=i,A}function Lr(r){var a,a=(r+12|0)>>2,e=Se[a],i=Ae[e];if(i<<24>>24==63){var v=e+1|0;Se[a]=v;var t=1,f=v,_=Ae[v]}else var t=0,f=e,_=i;var _,f,t,s=(_-48&255&255)<9;do if(s){var n=Wr(r,3),o=0!=(0|t);o&&(Ae[n]=45);var l=Ae[Se[a]]+1&255;Ae[n+t|0]=l;var b=o?2:1; -Ae[n+b|0]=0;var k=Se[a]+1|0;Se[a]=k;var u=n}else if(_<<24>>24==57){var c=Wr(r,4),h=0!=(0|t);h&&(Ae[c]=45),Ae[c+t|0]=49;var d=h?2:1;Ae[c+d|0]=48;var w=h?3:2;Ae[c+w|0]=0;var p=Se[a]+1|0;Se[a]=p;var u=c}else{if((_-65&255&255)>=16){var u=0;break}for(var E=0,A=f;;){var A,E,g=A+1|0;Se[a]=g;var y=(Ae[A]<<24>>24)+((E<<4)-65)|0,m=ge[g];if((m-65&255&255)>=16)break;var E=y,A=g}if(m<<24>>24!=64){var u=0;break}var S=Wr(r,17),M=0!=(0|t)?0|He.__str119289:0|ii,C=(za(S,0|He.__str118288,(ne=Oe,Oe+=8,Se[ne>>2]=M,Se[ne+4>>2]=y,ne)),Se[a]+1|0);Se[a]=C;var u=S}while(0);var u;return u}function Fr(r,a,e,i){var v,t,f,_;0==(0|a)&&Xa(0|He.__str72242,212,0|He.___func___str_array_push,0|He.__str115285),0==(0|i)&&Xa(0|He.__str72242,213,0|He.___func___str_array_push,0|He.__str116286);var f=(i+12|0)>>2,s=Me[f],n=0==(0|s);do{if(n){Se[f]=32;var o=Wr(r,128);if(0==(0|o)){var l=0;_=17;break}Se[i+16>>2]=o,_=11;break}if(Me[i+8>>2]>>>0>>0){_=11;break}var b=s<<3,k=Wr(r,b);if(0==(0|k)){var l=0;_=17;break}var u=k,c=i+16|0,h=Se[c>>2],d=Se[f]<<2;Pa(k,h,d,1);var w=Se[f]<<1;Se[f]=w,Se[c>>2]=u,_=11;break}while(0);do if(11==_){if((0|e)==-1)var p=Ca(a),E=p;else var E=e;var E,A=ja(a),g=E+1|0,y=Wr(r,g),t=(i+4|0)>>2,v=(i+16|0)>>2,m=(Se[t]<<2)+Se[v]|0;Se[m>>2]=y;var S=Se[Se[v]+(Se[t]<<2)>>2];if(0==(0|S)){Xa(0|He.__str72242,233,0|He.___func___str_array_push,0|He.__str117287);var M=Se[Se[v]+(Se[t]<<2)>>2]}else var M=S;var M;Pa(M,A,E,1),va(A),Ae[Se[Se[v]+(Se[t]<<2)>>2]+g|0]=0;var C=Se[t]+1|0;Se[t]=C;var R=i+8|0;if(C>>>0>2]>>>0){var l=1;break}Se[R>>2]=C;var l=1}while(0);var l;return l}function Xr(r,a,e,i,v){var t,f,_=Oe;Oe+=28;var s,n=_,o=_+8;Cr(o);var f=(r+12|0)>>2,l=0==(0|e),t=(0|n)>>2,b=n+4|0;r:do if(l)for(;;){var k=Se[f],u=Ae[k];if(u<<24>>24==0){s=12;break r}if(u<<24>>24==64){var c=k;s=7;break r}var h=Pr(r,n,a,1);if(0==(0|h)){var d=0;s=25;break r}var w=Se[t],p=Se[b>>2],E=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=w,Se[ne+4>>2]=p,ne)),A=Fr(r,E,-1,o);if(0==(0|A)){var d=0;s=25;break r}var g=Se[t],y=Da(g,0|He.__str110280);if(0==(0|y)){s=12;break r}}else for(;;){var m=Se[f],S=Ae[m];if(S<<24>>24==0){s=12;break r}if(S<<24>>24==64){var c=m;s=7;break r}var M=Pr(r,n,a,1);if(0==(0|M)){var d=0;s=25;break r}var C=Se[t],R=Da(C,0|He.__str84254);if(0==(0|R)){s=13;break r}var T=Se[b>>2],O=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=C,Se[ne+4>>2]=T,ne)),N=Fr(r,O,-1,o);if(0==(0|N)){var d=0;s=25;break r}var I=Se[t],P=Da(I,0|He.__str110280);if(0==(0|P)){s=12;break r}}while(0);do if(7==s){var c;Se[f]=c+1|0,s=12;break}while(0);do if(12==s){if(l){s=14;break}s=13;break}while(0);do if(13==s){var D=Se[f],L=D+1|0;if(Se[f]=L,Ae[D]<<24>>24==90){s=14;break}var d=0;s=25;break}while(0);r:do if(14==s){var F=o+4|0,X=Me[F>>2];do{if(0!=(0|X)){if(1==(0|X)){var j=o+16|0,U=Se[Se[j>>2]>>2],x=Da(U,0|He.__str84254);if(0==(0|x)){s=17;break}var z=j;s=20;break}var V=o+16|0;if(X>>>0<=1){var z=V;s=20;break}for(var B=0,H=1;;){var H,B,K=Se[Se[V>>2]+(H<<2)>>2],Y=Dr(r,0|He.__str112282,(ne=Oe,Oe+=8,Se[ne>>2]=B,Se[ne+4>>2]=K,ne)),G=H+1|0;if(G>>>0>=Me[F>>2]>>>0)break;var B=Y,H=G}if(0==(0|Y)){var z=V;s=20;break}var W=Y,Z=Y;s=21;break}s=17}while(0);if(17==s){var Q=i<<24>>24,q=v<<24>>24,$=Dr(r,0|He.__str111281,(ne=Oe,Oe+=8,Se[ne>>2]=Q,Se[ne+4>>2]=q,ne)),d=$;break}if(20==s)var z,W=Se[Se[z>>2]>>2],Z=0;var Z,W,J=v<<24>>24,rr=v<<24>>24==62;do if(rr){var ar=Ca(W);if(Ae[W+(ar-1)|0]<<24>>24!=62)break;var er=i<<24>>24,ir=Se[Se[o+16>>2]>>2],vr=Dr(r,0|He.__str113283,(ne=Oe,Oe+=16,Se[ne>>2]=er,Se[ne+4>>2]=ir,Se[ne+8>>2]=Z,Se[ne+12>>2]=J,ne)),d=vr;break r}while(0);var tr=i<<24>>24,fr=Se[Se[o+16>>2]>>2],_r=Dr(r,0|He.__str114284,(ne=Oe,Oe+=16,Se[ne>>2]=tr,Se[ne+4>>2]=fr,Se[ne+8>>2]=Z,Se[ne+12>>2]=J,ne)),d=_r}while(0);var d;return Oe=_,d}function jr(r){var a,e=Oe;Oe+=20;var i=e,v=r+24|0,t=Se[v>>2],a=(r+20|0)>>2,f=Se[a],_=r+44|0,s=Se[_>>2];Se[a]=t;var n=Kr(r);if(0==(0|n))var o=0;else{Cr(i);var l=Xr(r,i,0,60,62);if(0==(0|l))var b=n;else var k=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=n,Se[ne+4>>2]=l,ne)),b=k;var b;Se[v>>2]=t,Se[a]=f,Se[_>>2]=s;var o=b}var o;return Oe=e,o}function Ur(r,a,e,i){var v,t=a>>2;Se[e>>2]=0,Se[t]=0;var f=0==(18&i|0);do{if(f){var _=r<<24>>24,s=1==((_-65)%2|0);if(0==(1&i|0)){if(s?Se[e>>2]=0|He.__str95265:v=14,65==(0|_)||66==(0|_)){Se[t]=0|He.__str96266,v=21;break}if(67==(0|_)||68==(0|_)){Se[t]=0|He.__str97267,v=21;break}if(69==(0|_)||70==(0|_)){Se[t]=0|He.__str98268,v=21;break}if(71==(0|_)||72==(0|_)){Se[t]=0|He.__str99269,v=21;break}if(73==(0|_)||74==(0|_)){Se[t]=0|He.__str100270,v=21;break}if(75==(0|_)||76==(0|_)){v=21;break}if(77==(0|_)){Se[t]=0|He.__str101271,v=21;break}var n=0;v=22;break}if(s?Se[e>>2]=0|He.__str88258:v=5,65==(0|_)||66==(0|_)){Se[t]=0|He.__str89259,v=21;break}if(67==(0|_)||68==(0|_)){Se[t]=0|He.__str90260,v=21;break}if(69==(0|_)||70==(0|_)){Se[t]=0|He.__str91261,v=21;break}if(71==(0|_)||72==(0|_)){Se[t]=0|He.__str92262,v=21;break}if(73==(0|_)||74==(0|_)){Se[t]=0|He.__str93263,v=21;break}if(75==(0|_)||76==(0|_)){v=21;break}if(77==(0|_)){Se[t]=0|He.__str94264,v=21;break}var n=0;v=22;break}v=21}while(0);if(21==v)var n=1;var n;return n}function xr(r,a,e){var i;Se[e>>2]=0;var i=(r+12|0)>>2,v=Se[i];if(Ae[v]<<24>>24==69){Se[e>>2]=0|He.__str102272;var t=Se[i]+1|0;Se[i]=t;var f=t}else var f=v;var f;Se[i]=f+1|0;var _=Ae[f]<<24>>24;if(65==(0|_)){Se[a>>2]=0;var s=1}else if(66==(0|_)){Se[a>>2]=0|He.__str103273;var s=1}else if(67==(0|_)){Se[a>>2]=0|He.__str104274;var s=1}else if(68==(0|_)){Se[a>>2]=0|He.__str105275;var s=1}else var s=0;var s;return s}function zr(r){var a,e,a=(r+12|0)>>2,i=r+40|0,v=r+20|0,t=0|i,f=r+44|0,_=r+48|0,s=r+52|0,n=r+56|0,o=r+20|0,l=r+24|0,b=r+16|0,k=0;r:for(;;){var k,u=Se[a],c=Ae[u];if(c<<24>>24==64){var h=u+1|0;Se[a]=h;var d=1;break}var w=c<<24>>24;do{if(0==(0|w)){var d=0;break r}if(48==(0|w)||49==(0|w)||50==(0|w)||51==(0|w)||52==(0|w)||53==(0|w)||54==(0|w)||55==(0|w)||56==(0|w)||57==(0|w)){var p=u+1|0;Se[a]=p;var E=(Ae[u]<<24>>24)-48|0,A=Yr(v,E),g=A;e=14;break}if(63==(0|w)){var y=u+1|0;Se[a]=y;var m=Ae[y]<<24>>24;if(36==(0|m)){var S=u+2|0;Se[a]=S;var M=jr(r);if(0==(0|M)){var d=0;break r}var C=Fr(r,M,-1,v);if(0==(0|C)){var d=0;break r}var R=M;e=15;break}if(63==(0|m)){var T=Se[t>>2],O=Se[f>>2],N=Se[_>>2],I=Se[s>>2],P=Se[n>>2],D=Se[o>>2],L=Se[l>>2];Cr(i);var F=Ir(r);if(0==(0|F))var X=k;else var j=Se[b>>2],U=Dr(r,0|He.__str109279,(ne=Oe,Oe+=4,Se[ne>>2]=j,ne)),X=U;var X;Se[o>>2]=D,Se[l>>2]=L,Se[t>>2]=T,Se[f>>2]=O,Se[_>>2]=N,Se[s>>2]=I,Se[n>>2]=P;var g=X;e=14;break}var x=Lr(r);if(0==(0|x)){var d=0;break r}var z=Dr(r,0|He.__str109279,(ne=Oe,Oe+=4,Se[ne>>2]=x,ne)),g=z;e=14;break}var V=Kr(r),g=V;e=14;break}while(0);if(14==e){var g;if(0==(0|g)){var d=0;break}var R=g}var R,B=Fr(r,R,-1,i);if(0==(0|B)){var d=0;break}var k=R}var d;return d}function Vr(r){var a,e,i,v=Oe;Oe+=36;var t,f=v,i=f>>2,_=v+4,s=v+8,e=s>>2,n=v+16;Se[i]=0;var o=0|r,l=Se[o>>2],b=0==(128&l|0),k=r+12|0;do if(b){var u=Ae[Se[k>>2]]<<24>>24;if(48==(0|u))var c=0|He.__str76246,h=k,a=h>>2;else if(49==(0|u))var c=0|He.__str77247,h=k,a=h>>2;else{if(50!=(0|u)){var c=0,h=k,a=h>>2;break}var c=0|He.__str78248,h=k,a=h>>2}}else var c=0,h=k,a=h>>2;while(0);var h,c,d=0==(512&l|0);do if(d){if((Ae[Se[a]]-48&255&255)>=3){var w=0;break}var w=0|He.__str79249}else var w=0;while(0);var w,p=Gr(r,0),E=Se[a],A=E+1|0;Se[a]=A;var g=Ae[E]<<24>>24;do{if(48==(0|g)||49==(0|g)||50==(0|g)||51==(0|g)||52==(0|g)||53==(0|g)){var y=r+44|0,m=Se[y>>2];Cr(n);var S=Pr(r,s,n,0);if(0==(0|S)){var M=0;t=28;break}var C=xr(r,f,_);if(0==(0|C)){var M=0;t=28;break}var R=Se[i],T=0==(0|R),O=Se[_>>2];do if(T)Se[i]=O;else{if(0==(0|O))break;var N=Dr(r,0|He.__str83253,(ne=Oe,Oe+=8,Se[ne>>2]=R,Se[ne+4>>2]=O,ne));Se[i]=N}while(0);Se[y>>2]=m,t=22;break}if(54==(0|g)||55==(0|g)){var I=s+4|0;Se[I>>2]=0,Se[e]=0;var P=xr(r,f,_);if(0==(0|P)){var M=0;t=28;break}if(Ae[Se[a]]<<24>>24==64){t=22;break}var D=qr(r);if(0==(0|D)){var M=0;t=28;break}var L=Dr(r,0|He.__str107277,(ne=Oe,Oe+=4,Se[ne>>2]=D,ne));Se[I>>2]=L,t=22;break}if(56==(0|g)||57==(0|g)){Se[e+1]=0,Se[e]=0,Se[i]=0,t=22;break}var M=0;t=28}while(0);if(22==t){var F=0==(4096&Se[o>>2]|0);do{if(F){var X=Se[e],j=Se[i];if(0==(0|j)){var U=X;t=26;break}var x=0!=(0|X)?0|He.__str87257:0,z=0|He.__str87257,V=j,B=x,H=X;t=27;break}Se[i]=0,Se[e+1]=0,Se[e]=0;var U=0;t=26;break}while(0);if(26==t)var U,K=0!=(0|U)?0|He.__str87257:0,z=K,V=0,B=0,H=U;var H,B,V,z,Y=Se[e+1],G=Dr(r,0|He.__str108278,(ne=Oe,Oe+=32,Se[ne>>2]=c,Se[ne+4>>2]=w,Se[ne+8>>2]=H,Se[ne+12>>2]=B,Se[ne+16>>2]=V,Se[ne+20>>2]=z,Se[ne+24>>2]=p,Se[ne+28>>2]=Y,ne));Se[r+16>>2]=G;var M=1}var M;return Oe=v,M}function Br(r,a){var e,i,v,t,f=Oe;Oe+=44;var _,s=f,t=s>>2,n=f+8,o=f+12,v=o>>2,l=f+16,b=f+20,k=f+40;Se[v]=0;var i=(r+12|0)>>2,u=Se[i],c=u+1|0;Se[i]=c;var h=ge[u],d=h<<24>>24,w=(h-65&255&255)>25;r:do if(w)var p=0;else{var e=(0|r)>>2,E=Me[e],A=0==(128&E|0),g=d-65|0;do if(A){var y=g/8|0;if(0==(0|y))var m=0|He.__str76246,S=g;else if(1==(0|y))var m=0|He.__str77247,S=g;else{if(2!=(0|y)){var m=0,S=g;break}var m=0|He.__str78248,S=g}}else var m=0,S=g;while(0);var S,m,M=0==(512&E|0)&h<<24>>24<89,C=(0|S)%8;do if(M)if(2==(0|C)||3==(0|C))var R=m,T=0|He.__str79249;else if(4==(0|C)||5==(0|C))var R=m,T=0|He.__str80250;else{if(6!=(0|C)&&7!=(0|C)){var R=m,T=0;break}var O=Dr(r,0|He.__str81251,(ne=Oe,Oe+=4,Se[ne>>2]=m,ne)),R=O,T=0|He.__str80250}else var R=m,T=0;while(0);var T,R,N=Gr(r,0),I=6==(0|C);do{if(!I){if(7==((d-56)%8|0)){_=14;break}var P=N;_=15;break}_=14}while(0);if(14==_)var D=Lr(r),L=Dr(r,0|He.__str82252,(ne=Oe,Oe+=8,Se[ne>>2]=N,Se[ne+4>>2]=D,ne)),P=L;var P,F=h<<24>>24>88;do if(F)var X=0;else{if((C-2|0)>>>0<2){var X=0;break}var j=xr(r,o,k);if(0==(0|j)){var p=0;break r}var U=Me[v],x=Se[k>>2];if(0==(0|U)&0==(0|x)){var X=0;break}var z=Dr(r,0|He.__str83253,(ne=Oe,Oe+=8,Se[ne>>2]=U,Se[ne+4>>2]=x,ne));Se[v]=z;var X=z}while(0);var X,V=Se[i],B=V+1|0;Se[i]=B;var H=Ae[V],K=Se[e],Y=Ur(H,n,l,K);if(0==(0|Y)){var p=0;break}Cr(b);var G=Se[i];if(Ae[G]<<24>>24==64){Se[t]=0|He.__str84254,Se[t+1]=0;var W=G+1|0;Se[i]=W}else{var Z=Pr(r,s,b,0);if(0==(0|Z)){var p=0;break}}if(0!=(4&Se[e]|0)&&(Se[t+1]=0,Se[t]=0),0==(0|a))var Q=P;else{var q=0|s,$=Se[q>>2],J=s+4|0,rr=Se[J>>2],ar=Dr(r,0|He.__str85255,(ne=Oe,Oe+=12,Se[ne>>2]=P,Se[ne+4>>2]=$,Se[ne+8>>2]=rr,ne));Se[J>>2]=0,Se[q>>2]=0;var Q=ar}var Q,er=r+44|0,ir=Se[er>>2],vr=Xr(r,b,1,40,41);if(0==(0|vr)){var p=0;break}if(0==(4096&Se[e]|0))var tr=vr,fr=X;else{Se[v]=0;var tr=0,fr=0}var fr,tr;Se[er>>2]=ir;var _r=Se[t],sr=Se[t+1];if(0==(0|_r))var nr=0;else var or=0!=(0|sr)?0:0|He.__str87257,nr=or;var nr,lr=Se[n>>2],br=0!=(0|lr)?0|He.__str87257:0,kr=Se[l>>2],ur=Dr(r,0|He.__str86256,(ne=Oe,Oe+=44,Se[ne>>2]=R,Se[ne+4>>2]=T,Se[ne+8>>2]=_r,Se[ne+12>>2]=nr,Se[ne+16>>2]=lr,Se[ne+20>>2]=br,Se[ne+24>>2]=kr,Se[ne+28>>2]=Q,Se[ne+32>>2]=tr,Se[ne+36>>2]=fr,Se[ne+40>>2]=sr,ne));Se[r+16>>2]=ur;var p=1}while(0);var p;return Oe=f,p}function Hr(r){var a,a=(r+12|0)>>2,e=Se[a];if(Ae[e]<<24>>24==36)var i=e;else{Xa(0|He.__str72242,1252,0|He.___func___handle_template,0|He.__str74244);var i=Se[a]}var i;Se[a]=i+1|0;var v=Kr(r),t=0==(0|v);do if(t)var f=0;else{var _=Xr(r,0,0,60,62);if(0==(0|_)){var f=0;break}var s=Dr(r,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=v,Se[ne+4>>2]=_,ne));Se[r+16>>2]=s;var f=1}while(0);var f;return f}function Kr(r){for(var a,a=(r+12|0)>>2,e=Me[a],i=e,v=Ae[e];;){var v,i;if(!((v-65&255&255)<26|(v-97&255&255)<26|(v-48&255&255)<10)&&v<<24>>24!=95&&v<<24>>24!=36){var t=0;break}var f=i+1|0;Se[a]=f;var _=ge[f];if(_<<24>>24==64){Se[a]=i+2|0;var s=f-e|0,n=r+20|0,o=Fr(r,e,s,n);if(0==(0|o)){var t=0;break}var l=Se[r+24>>2]-1-Se[n>>2]|0,b=Yr(n,l),t=b;break}var i=f,v=_}var t;return t}function Yr(r,a){0==(0|r)&&Xa(0|He.__str72242,263,0|He.___func___str_array_get_ref,0|He.__str75245);var e=Se[r>>2]+a|0;if(e>>>0>2]>>>0)var i=Se[Se[r+16>>2]+(e<<2)>>2];else var i=0;var i;return i}function Gr(r,a){var e,e=(r+44|0)>>2,i=Me[e];if(i>>>0>a>>>0){for(var v=r+56|0,t=a,f=0,_=Se[v>>2],s=i;;){var s,_,f,t,n=Me[_+(t<<2)>>2];if(0==(0|n)){Xa(0|He.__str72242,680,0|He.___func___get_class_string,0|He.__str106276);var o=Se[v>>2],l=o,b=Se[o+(t<<2)>>2],k=Se[e]}else var l=_,b=n,k=s;var k,b,l,u=Ca(b),c=u+(f+2)|0,h=t+1|0;if(h>>>0>=k>>>0)break;var t=h,f=c,_=l,s=k}var d=c-1|0}else var d=-1;var d,w=Wr(r,d);if(0==(0|w))var p=0;else{var E=Se[e]-1|0,A=(0|E)<(0|a);r:do if(A)var g=0;else for(var y=r+56|0,m=0,S=E;;){var S,m,M=Se[Se[y>>2]+(S<<2)>>2],C=Ca(M),R=w+m|0;Pa(R,M,C,1);var T=C+m|0;if((0|S)>(0|a)){var O=T+1|0;Ae[w+T|0]=58;var N=T+2|0;Ae[w+O|0]=58;var I=N}else var I=T;var I,P=S-1|0;if((0|P)<(0|a)){var g=I;break r}var m=I,S=P}while(0);var g;Ae[w+g|0]=0;var p=w}var p;return p}function Wr(r,a){var e,i=a>>>0>1020;do if(i){var v=Se[r+4>>2],t=a+4|0,f=pe[v](t);if(0==(0|f)){var _=0;break}var s=r+60|0,n=Se[s>>2],o=f;Se[o>>2]=n,Se[s>>2]=f,Se[r+64>>2]=0;var _=f+4|0}else{var e=(r+64|0)>>2,l=Me[e];if(l>>>0>>0){var b=Se[r+4>>2],k=pe[b](1024);if(0==(0|k)){var _=0;break}var u=r+60|0,c=Se[u>>2],h=k;Se[h>>2]=c,Se[u>>2]=k,Se[e]=1020;var d=1020,w=k}else var d=l,w=Se[r+60>>2];var w,d;Se[e]=d-a|0;var _=w+(1024-d)|0}while(0);var _;return _}function Zr(r){var a=r<<24>>24;if(68==(0|a))var e=0|He.__str157327;else if(69==(0|a))var e=0|He.__str158328;else if(70==(0|a))var e=0|He.__str159329;else if(71==(0|a))var e=0|He.__str160330;else if(72==(0|a))var e=0|He.__str161331;else if(73==(0|a))var e=0|He.__str162332;else if(74==(0|a))var e=0|He.__str163333;else if(75==(0|a))var e=0|He.__str164334;else if(76==(0|a))var e=0|He.__str165335;else if(77==(0|a))var e=0|He.__str166336;else if(78==(0|a))var e=0|He.__str167337;else if(87==(0|a))var e=0|He.__str168338;else var e=0;var e;return e}function Qr(r){var a=r<<24>>24;if(67==(0|a))var e=0|He.__str145315;else if(68==(0|a))var e=0|He.__str146316;else if(69==(0|a))var e=0|He.__str147317;else if(70==(0|a))var e=0|He.__str148318;else if(71==(0|a))var e=0|He.__str149319;else if(72==(0|a))var e=0|He.__str150320;else if(73==(0|a))var e=0|He.__str151321;else if(74==(0|a))var e=0|He.__str152322;else if(75==(0|a))var e=0|He.__str153323;else if(77==(0|a))var e=0|He.__str154324;else if(78==(0|a))var e=0|He.__str155325;else if(79==(0|a))var e=0|He.__str156326;else if(88==(0|a))var e=0|He.__str84254;else if(90==(0|a))var e=0|He.__str110280;else var e=0;var e;return e}function qr(r){var a=r+44|0,e=Se[a>>2],i=zr(r);if(0==(0|i))var v=0;else var t=Gr(r,e),v=t;var v;return Se[a>>2]=e,v}function $r(r,a,e,i,v){var t,f,_,s=Oe;Oe+=16;var n,o=s,_=o>>2,l=s+4,b=s+8,f=b>>2;Se[l>>2]=0|ii;var t=(a+12|0)>>2,k=Se[t];if(Ae[k]<<24>>24==69){Se[l>>2]=0|He.__str134304;var u=k+1|0;Se[t]=u;var c=0|He.__str134304}else var c=0|ii;var c,h=i<<24>>24;do{if(65==(0|h)){var d=Dr(a,0|He.__str135305,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=d;n=10;break}if(66==(0|h)){var p=Dr(a,0|He.__str136306,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=p;n=10;break}if(80==(0|h)){var E=Dr(a,0|He.__str137307,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=E;n=10;break}if(81==(0|h)){var A=Dr(a,0|He.__str138308,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=A;n=10;break}if(82==(0|h)){var g=Dr(a,0|He.__str139309,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=g;n=10;break}if(83==(0|h)){var y=Dr(a,0|He.__str140310,(ne=Oe,Oe+=4,Se[ne>>2]=c,ne)),w=y;n=10;break}if(63==(0|h)){var w=0|ii;n=10}else n=31}while(0);r:do if(10==n){var w,m=xr(a,o,l);if(0==(0|m))break;var S=a+44|0,M=Se[S>>2],C=Se[t],R=Ae[C]<<24>>24==89;a:do if(R){var T=C+1|0;Se[t]=T;var O=Lr(a);if(0==(0|O))break r;var N=Ha(O),I=Ae[w]<<24>>24==32,P=Se[_],D=0==(0|P);do{if(I){if(!D){n=17;break}var L=w+1|0;n=18;break}if(D){var L=w;n=18;break}n=17;break}while(0);if(17==n){var F=Dr(a,0|He.__str141311,(ne=Oe,Oe+=8,Se[ne>>2]=P,Se[ne+4>>2]=w,ne));Se[_]=0;var X=F}else if(18==n)var L,j=Dr(a,0|He.__str142312,(ne=Oe,Oe+=4,Se[ne>>2]=L,ne)),X=j;var X;if(0==(0|N)){var U=X;break}for(var x=X,z=N;;){var z,x,V=z-1|0,B=Lr(a),H=Dr(a,0|He.__str143313,(ne=Oe,Oe+=8,Se[ne>>2]=x,Se[ne+4>>2]=B,ne));if(0==(0|V)){var U=H;break a}var x=H,z=V}}else var U=w;while(0);var U,K=Pr(a,b,e,0);if(0==(0|K))break;var Y=Se[_];if(0==(0|Y)){var G=0==(0|v);do if(G){if(Ae[U]<<24>>24==0){var W=U;break}var Z=U+1|0;if(Ae[Z]<<24>>24!=42){var W=U;break}var Q=Se[f],q=Ca(Q);if(Ae[Q+(q-1)|0]<<24>>24!=42){var W=U;break}var W=Z}else var W=U;while(0);var W,$=Se[f],J=Dr(a,0|He.__str170,(ne=Oe,Oe+=8,Se[ne>>2]=$,Se[ne+4>>2]=W,ne));Se[r>>2]=J}else{var rr=Se[f],ar=Dr(a,0|He.__str144314,(ne=Oe,Oe+=12,Se[ne>>2]=rr,Se[ne+4>>2]=Y,Se[ne+8>>2]=U,ne));Se[r>>2]=ar}var er=Se[f+1];Se[r+4>>2]=er,Se[S>>2]=M}while(0);Oe=s}function Jr(r){var a,e=r>>>0<245;do{if(e){if(r>>>0<11)var i=16;else var i=r+11&-8;var i,v=i>>>3,t=Me[vi>>2],f=t>>>(v>>>0);if(0!=(3&f|0)){var _=(1&f^1)+v|0,s=_<<1,n=(s<<2)+vi+40|0,o=(s+2<<2)+vi+40|0,l=Me[o>>2],b=l+8|0,k=Me[b>>2];if((0|n)==(0|k))Se[vi>>2]=t&(1<<_^-1);else{if(k>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[o>>2]=k,Se[k+12>>2]=n}var u=_<<3;Se[l+4>>2]=3|u;var c=l+(4|u)|0,h=1|Se[c>>2];Se[c>>2]=h;var d=b;a=38;break}if(i>>>0<=Me[vi+8>>2]>>>0){var w=i;a=30;break}if(0!=(0|f)){var p=2<>>12&16,y=A>>>(g>>>0),m=y>>>5&8,S=y>>>(m>>>0),M=S>>>2&4,C=S>>>(M>>>0),R=C>>>1&2,T=C>>>(R>>>0),O=T>>>1&1,N=(m|g|M|R|O)+(T>>>(O>>>0))|0,I=N<<1,P=(I<<2)+vi+40|0,D=(I+2<<2)+vi+40|0,L=Me[D>>2],F=L+8|0,X=Me[F>>2];if((0|P)==(0|X))Se[vi>>2]=t&(1<>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[D>>2]=X,Se[X+12>>2]=P}var j=N<<3,U=j-i|0;Se[L+4>>2]=3|i;var x=L,z=x+i|0;Se[x+(4|i)>>2]=1|U,Se[x+j>>2]=U;var V=Me[vi+8>>2];if(0!=(0|V)){var B=Se[vi+20>>2],H=V>>>2&1073741822,K=(H<<2)+vi+40|0,Y=Me[vi>>2],G=1<<(V>>>3),W=0==(Y&G|0);do{if(!W){var Z=(H+2<<2)+vi+40|0,Q=Me[Z>>2];if(Q>>>0>=Me[vi+16>>2]>>>0){var q=Q,$=Z;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=Y|G;var q=K,$=(H+2<<2)+vi+40|0}while(0);var $,q;Se[$>>2]=B,Se[q+12>>2]=B;var J=B+8|0;Se[J>>2]=q;var rr=B+12|0;Se[rr>>2]=K}Se[vi+8>>2]=U,Se[vi+20>>2]=z;var d=F;a=38;break}if(0==(0|Se[vi+4>>2])){var w=i;a=30;break}var ar=ra(i);if(0==(0|ar)){var w=i;a=30;break}var d=ar;a=38;break}if(r>>>0>4294967231){var w=-1;a=30;break}var er=r+11&-8;if(0==(0|Se[vi+4>>2])){var w=er;a=30;break}var ir=ea(er);if(0==(0|ir)){var w=er;a=30;break}var d=ir;a=38;break}while(0);if(30==a){var w,vr=Me[vi+8>>2];if(w>>>0>vr>>>0){var tr=Me[vi+12>>2];if(w>>>0>>0){var fr=tr-w|0;Se[vi+12>>2]=fr;var _r=Me[vi+24>>2],sr=_r;Se[vi+24>>2]=sr+w|0,Se[w+(sr+4)>>2]=1|fr,Se[_r+4>>2]=3|w;var d=_r+8|0}else var nr=aa(w),d=nr}else{var or=vr-w|0,lr=Me[vi+20>>2];if(or>>>0>15){var br=lr;Se[vi+20>>2]=br+w|0,Se[vi+8>>2]=or,Se[w+(br+4)>>2]=1|or,Se[br+vr>>2]=or,Se[lr+4>>2]=3|w}else{Se[vi+8>>2]=0,Se[vi+20>>2]=0,Se[lr+4>>2]=3|vr;var kr=vr+(lr+4)|0,ur=1|Se[kr>>2];Se[kr>>2]=ur}var d=lr+8|0}}var d;return d}function ra(r){var a,e,i,v=Se[vi+4>>2],t=(v&-v)-1|0,f=t>>>12&16,_=t>>>(f>>>0),s=_>>>5&8,n=_>>>(s>>>0),o=n>>>2&4,l=n>>>(o>>>0),b=l>>>1&2,k=l>>>(b>>>0),u=k>>>1&1,c=Me[vi+((s|f|o|b|u)+(k>>>(u>>>0))<<2)+304>>2],h=c,e=h>>2,d=(Se[c+4>>2]&-8)-r|0;r:for(;;)for(var d,h,w=h;;){var w,p=Se[w+16>>2];if(0==(0|p)){var E=Se[w+20>>2];if(0==(0|E))break r;var A=E}else var A=p;var A,g=(Se[A+4>>2]&-8)-r|0;if(g>>>0>>0){var h=A,e=h>>2,d=g;continue r}var w=A}var y=h,m=Me[vi+16>>2],S=y>>>0>>0;do if(!S){var M=y+r|0,C=M;if(y>>>0>=M>>>0)break;var R=Me[e+6],T=Me[e+3],O=(0|T)==(0|h);do if(O){var N=h+20|0,I=Se[N>>2];if(0==(0|I)){var P=h+16|0,D=Se[P>>2];if(0==(0|D)){var L=0,a=L>>2;break}var F=P,X=D}else{var F=N,X=I;i=14}for(;;){var X,F,j=X+20|0,U=Se[j>>2];if(0==(0|U)){var x=X+16|0,z=Me[x>>2];if(0==(0|z))break;var F=x,X=z}else var F=j,X=U}if(F>>>0>>0)throw Ka(),"Reached an unreachable!";Se[F>>2]=0;var L=X,a=L>>2}else{var V=Me[e+2];if(V>>>0>>0)throw Ka(),"Reached an unreachable!";Se[V+12>>2]=T,Se[T+8>>2]=V;var L=T,a=L>>2}while(0);var L,B=0==(0|R);r:do if(!B){var H=h+28|0,K=(Se[H>>2]<<2)+vi+304|0,Y=(0|h)==(0|Se[K>>2]);do{if(Y){if(Se[K>>2]=L,0!=(0|L))break;var G=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=G;break r}if(R>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var W=R+16|0;if((0|Se[W>>2])==(0|h)?Se[W>>2]=L:Se[R+20>>2]=L,0==(0|L))break r}while(0);if(L>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+6]=R;var Z=Me[e+4];if(0!=(0|Z)){if(Z>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+4]=Z,Se[Z+24>>2]=L}var Q=Me[e+5];if(0==(0|Q))break;if(Q>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+5]=Q,Se[Q+24>>2]=L}while(0);if(d>>>0<16){var q=d+r|0;Se[e+1]=3|q;var $=q+(y+4)|0,J=1|Se[$>>2];Se[$>>2]=J}else{Se[e+1]=3|r,Se[r+(y+4)>>2]=1|d,Se[y+d+r>>2]=d;var rr=Me[vi+8>>2];if(0!=(0|rr)){var ar=Me[vi+20>>2],er=rr>>>2&1073741822,ir=(er<<2)+vi+40|0,vr=Me[vi>>2],tr=1<<(rr>>>3),fr=0==(vr&tr|0);do{if(!fr){var _r=(er+2<<2)+vi+40|0,sr=Me[_r>>2];if(sr>>>0>=Me[vi+16>>2]>>>0){var nr=sr,or=_r;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=vr|tr;var nr=ir,or=(er+2<<2)+vi+40|0}while(0);var or,nr;Se[or>>2]=ar,Se[nr+12>>2]=ar,Se[ar+8>>2]=nr,Se[ar+12>>2]=ir}Se[vi+8>>2]=d,Se[vi+20>>2]=C}return h+8|0}while(0);throw Ka(),"Reached an unreachable!"}function aa(r){var a,e;0==(0|Se[ti>>2])&&ba();var i=0==(4&Se[vi+440>>2]|0);do{if(i){var v=Se[vi+24>>2],t=0==(0|v);do{if(!t){var f=v,_=ua(f);if(0==(0|_)){e=6;break}var s=Se[ti+8>>2],n=r+47-Se[vi+12>>2]+s&-s;if(n>>>0>=2147483647){e=14;break}var o=re(n);if((0|o)==(Se[_>>2]+Se[_+4>>2]|0)){var l=o,b=n,k=o;e=13;break}var u=o,c=n;e=15;break}e=6}while(0);do if(6==e){var h=re(0);if((0|h)==-1){e=14;break}var d=Se[ti+8>>2],w=d+(r+47)&-d,p=h,E=Se[ti+4>>2],A=E-1|0;if(0==(A&p|0))var g=w;else var g=w-p+(A+p&-E)|0;var g;if(g>>>0>=2147483647){e=14;break}var y=re(g);if((0|y)==(0|h)){var l=h,b=g,k=y;e=13;break}var u=y,c=g;e=15;break}while(0);if(13==e){var k,b,l;if((0|l)!=-1){var m=b,S=l;e=26;break}var u=k,c=b}else if(14==e){var M=4|Se[vi+440>>2];Se[vi+440>>2]=M,e=23;break}var c,u,C=0|-c,R=(0|u)!=-1&c>>>0<2147483647;do{if(R){if(c>>>0>=(r+48|0)>>>0){var T=c;e=21;break}var O=Se[ti+8>>2],N=r+47-c+O&-O;if(N>>>0>=2147483647){var T=c;e=21;break}var I=re(N);if((0|I)==-1){re(C);e=22;break}var T=N+c|0;e=21;break}var T=c;e=21}while(0);if(21==e){var T;if((0|u)!=-1){var m=T,S=u;e=26;break}}var P=4|Se[vi+440>>2];Se[vi+440>>2]=P,e=23;break}e=23}while(0);do if(23==e){var D=Se[ti+8>>2],L=D+(r+47)&-D;if(L>>>0>=2147483647){e=49;break}var F=re(L),X=re(0);if(!((0|X)!=-1&(0|F)!=-1&F>>>0>>0)){e=49;break}var j=X-F|0;if(j>>>0<=(r+40|0)>>>0|(0|F)==-1){e=49;break}var m=j,S=F;e=26;break}while(0);r:do if(26==e){var S,m,U=Se[vi+432>>2]+m|0;Se[vi+432>>2]=U,U>>>0>Me[vi+436>>2]>>>0&&(Se[vi+436>>2]=U);var x=Me[vi+24>>2],z=0==(0|x);a:do if(z){var V=Me[vi+16>>2];0==(0|V)|S>>>0>>0&&(Se[vi+16>>2]=S),Se[vi+444>>2]=S,Se[vi+448>>2]=m,Se[vi+456>>2]=0;var B=Se[ti>>2];Se[vi+36>>2]=B,Se[vi+32>>2]=-1,ha(),ca(S,m-40|0)}else{for(var H=vi+444|0,a=H>>2;;){var H;if(0==(0|H))break;var K=Me[a],Y=H+4|0,G=Me[Y>>2],W=K+G|0;if((0|S)==(0|W)){if(0!=(8&Se[a+3]|0))break;var Z=x;if(!(Z>>>0>=K>>>0&Z>>>0>>0))break;Se[Y>>2]=G+m|0;var Q=Se[vi+24>>2],q=Se[vi+12>>2]+m|0;ca(Q,q);break a}var H=Se[a+2],a=H>>2}S>>>0>2]>>>0&&(Se[vi+16>>2]=S);for(var $=S+m|0,J=vi+444|0;;){var J;if(0==(0|J))break;var rr=0|J,ar=Me[rr>>2];if((0|ar)==(0|$)){if(0!=(8&Se[J+12>>2]|0))break;Se[rr>>2]=S;var er=J+4|0,ir=Se[er>>2]+m|0;Se[er>>2]=ir;var vr=da(S,ar,r),tr=vr;e=50;break r}var J=Se[J+8>>2]}Ma(S,m)}while(0);var fr=Me[vi+12>>2];if(fr>>>0<=r>>>0){e=49;break}var _r=fr-r|0;Se[vi+12>>2]=_r;var sr=Me[vi+24>>2],nr=sr;Se[vi+24>>2]=nr+r|0,Se[r+(nr+4)>>2]=1|_r,Se[sr+4>>2]=3|r;var tr=sr+8|0;e=50;break}while(0);if(49==e){var or=Je();Se[or>>2]=12;var tr=0}var tr;return tr}function ea(r){var a,e,i,v,t,f,_=r>>2,s=0|-r,n=r>>>8,o=0==(0|n);do if(o)var l=0;else{if(r>>>0>16777215){var l=31;break}var b=(n+1048320|0)>>>16&8,k=n<>>16&4,c=k<>>16&2,d=14-(u|b|h)+(c<>>15)|0,l=r>>>((d+7|0)>>>0)&1|d<<1}while(0);var l,w=Me[vi+(l<<2)+304>>2],p=0==(0|w);r:do if(p)var E=0,A=s,g=0;else{if(31==(0|l))var y=0;else var y=25-(l>>>1)|0;for(var y,m=0,S=s,M=w,t=M>>2,C=r<>>0>>0){if((0|T)==(0|r)){var E=M,A=O,g=M;break r}var N=M,I=O}else var N=m,I=S;var I,N,P=Me[t+5],D=Me[((C>>>31<<2)+16>>2)+t],L=0==(0|P)|(0|P)==(0|D)?R:P;if(0==(0|D)){var E=N,A=I,g=L;break r}var m=N,S=I,M=D,t=M>>2,C=C<<1,R=L}}while(0);var g,A,E,F=0==(0|g)&0==(0|E);do if(F){var X=2<>2]&(X|-X);if(0==(0|j)){var U=g;break}var x=(j&-j)-1|0,z=x>>>12&16,V=x>>>(z>>>0),B=V>>>5&8,H=V>>>(B>>>0),K=H>>>2&4,Y=H>>>(K>>>0),G=Y>>>1&2,W=Y>>>(G>>>0),Z=W>>>1&1,U=Se[vi+((B|z|K|G|Z)+(W>>>(Z>>>0))<<2)+304>>2]}else var U=g;while(0);var U,Q=0==(0|U);r:do if(Q)var q=A,$=E,v=$>>2;else for(var J=U,i=J>>2,rr=A,ar=E;;){var ar,rr,J,er=(Se[i+1]&-8)-r|0,ir=er>>>0>>0,vr=ir?er:rr,tr=ir?J:ar,fr=Me[i+4];if(0==(0|fr)){var _r=Me[i+5];if(0==(0|_r)){var q=vr,$=tr,v=$>>2;break r}var J=_r,i=J>>2,rr=vr,ar=tr}else var J=fr,i=J>>2,rr=vr,ar=tr}while(0);var $,q,sr=0==(0|$);r:do{if(!sr){if(q>>>0>=(Se[vi+8>>2]-r|0)>>>0){var nr=0;break}var or=$,e=or>>2,lr=Me[vi+16>>2],br=or>>>0>>0;do if(!br){var kr=or+r|0,ur=kr;if(or>>>0>=kr>>>0)break;var cr=Me[v+6],hr=Me[v+3],dr=(0|hr)==(0|$);do if(dr){var wr=$+20|0,pr=Se[wr>>2];if(0==(0|pr)){var Er=$+16|0,Ar=Se[Er>>2];if(0==(0|Ar)){var gr=0,a=gr>>2;break}var yr=Er,mr=Ar}else{var yr=wr,mr=pr;f=28}for(;;){var mr,yr,Sr=mr+20|0,Mr=Se[Sr>>2];if(0==(0|Mr)){var Cr=mr+16|0,Rr=Me[Cr>>2];if(0==(0|Rr))break;var yr=Cr,mr=Rr}else var yr=Sr,mr=Mr}if(yr>>>0>>0)throw Ka(),"Reached an unreachable!";Se[yr>>2]=0;var gr=mr,a=gr>>2}else{var Tr=Me[v+2];if(Tr>>>0>>0)throw Ka(),"Reached an unreachable!";Se[Tr+12>>2]=hr,Se[hr+8>>2]=Tr;var gr=hr,a=gr>>2}while(0);var gr,Or=0==(0|cr);a:do if(!Or){var Nr=$+28|0,Ir=(Se[Nr>>2]<<2)+vi+304|0,Pr=(0|$)==(0|Se[Ir>>2]);do{if(Pr){if(Se[Ir>>2]=gr,0!=(0|gr))break;var Dr=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=Dr;break a}if(cr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var Lr=cr+16|0;if((0|Se[Lr>>2])==(0|$)?Se[Lr>>2]=gr:Se[cr+20>>2]=gr,0==(0|gr))break a}while(0);if(gr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+6]=cr;var Fr=Me[v+4];if(0!=(0|Fr)){if(Fr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+4]=Fr,Se[Fr+24>>2]=gr}var Xr=Me[v+5];if(0==(0|Xr))break;if(Xr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+5]=Xr,Se[Xr+24>>2]=gr}while(0);var jr=q>>>0<16;a:do if(jr){var Ur=q+r|0;Se[v+1]=3|Ur;var xr=Ur+(or+4)|0,zr=1|Se[xr>>2];Se[xr>>2]=zr}else if(Se[v+1]=3|r,Se[_+(e+1)]=1|q,Se[(q>>2)+e+_]=q,q>>>0<256){var Vr=q>>>2&1073741822,Br=(Vr<<2)+vi+40|0,Hr=Me[vi>>2],Kr=1<<(q>>>3),Yr=0==(Hr&Kr|0);do{if(!Yr){var Gr=(Vr+2<<2)+vi+40|0,Wr=Me[Gr>>2];if(Wr>>>0>=Me[vi+16>>2]>>>0){var Zr=Wr,Qr=Gr;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=Hr|Kr;var Zr=Br,Qr=(Vr+2<<2)+vi+40|0}while(0);var Qr,Zr;Se[Qr>>2]=ur,Se[Zr+12>>2]=ur,Se[_+(e+2)]=Zr,Se[_+(e+3)]=Br}else{var qr=kr,$r=q>>>8,Jr=0==(0|$r);do if(Jr)var ra=0;else{if(q>>>0>16777215){var ra=31;break}var aa=($r+1048320|0)>>>16&8,ea=$r<>>16&4,va=ea<>>16&2,fa=14-(ia|aa|ta)+(va<>>15)|0,ra=q>>>((fa+7|0)>>>0)&1|fa<<1}while(0);var ra,_a=(ra<<2)+vi+304|0;Se[_+(e+7)]=ra;var sa=r+(or+16)|0;Se[_+(e+5)]=0,Se[sa>>2]=0;var na=Se[vi+4>>2],oa=1<>2]=la,Se[_a>>2]=qr,Se[_+(e+6)]=_a,Se[_+(e+3)]=qr,Se[_+(e+2)]=qr}else{if(31==(0|ra))var ba=0;else var ba=25-(ra>>>1)|0;for(var ba,ka=q<>2];;){var ua,ka;if((Se[ua+4>>2]&-8|0)==(0|q)){var ca=ua+8|0,ha=Me[ca>>2],da=Me[vi+16>>2],wa=ua>>>0>>0;do if(!wa){if(ha>>>0>>0)break;Se[ha+12>>2]=qr,Se[ca>>2]=qr,Se[_+(e+2)]=ha,Se[_+(e+3)]=ua,Se[_+(e+6)]=0;break a}while(0);throw Ka(),"Reached an unreachable!"}var pa=(ka>>>31<<2)+ua+16|0,Ea=Me[pa>>2];if(0==(0|Ea)){if(pa>>>0>=Me[vi+16>>2]>>>0){Se[pa>>2]=qr,Se[_+(e+6)]=ua,Se[_+(e+3)]=qr,Se[_+(e+2)]=qr;break a}throw Ka(),"Reached an unreachable!"}var ka=ka<<1,ua=Ea}}}while(0);var nr=$+8|0;break r}while(0);throw Ka(),"Reached an unreachable!"}var nr=0}while(0);var nr;return nr}function ia(r){var a;0==(0|Se[ti>>2])&&ba();var e=r>>>0<4294967232;r:do if(e){var i=Me[vi+24>>2];if(0==(0|i)){var v=0;break}var t=Me[vi+12>>2],f=t>>>0>(r+40|0)>>>0;do if(f){var _=Me[ti+8>>2],s=-40-r-1+t+_|0,n=Math.floor((s>>>0)/(_>>>0)),o=(n-1)*_|0,l=i,b=ua(l);if(0!=(8&Se[b+12>>2]|0))break;var k=re(0),a=(b+4|0)>>2;if((0|k)!=(Se[b>>2]+Se[a]|0))break;var u=o>>>0>2147483646?-2147483648-_|0:o,c=0|-u,h=re(c),d=re(0);if(!((0|h)!=-1&d>>>0>>0))break;var w=k-d|0;if((0|k)==(0|d))break;var p=Se[a]-w|0;Se[a]=p;var E=Se[vi+432>>2]-w|0;Se[vi+432>>2]=E;var A=Se[vi+24>>2],g=Se[vi+12>>2]-w|0;ca(A,g);var v=(0|k)!=(0|d);break r}while(0);if(Me[vi+12>>2]>>>0<=Me[vi+28>>2]>>>0){var v=0;break}Se[vi+28>>2]=-1;var v=0}else var v=0;while(0);var v;return 1&v}function va(r){var a,e,i,v,t,f,_,s=r>>2,n=0==(0|r);r:do if(!n){var o=r-8|0,l=o,b=Me[vi+16>>2],k=o>>>0>>0;a:do if(!k){var u=Me[r-4>>2],c=3&u;if(1==(0|c))break;var h=u&-8,f=h>>2,d=r+(h-8)|0,w=d,p=0==(1&u|0);e:do if(p){var E=Me[o>>2];if(0==(0|c))break r;var A=-8-E|0,t=A>>2,g=r+A|0,y=g,m=E+h|0;if(g>>>0>>0)break a;if((0|y)==(0|Se[vi+20>>2])){var v=(r+(h-4)|0)>>2;if(3!=(3&Se[v]|0)){var S=y,i=S>>2,M=m;break}Se[vi+8>>2]=m;var C=Se[v]&-2;Se[v]=C,Se[t+(s+1)]=1|m,Se[d>>2]=m;break r}if(E>>>0<256){var R=Me[t+(s+2)],T=Me[t+(s+3)];if((0|R)!=(0|T)){var O=((E>>>2&1073741822)<<2)+vi+40|0,N=(0|R)!=(0|O)&R>>>0>>0;do if(!N){if(!((0|T)==(0|O)|T>>>0>=b>>>0))break;Se[R+12>>2]=T,Se[T+8>>2]=R;var S=y,i=S>>2,M=m;break e}while(0);throw Ka(),"Reached an unreachable!"}var I=Se[vi>>2]&(1<<(E>>>3)^-1);Se[vi>>2]=I;var S=y,i=S>>2,M=m}else{var P=g,D=Me[t+(s+6)],L=Me[t+(s+3)],F=(0|L)==(0|P);do if(F){var X=A+(r+20)|0,j=Se[X>>2];if(0==(0|j)){var U=A+(r+16)|0,x=Se[U>>2];if(0==(0|x)){var z=0,e=z>>2;break}var V=U,B=x}else{var V=X,B=j;_=21}for(;;){var B,V,H=B+20|0,K=Se[H>>2];if(0==(0|K)){var Y=B+16|0,G=Me[Y>>2];if(0==(0|G))break;var V=Y,B=G}else var V=H,B=K}if(V>>>0>>0)throw Ka(),"Reached an unreachable!";Se[V>>2]=0;var z=B,e=z>>2}else{var W=Me[t+(s+2)];if(W>>>0>>0)throw Ka(),"Reached an unreachable!";Se[W+12>>2]=L,Se[L+8>>2]=W;var z=L,e=z>>2}while(0);var z;if(0==(0|D)){var S=y,i=S>>2,M=m;break}var Z=A+(r+28)|0,Q=(Se[Z>>2]<<2)+vi+304|0,q=(0|P)==(0|Se[Q>>2]);do{if(q){if(Se[Q>>2]=z,0!=(0|z))break;var $=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=$;var S=y,i=S>>2,M=m;break e}if(D>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var J=D+16|0;if((0|Se[J>>2])==(0|P)?Se[J>>2]=z:Se[D+20>>2]=z,0==(0|z)){var S=y,i=S>>2,M=m;break e}}while(0);if(z>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[e+6]=D;var rr=Me[t+(s+4)];if(0!=(0|rr)){if(rr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[e+4]=rr,Se[rr+24>>2]=z}var ar=Me[t+(s+5)];if(0==(0|ar)){var S=y,i=S>>2,M=m;break}if(ar>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[e+5]=ar,Se[ar+24>>2]=z;var S=y,i=S>>2,M=m}}else var S=l,i=S>>2,M=h;while(0);var M,S,er=S;if(er>>>0>=d>>>0)break;var ir=r+(h-4)|0,vr=Me[ir>>2];if(0==(1&vr|0))break;var tr=0==(2&vr|0);do{if(tr){if((0|w)==(0|Se[vi+24>>2])){var fr=Se[vi+12>>2]+M|0;Se[vi+12>>2]=fr,Se[vi+24>>2]=S;var _r=1|fr;if(Se[i+1]=_r,(0|S)==(0|Se[vi+20>>2])&&(Se[vi+20>>2]=0,Se[vi+8>>2]=0),fr>>>0<=Me[vi+28>>2]>>>0)break r;ia(0);break r}if((0|w)==(0|Se[vi+20>>2])){var sr=Se[vi+8>>2]+M|0;Se[vi+8>>2]=sr,Se[vi+20>>2]=S;var nr=1|sr;Se[i+1]=nr;var or=er+sr|0;Se[or>>2]=sr;break r}var lr=(vr&-8)+M|0,br=vr>>>3,kr=vr>>>0<256;e:do if(kr){var ur=Me[s+f],cr=Me[((4|h)>>2)+s];if((0|ur)!=(0|cr)){var hr=((vr>>>2&1073741822)<<2)+vi+40|0,dr=(0|ur)==(0|hr);do{if(!dr){if(ur>>>0>2]>>>0){_=66;break}_=63;break}_=63}while(0);do if(63==_){if((0|cr)!=(0|hr)&&cr>>>0>2]>>>0)break;Se[ur+12>>2]=cr,Se[cr+8>>2]=ur;break e}while(0);throw Ka(),"Reached an unreachable!"}var wr=Se[vi>>2]&(1<>2]=wr}else{var pr=d,Er=Me[f+(s+4)],Ar=Me[((4|h)>>2)+s],gr=(0|Ar)==(0|pr);do if(gr){var yr=h+(r+12)|0,mr=Se[yr>>2];if(0==(0|mr)){var Sr=h+(r+8)|0,Mr=Se[Sr>>2];if(0==(0|Mr)){var Cr=0,a=Cr>>2;break}var Rr=Sr,Tr=Mr}else{var Rr=yr,Tr=mr;_=73}for(;;){var Tr,Rr,Or=Tr+20|0,Nr=Se[Or>>2];if(0==(0|Nr)){var Ir=Tr+16|0,Pr=Me[Ir>>2];if(0==(0|Pr))break;var Rr=Ir,Tr=Pr}else var Rr=Or,Tr=Nr}if(Rr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[Rr>>2]=0;var Cr=Tr,a=Cr>>2}else{var Dr=Me[s+f];if(Dr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[Dr+12>>2]=Ar, -Se[Ar+8>>2]=Dr;var Cr=Ar,a=Cr>>2}while(0);var Cr;if(0==(0|Er))break;var Lr=h+(r+20)|0,Fr=(Se[Lr>>2]<<2)+vi+304|0,Xr=(0|pr)==(0|Se[Fr>>2]);do{if(Xr){if(Se[Fr>>2]=Cr,0!=(0|Cr))break;var jr=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=jr;break e}if(Er>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var Ur=Er+16|0;if((0|Se[Ur>>2])==(0|pr)?Se[Ur>>2]=Cr:Se[Er+20>>2]=Cr,0==(0|Cr))break e}while(0);if(Cr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+6]=Er;var xr=Me[f+(s+2)];if(0!=(0|xr)){if(xr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+4]=xr,Se[xr+24>>2]=Cr}var zr=Me[f+(s+3)];if(0==(0|zr))break;if(zr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[a+5]=zr,Se[zr+24>>2]=Cr}while(0);if(Se[i+1]=1|lr,Se[er+lr>>2]=lr,(0|S)!=(0|Se[vi+20>>2])){var Vr=lr;break}Se[vi+8>>2]=lr;break r}Se[ir>>2]=vr&-2,Se[i+1]=1|M,Se[er+M>>2]=M;var Vr=M}while(0);var Vr;if(Vr>>>0<256){var Br=Vr>>>2&1073741822,Hr=(Br<<2)+vi+40|0,Kr=Me[vi>>2],Yr=1<<(Vr>>>3),Gr=0==(Kr&Yr|0);do{if(!Gr){var Wr=(Br+2<<2)+vi+40|0,Zr=Me[Wr>>2];if(Zr>>>0>=Me[vi+16>>2]>>>0){var Qr=Zr,qr=Wr;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=Kr|Yr;var Qr=Hr,qr=(Br+2<<2)+vi+40|0}while(0);var qr,Qr;Se[qr>>2]=S,Se[Qr+12>>2]=S,Se[i+2]=Qr,Se[i+3]=Hr;break r}var $r=S,Jr=Vr>>>8,ra=0==(0|Jr);do if(ra)var aa=0;else{if(Vr>>>0>16777215){var aa=31;break}var ea=(Jr+1048320|0)>>>16&8,va=Jr<>>16&4,_a=va<>>16&2,na=14-(fa|ea|sa)+(_a<>>15)|0,aa=Vr>>>((na+7|0)>>>0)&1|na<<1}while(0);var aa,oa=(aa<<2)+vi+304|0;Se[i+7]=aa,Se[i+5]=0,Se[i+4]=0;var la=Se[vi+4>>2],ba=1<>2]=ua,Se[oa>>2]=$r,Se[i+6]=oa,Se[i+3]=S,Se[i+2]=S}else{if(31==(0|aa))var ca=0;else var ca=25-(aa>>>1)|0;for(var ca,ha=Vr<>2];;){var da,ha;if((Se[da+4>>2]&-8|0)==(0|Vr)){var wa=da+8|0,pa=Me[wa>>2],Ea=Me[vi+16>>2],Aa=da>>>0>>0;do if(!Aa){if(pa>>>0>>0)break;Se[pa+12>>2]=$r,Se[wa>>2]=$r,Se[i+2]=pa,Se[i+3]=da,Se[i+6]=0;break e}while(0);throw Ka(),"Reached an unreachable!"}var ga=(ha>>>31<<2)+da+16|0,ya=Me[ga>>2];if(0==(0|ya)){if(ga>>>0>=Me[vi+16>>2]>>>0){Se[ga>>2]=$r,Se[i+6]=da,Se[i+3]=S,Se[i+2]=S;break e}throw Ka(),"Reached an unreachable!"}var ha=ha<<1,da=ya}}while(0);var ma=Se[vi+32>>2]-1|0;if(Se[vi+32>>2]=ma,0!=(0|ma))break r;ta();break r}while(0);throw Ka(),"Reached an unreachable!"}while(0)}function ta(){var r=Se[vi+452>>2],a=0==(0|r);r:do if(!a)for(var e=r;;){var e,i=Se[e+8>>2];if(0==(0|i))break r;var e=i}while(0);Se[vi+32>>2]=-1}function fa(r,a){if(0==(0|r))var e=Jr(a),i=e;else var v=la(r,a),i=v;var i;return i}function _a(r,a){var e,i=r>>>0<9;do if(i)var v=Jr(a),t=v;else{var f=r>>>0<16?16:r,_=0==(f-1&f|0);r:do if(_)var s=f;else{if(f>>>0<=16){var s=16;break}for(var n=16;;){var n,o=n<<1;if(o>>>0>=f>>>0){var s=o;break r}var n=o}}while(0);var s;if((-64-s|0)>>>0>a>>>0){if(a>>>0<11)var l=16;else var l=a+11&-8;var l,b=Jr(l+(s+12)|0);if(0==(0|b)){var t=0;break}var k=b-8|0;if(0==((b>>>0)%(s>>>0)|0))var u=k,c=0;else{var h=b+(s-1)&-s,d=h-8|0,w=k;if((d-w|0)>>>0>15)var p=d;else var p=h+(s-8)|0;var p,E=p-w|0,e=(b-4|0)>>2,A=Se[e],g=(A&-8)-E|0;if(0==(3&A|0)){var y=Se[k>>2]+E|0;Se[p>>2]=y,Se[p+4>>2]=g;var u=p,c=0}else{var m=p+4|0,S=g|1&Se[m>>2]|2;Se[m>>2]=S;var M=g+(p+4)|0,C=1|Se[M>>2];Se[M>>2]=C;var R=E|1&Se[e]|2;Se[e]=R;var T=b+(E-4)|0,O=1|Se[T>>2];Se[T>>2]=O;var u=p,c=b}}var c,u,N=u+4|0,I=Me[N>>2],P=0==(3&I|0);do if(P)var D=0;else{var L=I&-8;if(L>>>0<=(l+16|0)>>>0){var D=0;break}var F=L-l|0;Se[N>>2]=l|1&I|2,Se[u+(4|l)>>2]=3|F;var X=u+(4|L)|0,j=1|Se[X>>2];Se[X>>2]=j;var D=l+(u+8)|0}while(0);var D;0!=(0|c)&&va(c),0!=(0|D)&&va(D);var t=u+8|0}else{var U=Je();Se[U>>2]=12;var t=0}}while(0);var t;return t}function sa(r,a,e,i){var v,t;0==(0|Se[ti>>2])&&ba();var f=0==(0|i),_=0==(0|r);do{if(f){if(_){var s=Jr(0),n=s;t=30;break}var o=r<<2;if(o>>>0<11){var l=0,b=16;t=9;break}var l=0,b=o+11&-8;t=9;break}if(_){var n=i;t=30;break}var l=i,b=0;t=9;break}while(0);do if(9==t){var b,l,k=0==(1&e|0);r:do if(k){if(_){var u=0,c=0;break}for(var h=0,d=0;;){var d,h,w=Me[a+(d<<2)>>2];if(w>>>0<11)var p=16;else var p=w+11&-8;var p,E=p+h|0,A=d+1|0;if((0|A)==(0|r)){var u=0,c=E;break r}var h=E,d=A}}else{var g=Me[a>>2];if(g>>>0<11)var y=16;else var y=g+11&-8;var y,u=y,c=y*r|0}while(0);var c,u,m=Jr(b-4+c|0);if(0==(0|m)){var n=0;break}var S=m-8|0,M=Se[m-4>>2]&-8;if(0!=(2&e|0)){var C=-4-b+M|0;Fa(m,0,C,1)}if(0==(0|l)){var R=m+c|0,T=M-c|3;Se[m+(c-4)>>2]=T;var O=R,v=O>>2,N=c}else var O=l,v=O>>2,N=M;var N,O;Se[v]=m;var I=r-1|0,P=0==(0|I);r:do if(P)var D=S,L=N;else if(0==(0|u))for(var F=S,X=N,j=0;;){var j,X,F,U=Me[a+(j<<2)>>2];if(U>>>0<11)var x=16;else var x=U+11&-8;var x,z=X-x|0;Se[F+4>>2]=3|x;var V=F+x|0,B=j+1|0;if(Se[(B<<2>>2)+v]=x+(F+8)|0,(0|B)==(0|I)){var D=V,L=z;break r}var F=V,X=z,j=B}else for(var H=3|u,K=u+8|0,Y=S,G=N,W=0;;){var W,G,Y,Z=G-u|0;Se[Y+4>>2]=H;var Q=Y+u|0,q=W+1|0;if(Se[(q<<2>>2)+v]=Y+K|0,(0|q)==(0|I)){var D=Q,L=Z;break r}var Y=Q,G=Z,W=q}while(0);var L,D;Se[D+4>>2]=3|L;var n=O}while(0);var n;return n}function na(r){var a=r>>2;0==(0|Se[ti>>2])&&ba();var e=Me[vi+24>>2];if(0==(0|e))var i=0,v=0,t=0,f=0,_=0,s=0,n=0;else{for(var o=Me[vi+12>>2],l=o+40|0,b=vi+444|0,k=l,u=l,c=1;;){var c,u,k,b,h=Me[b>>2],d=h+8|0;if(0==(7&d|0))var w=0;else var w=7&-d;for(var w,p=b+4|0,E=h+w|0,A=c,g=u,y=k;;){var y,g,A,E;if(E>>>0>>0)break;if(E>>>0>=(h+Se[p>>2]|0)>>>0|(0|E)==(0|e))break;var m=Se[E+4>>2];if(7==(0|m))break;var S=m&-8,M=S+y|0;if(1==(3&m|0))var C=A+1|0,R=S+g|0;else var C=A,R=g;var R,C,E=E+S|0,A=C,g=R,y=M}var T=Me[b+8>>2];if(0==(0|T))break;var b=T,k=y,u=g,c=A}var O=Se[vi+432>>2],i=y,v=A,t=o,f=g,_=O-y|0,s=Se[vi+436>>2],n=O-g|0}var n,s,_,f,t,v,i;Se[a]=i,Se[a+1]=v,Se[a+2]=0,Se[a+3]=0,Se[a+4]=_,Se[a+5]=s,Se[a+6]=0,Se[a+7]=n,Se[a+8]=f,Se[a+9]=t}function oa(){0==(0|Se[ti>>2])&&ba();var r=Me[vi+24>>2],a=0==(0|r);r:do if(a)var e=0,i=0,v=0;else for(var t=Se[vi+436>>2],f=Me[vi+432>>2],_=vi+444|0,s=f-40-Se[vi+12>>2]|0;;){var s,_,n=Me[_>>2],o=n+8|0;if(0==(7&o|0))var l=0;else var l=7&-o;for(var l,b=_+4|0,k=n+l|0,u=s;;){var u,k;if(k>>>0>>0)break;if(k>>>0>=(n+Se[b>>2]|0)>>>0|(0|k)==(0|r))break;var c=Se[k+4>>2];if(7==(0|c))break;var h=c&-8,d=1==(3&c|0)?h:0,w=u-d|0,k=k+h|0,u=w}var p=Me[_+8>>2];if(0==(0|p)){var e=t,i=f,v=u;break r}var _=p,s=u}while(0);var v,i,e,E=Se[Se[qe>>2]+12>>2],A=(Qa(E,0|He.__str339,(ne=Oe,Oe+=4,Se[ne>>2]=e,ne)),Se[Se[qe>>2]+12>>2]),g=(Qa(A,0|He.__str1340,(ne=Oe,Oe+=4,Se[ne>>2]=i,ne)),Se[Se[qe>>2]+12>>2]);Qa(g,0|He.__str2341,(ne=Oe,Oe+=4,Se[ne>>2]=v,ne))}function la(r,a){var e,i,v,t=a>>>0>4294967231;r:do{if(!t){var f=r-8|0,_=f,i=(r-4|0)>>2,s=Me[i],n=s&-8,o=n-8|0,l=r+o|0,b=f>>>0>2]>>>0;do if(!b){var k=3&s;if(!(1!=(0|k)&(0|o)>-8))break;var e=(r+(n-4)|0)>>2;if(0==(1&Se[e]|0))break;if(a>>>0<11)var u=16;else var u=a+11&-8;var u,c=0==(0|k);do{if(c){var h=ka(_,u),d=0,w=h;v=17;break}if(n>>>0>>0){if((0|l)!=(0|Se[vi+24>>2])){v=21;break}var p=Se[vi+12>>2]+n|0;if(p>>>0<=u>>>0){v=21;break}var E=p-u|0,A=r+(u-8)|0;Se[i]=u|1&s|2;var g=1|E;Se[r+(u-4)>>2]=g,Se[vi+24>>2]=A,Se[vi+12>>2]=E;var d=0,w=_;v=17;break}var y=n-u|0;if(y>>>0<=15){var d=0,w=_;v=17;break}Se[i]=u|1&s|2,Se[r+(u-4)>>2]=3|y;var m=1|Se[e];Se[e]=m;var d=r+u|0,w=_;v=17;break}while(0);do if(17==v){var w,d;if(0==(0|w))break;0!=(0|d)&&va(d);var S=w+8|0;break r}while(0);var M=Jr(a);if(0==(0|M)){var S=0;break r}var C=0==(3&Se[i]|0)?8:4,R=n-C|0,T=R>>>0>>0?R:a;Pa(M,r,T,1),va(r);var S=M;break r}while(0);throw Ka(),"Reached an unreachable!"}var O=Je();Se[O>>2]=12;var S=0}while(0);var S;return S}function ba(){if(0==(0|Se[ti>>2])){var r=qa(8);if(0!=(r-1&r|0))throw Ka(),"Reached an unreachable!";Se[ti+8>>2]=r,Se[ti+4>>2]=r,Se[ti+12>>2]=-1,Se[ti+16>>2]=2097152,Se[ti+20>>2]=0,Se[vi+440>>2]=0;var a=$a(0);Se[ti>>2]=a&-16^1431655768}}function ka(r,a){var e=Se[r+4>>2]&-8,i=a>>>0<256;do if(i)var v=0;else{if(e>>>0>=(a+4|0)>>>0&&(e-a|0)>>>0<=Se[ti+8>>2]<<1>>>0){var v=r;break}var v=0}while(0);var v;return v}function ua(r){for(var a,e=vi+444|0,a=e>>2;;){var e,i=Me[a];if(i>>>0<=r>>>0&&(i+Se[a+1]|0)>>>0>r>>>0){var v=e;break}var t=Me[a+2];if(0==(0|t)){var v=0;break}var e=t,a=e>>2}var v;return v}function ca(r,a){var e=r,i=r+8|0;if(0==(7&i|0))var v=0;else var v=7&-i;var v,t=a-v|0;Se[vi+24>>2]=e+v|0,Se[vi+12>>2]=t,Se[v+(e+4)>>2]=1|t,Se[a+(e+4)>>2]=40;var f=Se[ti+16>>2];Se[vi+28>>2]=f}function ha(){for(var r=0;;){var r,a=r<<1,e=(a<<2)+vi+40|0;Se[vi+(a+3<<2)+40>>2]=e,Se[vi+(a+2<<2)+40>>2]=e;var i=r+1|0;if(32==(0|i))break;var r=i}}function da(r,a,e){var i,v,t,f,_=a>>2,s=r>>2,n=r+8|0;if(0==(7&n|0))var o=0;else var o=7&-n;var o,l=a+8|0;if(0==(7&l|0))var b=0,t=b>>2;else var b=7&-l,t=b>>2;var b,k=a+b|0,u=k,c=o+e|0,v=c>>2,h=r+c|0,d=h,w=k-(r+o)-e|0;Se[(o+4>>2)+s]=3|e;var p=(0|u)==(0|Se[vi+24>>2]);r:do if(p){var E=Se[vi+12>>2]+w|0;Se[vi+12>>2]=E,Se[vi+24>>2]=d;var A=1|E;Se[v+(s+1)]=A}else if((0|u)==(0|Se[vi+20>>2])){var g=Se[vi+8>>2]+w|0;Se[vi+8>>2]=g,Se[vi+20>>2]=d;var y=1|g;Se[v+(s+1)]=y;var m=r+g+c|0;Se[m>>2]=g}else{var S=Me[t+(_+1)];if(1==(3&S|0)){var M=S&-8,C=S>>>3,R=S>>>0<256;a:do if(R){var T=Me[((8|b)>>2)+_],O=Me[t+(_+3)];if((0|T)!=(0|O)){var N=((S>>>2&1073741822)<<2)+vi+40|0,I=(0|T)==(0|N);do{if(!I){if(T>>>0>2]>>>0){f=18;break}f=15;break}f=15}while(0);do if(15==f){if((0|O)!=(0|N)&&O>>>0>2]>>>0)break;Se[T+12>>2]=O,Se[O+8>>2]=T;break a}while(0);throw Ka(),"Reached an unreachable!"}var P=Se[vi>>2]&(1<>2]=P}else{var D=k,L=Me[((24|b)>>2)+_],F=Me[t+(_+3)],X=(0|F)==(0|D);do if(X){var j=16|b,U=j+(a+4)|0,x=Se[U>>2];if(0==(0|x)){var z=a+j|0,V=Se[z>>2];if(0==(0|V)){var B=0,i=B>>2;break}var H=z,K=V}else{var H=U,K=x;f=25}for(;;){var K,H,Y=K+20|0,G=Se[Y>>2];if(0==(0|G)){var W=K+16|0,Z=Me[W>>2];if(0==(0|Z))break;var H=W,K=Z}else var H=Y,K=G}if(H>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[H>>2]=0;var B=K,i=B>>2}else{var Q=Me[((8|b)>>2)+_];if(Q>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[Q+12>>2]=F,Se[F+8>>2]=Q;var B=F,i=B>>2}while(0);var B;if(0==(0|L))break;var q=b+(a+28)|0,$=(Se[q>>2]<<2)+vi+304|0,J=(0|D)==(0|Se[$>>2]);do{if(J){if(Se[$>>2]=B,0!=(0|B))break;var rr=Se[vi+4>>2]&(1<>2]^-1);Se[vi+4>>2]=rr;break a}if(L>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";var ar=L+16|0;if((0|Se[ar>>2])==(0|D)?Se[ar>>2]=B:Se[L+20>>2]=B,0==(0|B))break a}while(0);if(B>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[i+6]=L;var er=16|b,ir=Me[(er>>2)+_];if(0!=(0|ir)){if(ir>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[i+4]=ir,Se[ir+24>>2]=B}var vr=Me[(er+4>>2)+_];if(0==(0|vr))break;if(vr>>>0>2]>>>0)throw Ka(),"Reached an unreachable!";Se[i+5]=vr,Se[vr+24>>2]=B}while(0);var tr=a+(M|b)|0,fr=M+w|0}else var tr=u,fr=w;var fr,tr,_r=tr+4|0,sr=Se[_r>>2]&-2;if(Se[_r>>2]=sr,Se[v+(s+1)]=1|fr,Se[(fr>>2)+s+v]=fr,fr>>>0<256){var nr=fr>>>2&1073741822,or=(nr<<2)+vi+40|0,lr=Me[vi>>2],br=1<<(fr>>>3),kr=0==(lr&br|0);do{if(!kr){var ur=(nr+2<<2)+vi+40|0,cr=Me[ur>>2];if(cr>>>0>=Me[vi+16>>2]>>>0){var hr=cr,dr=ur;break}throw Ka(),"Reached an unreachable!"}Se[vi>>2]=lr|br;var hr=or,dr=(nr+2<<2)+vi+40|0}while(0);var dr,hr;Se[dr>>2]=d,Se[hr+12>>2]=d,Se[v+(s+2)]=hr,Se[v+(s+3)]=or}else{var wr=h,pr=fr>>>8,Er=0==(0|pr);do if(Er)var Ar=0;else{if(fr>>>0>16777215){var Ar=31;break}var gr=(pr+1048320|0)>>>16&8,yr=pr<>>16&4,Sr=yr<>>16&2,Cr=14-(mr|gr|Mr)+(Sr<>>15)|0,Ar=fr>>>((Cr+7|0)>>>0)&1|Cr<<1}while(0);var Ar,Rr=(Ar<<2)+vi+304|0;Se[v+(s+7)]=Ar;var Tr=c+(r+16)|0;Se[v+(s+5)]=0,Se[Tr>>2]=0;var Or=Se[vi+4>>2],Nr=1<>2]=Ir,Se[Rr>>2]=wr,Se[v+(s+6)]=Rr,Se[v+(s+3)]=wr,Se[v+(s+2)]=wr}else{if(31==(0|Ar))var Pr=0;else var Pr=25-(Ar>>>1)|0;for(var Pr,Dr=fr<>2];;){var Lr,Dr;if((Se[Lr+4>>2]&-8|0)==(0|fr)){var Fr=Lr+8|0,Xr=Me[Fr>>2],jr=Me[vi+16>>2],Ur=Lr>>>0>>0;do if(!Ur){if(Xr>>>0>>0)break;Se[Xr+12>>2]=wr,Se[Fr>>2]=wr,Se[v+(s+2)]=Xr,Se[v+(s+3)]=Lr,Se[v+(s+6)]=0;break r}while(0);throw Ka(),"Reached an unreachable!"}var xr=(Dr>>>31<<2)+Lr+16|0,zr=Me[xr>>2];if(0==(0|zr)){if(xr>>>0>=Me[vi+16>>2]>>>0){Se[xr>>2]=wr,Se[v+(s+6)]=Lr,Se[v+(s+3)]=wr,Se[v+(s+2)]=wr;break r}throw Ka(),"Reached an unreachable!"}var Dr=Dr<<1,Lr=zr}}}}while(0);return r+(8|o)|0}function wa(r){return 0|He.__str3342}function pa(r){return 0|He.__str14343}function Ea(r){Se[r>>2]=si+8|0}function Aa(r){0!=(0|r)&&va(r)}function ga(r){ya(r);var a=r;Aa(a)}function ya(r){var a=0|r;Ye(a)}function ma(r){var a=0|r;Ea(a),Se[r>>2]=ni+8|0}function Sa(r){var a=0|r;ya(a);var e=r;Aa(e)}function Ma(r,a){var e,i,v=Me[vi+24>>2],i=v>>2,t=v,f=ua(t),_=Se[f>>2],s=Se[f+4>>2],n=_+s|0,o=_+(s-39)|0;if(0==(7&o|0))var l=0;else var l=7&-o;var l,b=_+(s-47)+l|0,k=b>>>0<(v+16|0)>>>0?t:b,u=k+8|0,e=u>>2,c=u,h=r,d=a-40|0;ca(h,d);var w=k+4|0;Se[w>>2]=27,Se[e]=Se[vi+444>>2],Se[e+1]=Se[vi+448>>2],Se[e+2]=Se[vi+452>>2],Se[e+3]=Se[vi+456>>2],Se[vi+444>>2]=r,Se[vi+448>>2]=a,Se[vi+456>>2]=0,Se[vi+452>>2]=c;var p=k+28|0;Se[p>>2]=7;var E=(k+32|0)>>>0>>0;r:do if(E)for(var A=p;;){var A,g=A+4|0;if(Se[g>>2]=7,(A+8|0)>>>0>=n>>>0)break r;var A=g}while(0);var y=(0|k)==(0|t);r:do if(!y){var m=k-v|0,S=t+m|0,M=m+(t+4)|0,C=Se[M>>2]&-2;Se[M>>2]=C;var R=1|m;Se[i+1]=R;var T=S;if(Se[T>>2]=m,m>>>0<256){var O=m>>>2&1073741822,N=(O<<2)+vi+40|0,I=Me[vi>>2],P=1<<(m>>>3),D=0==(I&P|0);do{if(!D){var L=(O+2<<2)+vi+40|0,F=Me[L>>2];if(F>>>0>=Me[vi+16>>2]>>>0){var X=F,j=L;break}throw Ka(),"Reached an unreachable!"}var U=I|P;Se[vi>>2]=U;var X=N,j=(O+2<<2)+vi+40|0}while(0);var j,X;Se[j>>2]=v,Se[X+12>>2]=v,Se[i+2]=X,Se[i+3]=N}else{var x=v,z=m>>>8,V=0==(0|z);do if(V)var B=0;else{if(m>>>0>16777215){var B=31;break}var H=(z+1048320|0)>>>16&8,K=z<>>16&4,G=K<>>16&2,Z=14-(Y|H|W)+(G<>>15)|0,B=m>>>((Z+7|0)>>>0)&1|Z<<1}while(0);var B,Q=(B<<2)+vi+304|0;Se[i+7]=B,Se[i+5]=0,Se[i+4]=0;var q=Se[vi+4>>2],$=1<>2]=J,Se[Q>>2]=x,Se[i+6]=Q,Se[i+3]=v,Se[i+2]=v}else{if(31==(0|B))var rr=0;else var rr=25-(B>>>1)|0;for(var rr,ar=m<>2];;){var er,ar;if((Se[er+4>>2]&-8|0)==(0|m)){var ir=er+8|0,vr=Me[ir>>2],tr=Me[vi+16>>2],fr=er>>>0>>0;do if(!fr){if(vr>>>0>>0)break;Se[vr+12>>2]=x,Se[ir>>2]=x,Se[i+2]=vr,Se[i+3]=er,Se[i+6]=0;break r}while(0);throw Ka(),"Reached an unreachable!"}var _r=(ar>>>31<<2)+er+16|0,sr=Me[_r>>2];if(0==(0|sr)){if(_r>>>0>=Me[vi+16>>2]>>>0){Se[_r>>2]=x,Se[i+6]=er,Se[i+3]=v,Se[i+2]=v;break r}throw Ka(),"Reached an unreachable!"}var ar=ar<<1,er=sr}}}}while(0)}function Ca(r){return d(r)}function Ra(r,a){var e=0;do Ae[r+e]=Ae[a+e],e++;while(0!=Ae[a+e-1]);return r}function Ta(){var r=Ta;return r.LLVM_SAVEDSTACKS||(r.LLVM_SAVEDSTACKS=[]),r.LLVM_SAVEDSTACKS.push(le.stackSave()),r.LLVM_SAVEDSTACKS.length-1}function Oa(r){var a=Ta,e=a.LLVM_SAVEDSTACKS[r];a.LLVM_SAVEDSTACKS.splice(r,1),le.stackRestore(e)}function Na(r,a,e){for(var i=0;it?1:-1;i++}return 0}function Ia(r,a){var e=Ca(r),i=0;do Ae[r+e+i]=Ae[a+i],i++;while(0!=Ae[a+i-1]);return r}function Pa(r,a,e,i){if(e>=20&&a%2==r%2)if(a%4==r%4){for(var v=a+e;a%4;)Ae[r++]=Ae[a++];for(var t=a>>2,f=r>>2,_=v>>2;t<_;)Se[f++]=Se[t++];for(a=t<<2,r=f<<2;a>1,n=r>>1,o=v>>1;st?1:-1}return 0}function Fa(r,a,e,i){if(e>=20){for(var v=r+e;r%4;)Ae[r++]=a;a<0&&(a+=256);for(var t=r>>2,f=v>>2,_=a|a<<8|a<<16|a<<24;t>2],xe[1]=Se[a+_+4>>2],e=ze[0]):"i64"==r?e=[Se[a+_>>2],Se[a+_+4>>2]]:(r="i32",e=Se[a+_>>2]),_+=le.getNativeFieldSize(r),e}for(var i,v,t,f=r,_=0,s=[];;){var n=f;if(i=Ae[f],0===i)break;if(v=Ae[f+1],i=="%".charCodeAt(0)){var o=!1,l=!1,b=!1,k=!1;r:for(;;){switch(v){case"+".charCodeAt(0):o=!0;break;case"-".charCodeAt(0):l=!0;break;case"#".charCodeAt(0):b=!0;break;case"0".charCodeAt(0):if(k)break r;k=!0;break;default:break r}f++,v=Ae[f+1]}var u=0;if(v=="*".charCodeAt(0))u=e("i32"),f++,v=Ae[f+1];else for(;v>="0".charCodeAt(0)&&v<="9".charCodeAt(0);)u=10*u+(v-"0".charCodeAt(0)),f++,v=Ae[f+1];var c=!1;if(v==".".charCodeAt(0)){var h=0;if(c=!0,f++,v=Ae[f+1],v=="*".charCodeAt(0))h=e("i32"),f++;else for(;;){var d=Ae[f+1];if(d<"0".charCodeAt(0)||d>"9".charCodeAt(0))break;h=10*h+(d-"0".charCodeAt(0)),f++}v=Ae[f+1]}else var h=6;var E;switch(String.fromCharCode(v)){case"h":var A=Ae[f+2];A=="h".charCodeAt(0)?(f++,E=1):E=2;break;case"l":var A=Ae[f+2];A=="l".charCodeAt(0)?(f++,E=8):E=4;break;case"L":case"q":case"j":E=8;break;case"z":case"t":case"I":E=4;break;default:E=null}if(E&&f++,v=Ae[f+1],["d","i","u","o","x","X","p"].indexOf(String.fromCharCode(v))!=-1){var m=v=="d".charCodeAt(0)||v=="i".charCodeAt(0);E=E||4;var t=e("i"+8*E);if(8==E&&(t=le.makeBigInt(t[0],t[1],v=="u".charCodeAt(0))),E<=4){var S=Math.pow(256,E)-1;t=(m?y:g)(t&S,8*E)}var M,C=Math.abs(t),R="";if(v=="d".charCodeAt(0)||v=="i".charCodeAt(0))M=y(t,8*E,1).toString(10);else if(v=="u".charCodeAt(0))M=g(t,8*E,1).toString(10),t=Math.abs(t);else if(v=="o".charCodeAt(0))M=(b?"0":"")+C.toString(8);else if(v=="x".charCodeAt(0)||v=="X".charCodeAt(0)){if(R=b?"0x":"",t<0){t=-t,M=(C-1).toString(16);for(var T=[],O=0;OP&&P>=-4?(v=(v=="g".charCodeAt(0)?"f":"F").charCodeAt(0),h-=P+1):(v=(v=="g".charCodeAt(0)?"e":"E").charCodeAt(0),h--),I=Math.min(h,20)}v=="e".charCodeAt(0)||v=="E".charCodeAt(0)?(M=t.toExponential(I),/[eE][-+]\\d$/.test(M)&&(M=M.slice(0,-1)+"0"+M.slice(-1))):v!="f".charCodeAt(0)&&v!="F".charCodeAt(0)||(M=t.toFixed(I));var D=M.split("e");if(N&&!b)for(;D[0].length>1&&D[0].indexOf(".")!=-1&&("0"==D[0].slice(-1)||"."==D[0].slice(-1));)D[0]=D[0].slice(0,-1);else for(b&&M.indexOf(".")==-1&&(D[0]+=".");h>I++;)D[0]+="0";M=D[0]+(D.length>1?"e"+D[1]:""),v=="E".charCodeAt(0)&&(M=M.toUpperCase()),o&&t>=0&&(M="+"+M)}else M=(t<0?"-":"")+"inf",k=!1;for(;M.lengthh&&(L=L.slice(0,h))):L=p("(null)",!0),!l)for(;L.length0;)s.push(" ".charCodeAt(0));l||s.push(e("i8"))}else if(v=="n".charCodeAt(0)){var X=e("i32*");Se[X>>2]=s.length}else if(v=="%".charCodeAt(0))s.push(i);else for(var O=n;O="0".charCodeAt(0)&&r<="9".charCodeAt(0)}function Ha(r){for(var a;(a=Ae[r])&&Va(a);)r++;if(!a||!Ba(a))return 0;for(var e=r;(a=Ae[e])&&Ba(a);)e++;return Math.floor(Number(s(r).substr(0,e-r)))}function Ka(r){throw ke=!0,"ABORT: "+r+", at "+(new Error).stack}function Ya(r){return Ya.ret||(Ya.ret=_([0],"i32",we)),Se[Ya.ret>>2]=r,r}function Ga(r,a,e,i){var v=$e.streams[r];if(!v||v.object.isDevice)return Ya(Ge.EBADF),-1;if(v.isWrite){if(v.object.isFolder)return Ya(Ge.EISDIR),-1;if(e<0||i<0)return Ya(Ge.EINVAL),-1;for(var t=v.object.contents;t.length>2]=a),a}function Ja(){return Ya.ret}function re(r){var a=re;a.called||(Ie=o(Ie),a.called=!0);var e=Ie;return 0!=r&&le.staticAlloc(r),e}function ae(){return Se[ae.buf>>2]}function ee(r){r=r||Module.arguments,k();var a=null;return Module._main&&(a=Module.callMain(r),Module.noExitRuntime||u()),a}var ie=[],ve=false,te="object"==typeof window,fe="function"==typeof importScripts,_e=!te&&!ve&&!fe;if(ve){print=function(r){process.stdout.write(r+"\\n")},printErr=function(r){process.stderr.write(r+"\\n")};var se=require("fs");read=function(r){var a=se.readFileSync(r).toString();return a||"/"==r[0]||(r=__dirname.split("/").slice(0,-1).join("/")+"/src/"+r,a=se.readFileSync(r).toString()),a},load=function(a){r(read(a))},ie=process.argv.slice(2)}else if(_e)this.read||(this.read=function(r){snarf(r)}),"undefined"!=typeof scriptArgs?ie=scriptArgs:"undefined"!=typeof arguments&&(ie=arguments);else if(te)this.print=printErr=function(r){console.log(r)},this.read=function(r){var a=new XMLHttpRequest;return a.open("GET",r,!1),a.send(null),a.responseText},this.arguments&&(ie=arguments);else{if(!fe)throw"Unknown runtime environment. Where are we?";this.load=importScripts}"undefined"==typeof load&&"undefined"!=typeof read&&(this.load=function(a){r(read(a))}),"undefined"==typeof printErr&&(this.printErr=function(){}),"undefined"==typeof print&&(this.print=printErr);try{this.Module=Module}catch(r){this.Module=Module={}}Module.arguments||(Module.arguments=ie),Module.print&&(print=Module.print);var ne,oe,le={stackSave:function(){return Oe},stackRestore:function(r){Oe=r},forceAlign:function(r,a){if(a=a||4,1==a)return r;if(isNumber(r)&&isNumber(a))return Math.ceil(r/a)*a;if(isNumber(a)&&isPowerOfTwo(a)){var e=log2(a);return"(((("+r+")+"+(a-1)+")>>"+e+")<<"+e+")"}return"Math.ceil(("+r+")/"+a+")*"+a},isNumberType:function(r){return r in le.INT_TYPES||r in le.FLOAT_TYPES},isPointerType:function(r){return"*"==r[r.length-1]},isStructType:function(r){return!isPointerType(r)&&(!!/^\\[\\d+\\ x\\ (.*)\\]/.test(r)||(!!/?/.test(r)||"%"==r[0]))},INT_TYPES:{i1:0,i8:0,i16:0,i32:0,i64:0},FLOAT_TYPES:{float:0,double:0},bitshift64:function(r,e,i,v){var t=Math.pow(2,v)-1;if(v<32)switch(i){case"shl":return[r<>>32-v];case"ashr":return[(r>>>v|(e&t)<<32-v)>>0>>>0,e>>v>>>0];case"lshr":return[(r>>>v|(e&t)<<32-v)>>>0,e>>>v]}else if(32==v)switch(i){case"shl":return[0,r];case"ashr":return[e,(0|e)<0?t:0];case"lshr":return[e,0]}else switch(i){case"shl":return[0,r<>v-32>>>0,(0|e)<0?t:0];case"lshr":return[e>>>v-32,0]}a("unknown bitshift64 op: "+[value,i,v])},or64:function(r,a){var e=0|r|(0|a),i=4294967296*(Math.round(r/4294967296)|Math.round(a/4294967296));return e+i},and64:function(r,a){var e=(0|r)&(0|a),i=4294967296*(Math.round(r/4294967296)&Math.round(a/4294967296));return e+i},xor64:function(r,a){var e=(0|r)^(0|a),i=4294967296*(Math.round(r/4294967296)^Math.round(a/4294967296));return e+i},getNativeTypeSize:function(r,a){if(1==le.QUANTUM_SIZE)return 1;var i={"%i1":1,"%i8":1,"%i16":2,"%i32":4,"%i64":8,"%float":4,"%double":8}["%"+r];if(!i)if("*"==r[r.length-1])i=le.QUANTUM_SIZE;else if("i"==r[0]){var v=parseInt(r.substr(1));e(v%8==0),i=v/8}return i},getNativeFieldSize:function(r){return Math.max(le.getNativeTypeSize(r),le.QUANTUM_SIZE)},dedup:function(r,a){var e={};return a?r.filter(function(r){return!e[r[a]]&&(e[r[a]]=!0,!0)}):r.filter(function(r){return!e[r]&&(e[r]=!0,!0)})},set:function(){for(var r="object"==typeof arguments[0]?arguments[0]:arguments,a={},e=0;e=0&&a.push(f-e),e=f,f}),r.flatSize=le.alignMemory(r.flatSize,r.alignSize),0==a.length?r.flatFactor=r.flatSize:1==le.dedup(a).length&&(r.flatFactor=a[0]),r.needsFlattening=1!=r.flatFactor,r.flatIndexes},generateStructInfo:function(r,a,i){var v,t;if(a){if(i=i||0,v=("undefined"==typeof Types?le.typeInfo:Types.types)[a],!v)return null;e(v.fields.length===r.length,"Number of named fields must match the type for "+a),t=v.flatIndexes}else{var v={fields:r.map(function(r){return r[0]})};t=le.calculateStructAlignment(v)}var f={__size__:v.flatSize};return a?r.forEach(function(r,a){if("string"==typeof r)f[r]=t[a]+i;else{var e;for(var _ in r)e=_;f[e]=le.generateStructInfo(r[e],v.fields[a],t[a])}}):r.forEach(function(r,a){f[r[1]]=t[a]}),f},stackAlloc:function(r){var a=Oe;return Oe+=r,Oe=Oe+3>>2<<2,a},staticAlloc:function(r){var a=Ie;return Ie+=r,Ie=Ie+3>>2<<2,Ie>=Le&&l(),a},alignMemory:function(r,a){var e=r=Math.ceil(r/(a?a:4))*(a?a:4);return e},makeBigInt:function(r,a,e){var i=e?(r>>>0)+4294967296*(a>>>0):(r>>>0)+4294967296*(0|a);return i},QUANTUM_SIZE:4,__dummy__:0},be={MAX_ALLOWED:0,corrections:0,sigs:{},note:function(r,e,i){e||(this.corrections++,this.corrections>=this.MAX_ALLOWED&&a("\\n\\nToo many corrections!"))},print:function(){}},ke=!1,ue=0,ce=this;Module.ccall=i,Module.setValue=t,Module.getValue=f;var he=0,de=1,we=2;Module.ALLOC_NORMAL=he,Module.ALLOC_STACK=de,Module.ALLOC_STATIC=we,Module.allocate=_,Module.Pointer_stringify=s,Module.Array_stringify=n;var pe,Ee,Ae,ge,ye,me,Se,Me,Ce,Re,Te,Oe,Ne,Ie,Pe=4096,De=Module.TOTAL_STACK||5242880,Le=Module.TOTAL_MEMORY||10485760;Module.FAST_MEMORY||2097152;e(!!(Int32Array&&Float64Array&&new Int32Array(1).subarray&&new Int32Array(1).set),"Cannot fallback to non-typed array case: Code is too specialized");var Fe=new ArrayBuffer(Le);Ae=new Int8Array(Fe),ye=new Int16Array(Fe),Se=new Int32Array(Fe),ge=new Uint8Array(Fe),me=new Uint16Array(Fe),Me=new Uint32Array(Fe),Ce=new Float32Array(Fe),Re=new Float64Array(Fe),Se[0]=255,e(255===ge[0]&&0===ge[3],"Typed arrays 2 must be run on a little-endian system");var Xe=p("(null)");Ie=Xe.length;for(var je=0;je>2)),ze=(Ce.subarray(Ue>>2),Re.subarray(Ue>>3));Ne=Ue+8,Ie=o(Ne);var Ve=[],Be=[];Module.Array_copy=c,Module.TypedArray_copy=h,Module.String_len=d,Module.String_copy=w,Module.intArrayFromString=p,Module.intArrayToString=E,Module.writeStringToMemory=A;var He=[],Ke=0;O.X=1,N.X=1,V.X=1,H.X=1,G.X=1,W.X=1,q.X=1,$.X=1,rr.X=1,ar.X=1,er.X=1,vr.X=1,nr.X=1,or.X=1,kr.X=1,hr.X=1,Ar.X=1,Sr.X=1,Tr.X=1,Ir.X=1,Pr.X=1,Dr.X=1,Lr.X=1,Fr.X=1,Xr.X=1,zr.X=1,Vr.X=1,Br.X=1,Gr.X=1,$r.X=1,Module._malloc=Jr,Jr.X=1,ra.X=1,aa.X=1,ea.X=1,ia.X=1,Module._free=va,va.X=1,_a.X=1,sa.X=1,na.X=1,oa.X=1,la.X=1,da.X=1,Ma.X=1;var Ye,Ge={E2BIG:7,EACCES:13,EADDRINUSE:98,EADDRNOTAVAIL:99,EAFNOSUPPORT:97,EAGAIN:11,EALREADY:114,EBADF:9,EBADMSG:74,EBUSY:16,ECANCELED:125,ECHILD:10,ECONNABORTED:103,ECONNREFUSED:111,ECONNRESET:104,EDEADLK:35,EDESTADDRREQ:89,EDOM:33,EDQUOT:122,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:113,EIDRM:43,EILSEQ:84,EINPROGRESS:115,EINTR:4,EINVAL:22,EIO:5,EISCONN:106,EISDIR:21,ELOOP:40,EMFILE:24,EMLINK:31,EMSGSIZE:90,EMULTIHOP:72,ENAMETOOLONG:36,ENETDOWN:100,ENETRESET:102,ENETUNREACH:101,ENFILE:23,ENOBUFS:105,ENODATA:61,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:37,ENOLINK:67,ENOMEM:12,ENOMSG:42,ENOPROTOOPT:92,ENOSPC:28,ENOSR:63,ENOSTR:60,ENOSYS:38,ENOTCONN:107,ENOTDIR:20,ENOTEMPTY:39,ENOTRECOVERABLE:131,ENOTSOCK:88,ENOTSUP:95,ENOTTY:25,ENXIO:6,EOVERFLOW:75,EOWNERDEAD:130,EPERM:1,EPIPE:32,EPROTO:71,EPROTONOSUPPORT:93,EPROTOTYPE:91,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:116,ETIME:62,ETIMEDOUT:110,ETXTBSY:26,EWOULDBLOCK:11,EXDEV:18},We=0,Ze=0,Qe=0,qe=0,$e={currentPath:"/",nextInode:2,streams:[null],ignorePermissions:!0,absolutePath:function(r,a){if("string"!=typeof r)return null;void 0===a&&(a=$e.currentPath),r&&"/"==r[0]&&(a="");for(var e=a+"/"+r,i=e.split("/").reverse(),v=[""];i.length;){var t=i.pop();""==t||"."==t||(".."==t?v.length>1&&v.pop():v.push(t))}return 1==v.length?"/":v.join("/")},analyzePath:function(r,a,e){var i={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};if(r=$e.absolutePath(r),"/"==r)i.isRoot=!0,i.exists=i.parentExists=!0,i.name="/",i.path=i.parentPath="/",i.object=i.parentObject=$e.root;else if(null!==r){e=e||0,r=r.slice(1).split("/");for(var v=$e.root,t=[""];r.length;){1==r.length&&v.isFolder&&(i.parentExists=!0,i.parentPath=1==t.length?"/":t.join("/"),i.parentObject=v,i.name=r[0]);var f=r.shift();if(!v.isFolder){i.error=Ge.ENOTDIR;break}if(!v.read){i.error=Ge.EACCES;break}if(!v.contents.hasOwnProperty(f)){i.error=Ge.ENOENT;break}if(v=v.contents[f],v.link&&(!a||0!=r.length)){if(e>40){i.error=Ge.ELOOP;break}var _=$e.absolutePath(v.link,t.join("/"));return $e.analyzePath([_].concat(r).join("/"),a,e+1)}t.push(f),0==r.length&&(i.exists=!0,i.path=t.join("/"),i.object=v)}return i}return i},findObject:function(r,a){$e.ensureRoot();var e=$e.analyzePath(r,a);return e.exists?e.object:(Ya(e.error),null)},createObject:function(r,a,e,i,v){if(r||(r="/"),"string"==typeof r&&(r=$e.findObject(r)),!r)throw Ya(Ge.EACCES),new Error("Parent path must exist.");if(!r.isFolder)throw Ya(Ge.ENOTDIR), -new Error("Parent must be a folder.");if(!r.write&&!$e.ignorePermissions)throw Ya(Ge.EACCES),new Error("Parent folder must be writeable.");if(!a||"."==a||".."==a)throw Ya(Ge.ENOENT),new Error("Name must not be empty.");if(r.contents.hasOwnProperty(a))throw Ya(Ge.EEXIST),new Error("Can't overwrite object.");r.contents[a]={read:void 0===i||i,write:void 0!==v&&v,timestamp:Date.now(),inodeNumber:$e.nextInode++};for(var t in e)e.hasOwnProperty(t)&&(r.contents[a][t]=e[t]);return r.contents[a]},createFolder:function(r,a,e,i){var v={isFolder:!0,isDevice:!1,contents:{}};return $e.createObject(r,a,v,e,i)},createPath:function(r,a,e,i){var v=$e.findObject(r);if(null===v)throw new Error("Invalid parent.");for(a=a.split("/").reverse();a.length;){var t=a.pop();t&&(v.contents.hasOwnProperty(t)||$e.createFolder(v,t,e,i),v=v.contents[t])}return v},createFile:function(r,a,e,i,v){return e.isFolder=!1,$e.createObject(r,a,e,i,v)},createDataFile:function(r,a,e,i,v){if("string"==typeof e){for(var t=new Array(e.length),f=0,_=e.length;f<_;++f)t[f]=e.charCodeAt(f);e=t}var s={isDevice:!1,contents:e};return $e.createFile(r,a,s,i,v)},createLazyFile:function(r,a,e,i,v){var t={isDevice:!1,url:e};return $e.createFile(r,a,t,i,v)},createLink:function(r,a,e,i,v){var t={isDevice:!1,link:e};return $e.createFile(r,a,t,i,v)},createDevice:function(r,a,e,i){if(!e&&!i)throw new Error("A device must have at least one callback defined.");var v={isDevice:!0,input:e,output:i};return $e.createFile(r,a,v,Boolean(e),Boolean(i))},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;var a=!0;if("undefined"!=typeof XMLHttpRequest)e("Cannot do synchronous binary XHRs in modern browsers. Use --embed-file or --preload-file in emcc");else{if("undefined"==typeof read)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=p(read(r.url),!0)}catch(r){a=!1}}return a||Ya(Ge.EIO),a},ensureRoot:function(){$e.root||($e.root={read:!0,write:!0,isFolder:!0,isDevice:!1,timestamp:Date.now(),inodeNumber:1,contents:{}})},init:function(r,a,i){function v(r){null===r||r==="\\n".charCodeAt(0)?(a.printer(a.buffer.join("")),a.buffer=[]):a.buffer.push(String.fromCharCode(r))}e(!$e.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),$e.init.initialized=!0,$e.ensureRoot(),r=r||Module.stdin,a=a||Module.stdout,i=i||Module.stderr;var t=!0,f=!0,s=!0;r||(t=!1,r=function(){if(!r.cache||!r.cache.length){var a;"undefined"!=typeof window&&"function"==typeof window.prompt?a=window.prompt("Input: "):"function"==typeof readline&&(a=readline()),a||(a=""),r.cache=p(a+"\\n",!0)}return r.cache.shift()}),a||(f=!1,a=v),a.printer||(a.printer=print),a.buffer||(a.buffer=[]),i||(s=!1,i=v),i.printer||(i.printer=print),i.buffer||(i.buffer=[]),$e.createFolder("/","tmp",!0,!0);var n=$e.createFolder("/","dev",!0,!0),o=$e.createDevice(n,"stdin",r),l=$e.createDevice(n,"stdout",null,a),b=$e.createDevice(n,"stderr",null,i);$e.createDevice(n,"tty",r,a),$e.streams[1]={path:"/dev/stdin",object:o,position:0,isRead:!0,isWrite:!1,isAppend:!1,isTerminal:!t,error:!1,eof:!1,ungotten:[]},$e.streams[2]={path:"/dev/stdout",object:l,position:0,isRead:!1,isWrite:!0,isAppend:!1,isTerminal:!f,error:!1,eof:!1,ungotten:[]},$e.streams[3]={path:"/dev/stderr",object:b,position:0,isRead:!1,isWrite:!0,isAppend:!1,isTerminal:!s,error:!1,eof:!1,ungotten:[]},We=_([1],"void*",we),Ze=_([2],"void*",we),Qe=_([3],"void*",we),$e.createPath("/","dev/shm/tmp",!0,!0),$e.streams[We]=$e.streams[1],$e.streams[Ze]=$e.streams[2],$e.streams[Qe]=$e.streams[3],qe=_([_([0,0,0,0,We,0,0,0,Ze,0,0,0,Qe,0,0,0],"void*",we)],"void*",we)},quit:function(){$e.init.initialized&&($e.streams[2]&&$e.streams[2].object.output.buffer.length>0&&$e.streams[2].object.output("\\n".charCodeAt(0)),$e.streams[3]&&$e.streams[3].object.output.buffer.length>0&&$e.streams[3].object.output("\\n".charCodeAt(0)))}},Je=Ja;Ve.unshift({func:function(){$e.ignorePermissions=!1,$e.init.initialized||$e.init()}}),Be.push({func:function(){$e.quit()}}),Ya(0),ae.buf=_(12,"void*",we),Module.callMain=function(r){function a(){for(var r=0;r<3;r++)i.push(0)}var e=r.length+1,i=[_(p("/bin/this.program"),"i8",we)];a();for(var v=0;v>2]=0|He.__str,Se[ri+4>>2]=0|He.__str1,Se[ri+16>>2]=0|He.__str2,Se[ri+20>>2]=0|He.__str3,Se[ri+32>>2]=0|He.__str4,Se[ri+36>>2]=0|He.__str5,Se[ri+48>>2]=0|He.__str6,Se[ri+52>>2]=0|He.__str7,Se[ri+64>>2]=0|He.__str8,Se[ri+68>>2]=0|He.__str7,Se[ri+80>>2]=0|He.__str9,Se[ri+84>>2]=0|He.__str10,Se[ri+96>>2]=0|He.__str11,Se[ri+100>>2]=0|He.__str12,Se[ri+112>>2]=0|He.__str13,Se[ri+116>>2]=0|He.__str14,Se[ri+128>>2]=0|He.__str15,Se[ri+132>>2]=0|He.__str16,Se[ri+144>>2]=0|He.__str17,Se[ri+148>>2]=0|He.__str18,Se[ri+160>>2]=0|He.__str19,Se[ri+164>>2]=0|He.__str20,Se[ri+176>>2]=0|He.__str21,Se[ri+180>>2]=0|He.__str22,Se[ri+192>>2]=0|He.__str23,Se[ri+196>>2]=0|He.__str24,Se[ri+208>>2]=0|He.__str25,Se[ri+212>>2]=0|He.__str26,Se[ri+224>>2]=0|He.__str27,Se[ri+228>>2]=0|He.__str28,Se[ri+240>>2]=0|He.__str29,Se[ri+244>>2]=0|He.__str30,Se[ri+256>>2]=0|He.__str31,Se[ri+260>>2]=0|He.__str32,Se[ri+272>>2]=0|He.__str33,Se[ri+276>>2]=0|He.__str34,Se[ri+288>>2]=0|He.__str35,Se[ri+292>>2]=0|He.__str36,Se[ri+304>>2]=0|He.__str37,Se[ri+308>>2]=0|He.__str38,Se[ri+320>>2]=0|He.__str39,Se[ri+324>>2]=0|He.__str40,Se[ri+336>>2]=0|He.__str41,Se[ri+340>>2]=0|He.__str42,Se[ri+352>>2]=0|He.__str43,Se[ri+356>>2]=0|He.__str44,Se[ri+368>>2]=0|He.__str45,Se[ri+372>>2]=0|He.__str46,Se[ri+384>>2]=0|He.__str47,Se[ri+388>>2]=0|He.__str48,Se[ri+400>>2]=0|He.__str49,Se[ri+404>>2]=0|He.__str119289,Se[ri+416>>2]=0|He.__str51,Se[ri+420>>2]=0|He.__str20,Se[ri+432>>2]=0|He.__str52,Se[ri+436>>2]=0|He.__str53,Se[ri+448>>2]=0|He.__str54,Se[ri+452>>2]=0|He.__str55,Se[ri+464>>2]=0|He.__str56,Se[ri+468>>2]=0|He.__str57,Se[ri+480>>2]=0|He.__str58,Se[ri+484>>2]=0|He.__str119289,Se[ri+496>>2]=0|He.__str59,Se[ri+500>>2]=0|He.__str60,Se[ri+512>>2]=0|He.__str61,Se[ri+516>>2]=0|He.__str62,Se[ri+528>>2]=0|He.__str63,Se[ri+532>>2]=0|He.__str64,Se[ri+544>>2]=0|He.__str65,Se[ri+548>>2]=0|He.__str66,Se[ri+560>>2]=0|He.__str67,Se[ri+564>>2]=0|He.__str68,Se[ri+576>>2]=0|He.__str69,Se[ri+580>>2]=0|He.__str70,Se[ri+592>>2]=0|He.__str71,Se[ri+596>>2]=0|He.__str72,Se[ri+608>>2]=0|He.__str73,Se[ri+612>>2]=0|He.__str74,Se[ri+624>>2]=0|He.__str75,Se[ri+628>>2]=0|He.__str76,Se[ri+640>>2]=0|He.__str77,Se[ri+644>>2]=0|He.__str72,Se[ri+656>>2]=0|He.__str78,Se[ri+660>>2]=0|He.__str79,Se[ri+672>>2]=0|He.__str80,Se[ri+676>>2]=0|He.__str81,Se[ri+688>>2]=0|He.__str82,Se[ri+692>>2]=0|He.__str83,Se[ri+704>>2]=0|He.__str84,Se[ri+708>>2]=0|He.__str85,Se[ri+720>>2]=0|He.__str86,Se[ri+724>>2]=0|He.__str87,Se[ri+736>>2]=0|He.__str88,Se[ri+740>>2]=0|He.__str89,Se[ri+752>>2]=0|He.__str90,Se[ri+756>>2]=0|He.__str91,Se[ri+768>>2]=0|He.__str92,Se[ri+772>>2]=0|He.__str91,Se[ai>>2]=0|He.__str145315,Se[ai+8>>2]=0|He.__str145315,Se[ai+20>>2]=0|He.__str167337,Se[ai+28>>2]=0|He.__str95,Se[ai+40>>2]=0|He.__str146316,Se[ai+48>>2]=0|He.__str97,Se[ai+60>>2]=0|He.__str155325,Se[ai+68>>2]=0|He.__str155325,Se[ai+80>>2]=0|He.__str156326,Se[ai+88>>2]=0|He.__str156326,Se[ai+100>>2]=0|He.__str154324,Se[ai+108>>2]=0|He.__str154324,Se[ai+120>>2]=0|He.__str101,Se[ai+128>>2]=0|He.__str101,Se[ai+140>>2]=0|He.__str147317,Se[ai+148>>2]=0|He.__str147317,Se[ai+160>>2]=0|He.__str150320,Se[ai+168>>2]=0|He.__str150320,Se[ai+180>>2]=0|He.__str151321,Se[ai+188>>2]=0|He.__str105,Se[ai+220>>2]=0|He.__str152322,Se[ai+228>>2]=0|He.__str152322,Se[ai+240>>2]=0|He.__str153323,Se[ai+248>>2]=0|He.__str153323,Se[ai+260>>2]=0|He.__str165335,Se[ai+268>>2]=0|He.__str165335,Se[ai+280>>2]=0|He.__str166336,Se[ai+288>>2]=0|He.__str166336,Se[ai+360>>2]=0|He.__str148318,Se[ai+368>>2]=0|He.__str148318,Se[ai+380>>2]=0|He.__str149319,Se[ai+388>>2]=0|He.__str149319,Se[ai+420>>2]=0|He.__str84254,Se[ai+428>>2]=0|He.__str84254,Se[ai+440>>2]=0|He.__str168338,Se[ai+448>>2]=0|He.__str146316,Se[ai+460>>2]=0|He.__str114,Se[ai+468>>2]=0|He.__str152322,Se[ai+480>>2]=0|He.__str115,Se[ai+488>>2]=0|He.__str115,Se[ai+500>>2]=0|He.__str110280,Se[ai+508>>2]=0|He.__str110280,Se[ei+4>>2]=0|He.__str152,Se[ei+12>>2]=0|He.__str152,Se[ei+32>>2]=0|He.__str153,Se[ei+40>>2]=0|He.__str153,Se[ei+48>>2]=0|He.__str154,Se[ei+60>>2]=0|He.__str155,Se[ei+68>>2]=0|He.__str155,Se[ei+76>>2]=0|He.__str156,Se[ei+88>>2]=0|He.__str157,Se[ei+96>>2]=0|He.__str158,Se[ei+104>>2]=0|He.__str156,Se[ei+116>>2]=0|He.__str159,Se[ei+124>>2]=0|He.__str160,Se[ei+132>>2]=0|He.__str161,Se[ei+144>>2]=0|He.__str162,Se[ei+152>>2]=0|He.__str163,Se[ei+160>>2]=0|He.__str164,Se[ei+172>>2]=0|He.__str165,Se[ei+180>>2]=0|He.__str166,Se[ei+188>>2]=0|He.__str167,Se[si+4>>2]=bi,Se[ni+4>>2]=ki,oi=_([2,0,0,0,0],["i8*",0,0,0,0],we),Se[bi>>2]=oi+8|0,Se[bi+4>>2]=0|He.__ZTSSt9bad_alloc,Se[bi+8>>2]=li,Se[ki>>2]=oi+8|0,Se[ki+4>>2]=0|He.__ZTSSt20bad_array_new_length,Se[ki+8>>2]=bi,ui=16,ci=6,hi=18,di=6,wi=6,pe=[0,0,Jr,0,va,0,ya,0,ga,0,wa,0,Sa,0,pa,0,Ea,0,ma,0],Module.FUNCTION_TABLE=pe,Module.run=ee,Module.preRun&&Module.preRun(),0==Ke){ee()}Module.postRun&&Module.postRun(),Module.___cxa_demangle=G;var pi=v("__cxa_demangle","string",["string","string","number","number"]);return function(r){return pi(r,"",1,0)}}(); -`; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.chromeTreeToNodes = void 0; - -function treeToArray(root) { - const nodes = []; - - function visit(node) { - nodes.push({ - id: node.id, - callFrame: { - columnNumber: 0, - functionName: node.functionName, - lineNumber: node.lineNumber, - scriptId: node.scriptId, - url: node.url - }, - hitCount: node.hitCount, - children: node.children.map(child => child.id) - }); - node.children.forEach(visit); - } - - visit(root); - return nodes; -} - -function timestampsToDeltas(timestamps, startTime) { - return timestamps.map((timestamp, index) => { - const lastTimestamp = index === 0 ? startTime * 1000000 : timestamps[index - 1]; - return timestamp - lastTimestamp; - }); -} -/** - * Convert the old tree-based format to the new flat-array based format - */ - - -function chromeTreeToNodes(content) { - // Note that both startTime and endTime are now in microseconds - return { - samples: content.samples, - startTime: content.startTime * 1000000, - endTime: content.endTime * 1000000, - nodes: treeToArray(content.head), - timeDeltas: timestampsToDeltas(content.timestamps, content.startTime) - }; -} - -exports.chromeTreeToNodes = chromeTreeToNodes; - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Flamechart = void 0; - -const utils_1 = __webpack_require__(0); - -const math_1 = __webpack_require__(11); - -class Flamechart { - constructor(source) { - this.source = source; // Bottom to top - - this.layers = []; - this.totalWeight = 0; - this.minFrameWidth = 1; - const stack = []; - - const openFrame = (node, value) => { - const parent = utils_1.lastOf(stack); - const frame = { - node, - parent, - children: [], - start: value, - end: value - }; - - if (parent) { - parent.children.push(frame); - } - - stack.push(frame); - }; - - this.minFrameWidth = Infinity; - - const closeFrame = (node, value) => { - console.assert(stack.length > 0); - const stackTop = stack.pop(); - stackTop.end = value; - if (stackTop.end - stackTop.start === 0) return; - const layerIndex = stack.length; - - while (this.layers.length <= layerIndex) this.layers.push([]); - - this.layers[layerIndex].push(stackTop); - this.minFrameWidth = Math.min(this.minFrameWidth, stackTop.end - stackTop.start); - }; - - this.totalWeight = source.getTotalWeight(); - source.forEachCall(openFrame, closeFrame); - if (!isFinite(this.minFrameWidth)) this.minFrameWidth = 1; - } - - getTotalWeight() { - return this.totalWeight; - } - - getLayers() { - return this.layers; - } - - getColorBucketForFrame(frame) { - return this.source.getColorBucketForFrame(frame); - } - - getMinFrameWidth() { - return this.minFrameWidth; - } - - formatValue(v) { - return this.source.formatValue(v); - } - - getClampedViewportWidth(viewportWidth) { - const maxWidth = this.getTotalWeight(); // In order to avoid floating point error, we cap the maximum zoom. In - // particular, it's important that at the maximum zoom level, the total - // trace size + a viewport width is not equal to the trace size due to - // floating point rounding. - // - // For instance, if the profile's total weight is 2^60, and the viewport - // size is 1, trying to move one viewport width right will result in no - // change because 2^60 + 1 = 2^60 in floating point arithmetic. JavaScript - // numbers are 64 bit floats, and therefore have 53 mantissa bits. You can - // see this for yourself in the console. Try: - // - // > Math.pow(2, 60) + 1 === Math.pow(2, 60) - // true - // > Math.pow(2, 53) + 1 === Math.pow(2, 53) - // true - // > Math.pow(2, 52) + 1 === Math.pow(2, 52) - // false - // - // We use 2^40 as a cap instead, since we want to be able to make small - // adjustments within a viewport width. - // - // For reference, this will still allow you to zoom until 1 nanosecond fills - // the screen in a profile with a duration of over 18 minutes. - // - // > Math.pow(2, 40) / (60 * Math.pow(10, 9)) - // 18.325193796266667 - // - - const maxZoom = Math.pow(2, 40); // In addition to capping zoom to avoid floating point error, we further cap - // zoom to avoid letting you zoom in so that the smallest element more than - // fills the screen, since that probably isn't useful. The final zoom cap is - // determined by the minimum zoom of either 2^40x zoom or the necessary zoom - // for the smallest frame to fill the screen three times. - - const minWidth = math_1.clamp(3 * this.getMinFrameWidth(), maxWidth / maxZoom, maxWidth); - return math_1.clamp(viewportWidth, minWidth, maxWidth); - } // Given a desired config-space viewport rectangle, clamp the rectangle so - // that it fits within the given flamechart. This prevents the viewport from - // extending past the bounds of the flamechart or zooming in too far. - - - getClampedConfigSpaceViewportRect({ - configSpaceViewportRect, - renderInverted - }) { - const configSpaceSize = new math_1.Vec2(this.getTotalWeight(), this.getLayers().length); - const width = this.getClampedViewportWidth(configSpaceViewportRect.size.x); - const size = configSpaceViewportRect.size.withX(width); - const origin = math_1.Vec2.clamp(configSpaceViewportRect.origin, new math_1.Vec2(0, renderInverted ? 0 : -1), math_1.Vec2.max(math_1.Vec2.zero, configSpaceSize.minus(size).plus(new math_1.Vec2(0, 1)))); - return new math_1.Rect(origin, configSpaceViewportRect.size.withX(width)); - } - -} - -exports.Flamechart = Flamechart; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Rect = exports.AffineTransform = exports.Vec2 = exports.clamp = void 0; - -function clamp(x, minVal, maxVal) { - if (x < minVal) return minVal; - if (x > maxVal) return maxVal; - return x; -} - -exports.clamp = clamp; - -let Vec2 = -/** @class */ -(() => { - class Vec2 { - constructor(x, y) { - this.x = x; - this.y = y; - } - - withX(x) { - return new Vec2(x, this.y); - } - - withY(y) { - return new Vec2(this.x, y); - } - - plus(other) { - return new Vec2(this.x + other.x, this.y + other.y); - } - - minus(other) { - return new Vec2(this.x - other.x, this.y - other.y); - } - - times(scalar) { - return new Vec2(this.x * scalar, this.y * scalar); - } - - timesPointwise(other) { - return new Vec2(this.x * other.x, this.y * other.y); - } - - dividedByPointwise(other) { - return new Vec2(this.x / other.x, this.y / other.y); - } - - dot(other) { - return this.x * other.x + this.y * other.y; - } - - equals(other) { - return this.x === other.x && this.y === other.y; - } - - approxEquals(other, epsilon = 1e-9) { - return Math.abs(this.x - other.x) < epsilon && Math.abs(this.y - other.y) < epsilon; - } - - length2() { - return this.dot(this); - } - - length() { - return Math.sqrt(this.length2()); - } - - abs() { - return new Vec2(Math.abs(this.x), Math.abs(this.y)); - } - - static min(a, b) { - return new Vec2(Math.min(a.x, b.x), Math.min(a.y, b.y)); - } - - static max(a, b) { - return new Vec2(Math.max(a.x, b.x), Math.max(a.y, b.y)); - } - - static clamp(v, min, max) { - return new Vec2(clamp(v.x, min.x, max.x), clamp(v.y, min.y, max.y)); - } - - flatten() { - return [this.x, this.y]; - } - - } - - Vec2.zero = new Vec2(0, 0); - Vec2.unit = new Vec2(1, 1); - return Vec2; -})(); - -exports.Vec2 = Vec2; - -class AffineTransform { - constructor(m00 = 1, m01 = 0, m02 = 0, m10 = 0, m11 = 1, m12 = 0) { - this.m00 = m00; - this.m01 = m01; - this.m02 = m02; - this.m10 = m10; - this.m11 = m11; - this.m12 = m12; - } - - withScale(s) { - let { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - m00 = s.x; - m11 = s.y; - return new AffineTransform(m00, m01, m02, m10, m11, m12); - } - - static withScale(s) { - return new AffineTransform().withScale(s); - } - - scaledBy(s) { - return AffineTransform.withScale(s).times(this); - } - - getScale() { - return new Vec2(this.m00, this.m11); - } - - withTranslation(t) { - let { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - m02 = t.x; - m12 = t.y; - return new AffineTransform(m00, m01, m02, m10, m11, m12); - } - - static withTranslation(t) { - return new AffineTransform().withTranslation(t); - } - - getTranslation() { - return new Vec2(this.m02, this.m12); - } - - translatedBy(t) { - return AffineTransform.withTranslation(t).times(this); - } - - static betweenRects(from, to) { - return AffineTransform.withTranslation(from.origin.times(-1)).scaledBy(new Vec2(to.size.x / from.size.x, to.size.y / from.size.y)).translatedBy(to.origin); - } - - times(other) { - const m00 = this.m00 * other.m00 + this.m01 * other.m10; - const m01 = this.m00 * other.m01 + this.m01 * other.m11; - const m02 = this.m00 * other.m02 + this.m01 * other.m12 + this.m02; - const m10 = this.m10 * other.m00 + this.m11 * other.m10; - const m11 = this.m10 * other.m01 + this.m11 * other.m11; - const m12 = this.m10 * other.m02 + this.m11 * other.m12 + this.m12; - return new AffineTransform(m00, m01, m02, m10, m11, m12); - } - - equals(other) { - return this.m00 == other.m00 && this.m01 == other.m01 && this.m02 == other.m02 && this.m10 == other.m10 && this.m11 == other.m11 && this.m12 == other.m12; - } - - approxEquals(other, epsilon = 1e-9) { - return Math.abs(this.m00 - other.m00) < epsilon && Math.abs(this.m01 - other.m01) < epsilon && Math.abs(this.m02 - other.m02) < epsilon && Math.abs(this.m10 - other.m10) < epsilon && Math.abs(this.m11 - other.m11) < epsilon && Math.abs(this.m12 - other.m12) < epsilon; - } - - timesScalar(s) { - const { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - return new AffineTransform(s * m00, s * m01, s * m02, s * m10, s * m11, s * m12); - } - - det() { - const { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - const m20 = 0; - const m21 = 0; - const m22 = 1; - return m00 * (m11 * m22 - m12 * m21) - m01 * (m10 * m22 - m12 * m20) + m02 * (m10 * m21 - m11 * m20); - } - - adj() { - const { - m00, - m01, - m02, - m10, - m11, - m12 - } = this; - const m20 = 0; - const m21 = 0; - const m22 = 1; // Adjugate matrix (a) is the transpose of the - // cofactor matrix (c). - // - // 00 01 02 - // 10 11 12 - // 20 21 22 - - const a00 = - /* c00 = */ - +(m11 * m22 - m12 * m21); - const a01 = - /* c10 = */ - -(m01 * m22 - m02 * m21); - const a02 = - /* c20 = */ - +(m01 * m12 - m02 * m11); - const a10 = - /* c01 = */ - -(m10 * m22 - m12 * m20); - const a11 = - /* c11 = */ - +(m00 * m22 - m02 * m20); - const a12 = - /* c21 = */ - -(m00 * m12 - m02 * m10); - return new AffineTransform(a00, a01, a02, a10, a11, a12); - } - - inverted() { - const det = this.det(); - if (det === 0) return null; - const adj = this.adj(); - return adj.timesScalar(1 / det); - } - - transformVector(v) { - return new Vec2(v.x * this.m00 + v.y * this.m01, v.x * this.m10 + v.y * this.m11); - } - - inverseTransformVector(v) { - const inv = this.inverted(); - if (!inv) return null; - return inv.transformVector(v); - } - - transformPosition(v) { - return new Vec2(v.x * this.m00 + v.y * this.m01 + this.m02, v.x * this.m10 + v.y * this.m11 + this.m12); - } - - inverseTransformPosition(v) { - const inv = this.inverted(); - if (!inv) return null; - return inv.transformPosition(v); - } - - transformRect(r) { - const size = this.transformVector(r.size); - const origin = this.transformPosition(r.origin); - - if (size.x < 0 && size.y < 0) { - return new Rect(origin.plus(size), size.abs()); - } else if (size.x < 0) { - return new Rect(origin.withX(origin.x + size.x), size.abs()); - } else if (size.y < 0) { - return new Rect(origin.withY(origin.y + size.y), size.abs()); - } - - return new Rect(origin, size); - } - - inverseTransformRect(r) { - const inv = this.inverted(); - if (!inv) return null; - return inv.transformRect(r); - } - - flatten() { - // Flatten into GLSL format - // prettier-ignore - return [this.m00, this.m10, 0, this.m01, this.m11, 0, this.m02, this.m12, 1]; - } - -} - -exports.AffineTransform = AffineTransform; - -let Rect = -/** @class */ -(() => { - class Rect { - constructor(origin, size) { - this.origin = origin; - this.size = size; - } - - isEmpty() { - return this.width() == 0 || this.height() == 0; - } - - width() { - return this.size.x; - } - - height() { - return this.size.y; - } - - left() { - return this.origin.x; - } - - right() { - return this.left() + this.width(); - } - - top() { - return this.origin.y; - } - - bottom() { - return this.top() + this.height(); - } - - topLeft() { - return this.origin; - } - - topRight() { - return this.origin.plus(new Vec2(this.width(), 0)); - } - - bottomRight() { - return this.origin.plus(this.size); - } - - bottomLeft() { - return this.origin.plus(new Vec2(0, this.height())); - } - - withOrigin(origin) { - return new Rect(origin, this.size); - } - - withSize(size) { - return new Rect(this.origin, size); - } - - closestPointTo(p) { - return new Vec2(clamp(p.x, this.left(), this.right()), clamp(p.y, this.top(), this.bottom())); - } - - distanceFrom(p) { - return p.minus(this.closestPointTo(p)).length(); - } - - contains(p) { - return this.distanceFrom(p) === 0; - } - - hasIntersectionWith(other) { - const top = Math.max(this.top(), other.top()); - const bottom = Math.max(top, Math.min(this.bottom(), other.bottom())); - if (bottom - top === 0) return false; - const left = Math.max(this.left(), other.left()); - const right = Math.max(left, Math.min(this.right(), other.right())); - if (right - left === 0) return false; - return true; - } - - intersectWith(other) { - const topLeft = Vec2.max(this.topLeft(), other.topLeft()); - const bottomRight = Vec2.max(topLeft, Vec2.min(this.bottomRight(), other.bottomRight())); - return new Rect(topLeft, bottomRight.minus(topLeft)); - } - - equals(other) { - return this.origin.equals(other.origin) && this.size.equals(other.size); - } - - approxEquals(other) { - return this.origin.approxEquals(other.origin) && this.size.approxEquals(other.size); - } - - area() { - return this.size.x * this.size.y; - } - - } - - Rect.empty = new Rect(Vec2.zero, Vec2.zero); - Rect.unit = new Rect(Vec2.zero, Vec2.unit); - Rect.NDC = new Rect(new Vec2(-1, -1), new Vec2(2, 2)); - return Rect; -})(); - -exports.Rect = Rect; - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. - - /* istanbul ignore next */ - - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})(this, function () { - 'use strict'; - - function _isNumber(n) { - return !isNaN(parseFloat(n)) && isFinite(n); - } - - function _capitalize(str) { - return str.charAt(0).toUpperCase() + str.substring(1); - } - - function _getter(p) { - return function () { - return this[p]; - }; - } - - var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel']; - var numericProps = ['columnNumber', 'lineNumber']; - var stringProps = ['fileName', 'functionName', 'source']; - var arrayProps = ['args']; - var props = booleanProps.concat(numericProps, stringProps, arrayProps); - - function StackFrame(obj) { - if (!obj) return; - - for (var i = 0; i < props.length; i++) { - if (obj[props[i]] !== undefined) { - this['set' + _capitalize(props[i])](obj[props[i]]); - } - } - } - - StackFrame.prototype = { - getArgs: function () { - return this.args; - }, - setArgs: function (v) { - if (Object.prototype.toString.call(v) !== '[object Array]') { - throw new TypeError('Args must be an Array'); - } - - this.args = v; - }, - getEvalOrigin: function () { - return this.evalOrigin; - }, - setEvalOrigin: function (v) { - if (v instanceof StackFrame) { - this.evalOrigin = v; - } else if (v instanceof Object) { - this.evalOrigin = new StackFrame(v); - } else { - throw new TypeError('Eval Origin must be an Object or StackFrame'); - } - }, - toString: function () { - var fileName = this.getFileName() || ''; - var lineNumber = this.getLineNumber() || ''; - var columnNumber = this.getColumnNumber() || ''; - var functionName = this.getFunctionName() || ''; - - if (this.getIsEval()) { - if (fileName) { - return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; - } - - return '[eval]:' + lineNumber + ':' + columnNumber; - } - - if (functionName) { - return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; - } - - return fileName + ':' + lineNumber + ':' + columnNumber; - } - }; - - StackFrame.fromString = function StackFrame$$fromString(str) { - var argsStartIndex = str.indexOf('('); - var argsEndIndex = str.lastIndexOf(')'); - var functionName = str.substring(0, argsStartIndex); - var args = str.substring(argsStartIndex + 1, argsEndIndex).split(','); - var locationString = str.substring(argsEndIndex + 1); - - if (locationString.indexOf('@') === 0) { - var parts = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString, ''); - var fileName = parts[1]; - var lineNumber = parts[2]; - var columnNumber = parts[3]; - } - - return new StackFrame({ - functionName: functionName, - args: args || undefined, - fileName: fileName, - lineNumber: lineNumber || undefined, - columnNumber: columnNumber || undefined - }); - }; - - for (var i = 0; i < booleanProps.length; i++) { - StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]); - - StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function (p) { - return function (v) { - this[p] = Boolean(v); - }; - }(booleanProps[i]); - } - - for (var j = 0; j < numericProps.length; j++) { - StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]); - - StackFrame.prototype['set' + _capitalize(numericProps[j])] = function (p) { - return function (v) { - if (!_isNumber(v)) { - throw new TypeError(p + ' must be a Number'); - } - - this[p] = Number(v); - }; - }(numericProps[j]); - } - - for (var k = 0; k < stringProps.length; k++) { - StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]); - - StackFrame.prototype['set' + _capitalize(stringProps[k])] = function (p) { - return function (v) { - this[p] = String(v); - }; - }(stringProps[k]); - } - - return StackFrame; -}); - -/***/ }), -/* 13 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "importFile", function() { return /* binding */ importFile_worker_importFile; }); - -// EXTERNAL MODULE: ../react-devtools-timeline/node_modules/regenerator-runtime/runtime.js -var runtime = __webpack_require__(5); - -// EXTERNAL MODULE: /Users/kevin.le-seigle/WS/react/node_modules/@elg/speedscope/dist/library/library.js -var library = __webpack_require__(1); - -// CONCATENATED MODULE: ../react-devtools-shared/src/constants.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi'; -const INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc'; -const LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf'; // Flip this flag to true to enable verbose console debug logging. - -const __DEBUG__ = false; // Flip this flag to true to enable performance.mark() and performance.measure() timings. - -const __PERFORMANCE_PROFILE__ = false; -const TREE_OPERATION_ADD = 1; -const TREE_OPERATION_REMOVE = 2; -const TREE_OPERATION_REORDER_CHILDREN = 3; -const TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4; -const TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5; -const TREE_OPERATION_REMOVE_ROOT = 6; -const TREE_OPERATION_SET_SUBTREE_MODE = 7; -const PROFILING_FLAG_BASIC_SUPPORT = 0b01; -const PROFILING_FLAG_TIMELINE_SUPPORT = 0b10; -const LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab'; -const LOCAL_STORAGE_FILTER_PREFERENCES_KEY = 'React::DevTools::componentFilters'; -const SESSION_STORAGE_LAST_SELECTION_KEY = 'React::DevTools::lastSelection'; -const LOCAL_STORAGE_OPEN_IN_EDITOR_URL = 'React::DevTools::openInEditorUrl'; -const LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY = 'React::DevTools::parseHookNames'; -const SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY = 'React::DevTools::recordChangeDescriptions'; -const SESSION_STORAGE_RELOAD_AND_PROFILE_KEY = 'React::DevTools::reloadAndProfile'; -const LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS = 'React::DevTools::breakOnConsoleErrors'; -const LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY = 'React::DevTools::appendComponentStack'; -const LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY = 'React::DevTools::showInlineWarningsAndErrors'; -const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY = 'React::DevTools::traceUpdatesEnabled'; -const LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE = 'React::DevTools::hideConsoleLogsInStrictMode'; -const PROFILER_EXPORT_VERSION = 5; -const CHANGE_LOG_URL = 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md'; -const UNSUPPORTED_VERSION_URL = 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back'; -const REACT_DEVTOOLS_WORKPLACE_URL = 'https://fburl.com/react-devtools-workplace-group'; -const THEME_STYLES = { - light: { - '--color-attribute-name': '#ef6632', - '--color-attribute-name-not-editable': '#23272f', - '--color-attribute-name-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-attribute-value': '#1a1aa6', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': '#1a1aa6', - '--color-background': '#ffffff', - '--color-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-background-inactive': '#e5e5e5', - '--color-background-invalid': '#fff0f0', - '--color-background-selected': '#0088fa', - '--color-button-background': '#ffffff', - '--color-button-background-focus': '#ededed', - '--color-button': '#5f6673', - '--color-button-disabled': '#cfd1d5', - '--color-button-active': '#0088fa', - '--color-button-focus': '#23272f', - '--color-button-hover': '#23272f', - '--color-border': '#eeeeee', - '--color-commit-did-not-render-fill': '#cfd1d5', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#cfd1d5', - '--color-commit-did-not-render-pattern-text': '#333333', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#6a51b2', - '--color-component-name-inverted': '#ffffff', - '--color-component-badge-background': 'rgba(0, 0, 0, 0.1)', - '--color-component-badge-background-inverted': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-count': '#777d88', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#ffffff', - '--color-console-error-background': '#fff0f0', - '--color-console-error-border': '#ffd6d6', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fe2e31', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#fffbe5', - '--color-console-warning-border': '#fff5c1', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#64460c', - '--color-context-background': 'rgba(0,0,0,.9)', - '--color-context-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-context-background-selected': '#178fb9', - '--color-context-border': '#3d424a', - '--color-context-text': '#ffffff', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#777d88', - '--color-dimmer': '#cfd1d5', - '--color-dimmest': '#eff0f1', - '--color-error-background': 'hsl(0, 100%, 97%)', - '--color-error-border': 'hsl(0, 100%, 92%)', - '--color-error-text': '#ff0000', - '--color-expand-collapse-toggle': '#777d88', - '--color-link': '#0000ff', - '--color-modal-background': 'rgba(255, 255, 255, 0.75)', - '--color-bridge-version-npm-background': '#eff0f1', - '--color-bridge-version-npm-text': '#000000', - '--color-bridge-version-number': '#0088fa', - '--color-primitive-hook-badge-background': '#e5e5e5', - '--color-primitive-hook-badge-text': '#5f6673', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#3578e5', - '--color-record-inactive': '#0088fa', - '--color-resize-bar': '#eeeeee', - '--color-resize-bar-active': '#dcdcdc', - '--color-resize-bar-border': '#d1d1d1', - '--color-resize-bar-dot': '#333333', - '--color-timeline-internal-module': '#d1d1d1', - '--color-timeline-internal-module-hover': '#c9c9c9', - '--color-timeline-internal-module-text': '#444', - '--color-timeline-native-event': '#ccc', - '--color-timeline-native-event-hover': '#aaa', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#f0e7d1', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#e3ba52', - '--color-timeline-priority-background': '#f6f6f6', - '--color-timeline-priority-border': '#eeeeee', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#d3e5f6', - '--color-timeline-react-idle-hover': '#c3d9ef', - '--color-timeline-react-render': '#9fc3f3', - '--color-timeline-react-render-hover': '#83afe9', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#c88ff0', - '--color-timeline-react-commit-hover': '#b281d6', - '--color-timeline-react-commit-text': '#3e2c4a', - '--color-timeline-react-layout-effects': '#b281d6', - '--color-timeline-react-layout-effects-hover': '#9d71bd', - '--color-timeline-react-layout-effects-text': '#3e2c4a', - '--color-timeline-react-passive-effects': '#b281d6', - '--color-timeline-react-passive-effects-hover': '#9d71bd', - '--color-timeline-react-passive-effects-text': '#3e2c4a', - '--color-timeline-react-schedule': '#9fc3f3', - '--color-timeline-react-schedule-hover': '#2683E2', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#ffdf37', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#ee1638', - '--color-timeline-thrown-error-hover': '#da1030', - '--color-timeline-text-color': '#000000', - '--color-timeline-text-dim-color': '#ccc', - '--color-timeline-react-work-border': '#eeeeee', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(0, 136, 250, 0.1)', - '--color-selected-tree-highlight-inactive': 'rgba(0, 0, 0, 0.05)', - '--color-scroll-caret': 'rgba(150, 150, 150, 0.5)', - '--color-tab-selected-border': '#0088fa', - '--color-text': '#000000', - '--color-text-invalid': '#ff0000', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#0088fa', - '--color-toggle-background-off': '#cfd1d5', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#fb3655', - '--color-warning-background-hover': '#f82042', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#fd4d69', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#c2c2c2', - '--color-scroll-track': '#fafafa', - '--color-tooltip-background': 'rgba(0, 0, 0, 0.9)', - '--color-tooltip-text': '#ffffff' - }, - dark: { - '--color-attribute-name': '#9d87d2', - '--color-attribute-name-not-editable': '#ededed', - '--color-attribute-name-inverted': '#282828', - '--color-attribute-value': '#cedae0', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': 'yellow', - '--color-background': '#282c34', - '--color-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-background-inactive': '#3d424a', - '--color-background-invalid': '#5c0000', - '--color-background-selected': '#178fb9', - '--color-button-background': '#282c34', - '--color-button-background-focus': '#3d424a', - '--color-button': '#afb3b9', - '--color-button-active': '#61dafb', - '--color-button-disabled': '#4f5766', - '--color-button-focus': '#a2e9fc', - '--color-button-hover': '#ededed', - '--color-border': '#3d424a', - '--color-commit-did-not-render-fill': '#777d88', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#666c77', - '--color-commit-did-not-render-pattern-text': '#ffffff', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#61dafb', - '--color-component-name-inverted': '#282828', - '--color-component-badge-background': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-background-inverted': 'rgba(0, 0, 0, 0.25)', - '--color-component-badge-count': '#8f949d', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#000000', - '--color-console-error-background': '#290000', - '--color-console-error-border': '#5c0000', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fc7f7f', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#332b00', - '--color-console-warning-border': '#665500', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#f5f2ed', - '--color-context-background': 'rgba(255,255,255,.95)', - '--color-context-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-context-background-selected': '#0088fa', - '--color-context-border': '#eeeeee', - '--color-context-text': '#000000', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#8f949d', - '--color-dimmer': '#777d88', - '--color-dimmest': '#4f5766', - '--color-error-background': '#200', - '--color-error-border': '#900', - '--color-error-text': '#f55', - '--color-expand-collapse-toggle': '#8f949d', - '--color-link': '#61dafb', - '--color-modal-background': 'rgba(0, 0, 0, 0.75)', - '--color-bridge-version-npm-background': 'rgba(0, 0, 0, 0.25)', - '--color-bridge-version-npm-text': '#ffffff', - '--color-bridge-version-number': 'yellow', - '--color-primitive-hook-badge-background': 'rgba(0, 0, 0, 0.25)', - '--color-primitive-hook-badge-text': 'rgba(255, 255, 255, 0.7)', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#a2e9fc', - '--color-record-inactive': '#61dafb', - '--color-resize-bar': '#282c34', - '--color-resize-bar-active': '#31363f', - '--color-resize-bar-border': '#3d424a', - '--color-resize-bar-dot': '#cfd1d5', - '--color-timeline-internal-module': '#303542', - '--color-timeline-internal-module-hover': '#363b4a', - '--color-timeline-internal-module-text': '#7f8899', - '--color-timeline-native-event': '#b2b2b2', - '--color-timeline-native-event-hover': '#949494', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#e3dbc5', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#d6af4d', - '--color-timeline-priority-background': '#1d2129', - '--color-timeline-priority-border': '#282c34', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#3d485b', - '--color-timeline-react-idle-hover': '#465269', - '--color-timeline-react-render': '#2683E2', - '--color-timeline-react-render-hover': '#1a76d4', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#731fad', - '--color-timeline-react-commit-hover': '#611b94', - '--color-timeline-react-commit-text': '#e5c1ff', - '--color-timeline-react-layout-effects': '#611b94', - '--color-timeline-react-layout-effects-hover': '#51167a', - '--color-timeline-react-layout-effects-text': '#e5c1ff', - '--color-timeline-react-passive-effects': '#611b94', - '--color-timeline-react-passive-effects-hover': '#51167a', - '--color-timeline-react-passive-effects-text': '#e5c1ff', - '--color-timeline-react-schedule': '#2683E2', - '--color-timeline-react-schedule-hover': '#1a76d4', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#e4c00f', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#fb3655', - '--color-timeline-thrown-error-hover': '#f82042', - '--color-timeline-text-color': '#282c34', - '--color-timeline-text-dim-color': '#555b66', - '--color-timeline-react-work-border': '#3d424a', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(23, 143, 185, 0.15)', - '--color-selected-tree-highlight-inactive': 'rgba(255, 255, 255, 0.05)', - '--color-scroll-caret': '#4f5766', - '--color-shadow': 'rgba(0, 0, 0, 0.5)', - '--color-tab-selected-border': '#178fb9', - '--color-text': '#ffffff', - '--color-text-invalid': '#ff8080', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#178fb9', - '--color-toggle-background-off': '#777d88', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#ee1638', - '--color-warning-background-hover': '#da1030', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#ee1638', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#afb3b9', - '--color-scroll-track': '#313640', - '--color-tooltip-background': 'rgba(255, 255, 255, 0.95)', - '--color-tooltip-text': '#000000' - }, - compact: { - '--font-size-monospace-small': '9px', - '--font-size-monospace-normal': '11px', - '--font-size-monospace-large': '15px', - '--font-size-sans-small': '10px', - '--font-size-sans-normal': '12px', - '--font-size-sans-large': '14px', - '--line-height-data': '18px' - }, - comfortable: { - '--font-size-monospace-small': '10px', - '--font-size-monospace-normal': '13px', - '--font-size-monospace-large': '17px', - '--font-size-sans-small': '12px', - '--font-size-sans-normal': '14px', - '--font-size-sans-large': '16px', - '--line-height-data': '22px' - } -}; // HACK -// -// Sometimes the inline target is rendered before root styles are applied, -// which would result in e.g. NaN itemSize being passed to react-window list. - -const COMFORTABLE_LINE_HEIGHT = parseInt(THEME_STYLES.comfortable['--line-height-data'], 10); -const COMPACT_LINE_HEIGHT = parseInt(THEME_STYLES.compact['--line-height-data'], 10); - -// CONCATENATED MODULE: ../react-devtools-timeline/src/constants.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -const REACT_TOTAL_NUM_LANES = 31; // Increment this number any time a backwards breaking change is made to the profiler metadata. - -const SCHEDULING_PROFILER_VERSION = 1; -const SNAPSHOT_MAX_HEIGHT = 60; -// CONCATENATED MODULE: ../react-devtools-timeline/src/import-worker/InvalidProfileError.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -/** - * An error thrown when an invalid profile could not be processed. - */ -class InvalidProfileError extends Error {} -// CONCATENATED MODULE: ../react-devtools-timeline/node_modules/memoize-one/dist/memoize-one.esm.js -function areInputsEqual(newInputs, lastInputs) { - if (newInputs.length !== lastInputs.length) { - return false; - } - - for (var i = 0; i < newInputs.length; i++) { - if (newInputs[i] !== lastInputs[i]) { - return false; - } - } - - return true; -} - -function memoizeOne(resultFn, isEqual) { - if (isEqual === void 0) { - isEqual = areInputsEqual; - } - - var lastThis; - var lastArgs = []; - var lastResult; - var calledOnce = false; - - function memoized() { - var newArgs = []; - - for (var _i = 0; _i < arguments.length; _i++) { - newArgs[_i] = arguments[_i]; - } - - if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) { - return lastResult; - } - - lastResult = resultFn.apply(this, newArgs); - calledOnce = true; - lastThis = this; - lastArgs = newArgs; - return lastResult; - } - - return memoized; -} - -/* harmony default export */ var memoize_one_esm = (memoizeOne); -// CONCATENATED MODULE: ../react-devtools-timeline/src/utils/getBatchRange.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - -function unmemoizedGetBatchRange(batchUID, data, minStartTime = 0) { - const measures = data.batchUIDToMeasuresMap.get(batchUID); - - if (measures == null || measures.length === 0) { - throw Error(`Could not find measures with batch UID "${batchUID}"`); - } - - const lastMeasure = measures[measures.length - 1]; - const stopTime = lastMeasure.timestamp + lastMeasure.duration; - - if (stopTime < minStartTime) { - return [0, 0]; - } - - let startTime = minStartTime; - - for (let index = 0; index < measures.length; index++) { - const measure = measures[index]; - - if (measure.timestamp >= minStartTime) { - startTime = measure.timestamp; - break; - } - } - - return [startTime, stopTime]; -} - -const getBatchRange = memoize_one_esm(unmemoizedGetBatchRange); -// EXTERNAL MODULE: /Users/kevin.le-seigle/WS/react/node_modules/error-stack-parser/error-stack-parser.js -var error_stack_parser = __webpack_require__(3); -var error_stack_parser_default = /*#__PURE__*/__webpack_require__.n(error_stack_parser); - -// CONCATENATED MODULE: ../react-devtools-timeline/src/import-worker/preprocessData.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - - -const NATIVE_EVENT_DURATION_THRESHOLD = 20; -const NESTED_UPDATE_DURATION_THRESHOLD = 20; -const WARNING_STRINGS = { - LONG_EVENT_HANDLER: 'An event handler scheduled a big update with React. Consider using the Transition API to defer some of this work.', - NESTED_UPDATE: 'A big nested update was scheduled during layout. ' + 'Nested updates require React to re-render synchronously before the browser can paint. ' + 'Consider delaying this update by moving it to a passive effect (useEffect).', - SUSPEND_DURING_UPDATE: 'A component suspended during an update which caused a fallback to be shown. ' + "Consider using the Transition API to avoid hiding components after they've been mounted." -}; // Exported for tests - -function getLanesFromTransportDecimalBitmask(laneBitmaskString) { - const laneBitmask = parseInt(laneBitmaskString, 10); // As negative numbers are stored in two's complement format, our bitmask - // checks will be thrown off by them. - - if (laneBitmask < 0) { - return []; - } - - const lanes = []; - let powersOfTwo = 0; - - while (powersOfTwo <= REACT_TOTAL_NUM_LANES) { - if (1 << powersOfTwo & laneBitmask) { - lanes.push(powersOfTwo); - } - - powersOfTwo++; - } - - return lanes; -} - -function updateLaneToLabelMap(profilerData, laneLabelTuplesString) { - // These marks appear multiple times in the data; - // We only need to extact them once. - if (profilerData.laneToLabelMap.size === 0) { - const laneLabelTuples = laneLabelTuplesString.split(','); - - for (let laneIndex = 0; laneIndex < laneLabelTuples.length; laneIndex++) { - // The numeric lane value (e.g. 64) isn't important. - // The profiler parses and stores the lane's position within the bitmap, - // (e.g. lane 1 is index 0, lane 16 is index 4). - profilerData.laneToLabelMap.set(laneIndex, laneLabelTuples[laneIndex]); - } - } -} - -let profilerVersion = null; - -function getLastType(stack) { - if (stack.length > 0) { - const { - type - } = stack[stack.length - 1]; - return type; - } - - return null; -} - -function getDepth(stack) { - if (stack.length > 0) { - const { - depth, - type - } = stack[stack.length - 1]; - return type === 'render-idle' ? depth : depth + 1; - } - - return 0; -} - -function markWorkStarted(type, startTime, lanes, currentProfilerData, state) { - const { - batchUID, - measureStack - } = state; - const depth = getDepth(measureStack); - const measure = { - type, - batchUID, - depth, - lanes, - timestamp: startTime, - duration: 0 - }; - state.measureStack.push({ - depth, - measure, - startTime, - type - }); // This array is pre-initialized when the batchUID is generated. - - const measures = currentProfilerData.batchUIDToMeasuresMap.get(batchUID); - - if (measures != null) { - measures.push(measure); - } else { - currentProfilerData.batchUIDToMeasuresMap.set(state.batchUID, [measure]); - } // This array is pre-initialized before processing starts. - - - lanes.forEach(lane => { - currentProfilerData.laneToReactMeasureMap.get(lane).push(measure); - }); -} - -function markWorkCompleted(type, stopTime, currentProfilerData, stack) { - if (stack.length === 0) { - console.error('Unexpected type "%s" completed at %sms while stack is empty.', type, stopTime); // Ignore work "completion" user timing mark that doesn't complete anything - - return; - } - - const last = stack[stack.length - 1]; - - if (last.type !== type) { - console.error('Unexpected type "%s" completed at %sms before "%s" completed.', type, stopTime, last.type); - } - - const { - measure, - startTime - } = stack.pop(); - - if (!measure) { - console.error('Could not find matching measure for type "%s".', type); - } // $FlowFixMe This property should not be writable outside of this function. - - - measure.duration = stopTime - startTime; -} - -function throwIfIncomplete(type, stack) { - const lastIndex = stack.length - 1; - - if (lastIndex >= 0) { - const last = stack[lastIndex]; - - if (last.stopTime === undefined && last.type === type) { - throw new InvalidProfileError(`Unexpected type "${type}" started before "${last.type}" completed.`); - } - } -} - -function processEventDispatch(event, timestamp, profilerData, state) { - const data = event.args.data; - const type = data.type; - - if (type.startsWith('react-')) { - const stackTrace = data.stackTrace; - - if (stackTrace) { - const topFrame = stackTrace[stackTrace.length - 1]; - - if (topFrame.url.includes('/react-dom.')) { - // Filter out fake React events dispatched by invokeGuardedCallbackDev. - return; - } - } - } // Reduce noise from events like DOMActivate, load/unload, etc. which are usually not relevant - - - if (type === 'blur' || type === 'click' || type === 'input' || type.startsWith('focus') || type.startsWith('key') || type.startsWith('mouse') || type.startsWith('pointer')) { - const duration = event.dur / 1000; - let depth = 0; - - while (state.nativeEventStack.length > 0) { - const prevNativeEvent = state.nativeEventStack[state.nativeEventStack.length - 1]; - const prevStopTime = prevNativeEvent.timestamp + prevNativeEvent.duration; - - if (timestamp < prevStopTime) { - depth = prevNativeEvent.depth + 1; - break; - } else { - state.nativeEventStack.pop(); - } - } - - const nativeEvent = { - depth, - duration, - timestamp, - type, - warning: null - }; - profilerData.nativeEvents.push(nativeEvent); // Keep track of curent event in case future ones overlap. - // We separate them into different vertical lanes in this case. - - state.nativeEventStack.push(nativeEvent); - } -} - -function processResourceFinish(event, timestamp, profilerData, state) { - const requestId = event.args.data.requestId; - const networkMeasure = state.requestIdToNetworkMeasureMap.get(requestId); - - if (networkMeasure != null) { - networkMeasure.finishTimestamp = timestamp; - - if (networkMeasure.firstReceivedDataTimestamp === 0) { - networkMeasure.firstReceivedDataTimestamp = timestamp; - } - - if (networkMeasure.lastReceivedDataTimestamp === 0) { - networkMeasure.lastReceivedDataTimestamp = timestamp; - } // Clean up now that the resource is done. - - - state.requestIdToNetworkMeasureMap.delete(event.args.data.requestId); - } -} - -function processResourceReceivedData(event, timestamp, profilerData, state) { - const requestId = event.args.data.requestId; - const networkMeasure = state.requestIdToNetworkMeasureMap.get(requestId); - - if (networkMeasure != null) { - if (networkMeasure.firstReceivedDataTimestamp === 0) { - networkMeasure.firstReceivedDataTimestamp = timestamp; - } - - networkMeasure.lastReceivedDataTimestamp = timestamp; - networkMeasure.finishTimestamp = timestamp; - } -} - -function processResourceReceiveResponse(event, timestamp, profilerData, state) { - const requestId = event.args.data.requestId; - const networkMeasure = state.requestIdToNetworkMeasureMap.get(requestId); - - if (networkMeasure != null) { - networkMeasure.receiveResponseTimestamp = timestamp; - } -} - -function processScreenshot(event, timestamp, profilerData, state) { - const encodedSnapshot = event.args.snapshot; // Base 64 encoded - - const snapshot = { - height: 0, - image: null, - imageSource: `data:image/png;base64,${encodedSnapshot}`, - timestamp, - width: 0 - }; // Delay processing until we've extracted snapshot dimensions. - - let resolveFn = null; - state.asyncProcessingPromises.push(new Promise(resolve => { - resolveFn = resolve; - })); // Parse the Base64 image data to determine native size. - // This will be used later to scale for display within the thumbnail strip. - - fetch(snapshot.imageSource).then(response => response.blob()).then(blob => { - // $FlowFixMe createImageBitmap - createImageBitmap(blob).then(bitmap => { - snapshot.height = bitmap.height; - snapshot.width = bitmap.width; - resolveFn(); - }); - }); - profilerData.snapshots.push(snapshot); -} - -function processResourceSendRequest(event, timestamp, profilerData, state) { - const data = event.args.data; - const requestId = data.requestId; - const availableDepths = new Array(state.requestIdToNetworkMeasureMap.size + 1).fill(true); - state.requestIdToNetworkMeasureMap.forEach(({ - depth - }) => { - availableDepths[depth] = false; - }); - let depth = 0; - - for (let i = 0; i < availableDepths.length; i++) { - if (availableDepths[i]) { - depth = i; - break; - } - } - - const networkMeasure = { - depth, - finishTimestamp: 0, - firstReceivedDataTimestamp: 0, - lastReceivedDataTimestamp: 0, - requestId, - requestMethod: data.requestMethod, - priority: data.priority, - sendRequestTimestamp: timestamp, - receiveResponseTimestamp: 0, - url: data.url - }; - state.requestIdToNetworkMeasureMap.set(requestId, networkMeasure); - profilerData.networkMeasures.push(networkMeasure); - networkMeasure.sendRequestTimestamp = timestamp; -} - -function processTimelineEvent(event, -/** Finalized profiler data up to `event`. May be mutated. */ -currentProfilerData, -/** Intermediate processor state. May be mutated. */ -state) { - const { - cat, - name, - ts, - ph - } = event; - const startTime = (ts - currentProfilerData.startTime) / 1000; - - switch (cat) { - case 'disabled-by-default-devtools.screenshot': - processScreenshot(event, startTime, currentProfilerData, state); - break; - - case 'devtools.timeline': - switch (name) { - case 'EventDispatch': - processEventDispatch(event, startTime, currentProfilerData, state); - break; - - case 'ResourceFinish': - processResourceFinish(event, startTime, currentProfilerData, state); - break; - - case 'ResourceReceivedData': - processResourceReceivedData(event, startTime, currentProfilerData, state); - break; - - case 'ResourceReceiveResponse': - processResourceReceiveResponse(event, startTime, currentProfilerData, state); - break; - - case 'ResourceSendRequest': - processResourceSendRequest(event, startTime, currentProfilerData, state); - break; - } - - break; - - case 'blink.user_timing': - if (name.startsWith('--react-version-')) { - const [reactVersion] = name.substr(16).split('-'); - currentProfilerData.reactVersion = reactVersion; - } else if (name.startsWith('--profiler-version-')) { - const [versionString] = name.substr(19).split('-'); - profilerVersion = parseInt(versionString, 10); - - if (profilerVersion !== SCHEDULING_PROFILER_VERSION) { - throw new InvalidProfileError(`This version of profiling data (${versionString}) is not supported by the current profiler.`); - } - } else if (name.startsWith('--react-lane-labels-')) { - const [laneLabelTuplesString] = name.substr(20).split('-'); - updateLaneToLabelMap(currentProfilerData, laneLabelTuplesString); - } else if (name.startsWith('--component-')) { - processReactComponentMeasure(name, startTime, currentProfilerData, state); - } else if (name.startsWith('--schedule-render-')) { - const [laneBitmaskString] = name.substr(18).split('-'); - currentProfilerData.schedulingEvents.push({ - type: 'schedule-render', - lanes: getLanesFromTransportDecimalBitmask(laneBitmaskString), - timestamp: startTime, - warning: null - }); - } else if (name.startsWith('--schedule-forced-update-')) { - const [laneBitmaskString, componentName] = name.substr(25).split('-'); - const forceUpdateEvent = { - type: 'schedule-force-update', - lanes: getLanesFromTransportDecimalBitmask(laneBitmaskString), - componentName, - timestamp: startTime, - warning: null - }; // If this is a nested update, make a note of it. - // Once we're done processing events, we'll check to see if it was a long update and warn about it. - - if (state.measureStack.find(({ - type - }) => type === 'commit')) { - state.potentialLongNestedUpdate = forceUpdateEvent; - } - - currentProfilerData.schedulingEvents.push(forceUpdateEvent); - } else if (name.startsWith('--schedule-state-update-')) { - const [laneBitmaskString, componentName] = name.substr(24).split('-'); - const stateUpdateEvent = { - type: 'schedule-state-update', - lanes: getLanesFromTransportDecimalBitmask(laneBitmaskString), - componentName, - timestamp: startTime, - warning: null - }; // If this is a nested update, make a note of it. - // Once we're done processing events, we'll check to see if it was a long update and warn about it. - - if (state.measureStack.find(({ - type - }) => type === 'commit')) { - state.potentialLongNestedUpdate = stateUpdateEvent; - } - - currentProfilerData.schedulingEvents.push(stateUpdateEvent); - } else if (name.startsWith('--error-')) { - const [componentName, phase, message] = name.substr(8).split('-'); - currentProfilerData.thrownErrors.push({ - componentName, - message, - phase: phase, - timestamp: startTime, - type: 'thrown-error' - }); - } else if (name.startsWith('--suspense-suspend-')) { - const [id, componentName, phase, laneBitmaskString, promiseName] = name.substr(19).split('-'); - const lanes = getLanesFromTransportDecimalBitmask(laneBitmaskString); - const availableDepths = new Array(state.unresolvedSuspenseEvents.size + 1).fill(true); - state.unresolvedSuspenseEvents.forEach(({ - depth - }) => { - availableDepths[depth] = false; - }); - let depth = 0; - - for (let i = 0; i < availableDepths.length; i++) { - if (availableDepths[i]) { - depth = i; - break; - } - } // TODO (timeline) Maybe we should calculate depth in post, - // so unresolved Suspense requests don't take up space. - // We can't know if they'll be resolved or not at this point. - // We'll just give them a default (fake) duration width. - - - const suspenseEvent = { - componentName, - depth, - duration: null, - id, - phase: phase, - promiseName: promiseName || null, - resolution: 'unresolved', - timestamp: startTime, - type: 'suspense', - warning: null - }; - - if (phase === 'update') { - // If a component suspended during an update, we should verify that it was during a transition. - // We need the lane metadata to verify this though. - // Since that data is only logged during commit, we may not have it yet. - // Store these events for post-processing then. - state.potentialSuspenseEventsOutsideOfTransition.push([suspenseEvent, lanes]); - } - - currentProfilerData.suspenseEvents.push(suspenseEvent); - state.unresolvedSuspenseEvents.set(id, suspenseEvent); - } else if (name.startsWith('--suspense-resolved-')) { - const [id] = name.substr(20).split('-'); - const suspenseEvent = state.unresolvedSuspenseEvents.get(id); - - if (suspenseEvent != null) { - state.unresolvedSuspenseEvents.delete(id); - suspenseEvent.duration = startTime - suspenseEvent.timestamp; - suspenseEvent.resolution = 'resolved'; - } - } else if (name.startsWith('--suspense-rejected-')) { - const [id] = name.substr(20).split('-'); - const suspenseEvent = state.unresolvedSuspenseEvents.get(id); - - if (suspenseEvent != null) { - state.unresolvedSuspenseEvents.delete(id); - suspenseEvent.duration = startTime - suspenseEvent.timestamp; - suspenseEvent.resolution = 'rejected'; - } - } else if (name.startsWith('--render-start-')) { - if (state.nextRenderShouldGenerateNewBatchID) { - state.nextRenderShouldGenerateNewBatchID = false; - state.batchUID = state.uidCounter++; - } // If this render is the result of a nested update, make a note of it. - // Once we're done processing events, we'll check to see if it was a long update and warn about it. - - - if (state.potentialLongNestedUpdate !== null) { - state.potentialLongNestedUpdates.push([state.potentialLongNestedUpdate, state.batchUID]); - state.potentialLongNestedUpdate = null; - } - - const [laneBitmaskString] = name.substr(15).split('-'); - throwIfIncomplete('render', state.measureStack); - - if (getLastType(state.measureStack) !== 'render-idle') { - markWorkStarted('render-idle', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - } - - markWorkStarted('render', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - - for (let i = 0; i < state.nativeEventStack.length; i++) { - const nativeEvent = state.nativeEventStack[i]; - const stopTime = nativeEvent.timestamp + nativeEvent.duration; // If React work was scheduled during an event handler, and the event had a long duration, - // it might be because the React render was long and stretched the event. - // It might also be that the React work was short and that something else stretched the event. - // Make a note of this event for now and we'll examine the batch of React render work later. - // (We can't know until we're done processing the React update anyway.) - - if (stopTime > startTime) { - state.potentialLongEvents.push([nativeEvent, state.batchUID]); - } - } - } else if (name.startsWith('--render-stop') || name.startsWith('--render-yield')) { - markWorkCompleted('render', startTime, currentProfilerData, state.measureStack); - } else if (name.startsWith('--commit-start-')) { - state.nextRenderShouldGenerateNewBatchID = true; - const [laneBitmaskString] = name.substr(15).split('-'); - markWorkStarted('commit', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - } else if (name.startsWith('--commit-stop')) { - markWorkCompleted('commit', startTime, currentProfilerData, state.measureStack); - markWorkCompleted('render-idle', startTime, currentProfilerData, state.measureStack); - } else if (name.startsWith('--layout-effects-start-')) { - const [laneBitmaskString] = name.substr(23).split('-'); - markWorkStarted('layout-effects', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - } else if (name.startsWith('--layout-effects-stop')) { - markWorkCompleted('layout-effects', startTime, currentProfilerData, state.measureStack); - } else if (name.startsWith('--passive-effects-start-')) { - const [laneBitmaskString] = name.substr(24).split('-'); - markWorkStarted('passive-effects', startTime, getLanesFromTransportDecimalBitmask(laneBitmaskString), currentProfilerData, state); - } else if (name.startsWith('--passive-effects-stop')) { - markWorkCompleted('passive-effects', startTime, currentProfilerData, state.measureStack); - } else if (name.startsWith('--react-internal-module-start-')) { - const stackFrameStart = name.substr(30); - - if (!state.internalModuleStackStringSet.has(stackFrameStart)) { - state.internalModuleStackStringSet.add(stackFrameStart); - const parsedStackFrameStart = parseStackFrame(stackFrameStart); - state.internalModuleCurrentStackFrame = parsedStackFrameStart; - } - } else if (name.startsWith('--react-internal-module-stop-')) { - const stackFrameStop = name.substr(29); - - if (!state.internalModuleStackStringSet.has(stackFrameStop)) { - state.internalModuleStackStringSet.add(stackFrameStop); - const parsedStackFrameStop = parseStackFrame(stackFrameStop); - - if (parsedStackFrameStop !== null && state.internalModuleCurrentStackFrame !== null) { - const parsedStackFrameStart = state.internalModuleCurrentStackFrame; - state.internalModuleCurrentStackFrame = null; - const range = [parsedStackFrameStart, parsedStackFrameStop]; - const ranges = currentProfilerData.internalModuleSourceToRanges.get(parsedStackFrameStart.fileName); - - if (ranges == null) { - currentProfilerData.internalModuleSourceToRanges.set(parsedStackFrameStart.fileName, [range]); - } else { - ranges.push(range); - } - } - } - } else if (ph === 'R' || ph === 'n') { - // User Timing mark - currentProfilerData.otherUserTimingMarks.push({ - name, - timestamp: startTime - }); - } else if (ph === 'b') {// TODO: Begin user timing measure - } else if (ph === 'e') {// TODO: End user timing measure - } else if (ph === 'i' || ph === 'I') {// Instant events. - // Note that the capital "I" is a deprecated value that exists in Chrome Canary traces. - } else { - throw new InvalidProfileError(`Unrecognized event ${JSON.stringify(event)}! This is likely a bug in this profiler tool.`); - } - - break; - } -} - -function assertNoOverlappingComponentMeasure(state) { - if (state.currentReactComponentMeasure !== null) { - console.error('Component measure started while another measure in progress:', state.currentReactComponentMeasure); - } -} - -function assertCurrentComponentMeasureType(state, type) { - if (state.currentReactComponentMeasure === null) { - console.error(`Component measure type "${type}" stopped while no measure was in progress`); - } else if (state.currentReactComponentMeasure.type !== type) { - console.error(`Component measure type "${type}" stopped while type ${state.currentReactComponentMeasure.type} in progress`); - } -} - -function processReactComponentMeasure(name, startTime, currentProfilerData, state) { - if (name.startsWith('--component-render-start-')) { - const [componentName] = name.substr(25).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'render', - warning: null - }; - } else if (name === '--component-render-stop') { - assertCurrentComponentMeasureType(state, 'render'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } else if (name.startsWith('--component-layout-effect-mount-start-')) { - const [componentName] = name.substr(38).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'layout-effect-mount', - warning: null - }; - } else if (name === '--component-layout-effect-mount-stop') { - assertCurrentComponentMeasureType(state, 'layout-effect-mount'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } else if (name.startsWith('--component-layout-effect-unmount-start-')) { - const [componentName] = name.substr(40).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'layout-effect-unmount', - warning: null - }; - } else if (name === '--component-layout-effect-unmount-stop') { - assertCurrentComponentMeasureType(state, 'layout-effect-unmount'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } else if (name.startsWith('--component-passive-effect-mount-start-')) { - const [componentName] = name.substr(39).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'passive-effect-mount', - warning: null - }; - } else if (name === '--component-passive-effect-mount-stop') { - assertCurrentComponentMeasureType(state, 'passive-effect-mount'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } else if (name.startsWith('--component-passive-effect-unmount-start-')) { - const [componentName] = name.substr(41).split('-'); - assertNoOverlappingComponentMeasure(state); - state.currentReactComponentMeasure = { - componentName, - timestamp: startTime, - duration: 0, - type: 'passive-effect-unmount', - warning: null - }; - } else if (name === '--component-passive-effect-unmount-stop') { - assertCurrentComponentMeasureType(state, 'passive-effect-unmount'); - - if (state.currentReactComponentMeasure !== null) { - const componentMeasure = state.currentReactComponentMeasure; - componentMeasure.duration = startTime - componentMeasure.timestamp; - state.currentReactComponentMeasure = null; - currentProfilerData.componentMeasures.push(componentMeasure); - } - } -} - -function preprocessFlamechart(rawData) { - let parsedData; - - try { - parsedData = Object(library["importFromChromeTimeline"])(rawData, 'react-devtools'); - } catch (error) { - // Assume any Speedscope errors are caused by bad profiles - const errorToRethrow = new InvalidProfileError(error.message); - errorToRethrow.stack = error.stack; - throw errorToRethrow; - } - - const profile = parsedData.profiles[0]; // TODO: Choose the main CPU thread only - - const speedscopeFlamechart = new library["Flamechart"]({ - getTotalWeight: profile.getTotalWeight.bind(profile), - forEachCall: profile.forEachCall.bind(profile), - formatValue: profile.formatValue.bind(profile), - getColorBucketForFrame: () => 0 - }); - const flamechart = speedscopeFlamechart.getLayers().map(layer => layer.map(({ - start, - end, - node: { - frame: { - name, - file, - line, - col - } - } - }) => ({ - name, - timestamp: start / 1000, - duration: (end - start) / 1000, - scriptUrl: file, - locationLine: line, - locationColumn: col - }))); - return flamechart; -} - -function parseStackFrame(stackFrame) { - const error = new Error(); - error.stack = stackFrame; - const frames = error_stack_parser_default.a.parse(error); - return frames.length === 1 ? frames[0] : null; -} - -async function preprocessData(timeline) { - const flamechart = preprocessFlamechart(timeline); - const laneToReactMeasureMap = new Map(); - - for (let lane = 0; lane < REACT_TOTAL_NUM_LANES; lane++) { - laneToReactMeasureMap.set(lane, []); - } - - const profilerData = { - batchUIDToMeasuresMap: new Map(), - componentMeasures: [], - duration: 0, - flamechart, - internalModuleSourceToRanges: new Map(), - laneToLabelMap: new Map(), - laneToReactMeasureMap, - nativeEvents: [], - networkMeasures: [], - otherUserTimingMarks: [], - reactVersion: null, - schedulingEvents: [], - snapshots: [], - snapshotHeight: 0, - startTime: 0, - suspenseEvents: [], - thrownErrors: [] - }; // Sort `timeline`. JSON Array Format trace events need not be ordered. See: - // https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#heading=h.f2f0yd51wi15 - - timeline = timeline.filter(Boolean).sort((a, b) => a.ts > b.ts ? 1 : -1); // Events displayed in flamechart have timestamps relative to the profile - // event's startTime. Source: https://github.com/v8/v8/blob/44bd8fd7/src/inspector/js_protocol.json#L1486 - // - // We'll thus expect there to be a 'Profile' event; if there is not one, we - // can deduce that there are no flame chart events. As we expect React - // scheduling profiling user timing marks to be recorded together with browser - // flame chart events, we can futher deduce that the data is invalid and we - // don't bother finding React events. - - const indexOfProfileEvent = timeline.findIndex(event => event.name === 'Profile'); - - if (indexOfProfileEvent === -1) { - return profilerData; - } // Use Profile event's `startTime` as the start time to align with flame chart. - // TODO: Remove assumption that there'll only be 1 'Profile' event. If this - // assumption does not hold, the chart may start at the wrong time. - - - profilerData.startTime = timeline[indexOfProfileEvent].args.data.startTime; - profilerData.duration = (timeline[timeline.length - 1].ts - profilerData.startTime) / 1000; - const state = { - asyncProcessingPromises: [], - batchUID: 0, - currentReactComponentMeasure: null, - internalModuleCurrentStackFrame: null, - internalModuleStackStringSet: new Set(), - measureStack: [], - nativeEventStack: [], - nextRenderShouldGenerateNewBatchID: true, - potentialLongEvents: [], - potentialLongNestedUpdate: null, - potentialLongNestedUpdates: [], - potentialSuspenseEventsOutsideOfTransition: [], - requestIdToNetworkMeasureMap: new Map(), - uidCounter: 0, - unresolvedSuspenseEvents: new Map() - }; - timeline.forEach(event => processTimelineEvent(event, profilerData, state)); - - if (profilerVersion === null) { - if (profilerData.schedulingEvents.length === 0 && profilerData.batchUIDToMeasuresMap.size === 0) { - // No profiler version could indicate data was logged using an older build of React, - // before an explicitly profiler version was included in the logging data. - // But it could also indicate that the website was either not using React, or using a production build. - // The easiest way to check for this case is to see if the data contains any scheduled updates or render work. - throw new InvalidProfileError('No React marks were found in the provided profile.' + ' Please provide profiling data from an React application running in development or profiling mode.'); - } - - throw new InvalidProfileError(`This version of profiling data is not supported by the current profiler.`); - } // Validate that all events and measures are complete - - - const { - measureStack - } = state; - - if (measureStack.length > 0) { - console.error('Incomplete events or measures', measureStack); - } // Check for warnings. - - - state.potentialLongEvents.forEach(([nativeEvent, batchUID]) => { - // See how long the subsequent batch of React work was. - // Ignore any work that was already started. - const [startTime, stopTime] = getBatchRange(batchUID, profilerData, nativeEvent.timestamp); - - if (stopTime - startTime > NATIVE_EVENT_DURATION_THRESHOLD) { - nativeEvent.warning = WARNING_STRINGS.LONG_EVENT_HANDLER; - } - }); - state.potentialLongNestedUpdates.forEach(([schedulingEvent, batchUID]) => { - // See how long the subsequent batch of React work was. - const [startTime, stopTime] = getBatchRange(batchUID, profilerData); - - if (stopTime - startTime > NESTED_UPDATE_DURATION_THRESHOLD) { - // Don't warn about transition updates scheduled during the commit phase. - // e.g. useTransition, useDeferredValue - // These are allowed to be long-running. - if (!schedulingEvent.lanes.some(lane => profilerData.laneToLabelMap.get(lane) === 'Transition')) { - schedulingEvent.warning = WARNING_STRINGS.NESTED_UPDATE; - } - } - }); - state.potentialSuspenseEventsOutsideOfTransition.forEach(([suspenseEvent, lanes]) => { - // HACK This is a bit gross but the numeric lane value might change between render versions. - if (!lanes.some(lane => profilerData.laneToLabelMap.get(lane) === 'Transition')) { - suspenseEvent.warning = WARNING_STRINGS.SUSPEND_DURING_UPDATE; - } - }); // Wait for any async processing to complete before returning. - // Since processing is done in a worker, async work must complete before data is serialized and returned. - - await Promise.all(state.asyncProcessingPromises); // Now that all images have been loaded, let's figure out the display size we're going to use for our thumbnails: - // both the ones rendered to the canvas and the ones shown on hover. - - if (profilerData.snapshots.length > 0) { - // NOTE We assume a static window size here, which is not necessarily true but should be for most cases. - // Regardless, Chrome also sets a single size/ratio and stick with it- so we'll do the same. - const snapshot = profilerData.snapshots[0]; - profilerData.snapshotHeight = Math.min(snapshot.height, SNAPSHOT_MAX_HEIGHT); - } - - return profilerData; -} -// EXTERNAL MODULE: /Users/kevin.le-seigle/WS/react/node_modules/nullthrows/nullthrows.js -var nullthrows = __webpack_require__(4); -var nullthrows_default = /*#__PURE__*/__webpack_require__.n(nullthrows); - -// CONCATENATED MODULE: ../react-devtools-timeline/src/import-worker/readInputData.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - -const readInputData = file => { - if (!file.name.endsWith('.json')) { - throw new InvalidProfileError('Invalid file type. Only JSON performance profiles are supported'); - } - - const fileReader = new FileReader(); - return new Promise((resolve, reject) => { - fileReader.onload = () => { - const result = nullthrows_default()(fileReader.result); - - if (typeof result === 'string') { - resolve(result); - } - - reject(new InvalidProfileError('Input file was not read as a string')); - }; - - fileReader.onerror = () => reject(fileReader.error); - - fileReader.readAsText(file); - }); -}; -// CONCATENATED MODULE: ../react-devtools-timeline/src/import-worker/importFile.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - -async function importFile(file) { - try { - const readFile = await readInputData(file); - const events = JSON.parse(readFile); - - if (events.length === 0) { - throw new InvalidProfileError('No profiling data found in file.'); - } - - const processedData = await preprocessData(events); - return { - status: 'SUCCESS', - processedData - }; - } catch (error) { - if (error instanceof InvalidProfileError) { - return { - status: 'INVALID_PROFILE_ERROR', - error - }; - } else { - return { - status: 'UNEXPECTED_ERROR', - error - }; - } - } -} -// CONCATENATED MODULE: /Users/kevin.le-seigle/WS/react/node_modules/workerize-loader/dist/rpc-worker-loader.js!/Users/kevin.le-seigle/WS/react/node_modules/babel-loader/lib??ref--2-1!/Users/kevin.le-seigle/WS/react/node_modules/babel-loader/lib??ref--3!../react-devtools-timeline/src/import-worker/importFile.worker.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -const importFile_worker_importFile = importFile; -addEventListener('message', function (e) {var _e$data = e.data,type = _e$data.type,method = _e$data.method,id = _e$data.id,params = _e$data.params,f,p;if (type === 'RPC' && method) {if (f = __webpack_exports__[method]) {p = Promise.resolve().then(function () {return f.apply(__webpack_exports__, params);});} else {p = Promise.reject('No such method');}p.then(function (result) {postMessage({type: 'RPC',id: id,result: result});}).catch(function (e) {var error = {message: e};if (e.stack) {error.message = e.message;error.stack = e.stack;error.name = e.name;}postMessage({type: 'RPC',id: id,error: error});});}});postMessage({type: 'RPC',method: 'ready'}); - -/***/ }) -/******/ ]); \ No newline at end of file diff --git a/tools/react-dev-tools/build/injectGlobalHook.js b/tools/react-dev-tools/build/injectGlobalHook.js deleted file mode 100644 index 541f428132b9..000000000000 --- a/tools/react-dev-tools/build/injectGlobalHook.js +++ /dev/null @@ -1,13227 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/build/"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 205); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ 0: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(64); -} else {} - -/***/ }), - -/***/ 1: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CHROME_WEBSTORE_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return INTERNAL_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LOCAL_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return __DEBUG__; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return __PERFORMANCE_PROFILE__; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return TREE_OPERATION_ADD; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return TREE_OPERATION_REMOVE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return TREE_OPERATION_REORDER_CHILDREN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return TREE_OPERATION_UPDATE_TREE_BASE_DURATION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return TREE_OPERATION_REMOVE_ROOT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return TREE_OPERATION_SET_SUBTREE_MODE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return PROFILING_FLAG_BASIC_SUPPORT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return PROFILING_FLAG_TIMELINE_SUPPORT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return LOCAL_STORAGE_DEFAULT_TAB_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return LOCAL_STORAGE_FILTER_PREFERENCES_KEY; }); -/* unused harmony export SESSION_STORAGE_LAST_SELECTION_KEY */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return LOCAL_STORAGE_OPEN_IN_EDITOR_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return SESSION_STORAGE_RELOAD_AND_PROFILE_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return PROFILER_EXPORT_VERSION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CHANGE_LOG_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return UNSUPPORTED_VERSION_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return REACT_DEVTOOLS_WORKPLACE_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return THEME_STYLES; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return COMFORTABLE_LINE_HEIGHT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return COMPACT_LINE_HEIGHT; }); -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi'; -const INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc'; -const LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf'; // Flip this flag to true to enable verbose console debug logging. - -const __DEBUG__ = false; // Flip this flag to true to enable performance.mark() and performance.measure() timings. - -const __PERFORMANCE_PROFILE__ = false; -const TREE_OPERATION_ADD = 1; -const TREE_OPERATION_REMOVE = 2; -const TREE_OPERATION_REORDER_CHILDREN = 3; -const TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4; -const TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5; -const TREE_OPERATION_REMOVE_ROOT = 6; -const TREE_OPERATION_SET_SUBTREE_MODE = 7; -const PROFILING_FLAG_BASIC_SUPPORT = 0b01; -const PROFILING_FLAG_TIMELINE_SUPPORT = 0b10; -const LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab'; -const LOCAL_STORAGE_FILTER_PREFERENCES_KEY = 'React::DevTools::componentFilters'; -const SESSION_STORAGE_LAST_SELECTION_KEY = 'React::DevTools::lastSelection'; -const LOCAL_STORAGE_OPEN_IN_EDITOR_URL = 'React::DevTools::openInEditorUrl'; -const LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY = 'React::DevTools::parseHookNames'; -const SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY = 'React::DevTools::recordChangeDescriptions'; -const SESSION_STORAGE_RELOAD_AND_PROFILE_KEY = 'React::DevTools::reloadAndProfile'; -const LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS = 'React::DevTools::breakOnConsoleErrors'; -const LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY = 'React::DevTools::appendComponentStack'; -const LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY = 'React::DevTools::showInlineWarningsAndErrors'; -const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY = 'React::DevTools::traceUpdatesEnabled'; -const LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE = 'React::DevTools::hideConsoleLogsInStrictMode'; -const PROFILER_EXPORT_VERSION = 5; -const CHANGE_LOG_URL = 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md'; -const UNSUPPORTED_VERSION_URL = 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back'; -const REACT_DEVTOOLS_WORKPLACE_URL = 'https://fburl.com/react-devtools-workplace-group'; -const THEME_STYLES = { - light: { - '--color-attribute-name': '#ef6632', - '--color-attribute-name-not-editable': '#23272f', - '--color-attribute-name-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-attribute-value': '#1a1aa6', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': '#1a1aa6', - '--color-background': '#ffffff', - '--color-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-background-inactive': '#e5e5e5', - '--color-background-invalid': '#fff0f0', - '--color-background-selected': '#0088fa', - '--color-button-background': '#ffffff', - '--color-button-background-focus': '#ededed', - '--color-button': '#5f6673', - '--color-button-disabled': '#cfd1d5', - '--color-button-active': '#0088fa', - '--color-button-focus': '#23272f', - '--color-button-hover': '#23272f', - '--color-border': '#eeeeee', - '--color-commit-did-not-render-fill': '#cfd1d5', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#cfd1d5', - '--color-commit-did-not-render-pattern-text': '#333333', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#6a51b2', - '--color-component-name-inverted': '#ffffff', - '--color-component-badge-background': 'rgba(0, 0, 0, 0.1)', - '--color-component-badge-background-inverted': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-count': '#777d88', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#ffffff', - '--color-console-error-background': '#fff0f0', - '--color-console-error-border': '#ffd6d6', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fe2e31', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#fffbe5', - '--color-console-warning-border': '#fff5c1', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#64460c', - '--color-context-background': 'rgba(0,0,0,.9)', - '--color-context-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-context-background-selected': '#178fb9', - '--color-context-border': '#3d424a', - '--color-context-text': '#ffffff', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#777d88', - '--color-dimmer': '#cfd1d5', - '--color-dimmest': '#eff0f1', - '--color-error-background': 'hsl(0, 100%, 97%)', - '--color-error-border': 'hsl(0, 100%, 92%)', - '--color-error-text': '#ff0000', - '--color-expand-collapse-toggle': '#777d88', - '--color-link': '#0000ff', - '--color-modal-background': 'rgba(255, 255, 255, 0.75)', - '--color-bridge-version-npm-background': '#eff0f1', - '--color-bridge-version-npm-text': '#000000', - '--color-bridge-version-number': '#0088fa', - '--color-primitive-hook-badge-background': '#e5e5e5', - '--color-primitive-hook-badge-text': '#5f6673', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#3578e5', - '--color-record-inactive': '#0088fa', - '--color-resize-bar': '#eeeeee', - '--color-resize-bar-active': '#dcdcdc', - '--color-resize-bar-border': '#d1d1d1', - '--color-resize-bar-dot': '#333333', - '--color-timeline-internal-module': '#d1d1d1', - '--color-timeline-internal-module-hover': '#c9c9c9', - '--color-timeline-internal-module-text': '#444', - '--color-timeline-native-event': '#ccc', - '--color-timeline-native-event-hover': '#aaa', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#f0e7d1', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#e3ba52', - '--color-timeline-priority-background': '#f6f6f6', - '--color-timeline-priority-border': '#eeeeee', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#d3e5f6', - '--color-timeline-react-idle-hover': '#c3d9ef', - '--color-timeline-react-render': '#9fc3f3', - '--color-timeline-react-render-hover': '#83afe9', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#c88ff0', - '--color-timeline-react-commit-hover': '#b281d6', - '--color-timeline-react-commit-text': '#3e2c4a', - '--color-timeline-react-layout-effects': '#b281d6', - '--color-timeline-react-layout-effects-hover': '#9d71bd', - '--color-timeline-react-layout-effects-text': '#3e2c4a', - '--color-timeline-react-passive-effects': '#b281d6', - '--color-timeline-react-passive-effects-hover': '#9d71bd', - '--color-timeline-react-passive-effects-text': '#3e2c4a', - '--color-timeline-react-schedule': '#9fc3f3', - '--color-timeline-react-schedule-hover': '#2683E2', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#ffdf37', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#ee1638', - '--color-timeline-thrown-error-hover': '#da1030', - '--color-timeline-text-color': '#000000', - '--color-timeline-text-dim-color': '#ccc', - '--color-timeline-react-work-border': '#eeeeee', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(0, 136, 250, 0.1)', - '--color-selected-tree-highlight-inactive': 'rgba(0, 0, 0, 0.05)', - '--color-scroll-caret': 'rgba(150, 150, 150, 0.5)', - '--color-tab-selected-border': '#0088fa', - '--color-text': '#000000', - '--color-text-invalid': '#ff0000', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#0088fa', - '--color-toggle-background-off': '#cfd1d5', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#fb3655', - '--color-warning-background-hover': '#f82042', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#fd4d69', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#c2c2c2', - '--color-scroll-track': '#fafafa', - '--color-tooltip-background': 'rgba(0, 0, 0, 0.9)', - '--color-tooltip-text': '#ffffff' - }, - dark: { - '--color-attribute-name': '#9d87d2', - '--color-attribute-name-not-editable': '#ededed', - '--color-attribute-name-inverted': '#282828', - '--color-attribute-value': '#cedae0', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': 'yellow', - '--color-background': '#282c34', - '--color-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-background-inactive': '#3d424a', - '--color-background-invalid': '#5c0000', - '--color-background-selected': '#178fb9', - '--color-button-background': '#282c34', - '--color-button-background-focus': '#3d424a', - '--color-button': '#afb3b9', - '--color-button-active': '#61dafb', - '--color-button-disabled': '#4f5766', - '--color-button-focus': '#a2e9fc', - '--color-button-hover': '#ededed', - '--color-border': '#3d424a', - '--color-commit-did-not-render-fill': '#777d88', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#666c77', - '--color-commit-did-not-render-pattern-text': '#ffffff', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#61dafb', - '--color-component-name-inverted': '#282828', - '--color-component-badge-background': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-background-inverted': 'rgba(0, 0, 0, 0.25)', - '--color-component-badge-count': '#8f949d', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#000000', - '--color-console-error-background': '#290000', - '--color-console-error-border': '#5c0000', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fc7f7f', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#332b00', - '--color-console-warning-border': '#665500', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#f5f2ed', - '--color-context-background': 'rgba(255,255,255,.95)', - '--color-context-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-context-background-selected': '#0088fa', - '--color-context-border': '#eeeeee', - '--color-context-text': '#000000', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#8f949d', - '--color-dimmer': '#777d88', - '--color-dimmest': '#4f5766', - '--color-error-background': '#200', - '--color-error-border': '#900', - '--color-error-text': '#f55', - '--color-expand-collapse-toggle': '#8f949d', - '--color-link': '#61dafb', - '--color-modal-background': 'rgba(0, 0, 0, 0.75)', - '--color-bridge-version-npm-background': 'rgba(0, 0, 0, 0.25)', - '--color-bridge-version-npm-text': '#ffffff', - '--color-bridge-version-number': 'yellow', - '--color-primitive-hook-badge-background': 'rgba(0, 0, 0, 0.25)', - '--color-primitive-hook-badge-text': 'rgba(255, 255, 255, 0.7)', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#a2e9fc', - '--color-record-inactive': '#61dafb', - '--color-resize-bar': '#282c34', - '--color-resize-bar-active': '#31363f', - '--color-resize-bar-border': '#3d424a', - '--color-resize-bar-dot': '#cfd1d5', - '--color-timeline-internal-module': '#303542', - '--color-timeline-internal-module-hover': '#363b4a', - '--color-timeline-internal-module-text': '#7f8899', - '--color-timeline-native-event': '#b2b2b2', - '--color-timeline-native-event-hover': '#949494', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#e3dbc5', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#d6af4d', - '--color-timeline-priority-background': '#1d2129', - '--color-timeline-priority-border': '#282c34', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#3d485b', - '--color-timeline-react-idle-hover': '#465269', - '--color-timeline-react-render': '#2683E2', - '--color-timeline-react-render-hover': '#1a76d4', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#731fad', - '--color-timeline-react-commit-hover': '#611b94', - '--color-timeline-react-commit-text': '#e5c1ff', - '--color-timeline-react-layout-effects': '#611b94', - '--color-timeline-react-layout-effects-hover': '#51167a', - '--color-timeline-react-layout-effects-text': '#e5c1ff', - '--color-timeline-react-passive-effects': '#611b94', - '--color-timeline-react-passive-effects-hover': '#51167a', - '--color-timeline-react-passive-effects-text': '#e5c1ff', - '--color-timeline-react-schedule': '#2683E2', - '--color-timeline-react-schedule-hover': '#1a76d4', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#e4c00f', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#fb3655', - '--color-timeline-thrown-error-hover': '#f82042', - '--color-timeline-text-color': '#282c34', - '--color-timeline-text-dim-color': '#555b66', - '--color-timeline-react-work-border': '#3d424a', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(23, 143, 185, 0.15)', - '--color-selected-tree-highlight-inactive': 'rgba(255, 255, 255, 0.05)', - '--color-scroll-caret': '#4f5766', - '--color-shadow': 'rgba(0, 0, 0, 0.5)', - '--color-tab-selected-border': '#178fb9', - '--color-text': '#ffffff', - '--color-text-invalid': '#ff8080', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#178fb9', - '--color-toggle-background-off': '#777d88', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#ee1638', - '--color-warning-background-hover': '#da1030', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#ee1638', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#afb3b9', - '--color-scroll-track': '#313640', - '--color-tooltip-background': 'rgba(255, 255, 255, 0.95)', - '--color-tooltip-text': '#000000' - }, - compact: { - '--font-size-monospace-small': '9px', - '--font-size-monospace-normal': '11px', - '--font-size-monospace-large': '15px', - '--font-size-sans-small': '10px', - '--font-size-sans-normal': '12px', - '--font-size-sans-large': '14px', - '--line-height-data': '18px' - }, - comfortable: { - '--font-size-monospace-small': '10px', - '--font-size-monospace-normal': '13px', - '--font-size-monospace-large': '17px', - '--font-size-sans-small': '12px', - '--font-size-sans-normal': '14px', - '--font-size-sans-large': '16px', - '--line-height-data': '22px' - } -}; // HACK -// -// Sometimes the inline target is rendered before root styles are applied, -// which would result in e.g. NaN itemSize being passed to react-window list. - -const COMFORTABLE_LINE_HEIGHT = parseInt(THEME_STYLES.comfortable['--line-height-data'], 10); -const COMPACT_LINE_HEIGHT = parseInt(THEME_STYLES.compact['--line-height-data'], 10); - - -/***/ }), - -/***/ 10: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return meta; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return dehydrate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return fillInPath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return hydrate; }); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -const meta = { - inspectable: Symbol('inspectable'), - inspected: Symbol('inspected'), - name: Symbol('name'), - preview_long: Symbol('preview_long'), - preview_short: Symbol('preview_short'), - readonly: Symbol('readonly'), - size: Symbol('size'), - type: Symbol('type'), - unserializable: Symbol('unserializable') -}; -// This threshold determines the depth at which the bridge "dehydrates" nested data. -// Dehydration means that we don't serialize the data for e.g. postMessage or stringify, -// unless the frontend explicitly requests it (e.g. a user clicks to expand a props object). -// -// Reducing this threshold will improve the speed of initial component inspection, -// but may decrease the responsiveness of expanding objects/arrays to inspect further. -const LEVEL_THRESHOLD = 2; -/** - * Generate the dehydrated metadata for complex object instances - */ - -function createDehydrated(type, inspectable, data, cleaned, path) { - cleaned.push(path); - const dehydrated = { - inspectable, - type, - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name - }; - - if (type === 'array' || type === 'typed_array') { - dehydrated.size = data.length; - } else if (type === 'object') { - dehydrated.size = Object.keys(data).length; - } - - if (type === 'iterator' || type === 'typed_array') { - dehydrated.readonly = true; - } - - return dehydrated; -} -/** - * Strip out complex data (instances, functions, and data nested > LEVEL_THRESHOLD levels deep). - * The paths of the stripped out objects are appended to the `cleaned` list. - * On the other side of the barrier, the cleaned list is used to "re-hydrate" the cleaned representation into - * an object with symbols as attributes, so that a sanitized object can be distinguished from a normal object. - * - * Input: {"some": {"attr": fn()}, "other": AnInstance} - * Output: { - * "some": { - * "attr": {"name": the fn.name, type: "function"} - * }, - * "other": { - * "name": "AnInstance", - * "type": "object", - * }, - * } - * and cleaned = [["some", "attr"], ["other"]] - */ - - -function dehydrate(data, cleaned, unserializable, path, isPathAllowed, level = 0) { - const type = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getDataType */ "f"])(data); - let isPathAllowedCheck; - - switch (type) { - case 'html_element': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: data.tagName, - type - }; - - case 'function': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: typeof data.name === 'function' || !data.name ? 'function' : data.name, - type - }; - - case 'string': - isPathAllowedCheck = isPathAllowed(path); - - if (isPathAllowedCheck) { - return data; - } else { - return data.length <= 500 ? data : data.slice(0, 500) + '...'; - } - - case 'bigint': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: data.toString(), - type - }; - - case 'symbol': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: data.toString(), - type - }; - // React Elements aren't very inspector-friendly, - // and often contain private fields or circular references. - - case 'react_element': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getDisplayNameForReactElement */ "j"])(data) || 'Unknown', - type - }; - // ArrayBuffers error if you try to inspect them. - - case 'array_buffer': - case 'data_view': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: type === 'data_view' ? 'DataView' : 'ArrayBuffer', - size: data.byteLength, - type - }; - - case 'array': - isPathAllowedCheck = isPathAllowed(path); - - if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { - return createDehydrated(type, true, data, cleaned, path); - } - - return data.map((item, i) => dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1)); - - case 'html_all_collection': - case 'typed_array': - case 'iterator': - isPathAllowedCheck = isPathAllowed(path); - - if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { - return createDehydrated(type, true, data, cleaned, path); - } else { - const unserializableValue = { - unserializable: true, - type: type, - readonly: true, - size: type === 'typed_array' ? data.length : undefined, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name - }; // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - - Array.from(data).forEach((item, i) => unserializableValue[i] = dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1)); - unserializable.push(path); - return unserializableValue; - } - - case 'opaque_iterator': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: data[Symbol.toStringTag], - type - }; - - case 'date': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: data.toString(), - type - }; - - case 'regexp': - cleaned.push(path); - return { - inspectable: false, - preview_short: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, false), - preview_long: Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* formatDataForPreview */ "b"])(data, true), - name: data.toString(), - type - }; - - case 'object': - isPathAllowedCheck = isPathAllowed(path); - - if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { - return createDehydrated(type, true, data, cleaned, path); - } else { - const object = {}; - Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getAllEnumerableKeys */ "c"])(data).forEach(key => { - const name = key.toString(); - object[name] = dehydrate(data[key], cleaned, unserializable, path.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1); - }); - return object; - } - - case 'infinity': - case 'nan': - case 'undefined': - // Some values are lossy when sent through a WebSocket. - // We dehydrate+rehydrate them to preserve their type. - cleaned.push(path); - return { - type - }; - - default: - return data; - } -} -function fillInPath(object, data, path, value) { - const target = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */ "l"])(object, path); - - if (target != null) { - if (!target[meta.unserializable]) { - delete target[meta.inspectable]; - delete target[meta.inspected]; - delete target[meta.name]; - delete target[meta.preview_long]; - delete target[meta.preview_short]; - delete target[meta.readonly]; - delete target[meta.size]; - delete target[meta.type]; - } - } - - if (value !== null && data.unserializable.length > 0) { - const unserializablePath = data.unserializable[0]; - let isMatch = unserializablePath.length === path.length; - - for (let i = 0; i < path.length; i++) { - if (path[i] !== unserializablePath[i]) { - isMatch = false; - break; - } - } - - if (isMatch) { - upgradeUnserializable(value, value); - } - } - - Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* setInObject */ "t"])(object, path, value); -} -function hydrate(object, cleaned, unserializable) { - cleaned.forEach(path => { - const length = path.length; - const last = path[length - 1]; - const parent = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */ "l"])(object, path.slice(0, length - 1)); - - if (!parent || !parent.hasOwnProperty(last)) { - return; - } - - const value = parent[last]; - - if (!value) { - return; - } else if (value.type === 'infinity') { - parent[last] = Infinity; - } else if (value.type === 'nan') { - parent[last] = NaN; - } else if (value.type === 'undefined') { - parent[last] = undefined; - } else { - // Replace the string keys with Symbols so they're non-enumerable. - const replaced = {}; - replaced[meta.inspectable] = !!value.inspectable; - replaced[meta.inspected] = false; - replaced[meta.name] = value.name; - replaced[meta.preview_long] = value.preview_long; - replaced[meta.preview_short] = value.preview_short; - replaced[meta.size] = value.size; - replaced[meta.readonly] = !!value.readonly; - replaced[meta.type] = value.type; - parent[last] = replaced; - } - }); - unserializable.forEach(path => { - const length = path.length; - const last = path[length - 1]; - const parent = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getInObject */ "l"])(object, path.slice(0, length - 1)); - - if (!parent || !parent.hasOwnProperty(last)) { - return; - } - - const node = parent[last]; - const replacement = { ...node - }; - upgradeUnserializable(replacement, node); - parent[last] = replacement; - }); - return object; -} - -function upgradeUnserializable(destination, source) { - Object.defineProperties(destination, { - [meta.inspected]: { - configurable: true, - enumerable: false, - value: !!source.inspected - }, - [meta.name]: { - configurable: true, - enumerable: false, - value: source.name - }, - [meta.preview_long]: { - configurable: true, - enumerable: false, - value: source.preview_long - }, - [meta.preview_short]: { - configurable: true, - enumerable: false, - value: source.preview_short - }, - [meta.size]: { - configurable: true, - enumerable: false, - value: source.size - }, - [meta.readonly]: { - configurable: true, - enumerable: false, - value: !!source.readonly - }, - [meta.type]: { - configurable: true, - enumerable: false, - value: source.type - }, - [meta.unserializable]: { - configurable: true, - enumerable: false, - value: !!source.unserializable - } - }); - delete destination.inspected; - delete destination.name; - delete destination.preview_long; - delete destination.preview_short; - delete destination.size; - delete destination.readonly; - delete destination.type; - delete destination.unserializable; -} - -/***/ }), - -/***/ 11: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(61); -} else {} - -/***/ }), - -/***/ 13: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return consoleManagedByDevToolsDuringStrictMode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return enableLogger; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return enableNamedHooksFeature; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return enableProfilerChangedHookIndices; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return enableStyleXFeatures; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isInternalFacebookBuild; }); -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -/************************************************************************ - * This file is forked between different DevTools implementations. - * It should never be imported directly! - * It should always be imported from "react-devtools-feature-flags". - ************************************************************************/ -const consoleManagedByDevToolsDuringStrictMode = true; -const enableLogger = false; -const enableNamedHooksFeature = true; -const enableProfilerChangedHookIndices = true; -const enableStyleXFeatures = false; -const isInternalFacebookBuild = false; -/************************************************************************ - * Do not edit the code below. - * It ensures this fork exports the same types as the default flags file. - ************************************************************************/ - -// eslint-disable-next-line no-unused-expressions -null; - -/***/ }), - -/***/ 14: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cleanForBridge; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return copyToClipboard; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return copyWithDelete; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return copyWithRename; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return copyWithSet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getEffectDurations; }); -/* unused harmony export serializeToString */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return format; }); -/* unused harmony export isSynchronousXHRSupported */ -/* harmony import */ var clipboard_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17); -/* harmony import */ var clipboard_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(clipboard_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _hydration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10); -/* harmony import */ var shared_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22); -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -function cleanForBridge(data, isPathAllowed, path = []) { - if (data !== null) { - const cleanedPaths = []; - const unserializablePaths = []; - const cleanedData = Object(_hydration__WEBPACK_IMPORTED_MODULE_1__[/* dehydrate */ "a"])(data, cleanedPaths, unserializablePaths, path, isPathAllowed); - return { - data: cleanedData, - cleaned: cleanedPaths, - unserializable: unserializablePaths - }; - } else { - return null; - } -} -function copyToClipboard(value) { - const safeToCopy = serializeToString(value); - const text = safeToCopy === undefined ? 'undefined' : safeToCopy; - const { - clipboardCopyText - } = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; // On Firefox navigator.clipboard.writeText has to be called from - // the content script js code (because it requires the clipboardWrite - // permission to be allowed out of a "user handling" callback), - // clipboardCopyText is an helper injected into the page from. - // injectGlobalHook. - - if (typeof clipboardCopyText === 'function') { - clipboardCopyText(text).catch(err => {}); - } else { - Object(clipboard_js__WEBPACK_IMPORTED_MODULE_0__["copy"])(text); - } -} -function copyWithDelete(obj, path, index = 0) { - const key = path[index]; - const updated = Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(obj) ? obj.slice() : { ...obj - }; - - if (index + 1 === path.length) { - if (Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(updated)) { - updated.splice(key, 1); - } else { - delete updated[key]; - } - } else { - // $FlowFixMe number or string is fine here - updated[key] = copyWithDelete(obj[key], path, index + 1); - } - - return updated; -} // This function expects paths to be the same except for the final value. -// e.g. ['path', 'to', 'foo'] and ['path', 'to', 'bar'] - -function copyWithRename(obj, oldPath, newPath, index = 0) { - const oldKey = oldPath[index]; - const updated = Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(obj) ? obj.slice() : { ...obj - }; - - if (index + 1 === oldPath.length) { - const newKey = newPath[index]; // $FlowFixMe number or string is fine here - - updated[newKey] = updated[oldKey]; - - if (Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(updated)) { - updated.splice(oldKey, 1); - } else { - delete updated[oldKey]; - } - } else { - // $FlowFixMe number or string is fine here - updated[oldKey] = copyWithRename(obj[oldKey], oldPath, newPath, index + 1); - } - - return updated; -} -function copyWithSet(obj, path, value, index = 0) { - if (index >= path.length) { - return value; - } - - const key = path[index]; - const updated = Object(shared_isArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(obj) ? obj.slice() : { ...obj - }; // $FlowFixMe number or string is fine here - - updated[key] = copyWithSet(obj[key], path, value, index + 1); - return updated; -} -function getEffectDurations(root) { - // Profiling durations are only available for certain builds. - // If available, they'll be stored on the HostRoot. - let effectDuration = null; - let passiveEffectDuration = null; - const hostRoot = root.current; - - if (hostRoot != null) { - const stateNode = hostRoot.stateNode; - - if (stateNode != null) { - effectDuration = stateNode.effectDuration != null ? stateNode.effectDuration : null; - passiveEffectDuration = stateNode.passiveEffectDuration != null ? stateNode.passiveEffectDuration : null; - } - } - - return { - effectDuration, - passiveEffectDuration - }; -} -function serializeToString(data) { - const cache = new Set(); // Use a custom replacer function to protect against circular references. - - return JSON.stringify(data, (key, value) => { - if (typeof value === 'object' && value !== null) { - if (cache.has(value)) { - return; - } - - cache.add(value); - } // $FlowFixMe - - - if (typeof value === 'bigint') { - return value.toString() + 'n'; - } - - return value; - }); -} // based on https://github.com/tmpfs/format-util/blob/0e62d430efb0a1c51448709abd3e2406c14d8401/format.js#L1 -// based on https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions -// Implements s, d, i and f placeholders -// NOTE: KEEP IN SYNC with src/hook.js - -function format(maybeMessage, ...inputArgs) { - const args = inputArgs.slice(); - let formatted = String(maybeMessage); // If the first argument is a string, check for substitutions. - - if (typeof maybeMessage === 'string') { - if (args.length) { - const REGEXP = /(%?)(%([jds]))/g; - formatted = formatted.replace(REGEXP, (match, escaped, ptn, flag) => { - let arg = args.shift(); - - switch (flag) { - case 's': - arg += ''; - break; - - case 'd': - case 'i': - arg = parseInt(arg, 10).toString(); - break; - - case 'f': - arg = parseFloat(arg).toString(); - break; - } - - if (!escaped) { - return arg; - } - - args.unshift(arg); - return match; - }); - } - } // Arguments that remain after formatting. - - - if (args.length) { - for (let i = 0; i < args.length; i++) { - formatted += ' ' + String(args[i]); - } - } // Update escaped %% values. - - - formatted = formatted.replace(/%{2,2}/g, '%'); - return String(formatted); -} -function isSynchronousXHRSupported() { - return !!(window.document && window.document.featurePolicy && window.document.featurePolicy.allowsFeature('sync-xhr')); -} - -/***/ }), - -/***/ 16: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const isArray = Array.isArray; -/* harmony default export */ __webpack_exports__["a"] = (isArray); - -/***/ }), - -/***/ 17: -/***/ (function(module, exports, __webpack_require__) { - -// Import support https://stackoverflow.com/questions/13673346/supporting-both-commonjs-and-amd -(function (name, definition) { - if (true) { - module.exports = definition(); - } else {} -})("clipboard", function () { - if (typeof document === 'undefined' || !document.addEventListener) { - return null; - } - - var clipboard = {}; - - clipboard.copy = function () { - var _intercept = false; - var _data = null; // Map from data type (e.g. "text/html") to value. - - var _bogusSelection = false; - - function cleanup() { - _intercept = false; - _data = null; - - if (_bogusSelection) { - window.getSelection().removeAllRanges(); - } - - _bogusSelection = false; - } - - document.addEventListener("copy", function (e) { - if (_intercept) { - for (var key in _data) { - e.clipboardData.setData(key, _data[key]); - } - - e.preventDefault(); - } - }); // Workaround for Safari: https://bugs.webkit.org/show_bug.cgi?id=156529 - - function bogusSelect() { - var sel = document.getSelection(); // If "nothing" is selected... - - if (!document.queryCommandEnabled("copy") && sel.isCollapsed) { - // ... temporarily select the entire body. - // - // We select the entire body because: - // - it's guaranteed to exist, - // - it works (unlike, say, document.head, or phantom element that is - // not inserted into the DOM), - // - it doesn't seem to flicker (due to the synchronous copy event), and - // - it avoids modifying the DOM (can trigger mutation observers). - // - // Because we can't do proper feature detection (we already checked - // document.queryCommandEnabled("copy") , which actually gives a false - // negative for Blink when nothing is selected) and UA sniffing is not - // reliable (a lot of UA strings contain "Safari"), this will also - // happen for some browsers other than Safari. :-() - var range = document.createRange(); - range.selectNodeContents(document.body); - sel.removeAllRanges(); - sel.addRange(range); - _bogusSelection = true; - } - } - - ; - return function (data) { - return new Promise(function (resolve, reject) { - _intercept = true; - - if (typeof data === "string") { - _data = { - "text/plain": data - }; - } else if (data instanceof Node) { - _data = { - "text/html": new XMLSerializer().serializeToString(data) - }; - } else if (data instanceof Object) { - _data = data; - } else { - reject("Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings."); - } - - function triggerCopy(tryBogusSelect) { - try { - if (document.execCommand("copy")) { - // document.execCommand is synchronous: http://www.w3.org/TR/2015/WD-clipboard-apis-20150421/#integration-with-rich-text-editing-apis - // So we can call resolve() back here. - cleanup(); - resolve(); - } else { - if (!tryBogusSelect) { - bogusSelect(); - triggerCopy(true); - } else { - cleanup(); - throw new Error("Unable to copy. Perhaps it's not available in your browser?"); - } - } - } catch (e) { - cleanup(); - reject(e); - } - } - - triggerCopy(false); - }); - }; - }(); - - clipboard.paste = function () { - var _intercept = false; - - var _resolve; - - var _dataType; - - document.addEventListener("paste", function (e) { - if (_intercept) { - _intercept = false; - e.preventDefault(); - var resolve = _resolve; - _resolve = null; - resolve(e.clipboardData.getData(_dataType)); - } - }); - return function (dataType) { - return new Promise(function (resolve, reject) { - _intercept = true; - _resolve = resolve; - _dataType = dataType || "text/plain"; - - try { - if (!document.execCommand("paste")) { - _intercept = false; - reject(new Error("Unable to paste. Pasting only works in Internet Explorer at the moment.")); - } - } catch (e) { - _intercept = false; - reject(new Error(e)); - } - }); - }; - }(); // Handle IE behaviour. - - - if (typeof ClipboardEvent === "undefined" && typeof window.clipboardData !== "undefined" && typeof window.clipboardData.setData !== "undefined") { - /*! promise-polyfill 2.0.1 */ - (function (a) { - function b(a, b) { - return function () { - a.apply(b, arguments); - }; - } - - function c(a) { - if ("object" != typeof this) throw new TypeError("Promises must be constructed via new"); - if ("function" != typeof a) throw new TypeError("not a function"); - this._state = null, this._value = null, this._deferreds = [], i(a, b(e, this), b(f, this)); - } - - function d(a) { - var b = this; - return null === this._state ? void this._deferreds.push(a) : void j(function () { - var c = b._state ? a.onFulfilled : a.onRejected; - if (null === c) return void (b._state ? a.resolve : a.reject)(b._value); - var d; - - try { - d = c(b._value); - } catch (e) { - return void a.reject(e); - } - - a.resolve(d); - }); - } - - function e(a) { - try { - if (a === this) throw new TypeError("A promise cannot be resolved with itself."); - - if (a && ("object" == typeof a || "function" == typeof a)) { - var c = a.then; - if ("function" == typeof c) return void i(b(c, a), b(e, this), b(f, this)); - } - - this._state = !0, this._value = a, g.call(this); - } catch (d) { - f.call(this, d); - } - } - - function f(a) { - this._state = !1, this._value = a, g.call(this); - } - - function g() { - for (var a = 0, b = this._deferreds.length; b > a; a++) d.call(this, this._deferreds[a]); - - this._deferreds = null; - } - - function h(a, b, c, d) { - this.onFulfilled = "function" == typeof a ? a : null, this.onRejected = "function" == typeof b ? b : null, this.resolve = c, this.reject = d; - } - - function i(a, b, c) { - var d = !1; - - try { - a(function (a) { - d || (d = !0, b(a)); - }, function (a) { - d || (d = !0, c(a)); - }); - } catch (e) { - if (d) return; - d = !0, c(e); - } - } - - var j = c.immediateFn || "function" == typeof setImmediate && setImmediate || function (a) { - setTimeout(a, 1); - }, - k = Array.isArray || function (a) { - return "[object Array]" === Object.prototype.toString.call(a); - }; - - c.prototype["catch"] = function (a) { - return this.then(null, a); - }, c.prototype.then = function (a, b) { - var e = this; - return new c(function (c, f) { - d.call(e, new h(a, b, c, f)); - }); - }, c.all = function () { - var a = Array.prototype.slice.call(1 === arguments.length && k(arguments[0]) ? arguments[0] : arguments); - return new c(function (b, c) { - function d(f, g) { - try { - if (g && ("object" == typeof g || "function" == typeof g)) { - var h = g.then; - if ("function" == typeof h) return void h.call(g, function (a) { - d(f, a); - }, c); - } - - a[f] = g, 0 === --e && b(a); - } catch (i) { - c(i); - } - } - - if (0 === a.length) return b([]); - - for (var e = a.length, f = 0; f < a.length; f++) d(f, a[f]); - }); - }, c.resolve = function (a) { - return a && "object" == typeof a && a.constructor === c ? a : new c(function (b) { - b(a); - }); - }, c.reject = function (a) { - return new c(function (b, c) { - c(a); - }); - }, c.race = function (a) { - return new c(function (b, c) { - for (var d = 0, e = a.length; e > d; d++) a[d].then(b, c); - }); - }, true && module.exports ? module.exports = c : a.Promise || (a.Promise = c); - })(this); - - clipboard.copy = function (data) { - return new Promise(function (resolve, reject) { - // IE supports string and URL types: https://msdn.microsoft.com/en-us/library/ms536744(v=vs.85).aspx - // We only support the string type for now. - if (typeof data !== "string" && !("text/plain" in data)) { - throw new Error("You must provide a text/plain type."); - } - - var strData = typeof data === "string" ? data : data["text/plain"]; - var copySucceeded = window.clipboardData.setData("Text", strData); - - if (copySucceeded) { - resolve(); - } else { - reject(new Error("Copying was rejected.")); - } - }); - }; - - clipboard.paste = function () { - return new Promise(function (resolve, reject) { - var strData = window.clipboardData.getData("Text"); - - if (strData) { - resolve(strData); - } else { - // The user rejected the paste request. - reject(new Error("Pasting was rejected.")); - } - }); - }; - } - - return clipboard; -}); - -/***/ }), - -/***/ 2: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ElementTypeClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return ElementTypeContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return ElementTypeFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return ElementTypeForwardRef; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return ElementTypeHostComponent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return ElementTypeMemo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return ElementTypeOtherOrUnknown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return ElementTypeProfiler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return ElementTypeRoot; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return ElementTypeSuspense; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return ElementTypeSuspenseList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return ElementTypeTracingMarker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ComponentFilterElementType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComponentFilterDisplayName; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ComponentFilterLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ComponentFilterHOC; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return StrictMode; }); -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// WARNING -// The values below are referenced by ComponentFilters (which are saved via localStorage). -// Do not change them or it will break previously saved user customizations. -// If new element types are added, use new numbers rather than re-ordering existing ones. -// -// Changing these types is also a backwards breaking change for the standalone shell, -// since the frontend and backend must share the same values- -// and the backend is embedded in certain environments (like React Native). -const ElementTypeClass = 1; -const ElementTypeContext = 2; -const ElementTypeFunction = 5; -const ElementTypeForwardRef = 6; -const ElementTypeHostComponent = 7; -const ElementTypeMemo = 8; -const ElementTypeOtherOrUnknown = 9; -const ElementTypeProfiler = 10; -const ElementTypeRoot = 11; -const ElementTypeSuspense = 12; -const ElementTypeSuspenseList = 13; -const ElementTypeTracingMarker = 14; // Different types of elements displayed in the Elements tree. -// These types may be used to visually distinguish types, -// or to enable/disable certain functionality. - -// WARNING -// The values below are referenced by ComponentFilters (which are saved via localStorage). -// Do not change them or it will break previously saved user customizations. -// If new filter types are added, use new numbers rather than re-ordering existing ones. -const ComponentFilterElementType = 1; -const ComponentFilterDisplayName = 2; -const ComponentFilterLocation = 3; -const ComponentFilterHOC = 4; -const StrictMode = 1; - -/***/ }), - -/***/ 205: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXTERNAL MODULE: /Users/kevin.le-seigle/WS/react/node_modules/nullthrows/nullthrows.js -var nullthrows = __webpack_require__(54); -var nullthrows_default = /*#__PURE__*/__webpack_require__.n(nullthrows); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/console.js -var backend_console = __webpack_require__(37); - -// CONCATENATED MODULE: ../react-devtools-shared/src/hook.js -/** - * Install the hook on window, which is an event emitter. - * Note because Chrome content scripts cannot directly modify the window object, - * we are evaling this function by inserting a script tag. - * That's why we have to inline the whole event emitter implementation, - * the string format implementation, and part of the console implementation here. - * - * - */ - -function installHook(target) { - if (target.hasOwnProperty('__REACT_DEVTOOLS_GLOBAL_HOOK__')) { - return null; - } - - let targetConsole = console; - let targetConsoleMethods = {}; - - for (const method in console) { - targetConsoleMethods[method] = console[method]; - } - - function dangerous_setTargetConsoleForTesting(targetConsoleForTesting) { - targetConsole = targetConsoleForTesting; - targetConsoleMethods = {}; - - for (const method in targetConsole) { - targetConsoleMethods[method] = console[method]; - } - } - - function detectReactBuildType(renderer) { - try { - if (typeof renderer.version === 'string') { - // React DOM Fiber (16+) - if (renderer.bundleType > 0) { - // This is not a production build. - // We are currently only using 0 (PROD) and 1 (DEV) - // but might add 2 (PROFILE) in the future. - return 'development'; - } // React 16 uses flat bundles. If we report the bundle as production - // version, it means we also minified and envified it ourselves. - - - return 'production'; // Note: There is still a risk that the CommonJS entry point has not - // been envified or uglified. In this case the user would have *both* - // development and production bundle, but only the prod one would run. - // This would be really bad. We have a separate check for this because - // it happens *outside* of the renderer injection. See `checkDCE` below. - } - - const toString = Function.prototype.toString; - - if (renderer.Mount && renderer.Mount._renderNewRootComponent) { - // React DOM Stack - const renderRootCode = toString.call(renderer.Mount._renderNewRootComponent); // Filter out bad results (if that is even possible): - - if (renderRootCode.indexOf('function') !== 0) { - // Hope for the best if we're not sure. - return 'production'; - } // Check for React DOM Stack < 15.1.0 in development. - // If it contains "storedMeasure" call, it's wrapped in ReactPerf (DEV only). - // This would be true even if it's minified, as method name still matches. - - - if (renderRootCode.indexOf('storedMeasure') !== -1) { - return 'development'; - } // For other versions (and configurations) it's not so easy. - // Let's quickly exclude proper production builds. - // If it contains a warning message, it's either a DEV build, - // or an PROD build without proper dead code elimination. - - - if (renderRootCode.indexOf('should be a pure function') !== -1) { - // Now how do we tell a DEV build from a bad PROD build? - // If we see NODE_ENV, we're going to assume this is a dev build - // because most likely it is referring to an empty shim. - if (renderRootCode.indexOf('NODE_ENV') !== -1) { - return 'development'; - } // If we see "development", we're dealing with an envified DEV build - // (such as the official React DEV UMD). - - - if (renderRootCode.indexOf('development') !== -1) { - return 'development'; - } // I've seen process.env.NODE_ENV !== 'production' being smartly - // replaced by `true` in DEV by Webpack. I don't know how that - // works but we can safely guard against it because `true` was - // never used in the function source since it was written. - - - if (renderRootCode.indexOf('true') !== -1) { - return 'development'; - } // By now either it is a production build that has not been minified, - // or (worse) this is a minified development build using non-standard - // environment (e.g. "staging"). We're going to look at whether - // the function argument name is mangled: - - - if ( // 0.13 to 15 - renderRootCode.indexOf('nextElement') !== -1 || // 0.12 - renderRootCode.indexOf('nextComponent') !== -1) { - // We can't be certain whether this is a development build or not, - // but it is definitely unminified. - return 'unminified'; - } else { - // This is likely a minified development build. - return 'development'; - } - } // By now we know that it's envified and dead code elimination worked, - // but what if it's still not minified? (Is this even possible?) - // Let's check matches for the first argument name. - - - if ( // 0.13 to 15 - renderRootCode.indexOf('nextElement') !== -1 || // 0.12 - renderRootCode.indexOf('nextComponent') !== -1) { - return 'unminified'; - } // Seems like we're using the production version. - // However, the branch above is Stack-only so this is 15 or earlier. - - - return 'outdated'; - } - } catch (err) {// Weird environments may exist. - // This code needs a higher fault tolerance - // because it runs even with closed DevTools. - // TODO: should we catch errors in all injected code, and not just this part? - } - - return 'production'; - } - - function checkDCE(fn) { - // This runs for production versions of React. - // Needs to be super safe. - try { - const toString = Function.prototype.toString; - const code = toString.call(fn); // This is a string embedded in the passed function under DEV-only - // condition. However the function executes only in PROD. Therefore, - // if we see it, dead code elimination did not work. - - if (code.indexOf('^_^') > -1) { - // Remember to report during next injection. - hasDetectedBadDCE = true; // Bonus: throw an exception hoping that it gets picked up by a reporting system. - // Not synchronously so that it doesn't break the calling code. - - setTimeout(function () { - throw new Error('React is running in production mode, but dead code ' + 'elimination has not been applied. Read how to correctly ' + 'configure React for production: ' + 'https://reactjs.org/link/perf-use-production-build'); - }); - } - } catch (err) {} - } // NOTE: KEEP IN SYNC with src/backend/utils.js - - - function format(maybeMessage, ...inputArgs) { - const args = inputArgs.slice(); // Symbols cannot be concatenated with Strings. - - let formatted = String(maybeMessage); // If the first argument is a string, check for substitutions. - - if (typeof maybeMessage === 'string') { - if (args.length) { - const REGEXP = /(%?)(%([jds]))/g; - formatted = formatted.replace(REGEXP, (match, escaped, ptn, flag) => { - let arg = args.shift(); - - switch (flag) { - case 's': - arg += ''; - break; - - case 'd': - case 'i': - arg = parseInt(arg, 10).toString(); - break; - - case 'f': - arg = parseFloat(arg).toString(); - break; - } - - if (!escaped) { - return arg; - } - - args.unshift(arg); - return match; - }); - } - } // Arguments that remain after formatting. - - - if (args.length) { - for (let i = 0; i < args.length; i++) { - formatted += ' ' + String(args[i]); - } - } // Update escaped %% values. - - - formatted = formatted.replace(/%{2,2}/g, '%'); - return String(formatted); - } - - let unpatchFn = null; // NOTE: KEEP IN SYNC with src/backend/console.js:patchForStrictMode - // This function hides or dims console logs during the initial double renderer - // in Strict Mode. We need this function because during initial render, - // React and DevTools are connecting and the renderer interface isn't avaiable - // and we want to be able to have consistent logging behavior for double logs - // during the initial renderer. - - function patchConsoleForInitialRenderInStrictMode({ - hideConsoleLogsInStrictMode, - browserTheme - }) { - const overrideConsoleMethods = ['error', 'trace', 'warn', 'log']; - - if (unpatchFn !== null) { - // Don't patch twice. - return; - } - - const originalConsoleMethods = {}; - - unpatchFn = () => { - for (const method in originalConsoleMethods) { - try { - // $FlowFixMe property error|warn is not writable. - targetConsole[method] = originalConsoleMethods[method]; - } catch (error) {} - } - }; - - overrideConsoleMethods.forEach(method => { - try { - const originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ : targetConsole[method]; - - const overrideMethod = (...args) => { - if (!hideConsoleLogsInStrictMode) { - // Dim the text color of the double logs if we're not - // hiding them. - let color; - - switch (method) { - case 'warn': - color = browserTheme === 'light' ? "rgba(250, 180, 50, 0.75)" : "rgba(250, 180, 50, 0.5)"; - break; - - case 'error': - color = browserTheme === 'light' ? "rgba(250, 123, 130, 0.75)" : "rgba(250, 123, 130, 0.5)"; - break; - - case 'log': - default: - color = browserTheme === 'light' ? "rgba(125, 125, 125, 0.75)" : "rgba(125, 125, 125, 0.5)"; - break; - } - - if (color) { - originalMethod(`%c${format(...args)}`, `color: ${color}`); - } else { - throw Error('Console color is not defined'); - } - } - }; - - overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod; - originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod; // $FlowFixMe property error|warn is not writable. - - targetConsole[method] = overrideMethod; - } catch (error) {} - }); - } // NOTE: KEEP IN SYNC with src/backend/console.js:unpatchForStrictMode - - - function unpatchConsoleForInitialRenderInStrictMode() { - if (unpatchFn !== null) { - unpatchFn(); - unpatchFn = null; - } - } - - let uidCounter = 0; - - function inject(renderer) { - const id = ++uidCounter; - renderers.set(id, renderer); - const reactBuildType = hasDetectedBadDCE ? 'deadcode' : detectReactBuildType(renderer); // Patching the console enables DevTools to do a few useful things: - // * Append component stacks to warnings and error messages - // * Disabling or marking logs during a double render in Strict Mode - // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber) - // - // For React Native, we intentionally patch early (during injection). - // This provides React Native developers with components stacks even if they don't run DevTools. - // - // This won't work for DOM though, since this entire file is eval'ed and inserted as a script tag. - // In that case, we'll only patch parts of the console that are needed during the first render - // and patch everything else later (when the frontend attaches). - // - // Don't patch in test environments because we don't want to interfere with Jest's own console overrides. - // - // Note that because this function is inlined, this conditional check must only use static booleans. - // Otherwise the extension will throw with an undefined error. - // (See comments in the try/catch below for more context on inlining.) - - if (false) {} // If we have just reloaded to profile, we need to inject the renderer interface before the app loads. - // Otherwise the renderer won't yet exist and we can skip this step. - - - const attach = target.__REACT_DEVTOOLS_ATTACH__; - - if (typeof attach === 'function') { - const rendererInterface = attach(hook, id, renderer, target); - hook.rendererInterfaces.set(id, rendererInterface); - } - - hook.emit('renderer', { - id, - renderer, - reactBuildType - }); - return id; - } - - let hasDetectedBadDCE = false; - - function sub(event, fn) { - hook.on(event, fn); - return () => hook.off(event, fn); - } - - function on(event, fn) { - if (!listeners[event]) { - listeners[event] = []; - } - - listeners[event].push(fn); - } - - function off(event, fn) { - if (!listeners[event]) { - return; - } - - const index = listeners[event].indexOf(fn); - - if (index !== -1) { - listeners[event].splice(index, 1); - } - - if (!listeners[event].length) { - delete listeners[event]; - } - } - - function emit(event, data) { - if (listeners[event]) { - listeners[event].map(fn => fn(data)); - } - } - - function getFiberRoots(rendererID) { - const roots = fiberRoots; - - if (!roots[rendererID]) { - roots[rendererID] = new Set(); - } - - return roots[rendererID]; - } - - function onCommitFiberUnmount(rendererID, fiber) { - const rendererInterface = rendererInterfaces.get(rendererID); - - if (rendererInterface != null) { - rendererInterface.handleCommitFiberUnmount(fiber); - } - } - - function onCommitFiberRoot(rendererID, root, priorityLevel) { - const mountedRoots = hook.getFiberRoots(rendererID); - const current = root.current; - const isKnownRoot = mountedRoots.has(root); - const isUnmounting = current.memoizedState == null || current.memoizedState.element == null; // Keep track of mounted roots so we can hydrate when DevTools connect. - - if (!isKnownRoot && !isUnmounting) { - mountedRoots.add(root); - } else if (isKnownRoot && isUnmounting) { - mountedRoots.delete(root); - } - - const rendererInterface = rendererInterfaces.get(rendererID); - - if (rendererInterface != null) { - rendererInterface.handleCommitFiberRoot(root, priorityLevel); - } - } - - function onPostCommitFiberRoot(rendererID, root) { - const rendererInterface = rendererInterfaces.get(rendererID); - - if (rendererInterface != null) { - rendererInterface.handlePostCommitFiberRoot(root); - } - } - - function setStrictMode(rendererID, isStrictMode) { - const rendererInterface = rendererInterfaces.get(rendererID); - - if (rendererInterface != null) { - if (isStrictMode) { - rendererInterface.patchConsoleForStrictMode(); - } else { - rendererInterface.unpatchConsoleForStrictMode(); - } - } else { - // This should only happen during initial render in the extension before DevTools - // finishes its handshake with the injected renderer - if (isStrictMode) { - const hideConsoleLogsInStrictMode = window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ === true; - const browserTheme = window.__REACT_DEVTOOLS_BROWSER_THEME__; - patchConsoleForInitialRenderInStrictMode({ - hideConsoleLogsInStrictMode, - browserTheme - }); - } else { - unpatchConsoleForInitialRenderInStrictMode(); - } - } - } - - const openModuleRangesStack = []; - const moduleRanges = []; - - function getTopStackFrameString(error) { - const frames = error.stack.split('\n'); - const frame = frames.length > 1 ? frames[1] : null; - return frame; - } - - function getInternalModuleRanges() { - return moduleRanges; - } - - function registerInternalModuleStart(error) { - const startStackFrame = getTopStackFrameString(error); - - if (startStackFrame !== null) { - openModuleRangesStack.push(startStackFrame); - } - } - - function registerInternalModuleStop(error) { - if (openModuleRangesStack.length > 0) { - const startStackFrame = openModuleRangesStack.pop(); - const stopStackFrame = getTopStackFrameString(error); - - if (stopStackFrame !== null) { - moduleRanges.push([startStackFrame, stopStackFrame]); - } - } - } // TODO: More meaningful names for "rendererInterfaces" and "renderers". - - - const fiberRoots = {}; - const rendererInterfaces = new Map(); - const listeners = {}; - const renderers = new Map(); - const hook = { - rendererInterfaces, - listeners, - // Fast Refresh for web relies on this. - renderers, - emit, - getFiberRoots, - inject, - on, - off, - sub, - // This is a legacy flag. - // React v16 checks the hook for this to ensure DevTools is new enough. - supportsFiber: true, - // React calls these methods. - checkDCE, - onCommitFiberUnmount, - onCommitFiberRoot, - onPostCommitFiberRoot, - setStrictMode, - // Schedule Profiler runtime helpers. - // These internal React modules to report their own boundaries - // which in turn enables the profiler to dim or filter internal frames. - getInternalModuleRanges, - registerInternalModuleStart, - registerInternalModuleStop - }; - - if (false) {} - - Object.defineProperty(target, '__REACT_DEVTOOLS_GLOBAL_HOOK__', { - // This property needs to be configurable for the test environment, - // else we won't be able to delete and recreate it between tests. - configurable: false, - enumerable: false, - - get() { - return hook; - } - - }); - return hook; -} -// EXTERNAL MODULE: ../react-devtools-shared/src/constants.js -var constants = __webpack_require__(1); - -// EXTERNAL MODULE: ../react-devtools-shared/src/storage.js -var storage = __webpack_require__(8); - -// CONCATENATED MODULE: ./src/injectGlobalHook.js -/* global chrome */ - - - - - -function injectCode(code) { - const script = document.createElement('script'); - script.textContent = code; // This script runs before the element is created, - // so we add the script to instead. - - nullthrows_default()(document.documentElement).appendChild(script); - nullthrows_default()(script.parentNode).removeChild(script); -} - -let lastDetectionResult; // We want to detect when a renderer attaches, and notify the "background page" -// (which is shared between tabs and can highlight the React icon). -// Currently we are in "content script" context, so we can't listen to the hook directly -// (it will be injected directly into the page). -// So instead, the hook will use postMessage() to pass message to us here. -// And when this happens, we'll send a message to the "background page". - -window.addEventListener('message', function onMessage({ - data, - source -}) { - var _data$payload; - - if (source !== window || !data) { - return; - } - - switch (data.source) { - case 'react-devtools-detector': - lastDetectionResult = { - hasDetectedReact: true, - reactBuildType: data.reactBuildType - }; - chrome.runtime.sendMessage(lastDetectionResult); - break; - - case 'react-devtools-extension': - if (((_data$payload = data.payload) === null || _data$payload === void 0 ? void 0 : _data$payload.type) === 'fetch-file-with-cache') { - const url = data.payload.url; - - const reject = value => { - chrome.runtime.sendMessage({ - source: 'react-devtools-content-script', - payload: { - type: 'fetch-file-with-cache-error', - url, - value - } - }); - }; - - const resolve = value => { - chrome.runtime.sendMessage({ - source: 'react-devtools-content-script', - payload: { - type: 'fetch-file-with-cache-complete', - url, - value - } - }); - }; - - fetch(url, { - cache: 'force-cache' - }).then(response => { - if (response.ok) { - response.text().then(text => resolve(text)).catch(error => reject(null)); - } else { - reject(null); - } - }, error => reject(null)); - } - - break; - - case 'react-devtools-inject-backend': - const script = document.createElement('script'); - script.src = chrome.runtime.getURL('build/react_devtools_backend.js'); - document.documentElement.appendChild(script); - script.parentNode.removeChild(script); - break; - } -}); // NOTE: Firefox WebExtensions content scripts are still alive and not re-injected -// while navigating the history to a document that has not been destroyed yet, -// replay the last detection result if the content script is active and the -// document has been hidden and shown again. - -window.addEventListener('pageshow', function ({ - target -}) { - if (!lastDetectionResult || target !== window.document) { - return; - } - - chrome.runtime.sendMessage(lastDetectionResult); -}); -const detectReact = ` -window.__REACT_DEVTOOLS_GLOBAL_HOOK__.on('renderer', function({reactBuildType}) { - window.postMessage({ - source: 'react-devtools-detector', - reactBuildType, - }, '*'); -}); -`; -const saveNativeValues = ` -window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeObjectCreate = Object.create; -window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeMap = Map; -window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeWeakMap = WeakMap; -window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeSet = Set; -`; // If we have just reloaded to profile, we need to inject the renderer interface before the app loads. - -if (Object(storage["d" /* sessionStorageGetItem */])(constants["u" /* SESSION_STORAGE_RELOAD_AND_PROFILE_KEY */]) === 'true') { - const rendererURL = chrome.runtime.getURL('build/renderer.js'); - let rendererCode; // We need to inject in time to catch the initial mount. - // This means we need to synchronously read the renderer code itself, - // and synchronously inject it into the page. - // There are very few ways to actually do this. - // This seems to be the best approach. - - const request = new XMLHttpRequest(); - request.addEventListener('load', function () { - rendererCode = this.responseText; - }); - request.open('GET', rendererURL, false); - request.send(); - injectCode(rendererCode); -} // Inject a __REACT_DEVTOOLS_GLOBAL_HOOK__ global for React to interact with. -// Only do this for HTML documents though, to avoid e.g. breaking syntax highlighting for XML docs. -// We need to inject this code because content scripts (ie injectGlobalHook.js) don't have access -// to the webpage's window, so in order to access front end settings -// and communicate with React, we must inject this code into the webpage - - -switch (document.contentType) { - case 'text/html': - case 'application/xhtml+xml': - { - injectCode(';(' + installHook.toString() + '(window))' + saveNativeValues + detectReact); - break; - } -} - -if (typeof exportFunction === 'function') { - // eslint-disable-next-line no-undef - exportFunction(text => { - // Call clipboard.writeText from the extension content script - // (as it has the clipboardWrite permission) and return a Promise - // accessible to the webpage js code. - return new window.Promise((resolve, reject) => window.navigator.clipboard.writeText(text).then(resolve, reject)); - }, window.wrappedJSObject.__REACT_DEVTOOLS_GLOBAL_HOOK__, { - defineAs: 'clipboardCopyText' - }); -} - -/***/ }), - -/***/ 22: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare - -function isArray(a) { - return isArrayImpl(a); -} - -/* harmony default export */ __webpack_exports__["a"] = (isArray); - -/***/ }), - -/***/ 25: -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {exports = module.exports = SemVer; -var debug; -/* istanbul ignore next */ - -if (typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift('SEMVER'); - console.log.apply(console, args); - }; -} else { - debug = function () {}; -} // Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. - - -exports.SEMVER_SPEC_VERSION = '2.0.0'; -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || -/* istanbul ignore next */ -9007199254740991; // Max safe segment length for coercion. - -var MAX_SAFE_COMPONENT_LENGTH = 16; // The actual regexps go on exports.re - -var re = exports.re = []; -var src = exports.src = []; -var t = exports.tokens = {}; -var R = 0; - -function tok(n) { - t[n] = R++; -} // The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - - -tok('NUMERICIDENTIFIER'); -src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -tok('NUMERICIDENTIFIERLOOSE'); -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'; // ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -tok('NONNUMERICIDENTIFIER'); -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; // ## Main Version -// Three dot-separated numeric identifiers. - -tok('MAINVERSION'); -src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')'; -tok('MAINVERSIONLOOSE'); -src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'; // ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -tok('PRERELEASEIDENTIFIER'); -src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + '|' + src[t.NONNUMERICIDENTIFIER] + ')'; -tok('PRERELEASEIDENTIFIERLOOSE'); -src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + '|' + src[t.NONNUMERICIDENTIFIER] + ')'; // ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -tok('PRERELEASE'); -src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'; -tok('PRERELEASELOOSE'); -src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'; // ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -tok('BUILDIDENTIFIER'); -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; // ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -tok('BUILD'); -src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'; // ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -tok('FULL'); -tok('FULLPLAIN'); -src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + src[t.PRERELEASE] + '?' + src[t.BUILD] + '?'; -src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'; // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. - -tok('LOOSEPLAIN'); -src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + '?' + src[t.BUILD] + '?'; -tok('LOOSE'); -src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'; -tok('GTLT'); -src[t.GTLT] = '((?:<|>)?=?)'; // Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. - -tok('XRANGEIDENTIFIERLOOSE'); -src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -tok('XRANGEIDENTIFIER'); -src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'; -tok('XRANGEPLAIN'); -src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:' + src[t.PRERELEASE] + ')?' + src[t.BUILD] + '?' + ')?)?'; -tok('XRANGEPLAINLOOSE'); -src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[t.PRERELEASELOOSE] + ')?' + src[t.BUILD] + '?' + ')?)?'; -tok('XRANGE'); -src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'; -tok('XRANGELOOSE'); -src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'; // Coercion. -// Extract anything that could conceivably be a part of a valid semver - -tok('COERCE'); -src[t.COERCE] = '(^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])'; -tok('COERCERTL'); -re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g'); // Tilde ranges. -// Meaning is "reasonably at or greater than" - -tok('LONETILDE'); -src[t.LONETILDE] = '(?:~>?)'; -tok('TILDETRIM'); -src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'; -re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; -tok('TILDE'); -src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'; -tok('TILDELOOSE'); -src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'; // Caret ranges. -// Meaning is "at least and backwards compatible with" - -tok('LONECARET'); -src[t.LONECARET] = '(?:\\^)'; -tok('CARETTRIM'); -src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'; -re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; -tok('CARET'); -src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'; -tok('CARETLOOSE'); -src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'; // A simple gt/lt/eq thing, or just "" to indicate "any version" - -tok('COMPARATORLOOSE'); -src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'; -tok('COMPARATOR'); -src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'; // An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` - -tok('COMPARATORTRIM'); -src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'; // this one has to use the /g flag - -re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; // Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. - -tok('HYPHENRANGE'); -src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAIN] + ')' + '\\s*$'; -tok('HYPHENRANGELOOSE'); -src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s*$'; // Star ranges basically just allow anything at all. - -tok('STAR'); -src[t.STAR] = '(<|>)?=?\\s*\\*'; // Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. - -for (var i = 0; i < R; i++) { - debug(i, src[i]); - - if (!re[i]) { - re[i] = new RegExp(src[i]); - } -} - -exports.parse = parse; - -function parse(version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - if (version instanceof SemVer) { - return version; - } - - if (typeof version !== 'string') { - return null; - } - - if (version.length > MAX_LENGTH) { - return null; - } - - var r = options.loose ? re[t.LOOSE] : re[t.FULL]; - - if (!r.test(version)) { - return null; - } - - try { - return new SemVer(version, options); - } catch (er) { - return null; - } -} - -exports.valid = valid; - -function valid(version, options) { - var v = parse(version, options); - return v ? v.version : null; -} - -exports.clean = clean; - -function clean(version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; - } else { - version = version.version; - } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); - } - - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters'); - } - - if (!(this instanceof SemVer)) { - return new SemVer(version, options); - } - - debug('SemVer', version, options); - this.options = options; - this.loose = !!options.loose; - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); - - if (!m) { - throw new TypeError('Invalid Version: ' + version); - } - - this.raw = version; // these are actually numbers - - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version'); - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version'); - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version'); - } // numberify any prerelease numeric ids - - - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id; - - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } - } - - return id; - }); - } - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch; - - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.'); - } - - return this.version; -}; - -SemVer.prototype.toString = function () { - return this.version; -}; - -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other); - - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - - return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } // NOT having a prerelease is > having one - - - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; - } - - var i = 0; - - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - debug('prerelease compare', i, a, b); - - if (a === undefined && b === undefined) { - return 0; - } else if (b === undefined) { - return 1; - } else if (a === undefined) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); -}; - -SemVer.prototype.compareBuild = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); - } - - var i = 0; - - do { - var a = this.build[i]; - var b = other.build[i]; - debug('prerelease compare', i, a, b); - - if (a === undefined && b === undefined) { - return 0; - } else if (b === undefined) { - return 1; - } else if (a === undefined) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); -}; // preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. - - -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break; - - case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break; - - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier); - } - - this.inc('pre', identifier); - break; - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - - this.patch = 0; - this.prerelease = []; - break; - - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++; - } - - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0]; - } else { - var i = this.prerelease.length; - - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - - if (i === -1) { - // didn't increment anything - this.prerelease.push(0); - } - } - - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; - } - } - - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - - this.format(); - this.raw = this.version; - return this; -}; - -exports.inc = inc; - -function inc(version, release, loose, identifier) { - if (typeof loose === 'string') { - identifier = loose; - loose = undefined; - } - - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; - } -} - -exports.diff = diff; - -function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ''; - - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre'; - var defaultResult = 'prerelease'; - } - - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } - } - - return defaultResult; // may be undefined - } -} - -exports.compareIdentifiers = compareIdentifiers; -var numeric = /^[0-9]+$/; - -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; - -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.major = major; - -function major(a, loose) { - return new SemVer(a, loose).major; -} - -exports.minor = minor; - -function minor(a, loose) { - return new SemVer(a, loose).minor; -} - -exports.patch = patch; - -function patch(a, loose) { - return new SemVer(a, loose).patch; -} - -exports.compare = compare; - -function compare(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); -} - -exports.compareLoose = compareLoose; - -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.compareBuild = compareBuild; - -function compareBuild(a, b, loose) { - var versionA = new SemVer(a, loose); - var versionB = new SemVer(b, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); -} - -exports.rcompare = rcompare; - -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; - -function sort(list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(a, b, loose); - }); -} - -exports.rsort = rsort; - -function rsort(list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(b, a, loose); - }); -} - -exports.gt = gt; - -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; - -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; - -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; - -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; - -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; - -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; - -function cmp(a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - return a === b; - - case '!==': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - return a !== b; - - case '': - case '=': - case '==': - return eq(a, b, loose); - - case '!=': - return neq(a, b, loose); - - case '>': - return gt(a, b, loose); - - case '>=': - return gte(a, b, loose); - - case '<': - return lt(a, b, loose); - - case '<=': - return lte(a, b, loose); - - default: - throw new TypeError('Invalid operator: ' + op); - } -} - -exports.Comparator = Comparator; - -function Comparator(comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } - } - - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - - debug('comparator', comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - - if (this.semver === ANY) { - this.value = ''; - } else { - this.value = this.operator + this.semver.version; - } - - debug('comp', this); -} - -var ANY = {}; - -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - var m = comp.match(r); - - if (!m) { - throw new TypeError('Invalid comparator: ' + comp); - } - - this.operator = m[1] !== undefined ? m[1] : ''; - - if (this.operator === '=') { - this.operator = ''; - } // if it literally is just '>' or '' then allow anything. - - - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); - } -}; - -Comparator.prototype.toString = function () { - return this.value; -}; - -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose); - - if (this.semver === ANY || version === ANY) { - return true; - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } - } - - return cmp(version, this.operator, this.semver, this.options); -}; - -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required'); - } - - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - var rangeTmp; - - if (this.operator === '') { - if (this.value === '') { - return true; - } - - rangeTmp = new Range(comp.value, options); - return satisfies(this.value, rangeTmp, options); - } else if (comp.operator === '') { - if (comp.value === '') { - return true; - } - - rangeTmp = new Range(this.value, options); - return satisfies(comp.semver, rangeTmp, options); - } - - var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>'); - var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<'); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<='); - var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<'); - var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>'); - return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; -}; - -exports.Range = Range; - -function Range(range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } - - if (range instanceof Range) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range(range.raw, options); - } - } - - if (range instanceof Comparator) { - return new Range(range.value, options); - } - - if (!(this instanceof Range)) { - return new Range(range, options); - } - - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; // First, split based on boolean or || - - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()); - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function () { - return this.range; -}; - -Range.prototype.parseRange = function (range) { - var loose = this.options.loose; - range = range.trim(); // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug('hyphen replace', range); // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug('comparator trim', range, re[t.COMPARATORTRIM]); // `~ 1.2.3` => `~1.2.3` - - range = range.replace(re[t.TILDETRIM], tildeTrimReplace); // `^ 1.2.3` => `^1.2.3` - - range = range.replace(re[t.CARETTRIM], caretTrimReplace); // normalize spaces - - range = range.split(/\s+/).join(' '); // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options); - }, this).join(' ').split(/\s+/); - - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe); - }); - } - - set = set.map(function (comp) { - return new Comparator(comp, this.options); - }, this); - return set; -}; - -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required'); - } - - return this.set.some(function (thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function (rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function (thisComparator) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); -}; // take a set of comparators and determine whether there -// exists a version which can satisfy it - - -function isSatisfiable(comparators, options) { - var result = true; - var remainingComparators = comparators.slice(); - var testComparator = remainingComparators.pop(); - - while (result && remainingComparators.length) { - result = remainingComparators.every(function (otherComparator) { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); - } - - return result; -} // Mostly just for testing and legacy API reasons - - -exports.toComparators = toComparators; - -function toComparators(range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} // comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. - - -function parseComparator(comp, options) { - debug('comp', comp, options); - comp = replaceCarets(comp, options); - debug('caret', comp); - comp = replaceTildes(comp, options); - debug('tildes', comp); - comp = replaceXRanges(comp, options); - debug('xrange', comp); - comp = replaceStars(comp, options); - debug('stars', comp); - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} // ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 - - -function replaceTildes(comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options); - }).join(' '); -} - -function replaceTilde(comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) { - ret = ''; - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } else if (pr) { - debug('replaceTilde pr', pr); - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0'; - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; - } - - debug('tilde return', ret); - return ret; - }); -} // ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 - - -function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options); - }).join(' '); -} - -function replaceCaret(comp, options) { - debug('caret', comp, options); - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) { - ret = ''; - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; - } - } else if (pr) { - debug('replaceCaret pr', pr); - - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + m + '.' + (+p + 1); - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0'; - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + (+M + 1) + '.0.0'; - } - } else { - debug('no pr'); - - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1); - } else { - ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; - } - } else { - ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0'; - } - } - - debug('caret return', ret); - return ret; - }); -} - -function replaceXRanges(comp, options) { - debug('replaceXRanges', comp, options); - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options); - }).join(' '); -} - -function replaceXRange(comp, options) { - comp = comp.trim(); - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) { - gtlt = ''; - } // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - - - pr = options.includePrerelease ? '-0' : ''; - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0'; - } else { - // nothing is forbidden - ret = '*'; - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0; - } - - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>='; - - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<'; - - if (xm) { - M = +M + 1; - } else { - m = +m + 1; - } - } - - ret = gtlt + M + '.' + m + '.' + p + pr; - } else if (xm) { - ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0' + pr + ' <' + M + '.' + (+m + 1) + '.0' + pr; - } - - debug('xRange return', ret); - return ret; - }); -} // Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. - - -function replaceStars(comp, options) { - debug('replaceStars', comp, options); // Looseness is ignored here. star is always as loose as it gets! - - return comp.trim().replace(re[t.STAR], ''); -} // This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 - - -function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = ''; - } else if (isX(fm)) { - from = '>=' + fM + '.0.0'; - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0'; - } else { - from = '>=' + from; - } - - if (isX(tM)) { - to = ''; - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0'; - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0'; - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - } else { - to = '<=' + to; - } - - return (from + ' ' + to).trim(); -} // if ANY of the sets match ALL of its comparators, then pass - - -Range.prototype.test = function (version) { - if (!version) { - return false; - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } - } - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true; - } - } - - return false; -}; - -function testSet(set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false; - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver); - - if (set[i].semver === ANY) { - continue; - } - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver; - - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } - } - } // Version has a -pre, but it's not one of the ones we like. - - - return false; - } - - return true; -} - -exports.satisfies = satisfies; - -function satisfies(version, range, options) { - try { - range = new Range(range, options); - } catch (er) { - return false; - } - - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; - -function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; - } - - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; -} - -exports.minSatisfying = minSatisfying; - -function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; - } - - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; -} - -exports.minVersion = minVersion; - -function minVersion(range, loose) { - range = new Range(range, loose); - var minver = new SemVer('0.0.0'); - - if (range.test(minver)) { - return minver; - } - - minver = new SemVer('0.0.0-0'); - - if (range.test(minver)) { - return minver; - } - - minver = null; - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version); - - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - - compver.raw = compver.format(); - - /* fallthrough */ - - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver; - } - - break; - - case '<': - case '<=': - /* Ignore maximum versions */ - break; - - /* istanbul ignore next */ - - default: - throw new Error('Unexpected operation: ' + comparator.operator); - } - }); - } - - if (minver && range.test(minver)) { - return minver; - } - - return null; -} - -exports.validRange = validRange; - -function validRange(range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*'; - } catch (er) { - return null; - } -} // Determine if version is less than all the versions possible in the range - - -exports.ltr = ltr; - -function ltr(version, range, options) { - return outside(version, range, '<', options); -} // Determine if version is greater than all the versions possible in the range. - - -exports.gtr = gtr; - -function gtr(version, range, options) { - return outside(version, range, '>', options); -} - -exports.outside = outside; - -function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - - switch (hilo) { - case '>': - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = '>'; - ecomp = '>='; - break; - - case '<': - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = '<'; - ecomp = '<='; - break; - - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } // If it satisifes the range it is not outside - - - if (satisfies(version, range, options)) { - return false; - } // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - var high = null; - var low = null; - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0'); - } - - high = high || comparator; - low = low || comparator; - - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); // If the edge version comparator has a operator then our version - // isn't outside it - - if (high.operator === comp || high.operator === ecomp) { - return false; - } // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - - - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - - return true; -} - -exports.prerelease = prerelease; - -function prerelease(version, options) { - var parsed = parse(version, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; -} - -exports.intersects = intersects; - -function intersects(r1, r2, options) { - r1 = new Range(r1, options); - r2 = new Range(r2, options); - return r1.intersects(r2); -} - -exports.coerce = coerce; - -function coerce(version, options) { - if (version instanceof SemVer) { - return version; - } - - if (typeof version === 'number') { - version = String(version); - } - - if (typeof version !== 'string') { - return null; - } - - options = options || {}; - var match = null; - - if (!options.rtl) { - match = version.match(re[t.COERCE]); - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - var next; - - while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; - } - - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; - } // leave it in a clean state - - - re[t.COERCERTL].lastIndex = -1; - } - - if (match === null) { - return null; - } - - return parse(match[2] + '.' + (match[3] || '0') + '.' + (match[4] || '0'), options); -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(62))) - -/***/ }), - -/***/ 3: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ getAllEnumerableKeys; }); -__webpack_require__.d(__webpack_exports__, "i", function() { return /* binding */ getDisplayName; }); -__webpack_require__.d(__webpack_exports__, "p", function() { return /* binding */ getUID; }); -__webpack_require__.d(__webpack_exports__, "v", function() { return /* binding */ utfDecodeString; }); -__webpack_require__.d(__webpack_exports__, "w", function() { return /* binding */ utfEncodeString; }); -__webpack_require__.d(__webpack_exports__, "g", function() { return /* binding */ getDefaultComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "n", function() { return /* binding */ getSavedComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "r", function() { return /* binding */ saveComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ getAppendComponentStack; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ getBreakOnConsoleErrors; }); -__webpack_require__.d(__webpack_exports__, "k", function() { return /* binding */ getHideConsoleLogsInStrictMode; }); -__webpack_require__.d(__webpack_exports__, "o", function() { return /* binding */ getShowInlineWarningsAndErrors; }); -__webpack_require__.d(__webpack_exports__, "h", function() { return /* binding */ getDefaultOpenInEditorURL; }); -__webpack_require__.d(__webpack_exports__, "m", function() { return /* binding */ getOpenInEditorURL; }); -__webpack_require__.d(__webpack_exports__, "s", function() { return /* binding */ separateDisplayNameAndHOCs; }); -__webpack_require__.d(__webpack_exports__, "u", function() { return /* binding */ shallowDiffers; }); -__webpack_require__.d(__webpack_exports__, "l", function() { return /* binding */ getInObject; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ deletePathInObject; }); -__webpack_require__.d(__webpack_exports__, "q", function() { return /* binding */ renamePathInObject; }); -__webpack_require__.d(__webpack_exports__, "t", function() { return /* binding */ setInObject; }); -__webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ getDataType; }); -__webpack_require__.d(__webpack_exports__, "j", function() { return /* binding */ getDisplayNameForReactElement; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ formatDataForPreview; }); - -// UNUSED EXPORTS: alphaSortKeys, printOperationsArray, setAppendComponentStack, setBreakOnConsoleErrors, sethideConsoleLogsInStrictMode, setShowInlineWarningsAndErrors - -// EXTERNAL MODULE: /Users/kevin.le-seigle/WS/react/node_modules/lru-cache/index.js -var lru_cache = __webpack_require__(40); -var lru_cache_default = /*#__PURE__*/__webpack_require__.n(lru_cache); - -// EXTERNAL MODULE: /Users/kevin.le-seigle/WS/react/build/oss-experimental/react-is/index.js -var react_is = __webpack_require__(11); - -// CONCATENATED MODULE: ../shared/ReactSymbols.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// ATTENTION -// When adding new symbols to this file, -// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. -const REACT_ELEMENT_TYPE = Symbol.for('react.element'); -const REACT_PORTAL_TYPE = Symbol.for('react.portal'); -const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); -const REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); -const REACT_PROFILER_TYPE = Symbol.for('react.profiler'); -const REACT_PROVIDER_TYPE = Symbol.for('react.provider'); -const REACT_CONTEXT_TYPE = Symbol.for('react.context'); -const REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context'); -const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); -const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); -const REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); -const REACT_MEMO_TYPE = Symbol.for('react.memo'); -const REACT_LAZY_TYPE = Symbol.for('react.lazy'); -const REACT_SCOPE_TYPE = Symbol.for('react.scope'); -const REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); -const REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); -const REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); -const REACT_CACHE_TYPE = Symbol.for('react.cache'); -const REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker'); -const REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value'); -const MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -const FAUX_ITERATOR_SYMBOL = '@@iterator'; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; - } - - const maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - - return null; -} -// EXTERNAL MODULE: ../react-devtools-shared/src/constants.js -var constants = __webpack_require__(1); - -// EXTERNAL MODULE: ../react-devtools-shared/src/types.js -var types = __webpack_require__(2); - -// EXTERNAL MODULE: ../react-devtools-shared/src/storage.js -var storage = __webpack_require__(8); - -// EXTERNAL MODULE: ../react-devtools-shared/src/hydration.js -var hydration = __webpack_require__(10); - -// EXTERNAL MODULE: ../react-devtools-shared/src/isArray.js -var isArray = __webpack_require__(16); - -// CONCATENATED MODULE: ../react-devtools-shared/src/utils.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - - - - - - - - -const cachedDisplayNames = new WeakMap(); // On large trees, encoding takes significant time. -// Try to reuse the already encoded strings. - -const encodedStringCache = new lru_cache_default.a({ - max: 1000 -}); -function alphaSortKeys(a, b) { - if (a.toString() > b.toString()) { - return 1; - } else if (b.toString() > a.toString()) { - return -1; - } else { - return 0; - } -} -function getAllEnumerableKeys(obj) { - const keys = new Set(); - let current = obj; - - while (current != null) { - const currentKeys = [...Object.keys(current), ...Object.getOwnPropertySymbols(current)]; - const descriptors = Object.getOwnPropertyDescriptors(current); - currentKeys.forEach(key => { - // $FlowFixMe: key can be a Symbol https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor - if (descriptors[key].enumerable) { - keys.add(key); - } - }); - current = Object.getPrototypeOf(current); - } - - return keys; -} -function getDisplayName(type, fallbackName = 'Anonymous') { - const nameFromCache = cachedDisplayNames.get(type); - - if (nameFromCache != null) { - return nameFromCache; - } - - let displayName = fallbackName; // The displayName property is not guaranteed to be a string. - // It's only safe to use for our purposes if it's a string. - // github.com/facebook/react-devtools/issues/803 - - if (typeof type.displayName === 'string') { - displayName = type.displayName; - } else if (typeof type.name === 'string' && type.name !== '') { - displayName = type.name; - } - - cachedDisplayNames.set(type, displayName); - return displayName; -} -let uidCounter = 0; -function getUID() { - return ++uidCounter; -} -function utfDecodeString(array) { - // Avoid spreading the array (e.g. String.fromCodePoint(...array)) - // Functions arguments are first placed on the stack before the function is called - // which throws a RangeError for large arrays. - // See github.com/facebook/react/issues/22293 - let string = ''; - - for (let i = 0; i < array.length; i++) { - const char = array[i]; - string += String.fromCodePoint(char); - } - - return string; -} - -function surrogatePairToCodePoint(charCode1, charCode2) { - return ((charCode1 & 0x3ff) << 10) + (charCode2 & 0x3ff) + 0x10000; -} // Credit for this encoding approach goes to Tim Down: -// https://stackoverflow.com/questions/4877326/how-can-i-tell-if-a-string-contains-multibyte-characters-in-javascript - - -function utfEncodeString(string) { - const cached = encodedStringCache.get(string); - - if (cached !== undefined) { - return cached; - } - - const encoded = []; - let i = 0; - let charCode; - - while (i < string.length) { - charCode = string.charCodeAt(i); // Handle multibyte unicode characters (like emoji). - - if ((charCode & 0xf800) === 0xd800) { - encoded.push(surrogatePairToCodePoint(charCode, string.charCodeAt(++i))); - } else { - encoded.push(charCode); - } - - ++i; - } - - encodedStringCache.set(string, encoded); - return encoded; -} -function printOperationsArray(operations) { - // The first two values are always rendererID and rootID - const rendererID = operations[0]; - const rootID = operations[1]; - const logs = [`operations for renderer:${rendererID} and root:${rootID}`]; - let i = 2; // Reassemble the string table. - - const stringTable = [null // ID = 0 corresponds to the null string. - ]; - const stringTableSize = operations[i++]; - const stringTableEnd = i + stringTableSize; - - while (i < stringTableEnd) { - const nextLength = operations[i++]; - const nextString = utfDecodeString(operations.slice(i, i + nextLength)); - stringTable.push(nextString); - i += nextLength; - } - - while (i < operations.length) { - const operation = operations[i]; - - switch (operation) { - case constants["w" /* TREE_OPERATION_ADD */]: - { - const id = operations[i + 1]; - const type = operations[i + 2]; - i += 3; - - if (type === types["m" /* ElementTypeRoot */]) { - logs.push(`Add new root node ${id}`); - i++; // isStrictModeCompliant - - i++; // supportsProfiling - - i++; // supportsStrictMode - - i++; // hasOwnerMetadata - } else { - const parentID = operations[i]; - i++; - i++; // ownerID - - const displayNameStringID = operations[i]; - const displayName = stringTable[displayNameStringID]; - i++; - i++; // key - - logs.push(`Add node ${id} (${displayName || 'null'}) as child of ${parentID}`); - } - - break; - } - - case constants["x" /* TREE_OPERATION_REMOVE */]: - { - const removeLength = operations[i + 1]; - i += 2; - - for (let removeIndex = 0; removeIndex < removeLength; removeIndex++) { - const id = operations[i]; - i += 1; - logs.push(`Remove node ${id}`); - } - - break; - } - - case constants["y" /* TREE_OPERATION_REMOVE_ROOT */]: - { - i += 1; - logs.push(`Remove root ${rootID}`); - break; - } - - case constants["A" /* TREE_OPERATION_SET_SUBTREE_MODE */]: - { - const id = operations[i + 1]; - const mode = operations[i + 1]; - i += 3; - logs.push(`Mode ${mode} set for subtree with root ${id}`); - break; - } - - case constants["z" /* TREE_OPERATION_REORDER_CHILDREN */]: - { - const id = operations[i + 1]; - const numChildren = operations[i + 2]; - i += 3; - const children = operations.slice(i, i + numChildren); - i += numChildren; - logs.push(`Re-order node ${id} children ${children.join(',')}`); - break; - } - - case constants["C" /* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */]: - // Base duration updates are only sent while profiling is in progress. - // We can ignore them at this point. - // The profiler UI uses them lazily in order to generate the tree. - i += 3; - break; - - case constants["B" /* TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS */]: - const id = operations[i + 1]; - const numErrors = operations[i + 2]; - const numWarnings = operations[i + 3]; - i += 4; - logs.push(`Node ${id} has ${numErrors} errors and ${numWarnings} warnings`); - break; - - default: - throw Error(`Unsupported Bridge operation "${operation}"`); - } - } - - console.log(logs.join('\n ')); -} -function getDefaultComponentFilters() { - return [{ - type: types["b" /* ComponentFilterElementType */], - value: types["i" /* ElementTypeHostComponent */], - isEnabled: true - }]; -} -function getSavedComponentFilters() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["h" /* LOCAL_STORAGE_FILTER_PREFERENCES_KEY */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return getDefaultComponentFilters(); -} -function saveComponentFilters(componentFilters) { - Object(storage["c" /* localStorageSetItem */])(constants["h" /* LOCAL_STORAGE_FILTER_PREFERENCES_KEY */], JSON.stringify(componentFilters)); -} -function getAppendComponentStack() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["m" /* LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return true; -} -function setAppendComponentStack(value) { - Object(storage["c" /* localStorageSetItem */])(constants["m" /* LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY */], JSON.stringify(value)); -} -function getBreakOnConsoleErrors() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["l" /* LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return false; -} -function setBreakOnConsoleErrors(value) { - Object(storage["c" /* localStorageSetItem */])(constants["l" /* LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS */], JSON.stringify(value)); -} -function getHideConsoleLogsInStrictMode() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["i" /* LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return false; -} -function sethideConsoleLogsInStrictMode(value) { - Object(storage["c" /* localStorageSetItem */])(constants["i" /* LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE */], JSON.stringify(value)); -} -function getShowInlineWarningsAndErrors() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["n" /* LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return true; -} -function setShowInlineWarningsAndErrors(value) { - Object(storage["c" /* localStorageSetItem */])(constants["n" /* LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY */], JSON.stringify(value)); -} -function getDefaultOpenInEditorURL() { - return typeof null === 'string' ? null : ''; -} -function getOpenInEditorURL() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["j" /* LOCAL_STORAGE_OPEN_IN_EDITOR_URL */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return getDefaultOpenInEditorURL(); -} -function separateDisplayNameAndHOCs(displayName, type) { - if (displayName === null) { - return [null, null]; - } - - let hocDisplayNames = null; - - switch (type) { - case types["e" /* ElementTypeClass */]: - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - if (displayName.indexOf('(') >= 0) { - const matches = displayName.match(/[^()]+/g); - - if (matches != null) { - displayName = matches.pop(); - hocDisplayNames = matches; - } - } - - break; - - default: - break; - } - - if (type === types["j" /* ElementTypeMemo */]) { - if (hocDisplayNames === null) { - hocDisplayNames = ['Memo']; - } else { - hocDisplayNames.unshift('Memo'); - } - } else if (type === types["g" /* ElementTypeForwardRef */]) { - if (hocDisplayNames === null) { - hocDisplayNames = ['ForwardRef']; - } else { - hocDisplayNames.unshift('ForwardRef'); - } - } - - return [displayName, hocDisplayNames]; -} // Pulled from react-compat -// https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349 - -function shallowDiffers(prev, next) { - for (const attribute in prev) { - if (!(attribute in next)) { - return true; - } - } - - for (const attribute in next) { - if (prev[attribute] !== next[attribute]) { - return true; - } - } - - return false; -} -function getInObject(object, path) { - return path.reduce((reduced, attr) => { - if (reduced) { - if (hasOwnProperty.call(reduced, attr)) { - return reduced[attr]; - } - - if (typeof reduced[Symbol.iterator] === 'function') { - // Convert iterable to array and return array[index] - // - // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - return Array.from(reduced)[attr]; - } - } - - return null; - }, object); -} -function deletePathInObject(object, path) { - const length = path.length; - const last = path[length - 1]; - - if (object != null) { - const parent = getInObject(object, path.slice(0, length - 1)); - - if (parent) { - if (Object(isArray["a" /* default */])(parent)) { - parent.splice(last, 1); - } else { - delete parent[last]; - } - } - } -} -function renamePathInObject(object, oldPath, newPath) { - const length = oldPath.length; - - if (object != null) { - const parent = getInObject(object, oldPath.slice(0, length - 1)); - - if (parent) { - const lastOld = oldPath[length - 1]; - const lastNew = newPath[length - 1]; - parent[lastNew] = parent[lastOld]; - - if (Object(isArray["a" /* default */])(parent)) { - parent.splice(lastOld, 1); - } else { - delete parent[lastOld]; - } - } - } -} -function setInObject(object, path, value) { - const length = path.length; - const last = path[length - 1]; - - if (object != null) { - const parent = getInObject(object, path.slice(0, length - 1)); - - if (parent) { - parent[last] = value; - } - } -} - -/** - * Get a enhanced/artificial type string based on the object instance - */ -function getDataType(data) { - if (data === null) { - return 'null'; - } else if (data === undefined) { - return 'undefined'; - } - - if (Object(react_is["isElement"])(data)) { - return 'react_element'; - } - - if (typeof HTMLElement !== 'undefined' && data instanceof HTMLElement) { - return 'html_element'; - } - - const type = typeof data; - - switch (type) { - case 'bigint': - return 'bigint'; - - case 'boolean': - return 'boolean'; - - case 'function': - return 'function'; - - case 'number': - if (Number.isNaN(data)) { - return 'nan'; - } else if (!Number.isFinite(data)) { - return 'infinity'; - } else { - return 'number'; - } - - case 'object': - if (Object(isArray["a" /* default */])(data)) { - return 'array'; - } else if (ArrayBuffer.isView(data)) { - return hasOwnProperty.call(data.constructor, 'BYTES_PER_ELEMENT') ? 'typed_array' : 'data_view'; - } else if (data.constructor && data.constructor.name === 'ArrayBuffer') { - // HACK This ArrayBuffer check is gross; is there a better way? - // We could try to create a new DataView with the value. - // If it doesn't error, we know it's an ArrayBuffer, - // but this seems kind of awkward and expensive. - return 'array_buffer'; - } else if (typeof data[Symbol.iterator] === 'function') { - const iterator = data[Symbol.iterator](); - - if (!iterator) {// Proxies might break assumptoins about iterators. - // See github.com/facebook/react/issues/21654 - } else { - return iterator === data ? 'opaque_iterator' : 'iterator'; - } - } else if (data.constructor && data.constructor.name === 'RegExp') { - return 'regexp'; - } else { - const toStringValue = Object.prototype.toString.call(data); - - if (toStringValue === '[object Date]') { - return 'date'; - } else if (toStringValue === '[object HTMLAllCollection]') { - return 'html_all_collection'; - } - } - - return 'object'; - - case 'string': - return 'string'; - - case 'symbol': - return 'symbol'; - - case 'undefined': - if (Object.prototype.toString.call(data) === '[object HTMLAllCollection]') { - return 'html_all_collection'; - } - - return 'undefined'; - - default: - return 'unknown'; - } -} -function getDisplayNameForReactElement(element) { - const elementType = Object(react_is["typeOf"])(element); - - switch (elementType) { - case react_is["ContextConsumer"]: - return 'ContextConsumer'; - - case react_is["ContextProvider"]: - return 'ContextProvider'; - - case react_is["ForwardRef"]: - return 'ForwardRef'; - - case react_is["Fragment"]: - return 'Fragment'; - - case react_is["Lazy"]: - return 'Lazy'; - - case react_is["Memo"]: - return 'Memo'; - - case react_is["Portal"]: - return 'Portal'; - - case react_is["Profiler"]: - return 'Profiler'; - - case react_is["StrictMode"]: - return 'StrictMode'; - - case react_is["Suspense"]: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - - case REACT_TRACING_MARKER_TYPE: - return 'TracingMarker'; - - default: - const { - type - } = element; - - if (typeof type === 'string') { - return type; - } else if (typeof type === 'function') { - return getDisplayName(type, 'Anonymous'); - } else if (type != null) { - return 'NotImplementedInDevtools'; - } else { - return 'Element'; - } - - } -} -const MAX_PREVIEW_STRING_LENGTH = 50; - -function truncateForDisplay(string, length = MAX_PREVIEW_STRING_LENGTH) { - if (string.length > length) { - return string.substr(0, length) + '…'; - } else { - return string; - } -} // Attempts to mimic Chrome's inline preview for values. -// For example, the following value... -// { -// foo: 123, -// bar: "abc", -// baz: [true, false], -// qux: { ab: 1, cd: 2 } -// }; -// -// Would show a preview of... -// {foo: 123, bar: "abc", baz: Array(2), qux: {…}} -// -// And the following value... -// [ -// 123, -// "abc", -// [true, false], -// { foo: 123, bar: "abc" } -// ]; -// -// Would show a preview of... -// [123, "abc", Array(2), {…}] - - -function formatDataForPreview(data, showFormattedValue) { - if (data != null && hasOwnProperty.call(data, hydration["d" /* meta */].type)) { - return showFormattedValue ? data[hydration["d" /* meta */].preview_long] : data[hydration["d" /* meta */].preview_short]; - } - - const type = getDataType(data); - - switch (type) { - case 'html_element': - return `<${truncateForDisplay(data.tagName.toLowerCase())} />`; - - case 'function': - return truncateForDisplay(`ƒ ${typeof data.name === 'function' ? '' : data.name}() {}`); - - case 'string': - return `"${data}"`; - - case 'bigint': - return truncateForDisplay(data.toString() + 'n'); - - case 'regexp': - return truncateForDisplay(data.toString()); - - case 'symbol': - return truncateForDisplay(data.toString()); - - case 'react_element': - return `<${truncateForDisplay(getDisplayNameForReactElement(data) || 'Unknown')} />`; - - case 'array_buffer': - return `ArrayBuffer(${data.byteLength})`; - - case 'data_view': - return `DataView(${data.buffer.byteLength})`; - - case 'array': - if (showFormattedValue) { - let formatted = ''; - - for (let i = 0; i < data.length; i++) { - if (i > 0) { - formatted += ', '; - } - - formatted += formatDataForPreview(data[i], false); - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `[${truncateForDisplay(formatted)}]`; - } else { - const length = hasOwnProperty.call(data, hydration["d" /* meta */].size) ? data[hydration["d" /* meta */].size] : data.length; - return `Array(${length})`; - } - - case 'typed_array': - const shortName = `${data.constructor.name}(${data.length})`; - - if (showFormattedValue) { - let formatted = ''; - - for (let i = 0; i < data.length; i++) { - if (i > 0) { - formatted += ', '; - } - - formatted += data[i]; - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `${shortName} [${truncateForDisplay(formatted)}]`; - } else { - return shortName; - } - - case 'iterator': - const name = data.constructor.name; - - if (showFormattedValue) { - // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - const array = Array.from(data); - let formatted = ''; - - for (let i = 0; i < array.length; i++) { - const entryOrEntries = array[i]; - - if (i > 0) { - formatted += ', '; - } // TRICKY - // Browsers display Maps and Sets differently. - // To mimic their behavior, detect if we've been given an entries tuple. - // Map(2) {"abc" => 123, "def" => 123} - // Set(2) {"abc", 123} - - - if (Object(isArray["a" /* default */])(entryOrEntries)) { - const key = formatDataForPreview(entryOrEntries[0], true); - const value = formatDataForPreview(entryOrEntries[1], false); - formatted += `${key} => ${value}`; - } else { - formatted += formatDataForPreview(entryOrEntries, false); - } - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `${name}(${data.size}) {${truncateForDisplay(formatted)}}`; - } else { - return `${name}(${data.size})`; - } - - case 'opaque_iterator': - { - return data[Symbol.toStringTag]; - } - - case 'date': - return data.toString(); - - case 'object': - if (showFormattedValue) { - const keys = Array.from(getAllEnumerableKeys(data)).sort(alphaSortKeys); - let formatted = ''; - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - - if (i > 0) { - formatted += ', '; - } - - formatted += `${key.toString()}: ${formatDataForPreview(data[key], false)}`; - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `{${truncateForDisplay(formatted)}}`; - } else { - return '{…}'; - } - - case 'boolean': - case 'number': - case 'infinity': - case 'nan': - case 'null': - case 'undefined': - return data; - - default: - try { - return truncateForDisplay(String(data)); - } catch (error) { - return 'unserializable'; - } - - } -} - -/***/ }), - -/***/ 31: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return REACT_TOTAL_NUM_LANES; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SCHEDULING_PROFILER_VERSION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return SNAPSHOT_MAX_HEIGHT; }); -/* harmony import */ var react_devtools_shared_src_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -const REACT_TOTAL_NUM_LANES = 31; // Increment this number any time a backwards breaking change is made to the profiler metadata. - -const SCHEDULING_PROFILER_VERSION = 1; -const SNAPSHOT_MAX_HEIGHT = 60; - -/***/ }), - -/***/ 37: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export isStringComponentStack */ -/* unused harmony export dangerous_setTargetConsoleForTesting */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return registerRenderer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return patch; }); -/* unused harmony export unpatch */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return patchForStrictMode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return unpatchForStrictMode; }); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); -/* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48); -/* harmony import */ var _DevToolsFiberComponentStack__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66); -/* harmony import */ var react_devtools_feature_flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13); -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - -const OVERRIDE_CONSOLE_METHODS = ['error', 'trace', 'warn']; -const DIMMED_NODE_CONSOLE_COLOR = '\x1b[2m%s\x1b[0m'; // React's custom built component stack strings match "\s{4}in" -// Chrome's prefix matches "\s{4}at" - -const PREFIX_REGEX = /\s{4}(in|at)\s{1}/; // Firefox and Safari have no prefix ("") -// but we can fallback to looking for location info (e.g. "foo.js:12:345") - -const ROW_COLUMN_NUMBER_REGEX = /:\d+:\d+(\n|$)/; -function isStringComponentStack(text) { - return PREFIX_REGEX.test(text) || ROW_COLUMN_NUMBER_REGEX.test(text); -} -const STYLE_DIRECTIVE_REGEX = /^%c/; // This function tells whether or not the arguments for a console -// method has been overridden by the patchForStrictMode function. -// If it has we'll need to do some special formatting of the arguments -// so the console color stays consistent - -function isStrictModeOverride(args, method) { - return args.length === 2 && STYLE_DIRECTIVE_REGEX.test(args[0]) && args[1] === `color: ${getConsoleColor(method) || ''}`; -} - -function getConsoleColor(method) { - switch (method) { - case 'warn': - return consoleSettingsRef.browserTheme === 'light' ? "rgba(250, 180, 50, 0.75)" : "rgba(250, 180, 50, 0.5)"; - - case 'error': - return consoleSettingsRef.browserTheme === 'light' ? "rgba(250, 123, 130, 0.75)" : "rgba(250, 123, 130, 0.5)"; - - case 'log': - default: - return consoleSettingsRef.browserTheme === 'light' ? "rgba(125, 125, 125, 0.75)" : "rgba(125, 125, 125, 0.5)"; - } -} - -const injectedRenderers = new Map(); -let targetConsole = console; -let targetConsoleMethods = {}; - -for (const method in console) { - targetConsoleMethods[method] = console[method]; -} - -let unpatchFn = null; -let isNode = false; - -try { - isNode = undefined === global; -} catch (error) {} // Enables e.g. Jest tests to inject a mock console object. - - -function dangerous_setTargetConsoleForTesting(targetConsoleForTesting) { - targetConsole = targetConsoleForTesting; - targetConsoleMethods = {}; - - for (const method in targetConsole) { - targetConsoleMethods[method] = console[method]; - } -} // v16 renderers should use this method to inject internals necessary to generate a component stack. -// These internals will be used if the console is patched. -// Injecting them separately allows the console to easily be patched or un-patched later (at runtime). - -function registerRenderer(renderer, onErrorOrWarning) { - const { - currentDispatcherRef, - getCurrentFiber, - findFiberByHostInstance, - version - } = renderer; // Ignore React v15 and older because they don't expose a component stack anyway. - - if (typeof findFiberByHostInstance !== 'function') { - return; - } // currentDispatcherRef gets injected for v16.8+ to support hooks inspection. - // getCurrentFiber gets injected for v16.9+. - - - if (currentDispatcherRef != null && typeof getCurrentFiber === 'function') { - const { - ReactTypeOfWork - } = Object(_renderer__WEBPACK_IMPORTED_MODULE_1__[/* getInternalReactConstants */ "b"])(version); - injectedRenderers.set(renderer, { - currentDispatcherRef, - getCurrentFiber, - workTagMap: ReactTypeOfWork, - onErrorOrWarning - }); - } -} -const consoleSettingsRef = { - appendComponentStack: false, - breakOnConsoleErrors: false, - showInlineWarningsAndErrors: false, - hideConsoleLogsInStrictMode: false, - browserTheme: 'dark' -}; // Patches console methods to append component stack for the current fiber. -// Call unpatch() to remove the injected behavior. - -function patch({ - appendComponentStack, - breakOnConsoleErrors, - showInlineWarningsAndErrors, - hideConsoleLogsInStrictMode, - browserTheme -}) { - // Settings may change after we've patched the console. - // Using a shared ref allows the patch function to read the latest values. - consoleSettingsRef.appendComponentStack = appendComponentStack; - consoleSettingsRef.breakOnConsoleErrors = breakOnConsoleErrors; - consoleSettingsRef.showInlineWarningsAndErrors = showInlineWarningsAndErrors; - consoleSettingsRef.hideConsoleLogsInStrictMode = hideConsoleLogsInStrictMode; - consoleSettingsRef.browserTheme = browserTheme; - - if (appendComponentStack || breakOnConsoleErrors || showInlineWarningsAndErrors) { - if (unpatchFn !== null) { - // Don't patch twice. - return; - } - - const originalConsoleMethods = {}; - - unpatchFn = () => { - for (const method in originalConsoleMethods) { - try { - // $FlowFixMe property error|warn is not writable. - targetConsole[method] = originalConsoleMethods[method]; - } catch (error) {} - } - }; - - OVERRIDE_CONSOLE_METHODS.forEach(method => { - try { - const originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__ : targetConsole[method]; - - const overrideMethod = (...args) => { - let shouldAppendWarningStack = false; - - if (method !== 'log') { - if (consoleSettingsRef.appendComponentStack) { - const lastArg = args.length > 0 ? args[args.length - 1] : null; - const alreadyHasComponentStack = typeof lastArg === 'string' && isStringComponentStack(lastArg); // If we are ever called with a string that already has a component stack, - // e.g. a React error/warning, don't append a second stack. - - shouldAppendWarningStack = !alreadyHasComponentStack; - } - } - - const shouldShowInlineWarningsAndErrors = consoleSettingsRef.showInlineWarningsAndErrors && (method === 'error' || method === 'warn'); // Search for the first renderer that has a current Fiber. - // We don't handle the edge case of stacks for more than one (e.g. interleaved renderers?) - // eslint-disable-next-line no-for-of-loops/no-for-of-loops - - for (const { - currentDispatcherRef, - getCurrentFiber, - onErrorOrWarning, - workTagMap - } of injectedRenderers.values()) { - const current = getCurrentFiber(); - - if (current != null) { - try { - if (shouldShowInlineWarningsAndErrors) { - // patch() is called by two places: (1) the hook and (2) the renderer backend. - // The backend is what implements a message queue, so it's the only one that injects onErrorOrWarning. - if (typeof onErrorOrWarning === 'function') { - onErrorOrWarning(current, method, // Copy args before we mutate them (e.g. adding the component stack) - args.slice()); - } - } - - if (shouldAppendWarningStack) { - const componentStack = Object(_DevToolsFiberComponentStack__WEBPACK_IMPORTED_MODULE_2__[/* getStackByFiberInDevAndProd */ "a"])(workTagMap, current, currentDispatcherRef); - - if (componentStack !== '') { - if (isStrictModeOverride(args, method)) { - args[0] = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* format */ "f"])(args[0], componentStack); - } else { - args.push(componentStack); - } - } - } - } catch (error) { - // Don't let a DevTools or React internal error interfere with logging. - setTimeout(() => { - throw error; - }, 0); - } finally { - break; - } - } - } - - if (consoleSettingsRef.breakOnConsoleErrors) { - // --- Welcome to debugging with React DevTools --- - // This debugger statement means that you've enabled the "break on warnings" feature. - // Use the browser's Call Stack panel to step out of this override function- - // to where the original warning or error was logged. - // eslint-disable-next-line no-debugger - debugger; - } - - originalMethod(...args); - }; - - overrideMethod.__REACT_DEVTOOLS_ORIGINAL_METHOD__ = originalMethod; - originalMethod.__REACT_DEVTOOLS_OVERRIDE_METHOD__ = overrideMethod; // $FlowFixMe property error|warn is not writable. - - targetConsole[method] = overrideMethod; - } catch (error) {} - }); - } else { - unpatch(); - } -} // Removed component stack patch from console methods. - -function unpatch() { - if (unpatchFn !== null) { - unpatchFn(); - unpatchFn = null; - } -} -let unpatchForStrictModeFn = null; // NOTE: KEEP IN SYNC with src/hook.js:patchConsoleForInitialRenderInStrictMode - -function patchForStrictMode() { - if (react_devtools_feature_flags__WEBPACK_IMPORTED_MODULE_3__[/* consoleManagedByDevToolsDuringStrictMode */ "a"]) { - const overrideConsoleMethods = ['error', 'trace', 'warn', 'log']; - - if (unpatchForStrictModeFn !== null) { - // Don't patch twice. - return; - } - - const originalConsoleMethods = {}; - - unpatchForStrictModeFn = () => { - for (const method in originalConsoleMethods) { - try { - // $FlowFixMe property error|warn is not writable. - targetConsole[method] = originalConsoleMethods[method]; - } catch (error) {} - } - }; - - overrideConsoleMethods.forEach(method => { - try { - const originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ : targetConsole[method]; - - const overrideMethod = (...args) => { - if (!consoleSettingsRef.hideConsoleLogsInStrictMode) { - // Dim the text color of the double logs if we're not - // hiding them. - if (isNode) { - originalMethod(DIMMED_NODE_CONSOLE_COLOR, Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* format */ "f"])(...args)); - } else { - const color = getConsoleColor(method); - - if (color) { - originalMethod(`%c${Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* format */ "f"])(...args)}`, `color: ${color}`); - } else { - throw Error('Console color is not defined'); - } - } - } - }; - - overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod; - originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod; // $FlowFixMe property error|warn is not writable. - - targetConsole[method] = overrideMethod; - } catch (error) {} - }); - } -} // NOTE: KEEP IN SYNC with src/hook.js:unpatchConsoleForInitialRenderInStrictMode - -function unpatchForStrictMode() { - if (react_devtools_feature_flags__WEBPACK_IMPORTED_MODULE_3__[/* consoleManagedByDevToolsDuringStrictMode */ "a"]) { - if (unpatchForStrictModeFn !== null) { - unpatchForStrictModeFn(); - unpatchForStrictModeFn = null; - } - } -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(52))) - -/***/ }), - -/***/ 4: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CONCURRENT_MODE_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CONCURRENT_MODE_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CONTEXT_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return CONTEXT_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return SERVER_CONTEXT_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return DEPRECATED_ASYNC_MODE_SYMBOL_STRING; }); -/* unused harmony export ELEMENT_NUMBER */ -/* unused harmony export ELEMENT_SYMBOL_STRING */ -/* unused harmony export DEBUG_TRACING_MODE_NUMBER */ -/* unused harmony export DEBUG_TRACING_MODE_SYMBOL_STRING */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return FORWARD_REF_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return FORWARD_REF_SYMBOL_STRING; }); -/* unused harmony export FRAGMENT_NUMBER */ -/* unused harmony export FRAGMENT_SYMBOL_STRING */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return LAZY_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return LAZY_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return MEMO_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return MEMO_SYMBOL_STRING; }); -/* unused harmony export PORTAL_NUMBER */ -/* unused harmony export PORTAL_SYMBOL_STRING */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return PROFILER_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return PROFILER_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return PROVIDER_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return PROVIDER_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return SCOPE_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return SCOPE_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return STRICT_MODE_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return STRICT_MODE_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return SUSPENSE_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return SUSPENSE_SYMBOL_STRING; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return SUSPENSE_LIST_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return SUSPENSE_LIST_SYMBOL_STRING; }); -/* unused harmony export SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED_SYMBOL_STRING */ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// This list should be kept updated to reflect additions to 'shared/ReactSymbols'. -// DevTools can't import symbols from 'shared/ReactSymbols' directly for two reasons: -// 1. DevTools requires symbols which may have been deleted in more recent versions (e.g. concurrent mode) -// 2. DevTools must support both Symbol and numeric forms of each symbol; -// Since e.g. standalone DevTools runs in a separate process, it can't rely on its own ES capabilities. -const CONCURRENT_MODE_NUMBER = 0xeacf; -const CONCURRENT_MODE_SYMBOL_STRING = 'Symbol(react.concurrent_mode)'; -const CONTEXT_NUMBER = 0xeace; -const CONTEXT_SYMBOL_STRING = 'Symbol(react.context)'; -const SERVER_CONTEXT_SYMBOL_STRING = 'Symbol(react.server_context)'; -const DEPRECATED_ASYNC_MODE_SYMBOL_STRING = 'Symbol(react.async_mode)'; -const ELEMENT_NUMBER = 0xeac7; -const ELEMENT_SYMBOL_STRING = 'Symbol(react.element)'; -const DEBUG_TRACING_MODE_NUMBER = 0xeae1; -const DEBUG_TRACING_MODE_SYMBOL_STRING = 'Symbol(react.debug_trace_mode)'; -const FORWARD_REF_NUMBER = 0xead0; -const FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref)'; -const FRAGMENT_NUMBER = 0xeacb; -const FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment)'; -const LAZY_NUMBER = 0xead4; -const LAZY_SYMBOL_STRING = 'Symbol(react.lazy)'; -const MEMO_NUMBER = 0xead3; -const MEMO_SYMBOL_STRING = 'Symbol(react.memo)'; -const PORTAL_NUMBER = 0xeaca; -const PORTAL_SYMBOL_STRING = 'Symbol(react.portal)'; -const PROFILER_NUMBER = 0xead2; -const PROFILER_SYMBOL_STRING = 'Symbol(react.profiler)'; -const PROVIDER_NUMBER = 0xeacd; -const PROVIDER_SYMBOL_STRING = 'Symbol(react.provider)'; -const SCOPE_NUMBER = 0xead7; -const SCOPE_SYMBOL_STRING = 'Symbol(react.scope)'; -const STRICT_MODE_NUMBER = 0xeacc; -const STRICT_MODE_SYMBOL_STRING = 'Symbol(react.strict_mode)'; -const SUSPENSE_NUMBER = 0xead1; -const SUSPENSE_SYMBOL_STRING = 'Symbol(react.suspense)'; -const SUSPENSE_LIST_NUMBER = 0xead8; -const SUSPENSE_LIST_SYMBOL_STRING = 'Symbol(react.suspense_list)'; -const SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED_SYMBOL_STRING = 'Symbol(react.server_context.defaultValue)'; - -/***/ }), - -/***/ 40: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - // A linked list to keep track of recently-used-ness - -const Yallist = __webpack_require__(59); - -const MAX = Symbol('max'); -const LENGTH = Symbol('length'); -const LENGTH_CALCULATOR = Symbol('lengthCalculator'); -const ALLOW_STALE = Symbol('allowStale'); -const MAX_AGE = Symbol('maxAge'); -const DISPOSE = Symbol('dispose'); -const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet'); -const LRU_LIST = Symbol('lruList'); -const CACHE = Symbol('cache'); -const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet'); - -const naiveLength = () => 1; // lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. - - -class LRUCache { - constructor(options) { - if (typeof options === 'number') options = { - max: options - }; - if (!options) options = {}; - if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number'); // Kind of weird to have a default max of Infinity, but oh well. - - const max = this[MAX] = options.max || Infinity; - const lc = options.length || naiveLength; - this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc; - this[ALLOW_STALE] = options.stale || false; - if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number'); - this[MAX_AGE] = options.maxAge || 0; - this[DISPOSE] = options.dispose; - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false; - this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false; - this.reset(); - } // resize the cache when the max changes. - - - set max(mL) { - if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number'); - this[MAX] = mL || Infinity; - trim(this); - } - - get max() { - return this[MAX]; - } - - set allowStale(allowStale) { - this[ALLOW_STALE] = !!allowStale; - } - - get allowStale() { - return this[ALLOW_STALE]; - } - - set maxAge(mA) { - if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number'); - this[MAX_AGE] = mA; - trim(this); - } - - get maxAge() { - return this[MAX_AGE]; - } // resize the cache when the lengthCalculator changes. - - - set lengthCalculator(lC) { - if (typeof lC !== 'function') lC = naiveLength; - - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC; - this[LENGTH] = 0; - this[LRU_LIST].forEach(hit => { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); - this[LENGTH] += hit.length; - }); - } - - trim(this); - } - - get lengthCalculator() { - return this[LENGTH_CALCULATOR]; - } - - get length() { - return this[LENGTH]; - } - - get itemCount() { - return this[LRU_LIST].length; - } - - rforEach(fn, thisp) { - thisp = thisp || this; - - for (let walker = this[LRU_LIST].tail; walker !== null;) { - const prev = walker.prev; - forEachStep(this, fn, walker, thisp); - walker = prev; - } - } - - forEach(fn, thisp) { - thisp = thisp || this; - - for (let walker = this[LRU_LIST].head; walker !== null;) { - const next = walker.next; - forEachStep(this, fn, walker, thisp); - walker = next; - } - } - - keys() { - return this[LRU_LIST].toArray().map(k => k.key); - } - - values() { - return this[LRU_LIST].toArray().map(k => k.value); - } - - reset() { - if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { - this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)); - } - - this[CACHE] = new Map(); // hash of items by key - - this[LRU_LIST] = new Yallist(); // list of items in order of use recency - - this[LENGTH] = 0; // length of items in the list - } - - dump() { - return this[LRU_LIST].map(hit => isStale(this, hit) ? false : { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }).toArray().filter(h => h); - } - - dumpLru() { - return this[LRU_LIST]; - } - - set(key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE]; - if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number'); - const now = maxAge ? Date.now() : 0; - const len = this[LENGTH_CALCULATOR](value, key); - - if (this[CACHE].has(key)) { - if (len > this[MAX]) { - del(this, this[CACHE].get(key)); - return false; - } - - const node = this[CACHE].get(key); - const item = node.value; // dispose of the old one before overwriting - // split out into 2 ifs for better coverage tracking - - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value); - } - - item.now = now; - item.maxAge = maxAge; - item.value = value; - this[LENGTH] += len - item.length; - item.length = len; - this.get(key); - trim(this); - return true; - } - - const hit = new Entry(key, value, len, now, maxAge); // oversized objects fall out of cache automatically. - - if (hit.length > this[MAX]) { - if (this[DISPOSE]) this[DISPOSE](key, value); - return false; - } - - this[LENGTH] += hit.length; - this[LRU_LIST].unshift(hit); - this[CACHE].set(key, this[LRU_LIST].head); - trim(this); - return true; - } - - has(key) { - if (!this[CACHE].has(key)) return false; - const hit = this[CACHE].get(key).value; - return !isStale(this, hit); - } - - get(key) { - return get(this, key, true); - } - - peek(key) { - return get(this, key, false); - } - - pop() { - const node = this[LRU_LIST].tail; - if (!node) return null; - del(this, node); - return node.value; - } - - del(key) { - del(this, this[CACHE].get(key)); - } - - load(arr) { - // reset the cache - this.reset(); - const now = Date.now(); // A previous serialized cache has the most recent items first - - for (let l = arr.length - 1; l >= 0; l--) { - const hit = arr[l]; - const expiresAt = hit.e || 0; - if (expiresAt === 0) // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v);else { - const maxAge = expiresAt - now; // dont add already expired items - - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge); - } - } - } - } - - prune() { - this[CACHE].forEach((value, key) => get(this, key, false)); - } - -} - -const get = (self, key, doUse) => { - const node = self[CACHE].get(key); - - if (node) { - const hit = node.value; - - if (isStale(self, hit)) { - del(self, node); - if (!self[ALLOW_STALE]) return undefined; - } else { - if (doUse) { - if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now(); - self[LRU_LIST].unshiftNode(node); - } - } - - return hit.value; - } -}; - -const isStale = (self, hit) => { - if (!hit || !hit.maxAge && !self[MAX_AGE]) return false; - const diff = Date.now() - hit.now; - return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE]; -}; - -const trim = self => { - if (self[LENGTH] > self[MAX]) { - for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - const prev = walker.prev; - del(self, walker); - walker = prev; - } - } -}; - -const del = (self, node) => { - if (node) { - const hit = node.value; - if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value); - self[LENGTH] -= hit.length; - self[CACHE].delete(hit.key); - self[LRU_LIST].removeNode(node); - } -}; - -class Entry { - constructor(key, value, length, now, maxAge) { - this.key = key; - this.value = value; - this.length = length; - this.now = now; - this.maxAge = maxAge || 0; - } - -} - -const forEachStep = (self, fn, node, thisp) => { - let hit = node.value; - - if (isStale(self, hit)) { - del(self, node); - if (!self[ALLOW_STALE]) hit = undefined; - } - - if (hit) fn.call(thisp, hit.value, hit.key, self); -}; - -module.exports = LRUCache; - -/***/ }), - -/***/ 46: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const hasOwnProperty = Object.prototype.hasOwnProperty; -/* harmony default export */ __webpack_exports__["a"] = (hasOwnProperty); - -/***/ }), - -/***/ 48: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ getInternalReactConstants; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ attach; }); - -// EXTERNAL MODULE: ../react-devtools-shared/node_modules/semver/semver.js -var semver = __webpack_require__(25); - -// EXTERNAL MODULE: ../react-devtools-shared/src/types.js -var types = __webpack_require__(2); - -// EXTERNAL MODULE: ../react-devtools-shared/src/utils.js + 1 modules -var utils = __webpack_require__(3); - -// EXTERNAL MODULE: ../react-devtools-shared/src/storage.js -var storage = __webpack_require__(8); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/utils.js -var backend_utils = __webpack_require__(14); - -// EXTERNAL MODULE: ../react-devtools-shared/src/constants.js -var constants = __webpack_require__(1); - -// EXTERNAL MODULE: /Users/kevin.le-seigle/WS/react/build/oss-experimental/react-debug-tools/index.js -var react_debug_tools = __webpack_require__(65); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/console.js -var backend_console = __webpack_require__(37); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/ReactSymbols.js -var ReactSymbols = __webpack_require__(4); - -// EXTERNAL MODULE: ../react-devtools-shared/src/config/DevToolsFeatureFlags.extension-oss.js -var DevToolsFeatureFlags_extension_oss = __webpack_require__(13); - -// CONCATENATED MODULE: ../shared/objectIs.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -function is(x, y) { - return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare - ; -} - -const objectIs = typeof Object.is === 'function' ? Object.is : is; -/* harmony default export */ var shared_objectIs = (objectIs); -// EXTERNAL MODULE: ../shared/hasOwnProperty.js -var shared_hasOwnProperty = __webpack_require__(46); - -// EXTERNAL MODULE: ../react-devtools-shared/src/isArray.js -var isArray = __webpack_require__(16); - -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/StyleX/utils.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -const cachedStyleNameToValueMap = new Map(); -function getStyleXData(data) { - const sources = new Set(); - const resolvedStyles = {}; - crawlData(data, sources, resolvedStyles); - return { - sources: Array.from(sources).sort(), - resolvedStyles - }; -} -function crawlData(data, sources, resolvedStyles) { - if (data == null) { - return; - } - - if (Object(isArray["a" /* default */])(data)) { - data.forEach(entry => { - if (entry == null) { - return; - } - - if (Object(isArray["a" /* default */])(entry)) { - crawlData(entry, sources, resolvedStyles); - } else { - crawlObjectProperties(entry, sources, resolvedStyles); - } - }); - } else { - crawlObjectProperties(data, sources, resolvedStyles); - } - - resolvedStyles = Object.fromEntries(Object.entries(resolvedStyles).sort()); -} - -function crawlObjectProperties(entry, sources, resolvedStyles) { - const keys = Object.keys(entry); - keys.forEach(key => { - const value = entry[key]; - - if (typeof value === 'string') { - if (key === value) { - // Special case; this key is the name of the style's source/file/module. - sources.add(key); - } else { - resolvedStyles[key] = getPropertyValueForStyleName(value); - } - } else { - const nestedStyle = {}; - resolvedStyles[key] = nestedStyle; - crawlData([value], sources, nestedStyle); - } - }); -} - -function getPropertyValueForStyleName(styleName) { - if (cachedStyleNameToValueMap.has(styleName)) { - return cachedStyleNameToValueMap.get(styleName); - } - - for (let styleSheetIndex = 0; styleSheetIndex < document.styleSheets.length; styleSheetIndex++) { - const styleSheet = document.styleSheets[styleSheetIndex]; // $FlowFixMe Flow doesn't konw about these properties - - const rules = styleSheet.rules || styleSheet.cssRules; - - for (let ruleIndex = 0; ruleIndex < rules.length; ruleIndex++) { - const rule = rules[ruleIndex]; // $FlowFixMe Flow doesn't konw about these properties - - const { - cssText, - selectorText, - style - } = rule; - - if (selectorText != null) { - if (selectorText.startsWith(`.${styleName}`)) { - const match = cssText.match(/{ *([a-z\-]+):/); - - if (match !== null) { - const property = match[1]; - const value = style.getPropertyValue(property); - cachedStyleNameToValueMap.set(styleName, value); - return value; - } else { - return null; - } - } - } - } - } - - return null; -} -// EXTERNAL MODULE: ../shared/isArray.js -var shared_isArray = __webpack_require__(22); - -// EXTERNAL MODULE: ../react-devtools-timeline/src/constants.js -var src_constants = __webpack_require__(31); - -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/profilingHooks.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - // Add padding to the start/stop time of the profile. -// This makes the UI nicer to use. - -const TIME_OFFSET = 10; -let performanceTarget = null; // If performance exists and supports the subset of the User Timing API that we require. - -let supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function'; -let supportsUserTimingV3 = false; - -if (supportsUserTiming) { - const CHECK_V3_MARK = '__v3'; - const markOptions = {}; // $FlowFixMe: Ignore Flow complaining about needing a value - - Object.defineProperty(markOptions, 'startTime', { - get: function () { - supportsUserTimingV3 = true; - return 0; - }, - set: function () {} - }); - - try { - // $FlowFixMe: Flow expects the User Timing level 2 API. - performance.mark(CHECK_V3_MARK, markOptions); - } catch (error) {// Ignore - } finally { - performance.clearMarks(CHECK_V3_MARK); - } -} - -if (supportsUserTimingV3) { - performanceTarget = performance; -} // Some environments (e.g. React Native / Hermes) don't support the performance API yet. - - -const getCurrentTime = typeof performance === 'object' && typeof performance.now === 'function' ? () => performance.now() : () => Date.now(); // Mocking the Performance Object (and User Timing APIs) for testing is fragile. -// This API allows tests to directly override the User Timing APIs. - -function setPerformanceMock_ONLY_FOR_TESTING(performanceMock) { - performanceTarget = performanceMock; - supportsUserTiming = performanceMock !== null; - supportsUserTimingV3 = performanceMock !== null; -} -function createProfilingHooks({ - getDisplayNameForFiber, - getIsProfiling, - getLaneLabelMap, - reactVersion -}) { - let currentBatchUID = 0; - let currentReactComponentMeasure = null; - let currentReactMeasuresStack = []; - let currentTimelineData = null; - let isProfiling = false; - let nextRenderShouldStartNewBatch = false; - - function getRelativeTime() { - const currentTime = getCurrentTime(); - - if (currentTimelineData) { - if (currentTimelineData.startTime === 0) { - currentTimelineData.startTime = currentTime - TIME_OFFSET; - } - - return currentTime - currentTimelineData.startTime; - } - - return 0; - } - - function getInternalModuleRanges() { - /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges === 'function') { - // Ask the DevTools hook for module ranges that may have been reported by the current renderer(s). - // Don't do this eagerly like the laneToLabelMap, - // because some modules might not yet have registered their boundaries when the renderer is injected. - const ranges = __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges(); // This check would not be required, - // except that it's possible for things to override __REACT_DEVTOOLS_GLOBAL_HOOK__. - - - if (Object(shared_isArray["a" /* default */])(ranges)) { - return ranges; - } - } - - return null; - } - - function getTimelineData() { - return currentTimelineData; - } - - function laneToLanesArray(lanes) { - const lanesArray = []; - let lane = 1; - - for (let index = 0; index < src_constants["a" /* REACT_TOTAL_NUM_LANES */]; index++) { - if (lane & lanes) { - lanesArray.push(lane); - } - - lane *= 2; - } - - return lanesArray; - } - - const laneToLabelMap = typeof getLaneLabelMap === 'function' ? getLaneLabelMap() : null; - - function markMetadata() { - markAndClear(`--react-version-${reactVersion}`); - markAndClear(`--profiler-version-${src_constants["b" /* SCHEDULING_PROFILER_VERSION */]}`); - const ranges = getInternalModuleRanges(); - - if (ranges) { - for (let i = 0; i < ranges.length; i++) { - const range = ranges[i]; - - if (Object(shared_isArray["a" /* default */])(range) && range.length === 2) { - const [startStackFrame, stopStackFrame] = ranges[i]; - markAndClear(`--react-internal-module-start-${startStackFrame}`); - markAndClear(`--react-internal-module-stop-${stopStackFrame}`); - } - } - } - - if (laneToLabelMap != null) { - const labels = Array.from(laneToLabelMap.values()).join(','); - markAndClear(`--react-lane-labels-${labels}`); - } - } - - function markAndClear(markName) { - // This method won't be called unless these functions are defined, so we can skip the extra typeof check. - performanceTarget.mark(markName); - performanceTarget.clearMarks(markName); - } - - function recordReactMeasureStarted(type, lanes) { - // Decide what depth thi work should be rendered at, based on what's on the top of the stack. - // It's okay to render over top of "idle" work but everything else should be on its own row. - let depth = 0; - - if (currentReactMeasuresStack.length > 0) { - const top = currentReactMeasuresStack[currentReactMeasuresStack.length - 1]; - depth = top.type === 'render-idle' ? top.depth : top.depth + 1; - } - - const lanesArray = laneToLanesArray(lanes); - const reactMeasure = { - type, - batchUID: currentBatchUID, - depth, - lanes: lanesArray, - timestamp: getRelativeTime(), - duration: 0 - }; - currentReactMeasuresStack.push(reactMeasure); - - if (currentTimelineData) { - const { - batchUIDToMeasuresMap, - laneToReactMeasureMap - } = currentTimelineData; - let reactMeasures = batchUIDToMeasuresMap.get(currentBatchUID); - - if (reactMeasures != null) { - reactMeasures.push(reactMeasure); - } else { - batchUIDToMeasuresMap.set(currentBatchUID, [reactMeasure]); - } - - lanesArray.forEach(lane => { - reactMeasures = laneToReactMeasureMap.get(lane); - - if (reactMeasures) { - reactMeasures.push(reactMeasure); - } - }); - } - } - - function recordReactMeasureCompleted(type) { - const currentTime = getRelativeTime(); - - if (currentReactMeasuresStack.length === 0) { - console.error('Unexpected type "%s" completed at %sms while currentReactMeasuresStack is empty.', type, currentTime); // Ignore work "completion" user timing mark that doesn't complete anything - - return; - } - - const top = currentReactMeasuresStack.pop(); - - if (top.type !== type) { - console.error('Unexpected type "%s" completed at %sms before "%s" completed.', type, currentTime, top.type); - } // $FlowFixMe This property should not be writable outside of this function. - - - top.duration = currentTime - top.timestamp; - - if (currentTimelineData) { - currentTimelineData.duration = getRelativeTime() + TIME_OFFSET; - } - } - - function markCommitStarted(lanes) { - if (isProfiling) { - recordReactMeasureStarted('commit', lanes); // TODO (timeline) Re-think this approach to "batching"; I don't think it works for Suspense or pre-rendering. - // This issue applies to the User Timing data also. - - nextRenderShouldStartNewBatch = true; - } - - if (supportsUserTimingV3) { - markAndClear(`--commit-start-${lanes}`); // Some metadata only needs to be logged once per session, - // but if profiling information is being recorded via the Performance tab, - // DevTools has no way of knowing when the recording starts. - // Because of that, we log thie type of data periodically (once per commit). - - markMetadata(); - } - } - - function markCommitStopped() { - if (isProfiling) { - recordReactMeasureCompleted('commit'); - recordReactMeasureCompleted('render-idle'); - } - - if (supportsUserTimingV3) { - markAndClear('--commit-stop'); - } - } - - function markComponentRenderStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'render', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-render-start-${componentName}`); - } - } - } - - function markComponentRenderStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } - - currentReactComponentMeasure.duration = getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-render-stop'); - } - } - - function markComponentLayoutEffectMountStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'layout-effect-mount', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-layout-effect-mount-start-${componentName}`); - } - } - } - - function markComponentLayoutEffectMountStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } - - currentReactComponentMeasure.duration = getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-layout-effect-mount-stop'); - } - } - - function markComponentLayoutEffectUnmountStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'layout-effect-unmount', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-layout-effect-unmount-start-${componentName}`); - } - } - } - - function markComponentLayoutEffectUnmountStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } - - currentReactComponentMeasure.duration = getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-layout-effect-unmount-stop'); - } - } - - function markComponentPassiveEffectMountStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'passive-effect-mount', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-passive-effect-mount-start-${componentName}`); - } - } - } - - function markComponentPassiveEffectMountStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } - - currentReactComponentMeasure.duration = getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-passive-effect-mount-stop'); - } - } - - function markComponentPassiveEffectUnmountStarted(fiber) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (isProfiling) { - currentReactComponentMeasure = { - componentName, - duration: 0, - timestamp: getRelativeTime(), - type: 'passive-effect-unmount', - warning: null - }; - } - } - - if (supportsUserTimingV3) { - markAndClear(`--component-passive-effect-unmount-start-${componentName}`); - } - } - } - - function markComponentPassiveEffectUnmountStopped() { - if (isProfiling) { - if (currentReactComponentMeasure) { - if (currentTimelineData) { - currentTimelineData.componentMeasures.push(currentReactComponentMeasure); - } - - currentReactComponentMeasure.duration = getRelativeTime() - currentReactComponentMeasure.timestamp; - currentReactComponentMeasure = null; - } - } - - if (supportsUserTimingV3) { - markAndClear('--component-passive-effect-unmount-stop'); - } - } - - function markComponentErrored(fiber, thrownValue, lanes) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - const phase = fiber.alternate === null ? 'mount' : 'update'; - let message = ''; - - if (thrownValue !== null && typeof thrownValue === 'object' && typeof thrownValue.message === 'string') { - message = thrownValue.message; - } else if (typeof thrownValue === 'string') { - message = thrownValue; - } - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (currentTimelineData) { - currentTimelineData.thrownErrors.push({ - componentName, - message, - phase, - timestamp: getRelativeTime(), - type: 'thrown-error' - }); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--error-${componentName}-${phase}-${message}`); - } - } - } - - const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // $FlowFixMe: Flow cannot handle polymorphic WeakMaps - - const wakeableIDs = new PossiblyWeakMap(); - let wakeableID = 0; - - function getWakeableID(wakeable) { - if (!wakeableIDs.has(wakeable)) { - wakeableIDs.set(wakeable, wakeableID++); - } - - return wakeableIDs.get(wakeable); - } - - function markComponentSuspended(fiber, wakeable, lanes) { - if (isProfiling || supportsUserTimingV3) { - const eventType = wakeableIDs.has(wakeable) ? 'resuspend' : 'suspend'; - const id = getWakeableID(wakeable); - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - const phase = fiber.alternate === null ? 'mount' : 'update'; // Following the non-standard fn.displayName convention, - // frameworks like Relay may also annotate Promises with a displayName, - // describing what operation/data the thrown Promise is related to. - // When this is available we should pass it along to the Timeline. - - const displayName = wakeable.displayName || ''; - let suspenseEvent = null; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - suspenseEvent = { - componentName, - depth: 0, - duration: 0, - id: `${id}`, - phase, - promiseName: displayName, - resolution: 'unresolved', - timestamp: getRelativeTime(), - type: 'suspense', - warning: null - }; - - if (currentTimelineData) { - currentTimelineData.suspenseEvents.push(suspenseEvent); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--suspense-${eventType}-${id}-${componentName}-${phase}-${lanes}-${displayName}`); - } - - wakeable.then(() => { - if (suspenseEvent) { - suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp; - suspenseEvent.resolution = 'resolved'; - } - - if (supportsUserTimingV3) { - markAndClear(`--suspense-resolved-${id}-${componentName}`); - } - }, () => { - if (suspenseEvent) { - suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp; - suspenseEvent.resolution = 'rejected'; - } - - if (supportsUserTimingV3) { - markAndClear(`--suspense-rejected-${id}-${componentName}`); - } - }); - } - } - - function markLayoutEffectsStarted(lanes) { - if (isProfiling) { - recordReactMeasureStarted('layout-effects', lanes); - } - - if (supportsUserTimingV3) { - markAndClear(`--layout-effects-start-${lanes}`); - } - } - - function markLayoutEffectsStopped() { - if (isProfiling) { - recordReactMeasureCompleted('layout-effects'); - } - - if (supportsUserTimingV3) { - markAndClear('--layout-effects-stop'); - } - } - - function markPassiveEffectsStarted(lanes) { - if (isProfiling) { - recordReactMeasureStarted('passive-effects', lanes); - } - - if (supportsUserTimingV3) { - markAndClear(`--passive-effects-start-${lanes}`); - } - } - - function markPassiveEffectsStopped() { - if (isProfiling) { - recordReactMeasureCompleted('passive-effects'); - } - - if (supportsUserTimingV3) { - markAndClear('--passive-effects-stop'); - } - } - - function markRenderStarted(lanes) { - if (isProfiling) { - if (nextRenderShouldStartNewBatch) { - nextRenderShouldStartNewBatch = false; - currentBatchUID++; - } // If this is a new batch of work, wrap an "idle" measure around it. - // Log it before the "render" measure to preserve the stack ordering. - - - if (currentReactMeasuresStack.length === 0 || currentReactMeasuresStack[currentReactMeasuresStack.length - 1].type !== 'render-idle') { - recordReactMeasureStarted('render-idle', lanes); - } - - recordReactMeasureStarted('render', lanes); - } - - if (supportsUserTimingV3) { - markAndClear(`--render-start-${lanes}`); - } - } - - function markRenderYielded() { - if (isProfiling) { - recordReactMeasureCompleted('render'); - } - - if (supportsUserTimingV3) { - markAndClear('--render-yield'); - } - } - - function markRenderStopped() { - if (isProfiling) { - recordReactMeasureCompleted('render'); - } - - if (supportsUserTimingV3) { - markAndClear('--render-stop'); - } - } - - function markRenderScheduled(lane) { - if (isProfiling) { - if (currentTimelineData) { - currentTimelineData.schedulingEvents.push({ - lanes: laneToLanesArray(lane), - timestamp: getRelativeTime(), - type: 'schedule-render', - warning: null - }); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--schedule-render-${lane}`); - } - } - - function markForceUpdateScheduled(fiber, lane) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (currentTimelineData) { - currentTimelineData.schedulingEvents.push({ - componentName, - lanes: laneToLanesArray(lane), - timestamp: getRelativeTime(), - type: 'schedule-force-update', - warning: null - }); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--schedule-forced-update-${lane}-${componentName}`); - } - } - } - - function markStateUpdateScheduled(fiber, lane) { - if (isProfiling || supportsUserTimingV3) { - const componentName = getDisplayNameForFiber(fiber) || 'Unknown'; - - if (isProfiling) { - // TODO (timeline) Record and cache component stack - if (currentTimelineData) { - currentTimelineData.schedulingEvents.push({ - componentName, - lanes: laneToLanesArray(lane), - timestamp: getRelativeTime(), - type: 'schedule-state-update', - warning: null - }); - } - } - - if (supportsUserTimingV3) { - markAndClear(`--schedule-state-update-${lane}-${componentName}`); - } - } - } - - function toggleProfilingStatus(value) { - if (isProfiling !== value) { - isProfiling = value; - - if (isProfiling) { - const internalModuleSourceToRanges = new Map(); - - if (supportsUserTimingV3) { - const ranges = getInternalModuleRanges(); - - if (ranges) { - for (let i = 0; i < ranges.length; i++) { - const range = ranges[i]; - - if (Object(shared_isArray["a" /* default */])(range) && range.length === 2) { - const [startStackFrame, stopStackFrame] = ranges[i]; - markAndClear(`--react-internal-module-start-${startStackFrame}`); - markAndClear(`--react-internal-module-stop-${stopStackFrame}`); - } - } - } - } - - const laneToReactMeasureMap = new Map(); - let lane = 1; - - for (let index = 0; index < src_constants["a" /* REACT_TOTAL_NUM_LANES */]; index++) { - laneToReactMeasureMap.set(lane, []); - lane *= 2; - } - - currentBatchUID = 0; - currentReactComponentMeasure = null; - currentReactMeasuresStack = []; - currentTimelineData = { - // Session wide metadata; only collected once. - internalModuleSourceToRanges, - laneToLabelMap: laneToLabelMap || new Map(), - reactVersion, - // Data logged by React during profiling session. - componentMeasures: [], - schedulingEvents: [], - suspenseEvents: [], - thrownErrors: [], - // Data inferred based on what React logs. - batchUIDToMeasuresMap: new Map(), - duration: 0, - laneToReactMeasureMap, - startTime: 0, - // Data only available in Chrome profiles. - flamechart: [], - nativeEvents: [], - networkMeasures: [], - otherUserTimingMarks: [], - snapshots: [], - snapshotHeight: 0 - }; - nextRenderShouldStartNewBatch = true; - } - } - } - - return { - getTimelineData, - profilingHooks: { - markCommitStarted, - markCommitStopped, - markComponentRenderStarted, - markComponentRenderStopped, - markComponentPassiveEffectMountStarted, - markComponentPassiveEffectMountStopped, - markComponentPassiveEffectUnmountStarted, - markComponentPassiveEffectUnmountStopped, - markComponentLayoutEffectMountStarted, - markComponentLayoutEffectMountStopped, - markComponentLayoutEffectUnmountStarted, - markComponentLayoutEffectUnmountStopped, - markComponentErrored, - markComponentSuspended, - markLayoutEffectsStarted, - markLayoutEffectsStopped, - markPassiveEffectsStarted, - markPassiveEffectsStopped, - markRenderStarted, - markRenderYielded, - markRenderStopped, - markRenderScheduled, - markForceUpdateScheduled, - markStateUpdateScheduled - }, - toggleProfilingStatus - }; -} -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/renderer.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - - - - - - - - - - - - - -function getFiberFlags(fiber) { - // The name of this field changed from "effectTag" to "flags" - return fiber.flags !== undefined ? fiber.flags : fiber.effectTag; -} // Some environments (e.g. React Native / Hermes) don't support the performance API yet. - - -const renderer_getCurrentTime = typeof performance === 'object' && typeof performance.now === 'function' ? () => performance.now() : () => Date.now(); -function getInternalReactConstants(version) { - const ReactTypeOfSideEffect = { - DidCapture: 0b10000000, - NoFlags: 0b00, - PerformedWork: 0b01, - Placement: 0b10, - Incomplete: 0b10000000000000, - Hydrating: 0b1000000000000 - }; // ********************************************************** - // The section below is copied from files in React repo. - // Keep it in sync, and add version guards if it changes. - // - // Technically these priority levels are invalid for versions before 16.9, - // but 16.9 is the first version to report priority level to DevTools, - // so we can avoid checking for earlier versions and support pre-16.9 canary releases in the process. - - let ReactPriorityLevels = { - ImmediatePriority: 99, - UserBlockingPriority: 98, - NormalPriority: 97, - LowPriority: 96, - IdlePriority: 95, - NoPriority: 90 - }; - - if (Object(semver["gt"])(version, '17.0.2')) { - ReactPriorityLevels = { - ImmediatePriority: 1, - UserBlockingPriority: 2, - NormalPriority: 3, - LowPriority: 4, - IdlePriority: 5, - NoPriority: 0 - }; - } - - let StrictModeBits = 0; - - if (Object(semver["gte"])(version, '18.0.0-alpha')) { - // 18+ - StrictModeBits = 0b011000; - } else if (Object(semver["gte"])(version, '16.9.0')) { - // 16.9 - 17 - StrictModeBits = 0b1; - } else if (Object(semver["gte"])(version, '16.3.0')) { - // 16.3 - 16.8 - StrictModeBits = 0b10; - } - - let ReactTypeOfWork = null; // ********************************************************** - // The section below is copied from files in React repo. - // Keep it in sync, and add version guards if it changes. - // - // TODO Update the gt() check below to be gte() whichever the next version number is. - // Currently the version in Git is 17.0.2 (but that version has not been/may not end up being released). - - if (Object(semver["gt"])(version, '17.0.1')) { - ReactTypeOfWork = { - CacheComponent: 24, - // Experimental - ClassComponent: 1, - ContextConsumer: 9, - ContextProvider: 10, - CoroutineComponent: -1, - // Removed - CoroutineHandlerPhase: -1, - // Removed - DehydratedSuspenseComponent: 18, - // Behind a flag - ForwardRef: 11, - Fragment: 7, - FunctionComponent: 0, - HostComponent: 5, - HostPortal: 4, - HostRoot: 3, - HostText: 6, - IncompleteClassComponent: 17, - IndeterminateComponent: 2, - LazyComponent: 16, - LegacyHiddenComponent: 23, - MemoComponent: 14, - Mode: 8, - OffscreenComponent: 22, - // Experimental - Profiler: 12, - ScopeComponent: 21, - // Experimental - SimpleMemoComponent: 15, - SuspenseComponent: 13, - SuspenseListComponent: 19, - // Experimental - TracingMarkerComponent: 25, - // Experimental - This is technically in 18 but we don't - // want to fork again so we're adding it here instead - YieldComponent: -1 // Removed - - }; - } else if (Object(semver["gte"])(version, '17.0.0-alpha')) { - ReactTypeOfWork = { - CacheComponent: -1, - // Doesn't exist yet - ClassComponent: 1, - ContextConsumer: 9, - ContextProvider: 10, - CoroutineComponent: -1, - // Removed - CoroutineHandlerPhase: -1, - // Removed - DehydratedSuspenseComponent: 18, - // Behind a flag - ForwardRef: 11, - Fragment: 7, - FunctionComponent: 0, - HostComponent: 5, - HostPortal: 4, - HostRoot: 3, - HostText: 6, - IncompleteClassComponent: 17, - IndeterminateComponent: 2, - LazyComponent: 16, - LegacyHiddenComponent: 24, - MemoComponent: 14, - Mode: 8, - OffscreenComponent: 23, - // Experimental - Profiler: 12, - ScopeComponent: 21, - // Experimental - SimpleMemoComponent: 15, - SuspenseComponent: 13, - SuspenseListComponent: 19, - // Experimental - TracingMarkerComponent: -1, - // Doesn't exist yet - YieldComponent: -1 // Removed - - }; - } else if (Object(semver["gte"])(version, '16.6.0-beta.0')) { - ReactTypeOfWork = { - CacheComponent: -1, - // Doesn't exist yet - ClassComponent: 1, - ContextConsumer: 9, - ContextProvider: 10, - CoroutineComponent: -1, - // Removed - CoroutineHandlerPhase: -1, - // Removed - DehydratedSuspenseComponent: 18, - // Behind a flag - ForwardRef: 11, - Fragment: 7, - FunctionComponent: 0, - HostComponent: 5, - HostPortal: 4, - HostRoot: 3, - HostText: 6, - IncompleteClassComponent: 17, - IndeterminateComponent: 2, - LazyComponent: 16, - LegacyHiddenComponent: -1, - MemoComponent: 14, - Mode: 8, - OffscreenComponent: -1, - // Experimental - Profiler: 12, - ScopeComponent: -1, - // Experimental - SimpleMemoComponent: 15, - SuspenseComponent: 13, - SuspenseListComponent: 19, - // Experimental - TracingMarkerComponent: -1, - // Doesn't exist yet - YieldComponent: -1 // Removed - - }; - } else if (Object(semver["gte"])(version, '16.4.3-alpha')) { - ReactTypeOfWork = { - CacheComponent: -1, - // Doesn't exist yet - ClassComponent: 2, - ContextConsumer: 11, - ContextProvider: 12, - CoroutineComponent: -1, - // Removed - CoroutineHandlerPhase: -1, - // Removed - DehydratedSuspenseComponent: -1, - // Doesn't exist yet - ForwardRef: 13, - Fragment: 9, - FunctionComponent: 0, - HostComponent: 7, - HostPortal: 6, - HostRoot: 5, - HostText: 8, - IncompleteClassComponent: -1, - // Doesn't exist yet - IndeterminateComponent: 4, - LazyComponent: -1, - // Doesn't exist yet - LegacyHiddenComponent: -1, - MemoComponent: -1, - // Doesn't exist yet - Mode: 10, - OffscreenComponent: -1, - // Experimental - Profiler: 15, - ScopeComponent: -1, - // Experimental - SimpleMemoComponent: -1, - // Doesn't exist yet - SuspenseComponent: 16, - SuspenseListComponent: -1, - // Doesn't exist yet - TracingMarkerComponent: -1, - // Doesn't exist yet - YieldComponent: -1 // Removed - - }; - } else { - ReactTypeOfWork = { - CacheComponent: -1, - // Doesn't exist yet - ClassComponent: 2, - ContextConsumer: 12, - ContextProvider: 13, - CoroutineComponent: 7, - CoroutineHandlerPhase: 8, - DehydratedSuspenseComponent: -1, - // Doesn't exist yet - ForwardRef: 14, - Fragment: 10, - FunctionComponent: 1, - HostComponent: 5, - HostPortal: 4, - HostRoot: 3, - HostText: 6, - IncompleteClassComponent: -1, - // Doesn't exist yet - IndeterminateComponent: 0, - LazyComponent: -1, - // Doesn't exist yet - LegacyHiddenComponent: -1, - MemoComponent: -1, - // Doesn't exist yet - Mode: 11, - OffscreenComponent: -1, - // Experimental - Profiler: 15, - ScopeComponent: -1, - // Experimental - SimpleMemoComponent: -1, - // Doesn't exist yet - SuspenseComponent: 16, - SuspenseListComponent: -1, - // Doesn't exist yet - TracingMarkerComponent: -1, - // Doesn't exist yet - YieldComponent: 9 - }; - } // ********************************************************** - // End of copied code. - // ********************************************************** - - - function getTypeSymbol(type) { - const symbolOrNumber = typeof type === 'object' && type !== null ? type.$$typeof : type; // $FlowFixMe Flow doesn't know about typeof "symbol" - - return typeof symbolOrNumber === 'symbol' ? symbolOrNumber.toString() : symbolOrNumber; - } - - const { - CacheComponent, - ClassComponent, - IncompleteClassComponent, - FunctionComponent, - IndeterminateComponent, - ForwardRef, - HostRoot, - HostComponent, - HostPortal, - HostText, - Fragment, - LazyComponent, - LegacyHiddenComponent, - MemoComponent, - OffscreenComponent, - Profiler, - ScopeComponent, - SimpleMemoComponent, - SuspenseComponent, - SuspenseListComponent, - TracingMarkerComponent - } = ReactTypeOfWork; - - function resolveFiberType(type) { - const typeSymbol = getTypeSymbol(type); - - switch (typeSymbol) { - case ReactSymbols["j" /* MEMO_NUMBER */]: - case ReactSymbols["k" /* MEMO_SYMBOL_STRING */]: - // recursively resolving memo type in case of memo(forwardRef(Component)) - return resolveFiberType(type.type); - - case ReactSymbols["f" /* FORWARD_REF_NUMBER */]: - case ReactSymbols["g" /* FORWARD_REF_SYMBOL_STRING */]: - return type.render; - - default: - return type; - } - } // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods - - - function getDisplayNameForFiber(fiber) { - const { - elementType, - type, - tag - } = fiber; - let resolvedType = type; - - if (typeof type === 'object' && type !== null) { - resolvedType = resolveFiberType(type); - } - - let resolvedContext = null; - - switch (tag) { - case CacheComponent: - return 'Cache'; - - case ClassComponent: - case IncompleteClassComponent: - return Object(utils["i" /* getDisplayName */])(resolvedType); - - case FunctionComponent: - case IndeterminateComponent: - return Object(utils["i" /* getDisplayName */])(resolvedType); - - case ForwardRef: - // Mirror https://github.com/facebook/react/blob/7c21bf72ace77094fd1910cc350a548287ef8350/packages/shared/getComponentName.js#L27-L37 - return type && type.displayName || Object(utils["i" /* getDisplayName */])(resolvedType, 'Anonymous'); - - case HostRoot: - const fiberRoot = fiber.stateNode; - - if (fiberRoot != null && fiberRoot._debugRootType !== null) { - return fiberRoot._debugRootType; - } - - return null; - - case HostComponent: - return type; - - case HostPortal: - case HostText: - case Fragment: - return null; - - case LazyComponent: - // This display name will not be user visible. - // Once a Lazy component loads its inner component, React replaces the tag and type. - // This display name will only show up in console logs when DevTools DEBUG mode is on. - return 'Lazy'; - - case MemoComponent: - case SimpleMemoComponent: - return elementType && elementType.displayName || type && type.displayName || Object(utils["i" /* getDisplayName */])(resolvedType, 'Anonymous'); - - case SuspenseComponent: - return 'Suspense'; - - case LegacyHiddenComponent: - return 'LegacyHidden'; - - case OffscreenComponent: - return 'Offscreen'; - - case ScopeComponent: - return 'Scope'; - - case SuspenseListComponent: - return 'SuspenseList'; - - case Profiler: - return 'Profiler'; - - case TracingMarkerComponent: - return 'TracingMarker'; - - default: - const typeSymbol = getTypeSymbol(type); - - switch (typeSymbol) { - case ReactSymbols["a" /* CONCURRENT_MODE_NUMBER */]: - case ReactSymbols["b" /* CONCURRENT_MODE_SYMBOL_STRING */]: - case ReactSymbols["e" /* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */]: - return null; - - case ReactSymbols["n" /* PROVIDER_NUMBER */]: - case ReactSymbols["o" /* PROVIDER_SYMBOL_STRING */]: - // 16.3.0 exposed the context object as "context" - // PR #12501 changed it to "_context" for 16.3.1+ - // NOTE Keep in sync with inspectElementRaw() - resolvedContext = fiber.type._context || fiber.type.context; - return `${resolvedContext.displayName || 'Context'}.Provider`; - - case ReactSymbols["c" /* CONTEXT_NUMBER */]: - case ReactSymbols["d" /* CONTEXT_SYMBOL_STRING */]: - case ReactSymbols["r" /* SERVER_CONTEXT_SYMBOL_STRING */]: - // 16.3-16.5 read from "type" because the Consumer is the actual context object. - // 16.6+ should read from "type._context" because Consumer can be different (in DEV). - // NOTE Keep in sync with inspectElementRaw() - resolvedContext = fiber.type._context || fiber.type; // NOTE: TraceUpdatesBackendManager depends on the name ending in '.Consumer' - // If you change the name, figure out a more resilient way to detect it. - - return `${resolvedContext.displayName || 'Context'}.Consumer`; - - case ReactSymbols["s" /* STRICT_MODE_NUMBER */]: - case ReactSymbols["t" /* STRICT_MODE_SYMBOL_STRING */]: - return null; - - case ReactSymbols["l" /* PROFILER_NUMBER */]: - case ReactSymbols["m" /* PROFILER_SYMBOL_STRING */]: - return `Profiler(${fiber.memoizedProps.id})`; - - case ReactSymbols["p" /* SCOPE_NUMBER */]: - case ReactSymbols["q" /* SCOPE_SYMBOL_STRING */]: - return 'Scope'; - - default: - // Unknown element type. - // This may mean a new element type that has not yet been added to DevTools. - return null; - } - - } - } - - return { - getDisplayNameForFiber, - getTypeSymbol, - ReactPriorityLevels, - ReactTypeOfWork, - ReactTypeOfSideEffect, - StrictModeBits - }; -} // Map of one or more Fibers in a pair to their unique id number. -// We track both Fibers to support Fast Refresh, -// which may forcefully replace one of the pair as part of hot reloading. -// In that case it's still important to be able to locate the previous ID during subsequent renders. - -const fiberToIDMap = new Map(); // Map of id to one (arbitrary) Fiber in a pair. -// This Map is used to e.g. get the display name for a Fiber or schedule an update, -// operations that should be the same whether the current and work-in-progress Fiber is used. - -const idToArbitraryFiberMap = new Map(); -function attach(hook, rendererID, renderer, global) { - // Newer versions of the reconciler package also specific reconciler version. - // If that version number is present, use it. - // Third party renderer versions may not match the reconciler version, - // and the latter is what's important in terms of tags and symbols. - const version = renderer.reconcilerVersion || renderer.version; - const { - getDisplayNameForFiber, - getTypeSymbol, - ReactPriorityLevels, - ReactTypeOfWork, - ReactTypeOfSideEffect, - StrictModeBits - } = getInternalReactConstants(version); - const { - DidCapture, - Hydrating, - NoFlags, - PerformedWork, - Placement - } = ReactTypeOfSideEffect; - const { - CacheComponent, - ClassComponent, - ContextConsumer, - DehydratedSuspenseComponent, - ForwardRef, - Fragment, - FunctionComponent, - HostRoot, - HostPortal, - HostComponent, - HostText, - IncompleteClassComponent, - IndeterminateComponent, - LegacyHiddenComponent, - MemoComponent, - OffscreenComponent, - SimpleMemoComponent, - SuspenseComponent, - SuspenseListComponent, - TracingMarkerComponent - } = ReactTypeOfWork; - const { - ImmediatePriority, - UserBlockingPriority, - NormalPriority, - LowPriority, - IdlePriority, - NoPriority - } = ReactPriorityLevels; - const { - getLaneLabelMap, - injectProfilingHooks, - overrideHookState, - overrideHookStateDeletePath, - overrideHookStateRenamePath, - overrideProps, - overridePropsDeletePath, - overridePropsRenamePath, - scheduleRefresh, - setErrorHandler, - setSuspenseHandler, - scheduleUpdate - } = renderer; - const supportsTogglingError = typeof setErrorHandler === 'function' && typeof scheduleUpdate === 'function'; - const supportsTogglingSuspense = typeof setSuspenseHandler === 'function' && typeof scheduleUpdate === 'function'; - - if (typeof scheduleRefresh === 'function') { - // When Fast Refresh updates a component, the frontend may need to purge cached information. - // For example, ASTs cached for the component (for named hooks) may no longer be valid. - // Send a signal to the frontend to purge this cached information. - // The "fastRefreshScheduled" dispatched is global (not Fiber or even Renderer specific). - // This is less effecient since it means the front-end will need to purge the entire cache, - // but this is probably an okay trade off in order to reduce coupling between the DevTools and Fast Refresh. - renderer.scheduleRefresh = (...args) => { - try { - hook.emit('fastRefreshScheduled'); - } finally { - return scheduleRefresh(...args); - } - }; - } - - let getTimelineData = null; - let toggleProfilingStatus = null; - - if (typeof injectProfilingHooks === 'function') { - const response = createProfilingHooks({ - getDisplayNameForFiber, - getIsProfiling: () => isProfiling, - getLaneLabelMap, - reactVersion: version - }); // Pass the Profiling hooks to the reconciler for it to call during render. - - injectProfilingHooks(response.profilingHooks); // Hang onto this toggle so we can notify the external methods of profiling status changes. - - getTimelineData = response.getTimelineData; - toggleProfilingStatus = response.toggleProfilingStatus; - } // Tracks Fibers with recently changed number of error/warning messages. - // These collections store the Fiber rather than the ID, - // in order to avoid generating an ID for Fibers that never get mounted - // (due to e.g. Suspense or error boundaries). - // onErrorOrWarning() adds Fibers and recordPendingErrorsAndWarnings() later clears them. - - - const fibersWithChangedErrorOrWarningCounts = new Set(); - const pendingFiberToErrorsMap = new Map(); - const pendingFiberToWarningsMap = new Map(); // Mapping of fiber IDs to error/warning messages and counts. - - const fiberIDToErrorsMap = new Map(); - const fiberIDToWarningsMap = new Map(); - - function clearErrorsAndWarnings() { - // eslint-disable-next-line no-for-of-loops/no-for-of-loops - for (const id of fiberIDToErrorsMap.keys()) { - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber != null) { - fibersWithChangedErrorOrWarningCounts.add(fiber); - updateMostRecentlyInspectedElementIfNecessary(id); - } - } // eslint-disable-next-line no-for-of-loops/no-for-of-loops - - - for (const id of fiberIDToWarningsMap.keys()) { - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber != null) { - fibersWithChangedErrorOrWarningCounts.add(fiber); - updateMostRecentlyInspectedElementIfNecessary(id); - } - } - - fiberIDToErrorsMap.clear(); - fiberIDToWarningsMap.clear(); - flushPendingEvents(); - } - - function clearMessageCountHelper(fiberID, pendingFiberToMessageCountMap, fiberIDToMessageCountMap) { - const fiber = idToArbitraryFiberMap.get(fiberID); - - if (fiber != null) { - // Throw out any pending changes. - pendingFiberToErrorsMap.delete(fiber); - - if (fiberIDToMessageCountMap.has(fiberID)) { - fiberIDToMessageCountMap.delete(fiberID); // If previous flushed counts have changed, schedule an update too. - - fibersWithChangedErrorOrWarningCounts.add(fiber); - flushPendingEvents(); - updateMostRecentlyInspectedElementIfNecessary(fiberID); - } else { - fibersWithChangedErrorOrWarningCounts.delete(fiber); - } - } - } - - function clearErrorsForFiberID(fiberID) { - clearMessageCountHelper(fiberID, pendingFiberToErrorsMap, fiberIDToErrorsMap); - } - - function clearWarningsForFiberID(fiberID) { - clearMessageCountHelper(fiberID, pendingFiberToWarningsMap, fiberIDToWarningsMap); - } - - function updateMostRecentlyInspectedElementIfNecessary(fiberID) { - if (mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === fiberID) { - hasElementUpdatedSinceLastInspected = true; - } - } // Called when an error or warning is logged during render, commit, or passive (including unmount functions). - - - function onErrorOrWarning(fiber, type, args) { - if (type === 'error') { - const maybeID = getFiberIDUnsafe(fiber); // if this is an error simulated by us to trigger error boundary, ignore - - if (maybeID != null && forceErrorForFiberIDs.get(maybeID) === true) { - return; - } - } - - const message = Object(backend_utils["f" /* format */])(...args); - - if (constants["E" /* __DEBUG__ */]) { - debug('onErrorOrWarning', fiber, null, `${type}: "${message}"`); - } // Mark this Fiber as needed its warning/error count updated during the next flush. - - - fibersWithChangedErrorOrWarningCounts.add(fiber); // Track the warning/error for later. - - const fiberMap = type === 'error' ? pendingFiberToErrorsMap : pendingFiberToWarningsMap; - const messageMap = fiberMap.get(fiber); - - if (messageMap != null) { - const count = messageMap.get(message) || 0; - messageMap.set(message, count + 1); - } else { - fiberMap.set(fiber, new Map([[message, 1]])); - } // Passive effects may trigger errors or warnings too; - // In this case, we should wait until the rest of the passive effects have run, - // but we shouldn't wait until the next commit because that might be a long time. - // This would also cause "tearing" between an inspected Component and the tree view. - // Then again we don't want to flush too soon because this could be an error during async rendering. - // Use a debounce technique to ensure that we'll eventually flush. - - - flushPendingErrorsAndWarningsAfterDelay(); - } // Patching the console enables DevTools to do a few useful things: - // * Append component stacks to warnings and error messages - // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber) - // - // Don't patch in test environments because we don't want to interfere with Jest's own console overrides. - - - if (true) { - Object(backend_console["c" /* registerRenderer */])(renderer, onErrorOrWarning); // The renderer interface can't read these preferences directly, - // because it is stored in localStorage within the context of the extension. - // It relies on the extension to pass the preference through via the global. - - const appendComponentStack = window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ !== false; - const breakOnConsoleErrors = window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ === true; - const showInlineWarningsAndErrors = window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ !== false; - const hideConsoleLogsInStrictMode = window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ === true; - const browserTheme = window.__REACT_DEVTOOLS_BROWSER_THEME__; - Object(backend_console["a" /* patch */])({ - appendComponentStack, - breakOnConsoleErrors, - showInlineWarningsAndErrors, - hideConsoleLogsInStrictMode, - browserTheme - }); - } - - const debug = (name, fiber, parentFiber, extraString = '') => { - if (constants["E" /* __DEBUG__ */]) { - const displayName = fiber.tag + ':' + (getDisplayNameForFiber(fiber) || 'null'); - const maybeID = getFiberIDUnsafe(fiber) || ''; - const parentDisplayName = parentFiber ? parentFiber.tag + ':' + (getDisplayNameForFiber(parentFiber) || 'null') : ''; - const maybeParentID = parentFiber ? getFiberIDUnsafe(parentFiber) || '' : ''; - console.groupCollapsed(`[renderer] %c${name} %c${displayName} (${maybeID}) %c${parentFiber ? `${parentDisplayName} (${maybeParentID})` : ''} %c${extraString}`, 'color: red; font-weight: bold;', 'color: blue;', 'color: purple;', 'color: black;'); - console.log(new Error().stack.split('\n').slice(1).join('\n')); - console.groupEnd(); - } - }; // Configurable Components tree filters. - - - const hideElementsWithDisplayNames = new Set(); - const hideElementsWithPaths = new Set(); - const hideElementsWithTypes = new Set(); // Highlight updates - - let traceUpdatesEnabled = false; - const traceUpdatesForNodes = new Set(); - - function applyComponentFilters(componentFilters) { - hideElementsWithTypes.clear(); - hideElementsWithDisplayNames.clear(); - hideElementsWithPaths.clear(); - componentFilters.forEach(componentFilter => { - if (!componentFilter.isEnabled) { - return; - } - - switch (componentFilter.type) { - case types["a" /* ComponentFilterDisplayName */]: - if (componentFilter.isValid && componentFilter.value !== '') { - hideElementsWithDisplayNames.add(new RegExp(componentFilter.value, 'i')); - } - - break; - - case types["b" /* ComponentFilterElementType */]: - hideElementsWithTypes.add(componentFilter.value); - break; - - case types["d" /* ComponentFilterLocation */]: - if (componentFilter.isValid && componentFilter.value !== '') { - hideElementsWithPaths.add(new RegExp(componentFilter.value, 'i')); - } - - break; - - case types["c" /* ComponentFilterHOC */]: - hideElementsWithDisplayNames.add(new RegExp('\\(')); - break; - - default: - console.warn(`Invalid component filter type "${componentFilter.type}"`); - break; - } - }); - } // The renderer interface can't read saved component filters directly, - // because they are stored in localStorage within the context of the extension. - // Instead it relies on the extension to pass filters through. - - - if (window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ != null) { - applyComponentFilters(window.__REACT_DEVTOOLS_COMPONENT_FILTERS__); - } else { - // Unfortunately this feature is not expected to work for React Native for now. - // It would be annoying for us to spam YellowBox warnings with unactionable stuff, - // so for now just skip this message... - //console.warn('⚛️ DevTools: Could not locate saved component filters'); - // Fallback to assuming the default filters in this case. - applyComponentFilters(Object(utils["g" /* getDefaultComponentFilters */])()); - } // If necessary, we can revisit optimizing this operation. - // For example, we could add a new recursive unmount tree operation. - // The unmount operations are already significantly smaller than mount operations though. - // This is something to keep in mind for later. - - - function updateComponentFilters(componentFilters) { - if (isProfiling) { - // Re-mounting a tree while profiling is in progress might break a lot of assumptions. - // If necessary, we could support this- but it doesn't seem like a necessary use case. - throw Error('Cannot modify filter preferences while profiling'); - } // Recursively unmount all roots. - - - hook.getFiberRoots(rendererID).forEach(root => { - currentRootID = getOrGenerateFiberID(root.current); // The TREE_OPERATION_REMOVE_ROOT operation serves two purposes: - // 1. It avoids sending unnecessary bridge traffic to clear a root. - // 2. It preserves Fiber IDs when remounting (below) which in turn ID to error/warning mapping. - - pushOperation(constants["y" /* TREE_OPERATION_REMOVE_ROOT */]); - flushPendingEvents(root); - currentRootID = -1; - }); - applyComponentFilters(componentFilters); // Reset pseudo counters so that new path selections will be persisted. - - rootDisplayNameCounter.clear(); // Recursively re-mount all roots with new filter criteria applied. - - hook.getFiberRoots(rendererID).forEach(root => { - currentRootID = getOrGenerateFiberID(root.current); - setRootPseudoKey(currentRootID, root.current); - mountFiberRecursively(root.current, null, false, false); - flushPendingEvents(root); - currentRootID = -1; - }); // Also re-evaluate all error and warning counts given the new filters. - - reevaluateErrorsAndWarnings(); - flushPendingEvents(); - } // NOTICE Keep in sync with get*ForFiber methods - - - function shouldFilterFiber(fiber) { - const { - _debugSource, - tag, - type - } = fiber; - - switch (tag) { - case DehydratedSuspenseComponent: - // TODO: ideally we would show dehydrated Suspense immediately. - // However, it has some special behavior (like disconnecting - // an alternate and turning into real Suspense) which breaks DevTools. - // For now, ignore it, and only show it once it gets hydrated. - // https://github.com/bvaughn/react-devtools-experimental/issues/197 - return true; - - case HostPortal: - case HostText: - case Fragment: - case LegacyHiddenComponent: - case OffscreenComponent: - return true; - - case HostRoot: - // It is never valid to filter the root element. - return false; - - default: - const typeSymbol = getTypeSymbol(type); - - switch (typeSymbol) { - case ReactSymbols["a" /* CONCURRENT_MODE_NUMBER */]: - case ReactSymbols["b" /* CONCURRENT_MODE_SYMBOL_STRING */]: - case ReactSymbols["e" /* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */]: - case ReactSymbols["s" /* STRICT_MODE_NUMBER */]: - case ReactSymbols["t" /* STRICT_MODE_SYMBOL_STRING */]: - return true; - - default: - break; - } - - } - - const elementType = getElementTypeForFiber(fiber); - - if (hideElementsWithTypes.has(elementType)) { - return true; - } - - if (hideElementsWithDisplayNames.size > 0) { - const displayName = getDisplayNameForFiber(fiber); - - if (displayName != null) { - // eslint-disable-next-line no-for-of-loops/no-for-of-loops - for (const displayNameRegExp of hideElementsWithDisplayNames) { - if (displayNameRegExp.test(displayName)) { - return true; - } - } - } - } - - if (_debugSource != null && hideElementsWithPaths.size > 0) { - const { - fileName - } = _debugSource; // eslint-disable-next-line no-for-of-loops/no-for-of-loops - - for (const pathRegExp of hideElementsWithPaths) { - if (pathRegExp.test(fileName)) { - return true; - } - } - } - - return false; - } // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods - - - function getElementTypeForFiber(fiber) { - const { - type, - tag - } = fiber; - - switch (tag) { - case ClassComponent: - case IncompleteClassComponent: - return types["e" /* ElementTypeClass */]; - - case FunctionComponent: - case IndeterminateComponent: - return types["h" /* ElementTypeFunction */]; - - case ForwardRef: - return types["g" /* ElementTypeForwardRef */]; - - case HostRoot: - return types["m" /* ElementTypeRoot */]; - - case HostComponent: - return types["i" /* ElementTypeHostComponent */]; - - case HostPortal: - case HostText: - case Fragment: - return types["k" /* ElementTypeOtherOrUnknown */]; - - case MemoComponent: - case SimpleMemoComponent: - return types["j" /* ElementTypeMemo */]; - - case SuspenseComponent: - return types["n" /* ElementTypeSuspense */]; - - case SuspenseListComponent: - return types["o" /* ElementTypeSuspenseList */]; - - case TracingMarkerComponent: - return types["p" /* ElementTypeTracingMarker */]; - - default: - const typeSymbol = getTypeSymbol(type); - - switch (typeSymbol) { - case ReactSymbols["a" /* CONCURRENT_MODE_NUMBER */]: - case ReactSymbols["b" /* CONCURRENT_MODE_SYMBOL_STRING */]: - case ReactSymbols["e" /* DEPRECATED_ASYNC_MODE_SYMBOL_STRING */]: - return types["k" /* ElementTypeOtherOrUnknown */]; - - case ReactSymbols["n" /* PROVIDER_NUMBER */]: - case ReactSymbols["o" /* PROVIDER_SYMBOL_STRING */]: - return types["f" /* ElementTypeContext */]; - - case ReactSymbols["c" /* CONTEXT_NUMBER */]: - case ReactSymbols["d" /* CONTEXT_SYMBOL_STRING */]: - return types["f" /* ElementTypeContext */]; - - case ReactSymbols["s" /* STRICT_MODE_NUMBER */]: - case ReactSymbols["t" /* STRICT_MODE_SYMBOL_STRING */]: - return types["k" /* ElementTypeOtherOrUnknown */]; - - case ReactSymbols["l" /* PROFILER_NUMBER */]: - case ReactSymbols["m" /* PROFILER_SYMBOL_STRING */]: - return types["l" /* ElementTypeProfiler */]; - - default: - return types["k" /* ElementTypeOtherOrUnknown */]; - } - - } - } // When profiling is supported, we store the latest tree base durations for each Fiber. - // This is so that we can quickly capture a snapshot of those values if profiling starts. - // If we didn't store these values, we'd have to crawl the tree when profiling started, - // and use a slow path to find each of the current Fibers. - - - const idToTreeBaseDurationMap = new Map(); // When profiling is supported, we store the latest tree base durations for each Fiber. - // This map enables us to filter these times by root when sending them to the frontend. - - const idToRootMap = new Map(); // When a mount or update is in progress, this value tracks the root that is being operated on. - - let currentRootID = -1; // Returns the unique ID for a Fiber or generates and caches a new one if the Fiber hasn't been seen before. - // Once this method has been called for a Fiber, untrackFiberID() should always be called later to avoid leaking. - - function getOrGenerateFiberID(fiber) { - let id = null; - - if (fiberToIDMap.has(fiber)) { - id = fiberToIDMap.get(fiber); - } else { - const { - alternate - } = fiber; - - if (alternate !== null && fiberToIDMap.has(alternate)) { - id = fiberToIDMap.get(alternate); - } - } - - let didGenerateID = false; - - if (id === null) { - didGenerateID = true; - id = Object(utils["p" /* getUID */])(); - } // This refinement is for Flow purposes only. - - - const refinedID = id; // Make sure we're tracking this Fiber - // e.g. if it just mounted or an error was logged during initial render. - - if (!fiberToIDMap.has(fiber)) { - fiberToIDMap.set(fiber, refinedID); - idToArbitraryFiberMap.set(refinedID, fiber); - } // Also make sure we're tracking its alternate, - // e.g. in case this is the first update after mount. - - - const { - alternate - } = fiber; - - if (alternate !== null) { - if (!fiberToIDMap.has(alternate)) { - fiberToIDMap.set(alternate, refinedID); - } - } - - if (constants["E" /* __DEBUG__ */]) { - if (didGenerateID) { - debug('getOrGenerateFiberID()', fiber, fiber.return, 'Generated a new UID'); - } - } - - return refinedID; - } // Returns an ID if one has already been generated for the Fiber or throws. - - - function getFiberIDThrows(fiber) { - const maybeID = getFiberIDUnsafe(fiber); - - if (maybeID !== null) { - return maybeID; - } - - throw Error(`Could not find ID for Fiber "${getDisplayNameForFiber(fiber) || ''}"`); - } // Returns an ID if one has already been generated for the Fiber or null if one has not been generated. - // Use this method while e.g. logging to avoid over-retaining Fibers. - - - function getFiberIDUnsafe(fiber) { - if (fiberToIDMap.has(fiber)) { - return fiberToIDMap.get(fiber); - } else { - const { - alternate - } = fiber; - - if (alternate !== null && fiberToIDMap.has(alternate)) { - return fiberToIDMap.get(alternate); - } - } - - return null; - } // Removes a Fiber (and its alternate) from the Maps used to track their id. - // This method should always be called when a Fiber is unmounting. - - - function untrackFiberID(fiber) { - if (constants["E" /* __DEBUG__ */]) { - debug('untrackFiberID()', fiber, fiber.return, 'schedule after delay'); - } // Untrack Fibers after a slight delay in order to support a Fast Refresh edge case: - // 1. Component type is updated and Fast Refresh schedules an update+remount. - // 2. flushPendingErrorsAndWarningsAfterDelay() runs, sees the old Fiber is no longer mounted - // (it's been disconnected by Fast Refresh), and calls untrackFiberID() to clear it from the Map. - // 3. React flushes pending passive effects before it runs the next render, - // which logs an error or warning, which causes a new ID to be generated for this Fiber. - // 4. DevTools now tries to unmount the old Component with the new ID. - // - // The underlying problem here is the premature clearing of the Fiber ID, - // but DevTools has no way to detect that a given Fiber has been scheduled for Fast Refresh. - // (The "_debugNeedsRemount" flag won't necessarily be set.) - // - // The best we can do is to delay untracking by a small amount, - // and give React time to process the Fast Refresh delay. - - - untrackFibersSet.add(fiber); // React may detach alternate pointers during unmount; - // Since our untracking code is async, we should explicily track the pending alternate here as well. - - const alternate = fiber.alternate; - - if (alternate !== null) { - untrackFibersSet.add(alternate); - } - - if (untrackFibersTimeoutID === null) { - untrackFibersTimeoutID = setTimeout(untrackFibers, 1000); - } - } - - const untrackFibersSet = new Set(); - let untrackFibersTimeoutID = null; - - function untrackFibers() { - if (untrackFibersTimeoutID !== null) { - clearTimeout(untrackFibersTimeoutID); - untrackFibersTimeoutID = null; - } - - untrackFibersSet.forEach(fiber => { - const fiberID = getFiberIDUnsafe(fiber); - - if (fiberID !== null) { - idToArbitraryFiberMap.delete(fiberID); // Also clear any errors/warnings associated with this fiber. - - clearErrorsForFiberID(fiberID); - clearWarningsForFiberID(fiberID); - } - - fiberToIDMap.delete(fiber); - const { - alternate - } = fiber; - - if (alternate !== null) { - fiberToIDMap.delete(alternate); - } - - if (forceErrorForFiberIDs.has(fiberID)) { - forceErrorForFiberIDs.delete(fiberID); - - if (forceErrorForFiberIDs.size === 0 && setErrorHandler != null) { - setErrorHandler(shouldErrorFiberAlwaysNull); - } - } - }); - untrackFibersSet.clear(); - } - - function getChangeDescription(prevFiber, nextFiber) { - switch (getElementTypeForFiber(nextFiber)) { - case types["e" /* ElementTypeClass */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - case types["g" /* ElementTypeForwardRef */]: - if (prevFiber === null) { - return { - context: null, - didHooksChange: false, - isFirstMount: true, - props: null, - state: null - }; - } else { - const data = { - context: getContextChangedKeys(nextFiber), - didHooksChange: false, - isFirstMount: false, - props: getChangedKeys(prevFiber.memoizedProps, nextFiber.memoizedProps), - state: getChangedKeys(prevFiber.memoizedState, nextFiber.memoizedState) - }; // Only traverse the hooks list once, depending on what info we're returning. - - if (DevToolsFeatureFlags_extension_oss["d" /* enableProfilerChangedHookIndices */]) { - const indices = getChangedHooksIndices(prevFiber.memoizedState, nextFiber.memoizedState); - data.hooks = indices; - data.didHooksChange = indices !== null && indices.length > 0; - } else { - data.didHooksChange = didHooksChange(prevFiber.memoizedState, nextFiber.memoizedState); - } - - return data; - } - - default: - return null; - } - } - - function updateContextsForFiber(fiber) { - switch (getElementTypeForFiber(fiber)) { - case types["e" /* ElementTypeClass */]: - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - if (idToContextsMap !== null) { - const id = getFiberIDThrows(fiber); - const contexts = getContextsForFiber(fiber); - - if (contexts !== null) { - idToContextsMap.set(id, contexts); - } - } - - break; - - default: - break; - } - } // Differentiates between a null context value and no context. - - - const NO_CONTEXT = {}; - - function getContextsForFiber(fiber) { - let legacyContext = NO_CONTEXT; - let modernContext = NO_CONTEXT; - - switch (getElementTypeForFiber(fiber)) { - case types["e" /* ElementTypeClass */]: - const instance = fiber.stateNode; - - if (instance != null) { - if (instance.constructor && instance.constructor.contextType != null) { - modernContext = instance.context; - } else { - legacyContext = instance.context; - - if (legacyContext && Object.keys(legacyContext).length === 0) { - legacyContext = NO_CONTEXT; - } - } - } - - return [legacyContext, modernContext]; - - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - const dependencies = fiber.dependencies; - - if (dependencies && dependencies.firstContext) { - modernContext = dependencies.firstContext; - } - - return [legacyContext, modernContext]; - - default: - return null; - } - } // Record all contexts at the time profiling is started. - // Fibers only store the current context value, - // so we need to track them separately in order to determine changed keys. - - - function crawlToInitializeContextsMap(fiber) { - const id = getFiberIDUnsafe(fiber); // Not all Fibers in the subtree have mounted yet. - // For example, Offscreen (hidden) or Suspense (suspended) subtrees won't yet be tracked. - // We can safely skip these subtrees. - - if (id !== null) { - updateContextsForFiber(fiber); - let current = fiber.child; - - while (current !== null) { - crawlToInitializeContextsMap(current); - current = current.sibling; - } - } - } - - function getContextChangedKeys(fiber) { - if (idToContextsMap !== null) { - const id = getFiberIDThrows(fiber); - const prevContexts = idToContextsMap.has(id) ? idToContextsMap.get(id) : null; - const nextContexts = getContextsForFiber(fiber); - - if (prevContexts == null || nextContexts == null) { - return null; - } - - const [prevLegacyContext, prevModernContext] = prevContexts; - const [nextLegacyContext, nextModernContext] = nextContexts; - - switch (getElementTypeForFiber(fiber)) { - case types["e" /* ElementTypeClass */]: - if (prevContexts && nextContexts) { - if (nextLegacyContext !== NO_CONTEXT) { - return getChangedKeys(prevLegacyContext, nextLegacyContext); - } else if (nextModernContext !== NO_CONTEXT) { - return prevModernContext !== nextModernContext; - } - } - - break; - - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - if (nextModernContext !== NO_CONTEXT) { - let prevContext = prevModernContext; - let nextContext = nextModernContext; - - while (prevContext && nextContext) { - // Note this only works for versions of React that support this key (e.v. 18+) - // For older versions, there's no good way to read the current context value after render has completed. - // This is because React maintains a stack of context values during render, - // but by the time DevTools is called, render has finished and the stack is empty. - if (!shared_objectIs(prevContext.memoizedValue, nextContext.memoizedValue)) { - return true; - } - - prevContext = prevContext.next; - nextContext = nextContext.next; - } - - return false; - } - - break; - - default: - break; - } - } - - return null; - } - - function isHookThatCanScheduleUpdate(hookObject) { - const queue = hookObject.queue; - - if (!queue) { - return false; - } - - const boundHasOwnProperty = shared_hasOwnProperty["a" /* default */].bind(queue); // Detect the shape of useState() or useReducer() - // using the attributes that are unique to these hooks - // but also stable (e.g. not tied to current Lanes implementation) - - const isStateOrReducer = boundHasOwnProperty('pending') && boundHasOwnProperty('dispatch') && typeof queue.dispatch === 'function'; // Detect useSyncExternalStore() - - const isSyncExternalStore = boundHasOwnProperty('value') && boundHasOwnProperty('getSnapshot') && typeof queue.getSnapshot === 'function'; // These are the only types of hooks that can schedule an update. - - return isStateOrReducer || isSyncExternalStore; - } - - function didStatefulHookChange(prev, next) { - const prevMemoizedState = prev.memoizedState; - const nextMemoizedState = next.memoizedState; - - if (isHookThatCanScheduleUpdate(prev)) { - return prevMemoizedState !== nextMemoizedState; - } - - return false; - } - - function didHooksChange(prev, next) { - if (prev == null || next == null) { - return false; - } // We can't report anything meaningful for hooks changes. - - - if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) { - while (next !== null) { - if (didStatefulHookChange(prev, next)) { - return true; - } else { - next = next.next; - prev = prev.next; - } - } - } - - return false; - } - - function getChangedHooksIndices(prev, next) { - if (DevToolsFeatureFlags_extension_oss["d" /* enableProfilerChangedHookIndices */]) { - if (prev == null || next == null) { - return null; - } - - const indices = []; - let index = 0; - - if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) { - while (next !== null) { - if (didStatefulHookChange(prev, next)) { - indices.push(index); - } - - next = next.next; - prev = prev.next; - index++; - } - } - - return indices; - } - - return null; - } - - function getChangedKeys(prev, next) { - if (prev == null || next == null) { - return null; - } // We can't report anything meaningful for hooks changes. - - - if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) { - return null; - } - - const keys = new Set([...Object.keys(prev), ...Object.keys(next)]); - const changedKeys = []; // eslint-disable-next-line no-for-of-loops/no-for-of-loops - - for (const key of keys) { - if (prev[key] !== next[key]) { - changedKeys.push(key); - } - } - - return changedKeys; - } // eslint-disable-next-line no-unused-vars - - - function didFiberRender(prevFiber, nextFiber) { - switch (nextFiber.tag) { - case ClassComponent: - case FunctionComponent: - case ContextConsumer: - case MemoComponent: - case SimpleMemoComponent: - // For types that execute user code, we check PerformedWork effect. - // We don't reflect bailouts (either referential or sCU) in DevTools. - // eslint-disable-next-line no-bitwise - return (getFiberFlags(nextFiber) & PerformedWork) === PerformedWork; - // Note: ContextConsumer only gets PerformedWork effect in 16.3.3+ - // so it won't get highlighted with React 16.3.0 to 16.3.2. - - default: - // For host components and other types, we compare inputs - // to determine whether something is an update. - return prevFiber.memoizedProps !== nextFiber.memoizedProps || prevFiber.memoizedState !== nextFiber.memoizedState || prevFiber.ref !== nextFiber.ref; - } - } - - const pendingOperations = []; - const pendingRealUnmountedIDs = []; - const pendingSimulatedUnmountedIDs = []; - let pendingOperationsQueue = []; - const pendingStringTable = new Map(); - let pendingStringTableLength = 0; - let pendingUnmountedRootID = null; - - function pushOperation(op) { - if (false) {} - - pendingOperations.push(op); - } - - function shouldBailoutWithPendingOperations() { - if (isProfiling) { - if (currentCommitProfilingMetadata != null && currentCommitProfilingMetadata.durations.length > 0) { - return false; - } - } - - return pendingOperations.length === 0 && pendingRealUnmountedIDs.length === 0 && pendingSimulatedUnmountedIDs.length === 0 && pendingUnmountedRootID === null; - } - - function flushOrQueueOperations(operations) { - if (shouldBailoutWithPendingOperations()) { - return; - } - - if (pendingOperationsQueue !== null) { - pendingOperationsQueue.push(operations); - } else { - hook.emit('operations', operations); - } - } - - let flushPendingErrorsAndWarningsAfterDelayTimeoutID = null; - - function clearPendingErrorsAndWarningsAfterDelay() { - if (flushPendingErrorsAndWarningsAfterDelayTimeoutID !== null) { - clearTimeout(flushPendingErrorsAndWarningsAfterDelayTimeoutID); - flushPendingErrorsAndWarningsAfterDelayTimeoutID = null; - } - } - - function flushPendingErrorsAndWarningsAfterDelay() { - clearPendingErrorsAndWarningsAfterDelay(); - flushPendingErrorsAndWarningsAfterDelayTimeoutID = setTimeout(() => { - flushPendingErrorsAndWarningsAfterDelayTimeoutID = null; - - if (pendingOperations.length > 0) { - // On the off chance that something else has pushed pending operations, - // we should bail on warnings; it's probably not safe to push midway. - return; - } - - recordPendingErrorsAndWarnings(); - - if (shouldBailoutWithPendingOperations()) { - // No warnings or errors to flush; we can bail out early here too. - return; - } // We can create a smaller operations array than flushPendingEvents() - // because we only need to flush warning and error counts. - // Only a few pieces of fixed information are required up front. - - - const operations = new Array(3 + pendingOperations.length); - operations[0] = rendererID; - operations[1] = currentRootID; - operations[2] = 0; // String table size - - for (let j = 0; j < pendingOperations.length; j++) { - operations[3 + j] = pendingOperations[j]; - } - - flushOrQueueOperations(operations); - pendingOperations.length = 0; - }, 1000); - } - - function reevaluateErrorsAndWarnings() { - fibersWithChangedErrorOrWarningCounts.clear(); - fiberIDToErrorsMap.forEach((countMap, fiberID) => { - const fiber = idToArbitraryFiberMap.get(fiberID); - - if (fiber != null) { - fibersWithChangedErrorOrWarningCounts.add(fiber); - } - }); - fiberIDToWarningsMap.forEach((countMap, fiberID) => { - const fiber = idToArbitraryFiberMap.get(fiberID); - - if (fiber != null) { - fibersWithChangedErrorOrWarningCounts.add(fiber); - } - }); - recordPendingErrorsAndWarnings(); - } - - function mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToMessageCountMap, fiberIDToMessageCountMap) { - let newCount = 0; - let messageCountMap = fiberIDToMessageCountMap.get(fiberID); - const pendingMessageCountMap = pendingFiberToMessageCountMap.get(fiber); - - if (pendingMessageCountMap != null) { - if (messageCountMap == null) { - messageCountMap = pendingMessageCountMap; - fiberIDToMessageCountMap.set(fiberID, pendingMessageCountMap); - } else { - // This Flow refinement should not be necessary and yet... - const refinedMessageCountMap = messageCountMap; - pendingMessageCountMap.forEach((pendingCount, message) => { - const previousCount = refinedMessageCountMap.get(message) || 0; - refinedMessageCountMap.set(message, previousCount + pendingCount); - }); - } - } - - if (!shouldFilterFiber(fiber)) { - if (messageCountMap != null) { - messageCountMap.forEach(count => { - newCount += count; - }); - } - } - - pendingFiberToMessageCountMap.delete(fiber); - return newCount; - } - - function recordPendingErrorsAndWarnings() { - clearPendingErrorsAndWarningsAfterDelay(); - fibersWithChangedErrorOrWarningCounts.forEach(fiber => { - const fiberID = getFiberIDUnsafe(fiber); - - if (fiberID === null) {// Don't send updates for Fibers that didn't mount due to e.g. Suspense or an error boundary. - } else { - const errorCount = mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToErrorsMap, fiberIDToErrorsMap); - const warningCount = mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToWarningsMap, fiberIDToWarningsMap); - pushOperation(constants["B" /* TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS */]); - pushOperation(fiberID); - pushOperation(errorCount); - pushOperation(warningCount); - } // Always clean up so that we don't leak. - - - pendingFiberToErrorsMap.delete(fiber); - pendingFiberToWarningsMap.delete(fiber); - }); - fibersWithChangedErrorOrWarningCounts.clear(); - } - - function flushPendingEvents(root) { - // Add any pending errors and warnings to the operations array. - // We do this just before flushing, so we can ignore errors for no-longer-mounted Fibers. - recordPendingErrorsAndWarnings(); - - if (shouldBailoutWithPendingOperations()) { - // If we aren't profiling, we can just bail out here. - // No use sending an empty update over the bridge. - // - // The Profiler stores metadata for each commit and reconstructs the app tree per commit using: - // (1) an initial tree snapshot and - // (2) the operations array for each commit - // Because of this, it's important that the operations and metadata arrays align, - // So it's important not to omit even empty operations while profiling is active. - return; - } - - const numUnmountIDs = pendingRealUnmountedIDs.length + pendingSimulatedUnmountedIDs.length + (pendingUnmountedRootID === null ? 0 : 1); - const operations = new Array( // Identify which renderer this update is coming from. - 2 + // [rendererID, rootFiberID] - // How big is the string table? - 1 + // [stringTableLength] - // Then goes the actual string table. - pendingStringTableLength + ( // All unmounts are batched in a single message. - // [TREE_OPERATION_REMOVE, removedIDLength, ...ids] - numUnmountIDs > 0 ? 2 + numUnmountIDs : 0) + // Regular operations - pendingOperations.length); // Identify which renderer this update is coming from. - // This enables roots to be mapped to renderers, - // Which in turn enables fiber props, states, and hooks to be inspected. - - let i = 0; - operations[i++] = rendererID; - operations[i++] = currentRootID; // Now fill in the string table. - // [stringTableLength, str1Length, ...str1, str2Length, ...str2, ...] - - operations[i++] = pendingStringTableLength; - pendingStringTable.forEach((entry, stringKey) => { - const encodedString = entry.encodedString; // Don't use the string length. - // It won't work for multibyte characters (like emoji). - - const length = encodedString.length; - operations[i++] = length; - - for (let j = 0; j < length; j++) { - operations[i + j] = encodedString[j]; - } - - i += length; - }); - - if (numUnmountIDs > 0) { - // All unmounts except roots are batched in a single message. - operations[i++] = constants["x" /* TREE_OPERATION_REMOVE */]; // The first number is how many unmounted IDs we're gonna send. - - operations[i++] = numUnmountIDs; // Fill in the real unmounts in the reverse order. - // They were inserted parents-first by React, but we want children-first. - // So we traverse our array backwards. - - for (let j = pendingRealUnmountedIDs.length - 1; j >= 0; j--) { - operations[i++] = pendingRealUnmountedIDs[j]; - } // Fill in the simulated unmounts (hidden Suspense subtrees) in their order. - // (We want children to go before parents.) - // They go *after* the real unmounts because we know for sure they won't be - // children of already pushed "real" IDs. If they were, we wouldn't be able - // to discover them during the traversal, as they would have been deleted. - - - for (let j = 0; j < pendingSimulatedUnmountedIDs.length; j++) { - operations[i + j] = pendingSimulatedUnmountedIDs[j]; - } - - i += pendingSimulatedUnmountedIDs.length; // The root ID should always be unmounted last. - - if (pendingUnmountedRootID !== null) { - operations[i] = pendingUnmountedRootID; - i++; - } - } // Fill in the rest of the operations. - - - for (let j = 0; j < pendingOperations.length; j++) { - operations[i + j] = pendingOperations[j]; - } - - i += pendingOperations.length; // Let the frontend know about tree operations. - - flushOrQueueOperations(operations); // Reset all of the pending state now that we've told the frontend about it. - - pendingOperations.length = 0; - pendingRealUnmountedIDs.length = 0; - pendingSimulatedUnmountedIDs.length = 0; - pendingUnmountedRootID = null; - pendingStringTable.clear(); - pendingStringTableLength = 0; - } - - function getStringID(string) { - if (string === null) { - return 0; - } - - const existingEntry = pendingStringTable.get(string); - - if (existingEntry !== undefined) { - return existingEntry.id; - } - - const id = pendingStringTable.size + 1; - const encodedString = Object(utils["w" /* utfEncodeString */])(string); - pendingStringTable.set(string, { - encodedString, - id - }); // The string table total length needs to account both for the string length, - // and for the array item that contains the length itself. - // - // Don't use string length for this table. - // It won't work for multibyte characters (like emoji). - - pendingStringTableLength += encodedString.length + 1; - return id; - } - - function recordMount(fiber, parentFiber) { - const isRoot = fiber.tag === HostRoot; - const id = getOrGenerateFiberID(fiber); - - if (constants["E" /* __DEBUG__ */]) { - debug('recordMount()', fiber, parentFiber); - } - - const hasOwnerMetadata = fiber.hasOwnProperty('_debugOwner'); - const isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration'); // Adding a new field here would require a bridge protocol version bump (a backwads breaking change). - // Instead let's re-purpose a pre-existing field to carry more information. - - let profilingFlags = 0; - - if (isProfilingSupported) { - profilingFlags = constants["q" /* PROFILING_FLAG_BASIC_SUPPORT */]; - - if (typeof injectProfilingHooks === 'function') { - profilingFlags |= constants["r" /* PROFILING_FLAG_TIMELINE_SUPPORT */]; - } - } - - if (isRoot) { - pushOperation(constants["w" /* TREE_OPERATION_ADD */]); - pushOperation(id); - pushOperation(types["m" /* ElementTypeRoot */]); - pushOperation((fiber.mode & StrictModeBits) !== 0 ? 1 : 0); - pushOperation(profilingFlags); - pushOperation(StrictModeBits !== 0 ? 1 : 0); - pushOperation(hasOwnerMetadata ? 1 : 0); - - if (isProfiling) { - if (displayNamesByRootID !== null) { - displayNamesByRootID.set(id, getDisplayNameForRoot(fiber)); - } - } - } else { - const { - key - } = fiber; - const displayName = getDisplayNameForFiber(fiber); - const elementType = getElementTypeForFiber(fiber); - const { - _debugOwner - } = fiber; // Ideally we should call getFiberIDThrows() for _debugOwner, - // since owners are almost always higher in the tree (and so have already been processed), - // but in some (rare) instances reported in open source, a descendant mounts before an owner. - // Since this is a DEV only field it's probably okay to also just lazily generate and ID here if needed. - // See https://github.com/facebook/react/issues/21445 - - const ownerID = _debugOwner != null ? getOrGenerateFiberID(_debugOwner) : 0; - const parentID = parentFiber ? getFiberIDThrows(parentFiber) : 0; - const displayNameStringID = getStringID(displayName); // This check is a guard to handle a React element that has been modified - // in such a way as to bypass the default stringification of the "key" property. - - const keyString = key === null ? null : String(key); - const keyStringID = getStringID(keyString); - pushOperation(constants["w" /* TREE_OPERATION_ADD */]); - pushOperation(id); - pushOperation(elementType); - pushOperation(parentID); - pushOperation(ownerID); - pushOperation(displayNameStringID); - pushOperation(keyStringID); // If this subtree has a new mode, let the frontend know. - - if ((fiber.mode & StrictModeBits) !== 0 && (parentFiber.mode & StrictModeBits) === 0) { - pushOperation(constants["A" /* TREE_OPERATION_SET_SUBTREE_MODE */]); - pushOperation(id); - pushOperation(types["q" /* StrictMode */]); - } - } - - if (isProfilingSupported) { - idToRootMap.set(id, currentRootID); - recordProfilingDurations(fiber); - } - } - - function recordUnmount(fiber, isSimulated) { - if (constants["E" /* __DEBUG__ */]) { - debug('recordUnmount()', fiber, null, isSimulated ? 'unmount is simulated' : ''); - } - - if (trackedPathMatchFiber !== null) { - // We're in the process of trying to restore previous selection. - // If this fiber matched but is being unmounted, there's no use trying. - // Reset the state so we don't keep holding onto it. - if (fiber === trackedPathMatchFiber || fiber === trackedPathMatchFiber.alternate) { - setTrackedPath(null); - } - } - - const unsafeID = getFiberIDUnsafe(fiber); - - if (unsafeID === null) { - // If we've never seen this Fiber, it might be inside of a legacy render Suspense fragment (so the store is not even aware of it). - // In that case we can just ignore it or it will cause errors later on. - // One example of this is a Lazy component that never resolves before being unmounted. - // - // This also might indicate a Fast Refresh force-remount scenario. - // - // TODO: This is fragile and can obscure actual bugs. - return; - } // Flow refinement. - - - const id = unsafeID; - const isRoot = fiber.tag === HostRoot; - - if (isRoot) { - // Roots must be removed only after all children (pending and simulated) have been removed. - // So we track it separately. - pendingUnmountedRootID = id; - } else if (!shouldFilterFiber(fiber)) { - // To maintain child-first ordering, - // we'll push it into one of these queues, - // and later arrange them in the correct order. - if (isSimulated) { - pendingSimulatedUnmountedIDs.push(id); - } else { - pendingRealUnmountedIDs.push(id); - } - } - - if (!fiber._debugNeedsRemount) { - untrackFiberID(fiber); - const isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration'); - - if (isProfilingSupported) { - idToRootMap.delete(id); - idToTreeBaseDurationMap.delete(id); - } - } - } - - function mountFiberRecursively(firstChild, parentFiber, traverseSiblings, traceNearestHostComponentUpdate) { - // Iterate over siblings rather than recursing. - // This reduces the chance of stack overflow for wide trees (e.g. lists with many items). - let fiber = firstChild; - - while (fiber !== null) { - // Generate an ID even for filtered Fibers, in case it's needed later (e.g. for Profiling). - getOrGenerateFiberID(fiber); - - if (constants["E" /* __DEBUG__ */]) { - debug('mountFiberRecursively()', fiber, parentFiber); - } // If we have the tree selection from previous reload, try to match this Fiber. - // Also remember whether to do the same for siblings. - - - const mightSiblingsBeOnTrackedPath = updateTrackedPathStateBeforeMount(fiber); - const shouldIncludeInTree = !shouldFilterFiber(fiber); - - if (shouldIncludeInTree) { - recordMount(fiber, parentFiber); - } - - if (traceUpdatesEnabled) { - if (traceNearestHostComponentUpdate) { - const elementType = getElementTypeForFiber(fiber); // If an ancestor updated, we should mark the nearest host nodes for highlighting. - - if (elementType === types["i" /* ElementTypeHostComponent */]) { - traceUpdatesForNodes.add(fiber.stateNode); - traceNearestHostComponentUpdate = false; - } - } // We intentionally do not re-enable the traceNearestHostComponentUpdate flag in this branch, - // because we don't want to highlight every host node inside of a newly mounted subtree. - - } - - const isSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent; - - if (isSuspense) { - const isTimedOut = fiber.memoizedState !== null; - - if (isTimedOut) { - // Special case: if Suspense mounts in a timed-out state, - // get the fallback child from the inner fragment and mount - // it as if it was our own child. Updates handle this too. - const primaryChildFragment = fiber.child; - const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; - const fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null; - - if (fallbackChild !== null) { - mountFiberRecursively(fallbackChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate); - } - } else { - let primaryChild = null; - const areSuspenseChildrenConditionallyWrapped = OffscreenComponent === -1; - - if (areSuspenseChildrenConditionallyWrapped) { - primaryChild = fiber.child; - } else if (fiber.child !== null) { - primaryChild = fiber.child.child; - } - - if (primaryChild !== null) { - mountFiberRecursively(primaryChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate); - } - } - } else { - if (fiber.child !== null) { - mountFiberRecursively(fiber.child, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate); - } - } // We're exiting this Fiber now, and entering its siblings. - // If we have selection to restore, we might need to re-activate tracking. - - - updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath); - fiber = traverseSiblings ? fiber.sibling : null; - } - } // We use this to simulate unmounting for Suspense trees - // when we switch from primary to fallback. - - - function unmountFiberChildrenRecursively(fiber) { - if (constants["E" /* __DEBUG__ */]) { - debug('unmountFiberChildrenRecursively()', fiber); - } // We might meet a nested Suspense on our way. - - - const isTimedOutSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent && fiber.memoizedState !== null; - let child = fiber.child; - - if (isTimedOutSuspense) { - // If it's showing fallback tree, let's traverse it instead. - const primaryChildFragment = fiber.child; - const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; // Skip over to the real Fiber child. - - child = fallbackChildFragment ? fallbackChildFragment.child : null; - } - - while (child !== null) { - // Record simulated unmounts children-first. - // We skip nodes without return because those are real unmounts. - if (child.return !== null) { - unmountFiberChildrenRecursively(child); - recordUnmount(child, true); - } - - child = child.sibling; - } - } - - function recordProfilingDurations(fiber) { - const id = getFiberIDThrows(fiber); - const { - actualDuration, - treeBaseDuration - } = fiber; - idToTreeBaseDurationMap.set(id, treeBaseDuration || 0); - - if (isProfiling) { - const { - alternate - } = fiber; // It's important to update treeBaseDuration even if the current Fiber did not render, - // because it's possible that one of its descendants did. - - if (alternate == null || treeBaseDuration !== alternate.treeBaseDuration) { - // Tree base duration updates are included in the operations typed array. - // So we have to convert them from milliseconds to microseconds so we can send them as ints. - const convertedTreeBaseDuration = Math.floor((treeBaseDuration || 0) * 1000); - pushOperation(constants["C" /* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */]); - pushOperation(id); - pushOperation(convertedTreeBaseDuration); - } - - if (alternate == null || didFiberRender(alternate, fiber)) { - if (actualDuration != null) { - // The actual duration reported by React includes time spent working on children. - // This is useful information, but it's also useful to be able to exclude child durations. - // The frontend can't compute this, since the immediate children may have been filtered out. - // So we need to do this on the backend. - // Note that this calculated self duration is not the same thing as the base duration. - // The two are calculated differently (tree duration does not accumulate). - let selfDuration = actualDuration; - let child = fiber.child; - - while (child !== null) { - selfDuration -= child.actualDuration || 0; - child = child.sibling; - } // If profiling is active, store durations for elements that were rendered during the commit. - // Note that we should do this for any fiber we performed work on, regardless of its actualDuration value. - // In some cases actualDuration might be 0 for fibers we worked on (particularly if we're using Date.now) - // In other cases (e.g. Memo) actualDuration might be greater than 0 even if we "bailed out". - - - const metadata = currentCommitProfilingMetadata; - metadata.durations.push(id, actualDuration, selfDuration); - metadata.maxActualDuration = Math.max(metadata.maxActualDuration, actualDuration); - - if (recordChangeDescriptions) { - const changeDescription = getChangeDescription(alternate, fiber); - - if (changeDescription !== null) { - if (metadata.changeDescriptions !== null) { - metadata.changeDescriptions.set(id, changeDescription); - } - } - - updateContextsForFiber(fiber); - } - } - } - } - } - - function recordResetChildren(fiber, childSet) { - if (constants["E" /* __DEBUG__ */]) { - debug('recordResetChildren()', childSet, fiber); - } // The frontend only really cares about the displayName, key, and children. - // The first two don't really change, so we are only concerned with the order of children here. - // This is trickier than a simple comparison though, since certain types of fibers are filtered. - - - const nextChildren = []; // This is a naive implementation that shallowly recourses children. - // We might want to revisit this if it proves to be too inefficient. - - let child = childSet; - - while (child !== null) { - findReorderedChildrenRecursively(child, nextChildren); - child = child.sibling; - } - - const numChildren = nextChildren.length; - - if (numChildren < 2) { - // No need to reorder. - return; - } - - pushOperation(constants["z" /* TREE_OPERATION_REORDER_CHILDREN */]); - pushOperation(getFiberIDThrows(fiber)); - pushOperation(numChildren); - - for (let i = 0; i < nextChildren.length; i++) { - pushOperation(nextChildren[i]); - } - } - - function findReorderedChildrenRecursively(fiber, nextChildren) { - if (!shouldFilterFiber(fiber)) { - nextChildren.push(getFiberIDThrows(fiber)); - } else { - let child = fiber.child; - const isTimedOutSuspense = fiber.tag === SuspenseComponent && fiber.memoizedState !== null; - - if (isTimedOutSuspense) { - // Special case: if Suspense mounts in a timed-out state, - // get the fallback child from the inner fragment, - // and skip over the primary child. - const primaryChildFragment = fiber.child; - const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; - const fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null; - - if (fallbackChild !== null) { - child = fallbackChild; - } - } - - while (child !== null) { - findReorderedChildrenRecursively(child, nextChildren); - child = child.sibling; - } - } - } // Returns whether closest unfiltered fiber parent needs to reset its child list. - - - function updateFiberRecursively(nextFiber, prevFiber, parentFiber, traceNearestHostComponentUpdate) { - const id = getOrGenerateFiberID(nextFiber); - - if (constants["E" /* __DEBUG__ */]) { - debug('updateFiberRecursively()', nextFiber, parentFiber); - } - - if (traceUpdatesEnabled) { - const elementType = getElementTypeForFiber(nextFiber); - - if (traceNearestHostComponentUpdate) { - // If an ancestor updated, we should mark the nearest host nodes for highlighting. - if (elementType === types["i" /* ElementTypeHostComponent */]) { - traceUpdatesForNodes.add(nextFiber.stateNode); - traceNearestHostComponentUpdate = false; - } - } else { - if (elementType === types["h" /* ElementTypeFunction */] || elementType === types["e" /* ElementTypeClass */] || elementType === types["f" /* ElementTypeContext */] || elementType === types["j" /* ElementTypeMemo */] || elementType === types["g" /* ElementTypeForwardRef */]) { - // Otherwise if this is a traced ancestor, flag for the nearest host descendant(s). - traceNearestHostComponentUpdate = didFiberRender(prevFiber, nextFiber); - } - } - } - - if (mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === id && didFiberRender(prevFiber, nextFiber)) { - // If this Fiber has updated, clear cached inspected data. - // If it is inspected again, it may need to be re-run to obtain updated hooks values. - hasElementUpdatedSinceLastInspected = true; - } - - const shouldIncludeInTree = !shouldFilterFiber(nextFiber); - const isSuspense = nextFiber.tag === SuspenseComponent; - let shouldResetChildren = false; // The behavior of timed-out Suspense trees is unique. - // Rather than unmount the timed out content (and possibly lose important state), - // React re-parents this content within a hidden Fragment while the fallback is showing. - // This behavior doesn't need to be observable in the DevTools though. - // It might even result in a bad user experience for e.g. node selection in the Elements panel. - // The easiest fix is to strip out the intermediate Fragment fibers, - // so the Elements panel and Profiler don't need to special case them. - // Suspense components only have a non-null memoizedState if they're timed-out. - - const prevDidTimeout = isSuspense && prevFiber.memoizedState !== null; - const nextDidTimeOut = isSuspense && nextFiber.memoizedState !== null; // The logic below is inspired by the code paths in updateSuspenseComponent() - // inside ReactFiberBeginWork in the React source code. - - if (prevDidTimeout && nextDidTimeOut) { - // Fallback -> Fallback: - // 1. Reconcile fallback set. - const nextFiberChild = nextFiber.child; - const nextFallbackChildSet = nextFiberChild ? nextFiberChild.sibling : null; // Note: We can't use nextFiber.child.sibling.alternate - // because the set is special and alternate may not exist. - - const prevFiberChild = prevFiber.child; - const prevFallbackChildSet = prevFiberChild ? prevFiberChild.sibling : null; - - if (nextFallbackChildSet != null && prevFallbackChildSet != null && updateFiberRecursively(nextFallbackChildSet, prevFallbackChildSet, nextFiber, traceNearestHostComponentUpdate)) { - shouldResetChildren = true; - } - } else if (prevDidTimeout && !nextDidTimeOut) { - // Fallback -> Primary: - // 1. Unmount fallback set - // Note: don't emulate fallback unmount because React actually did it. - // 2. Mount primary set - const nextPrimaryChildSet = nextFiber.child; - - if (nextPrimaryChildSet !== null) { - mountFiberRecursively(nextPrimaryChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate); - } - - shouldResetChildren = true; - } else if (!prevDidTimeout && nextDidTimeOut) { - // Primary -> Fallback: - // 1. Hide primary set - // This is not a real unmount, so it won't get reported by React. - // We need to manually walk the previous tree and record unmounts. - unmountFiberChildrenRecursively(prevFiber); // 2. Mount fallback set - - const nextFiberChild = nextFiber.child; - const nextFallbackChildSet = nextFiberChild ? nextFiberChild.sibling : null; - - if (nextFallbackChildSet != null) { - mountFiberRecursively(nextFallbackChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate); - shouldResetChildren = true; - } - } else { - // Common case: Primary -> Primary. - // This is the same code path as for non-Suspense fibers. - if (nextFiber.child !== prevFiber.child) { - // If the first child is different, we need to traverse them. - // Each next child will be either a new child (mount) or an alternate (update). - let nextChild = nextFiber.child; - let prevChildAtSameIndex = prevFiber.child; - - while (nextChild) { - // We already know children will be referentially different because - // they are either new mounts or alternates of previous children. - // Schedule updates and mounts depending on whether alternates exist. - // We don't track deletions here because they are reported separately. - if (nextChild.alternate) { - const prevChild = nextChild.alternate; - - if (updateFiberRecursively(nextChild, prevChild, shouldIncludeInTree ? nextFiber : parentFiber, traceNearestHostComponentUpdate)) { - // If a nested tree child order changed but it can't handle its own - // child order invalidation (e.g. because it's filtered out like host nodes), - // propagate the need to reset child order upwards to this Fiber. - shouldResetChildren = true; - } // However we also keep track if the order of the children matches - // the previous order. They are always different referentially, but - // if the instances line up conceptually we'll want to know that. - - - if (prevChild !== prevChildAtSameIndex) { - shouldResetChildren = true; - } - } else { - mountFiberRecursively(nextChild, shouldIncludeInTree ? nextFiber : parentFiber, false, traceNearestHostComponentUpdate); - shouldResetChildren = true; - } // Try the next child. - - - nextChild = nextChild.sibling; // Advance the pointer in the previous list so that we can - // keep comparing if they line up. - - if (!shouldResetChildren && prevChildAtSameIndex !== null) { - prevChildAtSameIndex = prevChildAtSameIndex.sibling; - } - } // If we have no more children, but used to, they don't line up. - - - if (prevChildAtSameIndex !== null) { - shouldResetChildren = true; - } - } else { - if (traceUpdatesEnabled) { - // If we're tracing updates and we've bailed out before reaching a host node, - // we should fall back to recursively marking the nearest host descendants for highlight. - if (traceNearestHostComponentUpdate) { - const hostFibers = findAllCurrentHostFibers(getFiberIDThrows(nextFiber)); - hostFibers.forEach(hostFiber => { - traceUpdatesForNodes.add(hostFiber.stateNode); - }); - } - } - } - } - - if (shouldIncludeInTree) { - const isProfilingSupported = nextFiber.hasOwnProperty('treeBaseDuration'); - - if (isProfilingSupported) { - recordProfilingDurations(nextFiber); - } - } - - if (shouldResetChildren) { - // We need to crawl the subtree for closest non-filtered Fibers - // so that we can display them in a flat children set. - if (shouldIncludeInTree) { - // Normally, search for children from the rendered child. - let nextChildSet = nextFiber.child; - - if (nextDidTimeOut) { - // Special case: timed-out Suspense renders the fallback set. - const nextFiberChild = nextFiber.child; - nextChildSet = nextFiberChild ? nextFiberChild.sibling : null; - } - - if (nextChildSet != null) { - recordResetChildren(nextFiber, nextChildSet); - } // We've handled the child order change for this Fiber. - // Since it's included, there's no need to invalidate parent child order. - - - return false; - } else { - // Let the closest unfiltered parent Fiber reset its child order instead. - return true; - } - } else { - return false; - } - } - - function cleanup() {// We don't patch any methods so there is no cleanup. - } - - function rootSupportsProfiling(root) { - if (root.memoizedInteractions != null) { - // v16 builds include this field for the scheduler/tracing API. - return true; - } else if (root.current != null && root.current.hasOwnProperty('treeBaseDuration')) { - // The scheduler/tracing API was removed in v17 though - // so we need to check a non-root Fiber. - return true; - } else { - return false; - } - } - - function flushInitialOperations() { - const localPendingOperationsQueue = pendingOperationsQueue; - pendingOperationsQueue = null; - - if (localPendingOperationsQueue !== null && localPendingOperationsQueue.length > 0) { - // We may have already queued up some operations before the frontend connected - // If so, let the frontend know about them. - localPendingOperationsQueue.forEach(operations => { - hook.emit('operations', operations); - }); - } else { - // Before the traversals, remember to start tracking - // our path in case we have selection to restore. - if (trackedPath !== null) { - mightBeOnTrackedPath = true; - } // If we have not been profiling, then we can just walk the tree and build up its current state as-is. - - - hook.getFiberRoots(rendererID).forEach(root => { - currentRootID = getOrGenerateFiberID(root.current); - setRootPseudoKey(currentRootID, root.current); // Handle multi-renderer edge-case where only some v16 renderers support profiling. - - if (isProfiling && rootSupportsProfiling(root)) { - // If profiling is active, store commit time and duration. - // The frontend may request this information after profiling has stopped. - currentCommitProfilingMetadata = { - changeDescriptions: recordChangeDescriptions ? new Map() : null, - durations: [], - commitTime: renderer_getCurrentTime() - profilingStartTime, - maxActualDuration: 0, - priorityLevel: null, - updaters: getUpdatersList(root), - effectDuration: null, - passiveEffectDuration: null - }; - } - - mountFiberRecursively(root.current, null, false, false); - flushPendingEvents(root); - currentRootID = -1; - }); - } - } - - function getUpdatersList(root) { - return root.memoizedUpdaters != null ? Array.from(root.memoizedUpdaters).filter(fiber => getFiberIDUnsafe(fiber) !== null).map(fiberToSerializedElement) : null; - } - - function handleCommitFiberUnmount(fiber) { - // This is not recursive. - // We can't traverse fibers after unmounting so instead - // we rely on React telling us about each unmount. - recordUnmount(fiber, false); - } - - function handlePostCommitFiberRoot(root) { - if (isProfiling && rootSupportsProfiling(root)) { - if (currentCommitProfilingMetadata !== null) { - const { - effectDuration, - passiveEffectDuration - } = Object(backend_utils["g" /* getEffectDurations */])(root); - currentCommitProfilingMetadata.effectDuration = effectDuration; - currentCommitProfilingMetadata.passiveEffectDuration = passiveEffectDuration; - } - } - } - - function handleCommitFiberRoot(root, priorityLevel) { - const current = root.current; - const alternate = current.alternate; // Flush any pending Fibers that we are untracking before processing the new commit. - // If we don't do this, we might end up double-deleting Fibers in some cases (like Legacy Suspense). - - untrackFibers(); - currentRootID = getOrGenerateFiberID(current); // Before the traversals, remember to start tracking - // our path in case we have selection to restore. - - if (trackedPath !== null) { - mightBeOnTrackedPath = true; - } - - if (traceUpdatesEnabled) { - traceUpdatesForNodes.clear(); - } // Handle multi-renderer edge-case where only some v16 renderers support profiling. - - - const isProfilingSupported = rootSupportsProfiling(root); - - if (isProfiling && isProfilingSupported) { - // If profiling is active, store commit time and duration. - // The frontend may request this information after profiling has stopped. - currentCommitProfilingMetadata = { - changeDescriptions: recordChangeDescriptions ? new Map() : null, - durations: [], - commitTime: renderer_getCurrentTime() - profilingStartTime, - maxActualDuration: 0, - priorityLevel: priorityLevel == null ? null : formatPriorityLevel(priorityLevel), - updaters: getUpdatersList(root), - // Initialize to null; if new enough React version is running, - // these values will be read during separate handlePostCommitFiberRoot() call. - effectDuration: null, - passiveEffectDuration: null - }; - } - - if (alternate) { - // TODO: relying on this seems a bit fishy. - const wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && // A dehydrated root is not considered mounted - alternate.memoizedState.isDehydrated !== true; - const isMounted = current.memoizedState != null && current.memoizedState.element != null && // A dehydrated root is not considered mounted - current.memoizedState.isDehydrated !== true; - - if (!wasMounted && isMounted) { - // Mount a new root. - setRootPseudoKey(currentRootID, current); - mountFiberRecursively(current, null, false, false); - } else if (wasMounted && isMounted) { - // Update an existing root. - updateFiberRecursively(current, alternate, null, false); - } else if (wasMounted && !isMounted) { - // Unmount an existing root. - removeRootPseudoKey(currentRootID); - recordUnmount(current, false); - } - } else { - // Mount a new root. - setRootPseudoKey(currentRootID, current); - mountFiberRecursively(current, null, false, false); - } - - if (isProfiling && isProfilingSupported) { - if (!shouldBailoutWithPendingOperations()) { - const commitProfilingMetadata = rootToCommitProfilingMetadataMap.get(currentRootID); - - if (commitProfilingMetadata != null) { - commitProfilingMetadata.push(currentCommitProfilingMetadata); - } else { - rootToCommitProfilingMetadataMap.set(currentRootID, [currentCommitProfilingMetadata]); - } - } - } // We're done here. - - - flushPendingEvents(root); - - if (traceUpdatesEnabled) { - hook.emit('traceUpdates', traceUpdatesForNodes); - } - - currentRootID = -1; - } - - function findAllCurrentHostFibers(id) { - const fibers = []; - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (!fiber) { - return fibers; - } // Next we'll drill down this component to find all HostComponent/Text. - - - let node = fiber; - - while (true) { - if (node.tag === HostComponent || node.tag === HostText) { - fibers.push(node); - } else if (node.child) { - node.child.return = node; - node = node.child; - continue; - } - - if (node === fiber) { - return fibers; - } - - while (!node.sibling) { - if (!node.return || node.return === fiber) { - return fibers; - } - - node = node.return; - } - - node.sibling.return = node.return; - node = node.sibling; - } // Flow needs the return here, but ESLint complains about it. - // eslint-disable-next-line no-unreachable - - - return fibers; - } - - function findNativeNodesForFiberID(id) { - try { - let fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber === null) { - return null; - } // Special case for a timed-out Suspense. - - - const isTimedOutSuspense = fiber.tag === SuspenseComponent && fiber.memoizedState !== null; - - if (isTimedOutSuspense) { - // A timed-out Suspense's findDOMNode is useless. - // Try our best to find the fallback directly. - const maybeFallbackFiber = fiber.child && fiber.child.sibling; - - if (maybeFallbackFiber != null) { - fiber = maybeFallbackFiber; - } - } - - const hostFibers = findAllCurrentHostFibers(id); - return hostFibers.map(hostFiber => hostFiber.stateNode).filter(Boolean); - } catch (err) { - // The fiber might have unmounted by now. - return null; - } - } - - function getDisplayNameForFiberID(id) { - const fiber = idToArbitraryFiberMap.get(id); - return fiber != null ? getDisplayNameForFiber(fiber) : null; - } - - function getFiberIDForNative(hostInstance, findNearestUnfilteredAncestor = false) { - let fiber = renderer.findFiberByHostInstance(hostInstance); - - if (fiber != null) { - if (findNearestUnfilteredAncestor) { - while (fiber !== null && shouldFilterFiber(fiber)) { - fiber = fiber.return; - } - } - - return getFiberIDThrows(fiber); - } - - return null; - } // This function is copied from React and should be kept in sync: - // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js - - - function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) { - throw new Error('Unable to find node on an unmounted component.'); - } - } // This function is copied from React and should be kept in sync: - // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js - - - function getNearestMountedFiber(fiber) { - let node = fiber; - let nearestMounted = fiber; - - if (!fiber.alternate) { - // If there is no alternate, this might be a new tree that isn't inserted - // yet. If it is, then it will have a pending insertion effect on it. - let nextNode = node; - - do { - node = nextNode; - - if ((node.flags & (Placement | Hydrating)) !== NoFlags) { - // This is an insertion or in-progress hydration. The nearest possible - // mounted fiber is the parent but we need to continue to figure out - // if that one is still mounted. - nearestMounted = node.return; - } - - nextNode = node.return; - } while (nextNode); - } else { - while (node.return) { - node = node.return; - } - } - - if (node.tag === HostRoot) { - // TODO: Check if this was a nested HostRoot when used with - // renderContainerIntoSubtree. - return nearestMounted; - } // If we didn't hit the root, that means that we're in an disconnected tree - // that has been unmounted. - - - return null; - } // This function is copied from React and should be kept in sync: - // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js - // It would be nice if we updated React to inject this function directly (vs just indirectly via findDOMNode). - // BEGIN copied code - - - function findCurrentFiberUsingSlowPathById(id) { - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber == null) { - console.warn(`Could not find Fiber with id "${id}"`); - return null; - } - - const alternate = fiber.alternate; - - if (!alternate) { - // If there is no alternate, then we only need to check if it is mounted. - const nearestMounted = getNearestMountedFiber(fiber); - - if (nearestMounted === null) { - throw new Error('Unable to find node on an unmounted component.'); - } - - if (nearestMounted !== fiber) { - return null; - } - - return fiber; - } // If we have two possible branches, we'll walk backwards up to the root - // to see what path the root points to. On the way we may hit one of the - // special cases and we'll deal with them. - - - let a = fiber; - let b = alternate; - - while (true) { - const parentA = a.return; - - if (parentA === null) { - // We're at the root. - break; - } - - const parentB = parentA.alternate; - - if (parentB === null) { - // There is no alternate. This is an unusual case. Currently, it only - // happens when a Suspense component is hidden. An extra fragment fiber - // is inserted in between the Suspense fiber and its children. Skip - // over this extra fragment fiber and proceed to the next parent. - const nextParent = parentA.return; - - if (nextParent !== null) { - a = b = nextParent; - continue; - } // If there's no parent, we're at the root. - - - break; - } // If both copies of the parent fiber point to the same child, we can - // assume that the child is current. This happens when we bailout on low - // priority: the bailed out fiber's child reuses the current child. - - - if (parentA.child === parentB.child) { - let child = parentA.child; - - while (child) { - if (child === a) { - // We've determined that A is the current branch. - assertIsMounted(parentA); - return fiber; - } - - if (child === b) { - // We've determined that B is the current branch. - assertIsMounted(parentA); - return alternate; - } - - child = child.sibling; - } // We should never have an alternate for any mounting node. So the only - // way this could possibly happen is if this was unmounted, if at all. - - - throw new Error('Unable to find node on an unmounted component.'); - } - - if (a.return !== b.return) { - // The return pointer of A and the return pointer of B point to different - // fibers. We assume that return pointers never criss-cross, so A must - // belong to the child set of A.return, and B must belong to the child - // set of B.return. - a = parentA; - b = parentB; - } else { - // The return pointers point to the same fiber. We'll have to use the - // default, slow path: scan the child sets of each parent alternate to see - // which child belongs to which set. - // - // Search parent A's child set - let didFindChild = false; - let child = parentA.child; - - while (child) { - if (child === a) { - didFindChild = true; - a = parentA; - b = parentB; - break; - } - - if (child === b) { - didFindChild = true; - b = parentA; - a = parentB; - break; - } - - child = child.sibling; - } - - if (!didFindChild) { - // Search parent B's child set - child = parentB.child; - - while (child) { - if (child === a) { - didFindChild = true; - a = parentB; - b = parentA; - break; - } - - if (child === b) { - didFindChild = true; - b = parentB; - a = parentA; - break; - } - - child = child.sibling; - } - - if (!didFindChild) { - throw new Error('Child was not found in either parent set. This indicates a bug ' + 'in React related to the return pointer. Please file an issue.'); - } - } - } - - if (a.alternate !== b) { - throw new Error("Return fibers should always be each others' alternates. " + 'This error is likely caused by a bug in React. Please file an issue.'); - } - } // If the root is not a host container, we're in a disconnected tree. I.e. - // unmounted. - - - if (a.tag !== HostRoot) { - throw new Error('Unable to find node on an unmounted component.'); - } - - if (a.stateNode.current === a) { - // We've determined that A is the current branch. - return fiber; - } // Otherwise B has to be current branch. - - - return alternate; - } // END copied code - - - function prepareViewAttributeSource(id, path) { - if (isMostRecentlyInspectedElement(id)) { - window.$attribute = Object(utils["l" /* getInObject */])(mostRecentlyInspectedElement, path); - } - } - - function prepareViewElementSource(id) { - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber == null) { - console.warn(`Could not find Fiber with id "${id}"`); - return; - } - - const { - elementType, - tag, - type - } = fiber; - - switch (tag) { - case ClassComponent: - case IncompleteClassComponent: - case IndeterminateComponent: - case FunctionComponent: - global.$type = type; - break; - - case ForwardRef: - global.$type = type.render; - break; - - case MemoComponent: - case SimpleMemoComponent: - global.$type = elementType != null && elementType.type != null ? elementType.type : type; - break; - - default: - global.$type = null; - break; - } - } - - function fiberToSerializedElement(fiber) { - return { - displayName: getDisplayNameForFiber(fiber) || 'Anonymous', - id: getFiberIDThrows(fiber), - key: fiber.key, - type: getElementTypeForFiber(fiber) - }; - } - - function getOwnersList(id) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber == null) { - return null; - } - - const { - _debugOwner - } = fiber; - const owners = [fiberToSerializedElement(fiber)]; - - if (_debugOwner) { - let owner = _debugOwner; - - while (owner !== null) { - owners.unshift(fiberToSerializedElement(owner)); - owner = owner._debugOwner || null; - } - } - - return owners; - } // Fast path props lookup for React Native style editor. - // Could use inspectElementRaw() but that would require shallow rendering hooks components, - // and could also mess with memoization. - - - function getInstanceAndStyle(id) { - let instance = null; - let style = null; - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber !== null) { - instance = fiber.stateNode; - - if (fiber.memoizedProps !== null) { - style = fiber.memoizedProps.style; - } - } - - return { - instance, - style - }; - } - - function isErrorBoundary(fiber) { - const { - tag, - type - } = fiber; - - switch (tag) { - case ClassComponent: - case IncompleteClassComponent: - const instance = fiber.stateNode; - return typeof type.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function'; - - default: - return false; - } - } - - function getNearestErrorBoundaryID(fiber) { - let parent = fiber.return; - - while (parent !== null) { - if (isErrorBoundary(parent)) { - return getFiberIDUnsafe(parent); - } - - parent = parent.return; - } - - return null; - } - - function inspectElementRaw(id) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber == null) { - return null; - } - - const { - _debugOwner, - _debugSource, - stateNode, - key, - memoizedProps, - memoizedState, - dependencies, - tag, - type - } = fiber; - const elementType = getElementTypeForFiber(fiber); - const usesHooks = (tag === FunctionComponent || tag === SimpleMemoComponent || tag === ForwardRef) && (!!memoizedState || !!dependencies); // TODO Show custom UI for Cache like we do for Suspense - // For now, just hide state data entirely since it's not meant to be inspected. - - const showState = !usesHooks && tag !== CacheComponent; - const typeSymbol = getTypeSymbol(type); - let canViewSource = false; - let context = null; - - if (tag === ClassComponent || tag === FunctionComponent || tag === IncompleteClassComponent || tag === IndeterminateComponent || tag === MemoComponent || tag === ForwardRef || tag === SimpleMemoComponent) { - canViewSource = true; - - if (stateNode && stateNode.context != null) { - // Don't show an empty context object for class components that don't use the context API. - const shouldHideContext = elementType === types["e" /* ElementTypeClass */] && !(type.contextTypes || type.contextType); - - if (!shouldHideContext) { - context = stateNode.context; - } - } - } else if (typeSymbol === ReactSymbols["c" /* CONTEXT_NUMBER */] || typeSymbol === ReactSymbols["d" /* CONTEXT_SYMBOL_STRING */]) { - // 16.3-16.5 read from "type" because the Consumer is the actual context object. - // 16.6+ should read from "type._context" because Consumer can be different (in DEV). - // NOTE Keep in sync with getDisplayNameForFiber() - const consumerResolvedContext = type._context || type; // Global context value. - - context = consumerResolvedContext._currentValue || null; // Look for overridden value. - - let current = fiber.return; - - while (current !== null) { - const currentType = current.type; - const currentTypeSymbol = getTypeSymbol(currentType); - - if (currentTypeSymbol === ReactSymbols["n" /* PROVIDER_NUMBER */] || currentTypeSymbol === ReactSymbols["o" /* PROVIDER_SYMBOL_STRING */]) { - // 16.3.0 exposed the context object as "context" - // PR #12501 changed it to "_context" for 16.3.1+ - // NOTE Keep in sync with getDisplayNameForFiber() - const providerResolvedContext = currentType._context || currentType.context; - - if (providerResolvedContext === consumerResolvedContext) { - context = current.memoizedProps.value; - break; - } - } - - current = current.return; - } - } - - let hasLegacyContext = false; - - if (context !== null) { - hasLegacyContext = !!type.contextTypes; // To simplify hydration and display logic for context, wrap in a value object. - // Otherwise simple values (e.g. strings, booleans) become harder to handle. - - context = { - value: context - }; - } - - let owners = null; - - if (_debugOwner) { - owners = []; - let owner = _debugOwner; - - while (owner !== null) { - owners.push(fiberToSerializedElement(owner)); - owner = owner._debugOwner || null; - } - } - - const isTimedOutSuspense = tag === SuspenseComponent && memoizedState !== null; - let hooks = null; - - if (usesHooks) { - const originalConsoleMethods = {}; // Temporarily disable all console logging before re-running the hook. - - for (const method in console) { - try { - originalConsoleMethods[method] = console[method]; // $FlowFixMe property error|warn is not writable. - - console[method] = () => {}; - } catch (error) {} - } - - try { - hooks = Object(react_debug_tools["inspectHooksOfFiber"])(fiber, renderer.currentDispatcherRef, true // Include source location info for hooks - ); - } finally { - // Restore original console functionality. - for (const method in originalConsoleMethods) { - try { - // $FlowFixMe property error|warn is not writable. - console[method] = originalConsoleMethods[method]; - } catch (error) {} - } - } - } - - let rootType = null; - let current = fiber; - - while (current.return !== null) { - current = current.return; - } - - const fiberRoot = current.stateNode; - - if (fiberRoot != null && fiberRoot._debugRootType !== null) { - rootType = fiberRoot._debugRootType; - } - - const errors = fiberIDToErrorsMap.get(id) || new Map(); - const warnings = fiberIDToWarningsMap.get(id) || new Map(); - const isErrored = (fiber.flags & DidCapture) !== NoFlags || forceErrorForFiberIDs.get(id) === true; - let targetErrorBoundaryID; - - if (isErrorBoundary(fiber)) { - // if the current inspected element is an error boundary, - // either that we want to use it to toggle off error state - // or that we allow to force error state on it if it's within another - // error boundary - targetErrorBoundaryID = isErrored ? id : getNearestErrorBoundaryID(fiber); - } else { - targetErrorBoundaryID = getNearestErrorBoundaryID(fiber); - } - - const plugins = { - stylex: null - }; - - if (DevToolsFeatureFlags_extension_oss["e" /* enableStyleXFeatures */]) { - if (memoizedProps.hasOwnProperty('xstyle')) { - plugins.stylex = getStyleXData(memoizedProps.xstyle); - } - } - - return { - id, - // Does the current renderer support editable hooks and function props? - canEditHooks: typeof overrideHookState === 'function', - canEditFunctionProps: typeof overrideProps === 'function', - // Does the current renderer support advanced editing interface? - canEditHooksAndDeletePaths: typeof overrideHookStateDeletePath === 'function', - canEditHooksAndRenamePaths: typeof overrideHookStateRenamePath === 'function', - canEditFunctionPropsDeletePaths: typeof overridePropsDeletePath === 'function', - canEditFunctionPropsRenamePaths: typeof overridePropsRenamePath === 'function', - canToggleError: supportsTogglingError && targetErrorBoundaryID != null, - // Is this error boundary in error state. - isErrored, - targetErrorBoundaryID, - canToggleSuspense: supportsTogglingSuspense && ( // If it's showing the real content, we can always flip fallback. - !isTimedOutSuspense || // If it's showing fallback because we previously forced it to, - // allow toggling it back to remove the fallback override. - forceFallbackForSuspenseIDs.has(id)), - // Can view component source location. - canViewSource, - // Does the component have legacy context attached to it. - hasLegacyContext, - key: key != null ? key : null, - displayName: getDisplayNameForFiber(fiber), - type: elementType, - // Inspectable properties. - // TODO Review sanitization approach for the below inspectable values. - context, - hooks, - props: memoizedProps, - state: showState ? memoizedState : null, - errors: Array.from(errors.entries()), - warnings: Array.from(warnings.entries()), - // List of owners - owners, - // Location of component in source code. - source: _debugSource || null, - rootType, - rendererPackageName: renderer.rendererPackageName, - rendererVersion: renderer.version, - plugins - }; - } - - let mostRecentlyInspectedElement = null; - let hasElementUpdatedSinceLastInspected = false; - let currentlyInspectedPaths = {}; - - function isMostRecentlyInspectedElement(id) { - return mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === id; - } - - function isMostRecentlyInspectedElementCurrent(id) { - return isMostRecentlyInspectedElement(id) && !hasElementUpdatedSinceLastInspected; - } // Track the intersection of currently inspected paths, - // so that we can send their data along if the element is re-rendered. - - - function mergeInspectedPaths(path) { - let current = currentlyInspectedPaths; - path.forEach(key => { - if (!current[key]) { - current[key] = {}; - } - - current = current[key]; - }); - } - - function createIsPathAllowed(key, secondaryCategory) { - // This function helps prevent previously-inspected paths from being dehydrated in updates. - // This is important to avoid a bad user experience where expanded toggles collapse on update. - return function isPathAllowed(path) { - switch (secondaryCategory) { - case 'hooks': - if (path.length === 1) { - // Never dehydrate the "hooks" object at the top levels. - return true; - } - - if (path[path.length - 2] === 'hookSource' && path[path.length - 1] === 'fileName') { - // It's important to preserve the full file name (URL) for hook sources - // in case the user has enabled the named hooks feature. - // Otherwise the frontend may end up with a partial URL which it can't load. - return true; - } - - if (path[path.length - 1] === 'subHooks' || path[path.length - 2] === 'subHooks') { - // Dehydrating the 'subHooks' property makes the HooksTree UI a lot more complicated, - // so it's easiest for now if we just don't break on this boundary. - // We can always dehydrate a level deeper (in the value object). - return true; - } - - break; - - default: - break; - } - - let current = key === null ? currentlyInspectedPaths : currentlyInspectedPaths[key]; - - if (!current) { - return false; - } - - for (let i = 0; i < path.length; i++) { - current = current[path[i]]; - - if (!current) { - return false; - } - } - - return true; - }; - } - - function updateSelectedElement(inspectedElement) { - const { - hooks, - id, - props - } = inspectedElement; - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber == null) { - console.warn(`Could not find Fiber with id "${id}"`); - return; - } - - const { - elementType, - stateNode, - tag, - type - } = fiber; - - switch (tag) { - case ClassComponent: - case IncompleteClassComponent: - case IndeterminateComponent: - global.$r = stateNode; - break; - - case FunctionComponent: - global.$r = { - hooks, - props, - type - }; - break; - - case ForwardRef: - global.$r = { - hooks, - props, - type: type.render - }; - break; - - case MemoComponent: - case SimpleMemoComponent: - global.$r = { - hooks, - props, - type: elementType != null && elementType.type != null ? elementType.type : type - }; - break; - - default: - global.$r = null; - break; - } - } - - function storeAsGlobal(id, path, count) { - if (isMostRecentlyInspectedElement(id)) { - const value = Object(utils["l" /* getInObject */])(mostRecentlyInspectedElement, path); - const key = `$reactTemp${count}`; - window[key] = value; - console.log(key); - console.log(value); - } - } - - function copyElementPath(id, path) { - if (isMostRecentlyInspectedElement(id)) { - Object(backend_utils["b" /* copyToClipboard */])(Object(utils["l" /* getInObject */])(mostRecentlyInspectedElement, path)); - } - } - - function inspectElement(requestID, id, path, forceFullData) { - if (path !== null) { - mergeInspectedPaths(path); - } - - if (isMostRecentlyInspectedElement(id) && !forceFullData) { - if (!hasElementUpdatedSinceLastInspected) { - if (path !== null) { - let secondaryCategory = null; - - if (path[0] === 'hooks') { - secondaryCategory = 'hooks'; - } // If this element has not been updated since it was last inspected, - // we can just return the subset of data in the newly-inspected path. - - - return { - id, - responseID: requestID, - type: 'hydrated-path', - path, - value: Object(backend_utils["a" /* cleanForBridge */])(Object(utils["l" /* getInObject */])(mostRecentlyInspectedElement, path), createIsPathAllowed(null, secondaryCategory), path) - }; - } else { - // If this element has not been updated since it was last inspected, we don't need to return it. - // Instead we can just return the ID to indicate that it has not changed. - return { - id, - responseID: requestID, - type: 'no-change' - }; - } - } - } else { - currentlyInspectedPaths = {}; - } - - hasElementUpdatedSinceLastInspected = false; - - try { - mostRecentlyInspectedElement = inspectElementRaw(id); - } catch (error) { - console.error('Error inspecting element.\n\n', error); - return { - type: 'error', - id, - responseID: requestID, - message: error.message, - stack: error.stack - }; - } - - if (mostRecentlyInspectedElement === null) { - return { - id, - responseID: requestID, - type: 'not-found' - }; - } // Any time an inspected element has an update, - // we should update the selected $r value as wel. - // Do this before dehydration (cleanForBridge). - - - updateSelectedElement(mostRecentlyInspectedElement); // Clone before cleaning so that we preserve the full data. - // This will enable us to send patches without re-inspecting if hydrated paths are requested. - // (Reducing how often we shallow-render is a better DX for function components that use hooks.) - - const cleanedInspectedElement = { ...mostRecentlyInspectedElement - }; - cleanedInspectedElement.context = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.context, createIsPathAllowed('context', null)); - cleanedInspectedElement.hooks = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.hooks, createIsPathAllowed('hooks', 'hooks')); - cleanedInspectedElement.props = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.props, createIsPathAllowed('props', null)); - cleanedInspectedElement.state = Object(backend_utils["a" /* cleanForBridge */])(cleanedInspectedElement.state, createIsPathAllowed('state', null)); - return { - id, - responseID: requestID, - type: 'full-data', - value: cleanedInspectedElement - }; - } - - function logElementToConsole(id) { - const result = isMostRecentlyInspectedElementCurrent(id) ? mostRecentlyInspectedElement : inspectElementRaw(id); - - if (result === null) { - console.warn(`Could not find Fiber with id "${id}"`); - return; - } - - const supportsGroup = typeof console.groupCollapsed === 'function'; - - if (supportsGroup) { - console.groupCollapsed(`[Click to expand] %c<${result.displayName || 'Component'} />`, // --dom-tag-name-color is the CSS variable Chrome styles HTML elements with in the console. - 'color: var(--dom-tag-name-color); font-weight: normal;'); - } - - if (result.props !== null) { - console.log('Props:', result.props); - } - - if (result.state !== null) { - console.log('State:', result.state); - } - - if (result.hooks !== null) { - console.log('Hooks:', result.hooks); - } - - const nativeNodes = findNativeNodesForFiberID(id); - - if (nativeNodes !== null) { - console.log('Nodes:', nativeNodes); - } - - if (result.source !== null) { - console.log('Location:', result.source); - } - - if (window.chrome || /firefox/i.test(navigator.userAgent)) { - console.log('Right-click any value to save it as a global variable for further inspection.'); - } - - if (supportsGroup) { - console.groupEnd(); - } - } - - function deletePath(type, id, hookID, path) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber !== null) { - const instance = fiber.stateNode; - - switch (type) { - case 'context': - // To simplify hydration and display of primitive context values (e.g. number, string) - // the inspectElement() method wraps context in a {value: ...} object. - // We need to remove the first part of the path (the "value") before continuing. - path = path.slice(1); - - switch (fiber.tag) { - case ClassComponent: - if (path.length === 0) {// Simple context value (noop) - } else { - Object(utils["a" /* deletePathInObject */])(instance.context, path); - } - - instance.forceUpdate(); - break; - - case FunctionComponent: - // Function components using legacy context are not editable - // because there's no instance on which to create a cloned, mutated context. - break; - } - - break; - - case 'hooks': - if (typeof overrideHookStateDeletePath === 'function') { - overrideHookStateDeletePath(fiber, hookID, path); - } - - break; - - case 'props': - if (instance === null) { - if (typeof overridePropsDeletePath === 'function') { - overridePropsDeletePath(fiber, path); - } - } else { - fiber.pendingProps = Object(backend_utils["c" /* copyWithDelete */])(instance.props, path); - instance.forceUpdate(); - } - - break; - - case 'state': - Object(utils["a" /* deletePathInObject */])(instance.state, path); - instance.forceUpdate(); - break; - } - } - } - - function renamePath(type, id, hookID, oldPath, newPath) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber !== null) { - const instance = fiber.stateNode; - - switch (type) { - case 'context': - // To simplify hydration and display of primitive context values (e.g. number, string) - // the inspectElement() method wraps context in a {value: ...} object. - // We need to remove the first part of the path (the "value") before continuing. - oldPath = oldPath.slice(1); - newPath = newPath.slice(1); - - switch (fiber.tag) { - case ClassComponent: - if (oldPath.length === 0) {// Simple context value (noop) - } else { - Object(utils["q" /* renamePathInObject */])(instance.context, oldPath, newPath); - } - - instance.forceUpdate(); - break; - - case FunctionComponent: - // Function components using legacy context are not editable - // because there's no instance on which to create a cloned, mutated context. - break; - } - - break; - - case 'hooks': - if (typeof overrideHookStateRenamePath === 'function') { - overrideHookStateRenamePath(fiber, hookID, oldPath, newPath); - } - - break; - - case 'props': - if (instance === null) { - if (typeof overridePropsRenamePath === 'function') { - overridePropsRenamePath(fiber, oldPath, newPath); - } - } else { - fiber.pendingProps = Object(backend_utils["d" /* copyWithRename */])(instance.props, oldPath, newPath); - instance.forceUpdate(); - } - - break; - - case 'state': - Object(utils["q" /* renamePathInObject */])(instance.state, oldPath, newPath); - instance.forceUpdate(); - break; - } - } - } - - function overrideValueAtPath(type, id, hookID, path, value) { - const fiber = findCurrentFiberUsingSlowPathById(id); - - if (fiber !== null) { - const instance = fiber.stateNode; - - switch (type) { - case 'context': - // To simplify hydration and display of primitive context values (e.g. number, string) - // the inspectElement() method wraps context in a {value: ...} object. - // We need to remove the first part of the path (the "value") before continuing. - path = path.slice(1); - - switch (fiber.tag) { - case ClassComponent: - if (path.length === 0) { - // Simple context value - instance.context = value; - } else { - Object(utils["t" /* setInObject */])(instance.context, path, value); - } - - instance.forceUpdate(); - break; - - case FunctionComponent: - // Function components using legacy context are not editable - // because there's no instance on which to create a cloned, mutated context. - break; - } - - break; - - case 'hooks': - if (typeof overrideHookState === 'function') { - overrideHookState(fiber, hookID, path, value); - } - - break; - - case 'props': - switch (fiber.tag) { - case ClassComponent: - fiber.pendingProps = Object(backend_utils["e" /* copyWithSet */])(instance.props, path, value); - instance.forceUpdate(); - break; - - default: - if (typeof overrideProps === 'function') { - overrideProps(fiber, path, value); - } - - break; - } - - break; - - case 'state': - switch (fiber.tag) { - case ClassComponent: - Object(utils["t" /* setInObject */])(instance.state, path, value); - instance.forceUpdate(); - break; - } - - break; - } - } - } - - let currentCommitProfilingMetadata = null; - let displayNamesByRootID = null; - let idToContextsMap = null; - let initialTreeBaseDurationsMap = null; - let initialIDToRootMap = null; - let isProfiling = false; - let profilingStartTime = 0; - let recordChangeDescriptions = false; - let rootToCommitProfilingMetadataMap = null; - - function getProfilingData() { - const dataForRoots = []; - - if (rootToCommitProfilingMetadataMap === null) { - throw Error('getProfilingData() called before any profiling data was recorded'); - } - - rootToCommitProfilingMetadataMap.forEach((commitProfilingMetadata, rootID) => { - const commitData = []; - const initialTreeBaseDurations = []; - const displayName = displayNamesByRootID !== null && displayNamesByRootID.get(rootID) || 'Unknown'; - - if (initialTreeBaseDurationsMap != null) { - initialTreeBaseDurationsMap.forEach((treeBaseDuration, id) => { - if (initialIDToRootMap != null && initialIDToRootMap.get(id) === rootID) { - // We don't need to convert milliseconds to microseconds in this case, - // because the profiling summary is JSON serialized. - initialTreeBaseDurations.push([id, treeBaseDuration]); - } - }); - } - - commitProfilingMetadata.forEach((commitProfilingData, commitIndex) => { - const { - changeDescriptions, - durations, - effectDuration, - maxActualDuration, - passiveEffectDuration, - priorityLevel, - commitTime, - updaters - } = commitProfilingData; - const fiberActualDurations = []; - const fiberSelfDurations = []; - - for (let i = 0; i < durations.length; i += 3) { - const fiberID = durations[i]; - fiberActualDurations.push([fiberID, durations[i + 1]]); - fiberSelfDurations.push([fiberID, durations[i + 2]]); - } - - commitData.push({ - changeDescriptions: changeDescriptions !== null ? Array.from(changeDescriptions.entries()) : null, - duration: maxActualDuration, - effectDuration, - fiberActualDurations, - fiberSelfDurations, - passiveEffectDuration, - priorityLevel, - timestamp: commitTime, - updaters - }); - }); - dataForRoots.push({ - commitData, - displayName, - initialTreeBaseDurations, - rootID - }); - }); - let timelineData = null; - - if (typeof getTimelineData === 'function') { - const currentTimelineData = getTimelineData(); - - if (currentTimelineData) { - const { - batchUIDToMeasuresMap, - internalModuleSourceToRanges, - laneToLabelMap, - laneToReactMeasureMap, - ...rest - } = currentTimelineData; - timelineData = { ...rest, - // Most of the data is safe to parse as-is, - // but we need to convert the nested Arrays back to Maps. - // Most of the data is safe to serialize as-is, - // but we need to convert the Maps to nested Arrays. - batchUIDToMeasuresKeyValueArray: Array.from(batchUIDToMeasuresMap.entries()), - internalModuleSourceToRanges: Array.from(internalModuleSourceToRanges.entries()), - laneToLabelKeyValueArray: Array.from(laneToLabelMap.entries()), - laneToReactMeasureKeyValueArray: Array.from(laneToReactMeasureMap.entries()) - }; - } - } - - return { - dataForRoots, - rendererID, - timelineData - }; - } - - function startProfiling(shouldRecordChangeDescriptions) { - if (isProfiling) { - return; - } - - recordChangeDescriptions = shouldRecordChangeDescriptions; // Capture initial values as of the time profiling starts. - // It's important we snapshot both the durations and the id-to-root map, - // since either of these may change during the profiling session - // (e.g. when a fiber is re-rendered or when a fiber gets removed). - - displayNamesByRootID = new Map(); - initialTreeBaseDurationsMap = new Map(idToTreeBaseDurationMap); - initialIDToRootMap = new Map(idToRootMap); - idToContextsMap = new Map(); - hook.getFiberRoots(rendererID).forEach(root => { - const rootID = getFiberIDThrows(root.current); - displayNamesByRootID.set(rootID, getDisplayNameForRoot(root.current)); - - if (shouldRecordChangeDescriptions) { - // Record all contexts at the time profiling is started. - // Fibers only store the current context value, - // so we need to track them separately in order to determine changed keys. - crawlToInitializeContextsMap(root.current); - } - }); - isProfiling = true; - profilingStartTime = renderer_getCurrentTime(); - rootToCommitProfilingMetadataMap = new Map(); - - if (toggleProfilingStatus !== null) { - toggleProfilingStatus(true); - } - } - - function stopProfiling() { - isProfiling = false; - recordChangeDescriptions = false; - - if (toggleProfilingStatus !== null) { - toggleProfilingStatus(false); - } - } // Automatically start profiling so that we don't miss timing info from initial "mount". - - - if (Object(storage["d" /* sessionStorageGetItem */])(constants["u" /* SESSION_STORAGE_RELOAD_AND_PROFILE_KEY */]) === 'true') { - startProfiling(Object(storage["d" /* sessionStorageGetItem */])(constants["t" /* SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY */]) === 'true'); - } // React will switch between these implementations depending on whether - // we have any manually suspended/errored-out Fibers or not. - - - function shouldErrorFiberAlwaysNull() { - return null; - } // Map of id and its force error status: true (error), false (toggled off), - // null (do nothing) - - - const forceErrorForFiberIDs = new Map(); - - function shouldErrorFiberAccordingToMap(fiber) { - if (typeof setErrorHandler !== 'function') { - throw new Error('Expected overrideError() to not get called for earlier React versions.'); - } - - const id = getFiberIDUnsafe(fiber); - - if (id === null) { - return null; - } - - let status = null; - - if (forceErrorForFiberIDs.has(id)) { - status = forceErrorForFiberIDs.get(id); - - if (status === false) { - // TRICKY overrideError adds entries to this Map, - // so ideally it would be the method that clears them too, - // but that would break the functionality of the feature, - // since DevTools needs to tell React to act differently than it normally would - // (don't just re-render the failed boundary, but reset its errored state too). - // So we can only clear it after telling React to reset the state. - // Technically this is premature and we should schedule it for later, - // since the render could always fail without committing the updated error boundary, - // but since this is a DEV-only feature, the simplicity is worth the trade off. - forceErrorForFiberIDs.delete(id); - - if (forceErrorForFiberIDs.size === 0) { - // Last override is gone. Switch React back to fast path. - setErrorHandler(shouldErrorFiberAlwaysNull); - } - } - } - - return status; - } - - function overrideError(id, forceError) { - if (typeof setErrorHandler !== 'function' || typeof scheduleUpdate !== 'function') { - throw new Error('Expected overrideError() to not get called for earlier React versions.'); - } - - forceErrorForFiberIDs.set(id, forceError); - - if (forceErrorForFiberIDs.size === 1) { - // First override is added. Switch React to slower path. - setErrorHandler(shouldErrorFiberAccordingToMap); - } - - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber != null) { - scheduleUpdate(fiber); - } - } - - function shouldSuspendFiberAlwaysFalse() { - return false; - } - - const forceFallbackForSuspenseIDs = new Set(); - - function shouldSuspendFiberAccordingToSet(fiber) { - const maybeID = getFiberIDUnsafe(fiber); - return maybeID !== null && forceFallbackForSuspenseIDs.has(maybeID); - } - - function overrideSuspense(id, forceFallback) { - if (typeof setSuspenseHandler !== 'function' || typeof scheduleUpdate !== 'function') { - throw new Error('Expected overrideSuspense() to not get called for earlier React versions.'); - } - - if (forceFallback) { - forceFallbackForSuspenseIDs.add(id); - - if (forceFallbackForSuspenseIDs.size === 1) { - // First override is added. Switch React to slower path. - setSuspenseHandler(shouldSuspendFiberAccordingToSet); - } - } else { - forceFallbackForSuspenseIDs.delete(id); - - if (forceFallbackForSuspenseIDs.size === 0) { - // Last override is gone. Switch React back to fast path. - setSuspenseHandler(shouldSuspendFiberAlwaysFalse); - } - } - - const fiber = idToArbitraryFiberMap.get(id); - - if (fiber != null) { - scheduleUpdate(fiber); - } - } // Remember if we're trying to restore the selection after reload. - // In that case, we'll do some extra checks for matching mounts. - - - let trackedPath = null; - let trackedPathMatchFiber = null; - let trackedPathMatchDepth = -1; - let mightBeOnTrackedPath = false; - - function setTrackedPath(path) { - if (path === null) { - trackedPathMatchFiber = null; - trackedPathMatchDepth = -1; - mightBeOnTrackedPath = false; - } - - trackedPath = path; - } // We call this before traversing a new mount. - // It remembers whether this Fiber is the next best match for tracked path. - // The return value signals whether we should keep matching siblings or not. - - - function updateTrackedPathStateBeforeMount(fiber) { - if (trackedPath === null || !mightBeOnTrackedPath) { - // Fast path: there's nothing to track so do nothing and ignore siblings. - return false; - } - - const returnFiber = fiber.return; - const returnAlternate = returnFiber !== null ? returnFiber.alternate : null; // By now we know there's some selection to restore, and this is a new Fiber. - // Is this newly mounted Fiber a direct child of the current best match? - // (This will also be true for new roots if we haven't matched anything yet.) - - if (trackedPathMatchFiber === returnFiber || trackedPathMatchFiber === returnAlternate && returnAlternate !== null) { - // Is this the next Fiber we should select? Let's compare the frames. - const actualFrame = getPathFrame(fiber); - const expectedFrame = trackedPath[trackedPathMatchDepth + 1]; - - if (expectedFrame === undefined) { - throw new Error('Expected to see a frame at the next depth.'); - } - - if (actualFrame.index === expectedFrame.index && actualFrame.key === expectedFrame.key && actualFrame.displayName === expectedFrame.displayName) { - // We have our next match. - trackedPathMatchFiber = fiber; - trackedPathMatchDepth++; // Are we out of frames to match? - - if (trackedPathMatchDepth === trackedPath.length - 1) { - // There's nothing that can possibly match afterwards. - // Don't check the children. - mightBeOnTrackedPath = false; - } else { - // Check the children, as they might reveal the next match. - mightBeOnTrackedPath = true; - } // In either case, since we have a match, we don't need - // to check the siblings. They'll never match. - - - return false; - } - } // This Fiber's parent is on the path, but this Fiber itself isn't. - // There's no need to check its children--they won't be on the path either. - - - mightBeOnTrackedPath = false; // However, one of its siblings may be on the path so keep searching. - - return true; - } - - function updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath) { - // updateTrackedPathStateBeforeMount() told us whether to match siblings. - // Now that we're entering siblings, let's use that information. - mightBeOnTrackedPath = mightSiblingsBeOnTrackedPath; - } // Roots don't have a real persistent identity. - // A root's "pseudo key" is "childDisplayName:indexWithThatName". - // For example, "App:0" or, in case of similar roots, "Story:0", "Story:1", etc. - // We will use this to try to disambiguate roots when restoring selection between reloads. - - - const rootPseudoKeys = new Map(); - const rootDisplayNameCounter = new Map(); - - function setRootPseudoKey(id, fiber) { - const name = getDisplayNameForRoot(fiber); - const counter = rootDisplayNameCounter.get(name) || 0; - rootDisplayNameCounter.set(name, counter + 1); - const pseudoKey = `${name}:${counter}`; - rootPseudoKeys.set(id, pseudoKey); - } - - function removeRootPseudoKey(id) { - const pseudoKey = rootPseudoKeys.get(id); - - if (pseudoKey === undefined) { - throw new Error('Expected root pseudo key to be known.'); - } - - const name = pseudoKey.substring(0, pseudoKey.lastIndexOf(':')); - const counter = rootDisplayNameCounter.get(name); - - if (counter === undefined) { - throw new Error('Expected counter to be known.'); - } - - if (counter > 1) { - rootDisplayNameCounter.set(name, counter - 1); - } else { - rootDisplayNameCounter.delete(name); - } - - rootPseudoKeys.delete(id); - } - - function getDisplayNameForRoot(fiber) { - let preferredDisplayName = null; - let fallbackDisplayName = null; - let child = fiber.child; // Go at most three levels deep into direct children - // while searching for a child that has a displayName. - - for (let i = 0; i < 3; i++) { - if (child === null) { - break; - } - - const displayName = getDisplayNameForFiber(child); - - if (displayName !== null) { - // Prefer display names that we get from user-defined components. - // We want to avoid using e.g. 'Suspense' unless we find nothing else. - if (typeof child.type === 'function') { - // There's a few user-defined tags, but we'll prefer the ones - // that are usually explicitly named (function or class components). - preferredDisplayName = displayName; - } else if (fallbackDisplayName === null) { - fallbackDisplayName = displayName; - } - } - - if (preferredDisplayName !== null) { - break; - } - - child = child.child; - } - - return preferredDisplayName || fallbackDisplayName || 'Anonymous'; - } - - function getPathFrame(fiber) { - const { - key - } = fiber; - let displayName = getDisplayNameForFiber(fiber); - const index = fiber.index; - - switch (fiber.tag) { - case HostRoot: - // Roots don't have a real displayName, index, or key. - // Instead, we'll use the pseudo key (childDisplayName:indexWithThatName). - const id = getFiberIDThrows(fiber); - const pseudoKey = rootPseudoKeys.get(id); - - if (pseudoKey === undefined) { - throw new Error('Expected mounted root to have known pseudo key.'); - } - - displayName = pseudoKey; - break; - - case HostComponent: - displayName = fiber.type; - break; - - default: - break; - } - - return { - displayName, - key, - index - }; - } // Produces a serializable representation that does a best effort - // of identifying a particular Fiber between page reloads. - // The return path will contain Fibers that are "invisible" to the store - // because their keys and indexes are important to restoring the selection. - - - function getPathForElement(id) { - let fiber = idToArbitraryFiberMap.get(id); - - if (fiber == null) { - return null; - } - - const keyPath = []; - - while (fiber !== null) { - keyPath.push(getPathFrame(fiber)); - fiber = fiber.return; - } - - keyPath.reverse(); - return keyPath; - } - - function getBestMatchForTrackedPath() { - if (trackedPath === null) { - // Nothing to match. - return null; - } - - if (trackedPathMatchFiber === null) { - // We didn't find anything. - return null; - } // Find the closest Fiber store is aware of. - - - let fiber = trackedPathMatchFiber; - - while (fiber !== null && shouldFilterFiber(fiber)) { - fiber = fiber.return; - } - - if (fiber === null) { - return null; - } - - return { - id: getFiberIDThrows(fiber), - isFullMatch: trackedPathMatchDepth === trackedPath.length - 1 - }; - } - - const formatPriorityLevel = priorityLevel => { - if (priorityLevel == null) { - return 'Unknown'; - } - - switch (priorityLevel) { - case ImmediatePriority: - return 'Immediate'; - - case UserBlockingPriority: - return 'User-Blocking'; - - case NormalPriority: - return 'Normal'; - - case LowPriority: - return 'Low'; - - case IdlePriority: - return 'Idle'; - - case NoPriority: - default: - return 'Unknown'; - } - }; - - function setTraceUpdatesEnabled(isEnabled) { - traceUpdatesEnabled = isEnabled; - } - - return { - cleanup, - clearErrorsAndWarnings, - clearErrorsForFiberID, - clearWarningsForFiberID, - copyElementPath, - deletePath, - findNativeNodesForFiberID, - flushInitialOperations, - getBestMatchForTrackedPath, - getDisplayNameForFiberID, - getFiberIDForNative, - getInstanceAndStyle, - getOwnersList, - getPathForElement, - getProfilingData, - handleCommitFiberRoot, - handleCommitFiberUnmount, - handlePostCommitFiberRoot, - inspectElement, - logElementToConsole, - patchConsoleForStrictMode: backend_console["b" /* patchForStrictMode */], - prepareViewAttributeSource, - prepareViewElementSource, - overrideError, - overrideSuspense, - overrideValueAtPath, - renamePath, - renderer, - setTraceUpdatesEnabled, - setTrackedPath, - startProfiling, - stopProfiling, - storeAsGlobal, - unpatchConsoleForStrictMode: backend_console["d" /* unpatchForStrictMode */], - updateComponentFilters - }; -} - -/***/ }), - -/***/ 52: -/***/ (function(module, exports) { - -var g; // This works in non-strict mode - -g = function () { - return this; -}(); - -try { - // This works if eval is allowed (see CSP) - g = g || new Function("return this")(); -} catch (e) { - // This works if the window reference is available - if (typeof window === "object") g = window; -} // g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - - -module.exports = g; - -/***/ }), - -/***/ 53: -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. - - /* istanbul ignore next */ - - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(63)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})(this, function ErrorStackParser(StackFrame) { - 'use strict'; - - var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/; - var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m; - var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/; - return { - /** - * Given an Error object, extract the most information from it. - * - * @param {Error} error object - * @return {Array} of StackFrames - */ - parse: function ErrorStackParser$$parse(error) { - if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') { - return this.parseOpera(error); - } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) { - return this.parseV8OrIE(error); - } else if (error.stack) { - return this.parseFFOrSafari(error); - } else { - throw new Error('Cannot parse given Error object'); - } - }, - // Separate line and column numbers from a string of the form: (URI:Line:Column) - extractLocation: function ErrorStackParser$$extractLocation(urlLike) { - // Fail-fast but return locations like "(native)" - if (urlLike.indexOf(':') === -1) { - return [urlLike]; - } - - var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/; - var parts = regExp.exec(urlLike.replace(/[()]/g, '')); - return [parts[1], parts[2] || undefined, parts[3] || undefined]; - }, - parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(CHROME_IE_STACK_REGEXP); - }, this); - return filtered.map(function (line) { - if (line.indexOf('(eval ') > -1) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, ''); - } - - var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in - // case it has spaces in it, as the string is split on \s+ later on - - var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); // remove the parenthesized location from the line, if it was matched - - sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine; - var tokens = sanitizedLine.split(/\s+/).slice(1); // if a location was matched, pass it to extractLocation() otherwise pop the last token - - var locationParts = this.extractLocation(location ? location[1] : tokens.pop()); - var functionName = tokens.join(' ') || undefined; - var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0]; - return new StackFrame({ - functionName: functionName, - fileName: fileName, - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - }, this); - }, - parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !line.match(SAFARI_NATIVE_CODE_REGEXP); - }, this); - return filtered.map(function (line) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - if (line.indexOf(' > eval') > -1) { - line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1'); - } - - if (line.indexOf('@') === -1 && line.indexOf(':') === -1) { - // Safari eval frames only have function names and nothing else - return new StackFrame({ - functionName: line - }); - } else { - var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; - var matches = line.match(functionNameRegex); - var functionName = matches && matches[1] ? matches[1] : undefined; - var locationParts = this.extractLocation(line.replace(functionNameRegex, '')); - return new StackFrame({ - functionName: functionName, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - } - }, this); - }, - parseOpera: function ErrorStackParser$$parseOpera(e) { - if (!e.stacktrace || e.message.indexOf('\n') > -1 && e.message.split('\n').length > e.stacktrace.split('\n').length) { - return this.parseOpera9(e); - } else if (!e.stack) { - return this.parseOpera10(e); - } else { - return this.parseOpera11(e); - } - }, - parseOpera9: function ErrorStackParser$$parseOpera9(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; - var lines = e.message.split('\n'); - var result = []; - - for (var i = 2, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - - if (match) { - result.push(new StackFrame({ - fileName: match[2], - lineNumber: match[1], - source: lines[i] - })); - } - } - - return result; - }, - parseOpera10: function ErrorStackParser$$parseOpera10(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; - var lines = e.stacktrace.split('\n'); - var result = []; - - for (var i = 0, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - - if (match) { - result.push(new StackFrame({ - functionName: match[3] || undefined, - fileName: match[2], - lineNumber: match[1], - source: lines[i] - })); - } - } - - return result; - }, - // Opera 10.65+ Error.stack very similar to FF/Safari - parseOpera11: function ErrorStackParser$$parseOpera11(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/); - }, this); - return filtered.map(function (line) { - var tokens = line.split('@'); - var locationParts = this.extractLocation(tokens.pop()); - var functionCall = tokens.shift() || ''; - var functionName = functionCall.replace(//, '$2').replace(/\([^)]*\)/g, '') || undefined; - var argsRaw; - - if (functionCall.match(/\(([^)]*)\)/)) { - argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1'); - } - - var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(','); - return new StackFrame({ - functionName: functionName, - args: args, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }); - }, this); - } - }; -}); - -/***/ }), - -/***/ 54: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function nullthrows(x, message) { - if (x != null) { - return x; - } - - var error = new Error(message !== undefined ? message : 'Got unexpected ' + x); - error.framesToPop = 1; // Skip nullthrows's own stack frame. - - throw error; -} - -module.exports = nullthrows; -module.exports.default = nullthrows; -Object.defineProperty(module.exports, '__esModule', { - value: true -}); - -/***/ }), - -/***/ 59: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = Yallist; -Yallist.Node = Node; -Yallist.create = Yallist; - -function Yallist(list) { - var self = this; - - if (!(self instanceof Yallist)) { - self = new Yallist(); - } - - self.tail = null; - self.head = null; - self.length = 0; - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item); - }); - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]); - } - } - - return self; -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list'); - } - - var next = node.next; - var prev = node.prev; - - if (next) { - next.prev = prev; - } - - if (prev) { - prev.next = next; - } - - if (node === this.head) { - this.head = next; - } - - if (node === this.tail) { - this.tail = prev; - } - - node.list.length--; - node.next = null; - node.prev = null; - node.list = null; - return next; -}; - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return; - } - - if (node.list) { - node.list.removeNode(node); - } - - var head = this.head; - node.list = this; - node.next = head; - - if (head) { - head.prev = node; - } - - this.head = node; - - if (!this.tail) { - this.tail = node; - } - - this.length++; -}; - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return; - } - - if (node.list) { - node.list.removeNode(node); - } - - var tail = this.tail; - node.list = this; - node.prev = tail; - - if (tail) { - tail.next = node; - } - - this.tail = node; - - if (!this.head) { - this.head = node; - } - - this.length++; -}; - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]); - } - - return this.length; -}; - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]); - } - - return this.length; -}; - -Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined; - } - - var res = this.tail.value; - this.tail = this.tail.prev; - - if (this.tail) { - this.tail.next = null; - } else { - this.head = null; - } - - this.length--; - return res; -}; - -Yallist.prototype.shift = function () { - if (!this.head) { - return undefined; - } - - var res = this.head.value; - this.head = this.head.next; - - if (this.head) { - this.head.prev = null; - } else { - this.tail = null; - } - - this.length--; - return res; -}; - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this; - - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this); - walker = walker.next; - } -}; - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this; - - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this); - walker = walker.prev; - } -}; - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next; - } - - if (i === n && walker !== null) { - return walker.value; - } -}; - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev; - } - - if (i === n && walker !== null) { - return walker.value; - } -}; - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this; - var res = new Yallist(); - - for (var walker = this.head; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)); - walker = walker.next; - } - - return res; -}; - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this; - var res = new Yallist(); - - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)); - walker = walker.prev; - } - - return res; -}; - -Yallist.prototype.reduce = function (fn, initial) { - var acc; - var walker = this.head; - - if (arguments.length > 1) { - acc = initial; - } else if (this.head) { - walker = this.head.next; - acc = this.head.value; - } else { - throw new TypeError('Reduce of empty list with no initial value'); - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i); - walker = walker.next; - } - - return acc; -}; - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc; - var walker = this.tail; - - if (arguments.length > 1) { - acc = initial; - } else if (this.tail) { - walker = this.tail.prev; - acc = this.tail.value; - } else { - throw new TypeError('Reduce of empty list with no initial value'); - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i); - walker = walker.prev; - } - - return acc; -}; - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length); - - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value; - walker = walker.next; - } - - return arr; -}; - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length); - - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value; - walker = walker.prev; - } - - return arr; -}; - -Yallist.prototype.slice = function (from, to) { - to = to || this.length; - - if (to < 0) { - to += this.length; - } - - from = from || 0; - - if (from < 0) { - from += this.length; - } - - var ret = new Yallist(); - - if (to < from || to < 0) { - return ret; - } - - if (from < 0) { - from = 0; - } - - if (to > this.length) { - to = this.length; - } - - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next; - } - - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value); - } - - return ret; -}; - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length; - - if (to < 0) { - to += this.length; - } - - from = from || 0; - - if (from < 0) { - from += this.length; - } - - var ret = new Yallist(); - - if (to < from || to < 0) { - return ret; - } - - if (from < 0) { - from = 0; - } - - if (to > this.length) { - to = this.length; - } - - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev; - } - - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value); - } - - return ret; -}; - -Yallist.prototype.splice = function (start, deleteCount -/*, ...nodes */ -) { - if (start > this.length) { - start = this.length - 1; - } - - if (start < 0) { - start = this.length + start; - } - - for (var i = 0, walker = this.head; walker !== null && i < start; i++) { - walker = walker.next; - } - - var ret = []; - - for (var i = 0; walker && i < deleteCount; i++) { - ret.push(walker.value); - walker = this.removeNode(walker); - } - - if (walker === null) { - walker = this.tail; - } - - if (walker !== this.head && walker !== this.tail) { - walker = walker.prev; - } - - for (var i = 2; i < arguments.length; i++) { - walker = insert(this, walker, arguments[i]); - } - - return ret; -}; - -Yallist.prototype.reverse = function () { - var head = this.head; - var tail = this.tail; - - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev; - walker.prev = walker.next; - walker.next = p; - } - - this.head = tail; - this.tail = head; - return this; -}; - -function insert(self, node, value) { - var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self); - - if (inserted.next === null) { - self.tail = inserted; - } - - if (inserted.prev === null) { - self.head = inserted; - } - - self.length++; - return inserted; -} - -function push(self, item) { - self.tail = new Node(item, self.tail, null, self); - - if (!self.head) { - self.head = self.tail; - } - - self.length++; -} - -function unshift(self, item) { - self.head = new Node(item, null, self.head, self); - - if (!self.tail) { - self.tail = self.head; - } - - self.length++; -} - -function Node(value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list); - } - - this.list = list; - this.value = value; - - if (prev) { - prev.next = this; - this.prev = prev; - } else { - this.prev = null; - } - - if (next) { - next.prev = this; - this.next = next; - } else { - this.next = null; - } -} - -try { - // add if support for Symbol.iterator is present - __webpack_require__(60)(Yallist); -} catch (er) {} - -/***/ }), - -/***/ 60: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function (Yallist) { - Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value; - } - }; -}; - -/***/ }), - -/***/ 61: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * @license React - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -var b = Symbol.for("react.element"), - c = Symbol.for("react.portal"), - d = Symbol.for("react.fragment"), - e = Symbol.for("react.strict_mode"), - f = Symbol.for("react.profiler"), - g = Symbol.for("react.provider"), - h = Symbol.for("react.context"), - k = Symbol.for("react.server_context"), - l = Symbol.for("react.forward_ref"), - m = Symbol.for("react.suspense"), - n = Symbol.for("react.suspense_list"), - p = Symbol.for("react.memo"), - q = Symbol.for("react.lazy"), - t = Symbol.for("react.offscreen"), - u = Symbol.for("react.cache"), - v = Symbol.for("react.module.reference"); - -function w(a) { - if ("object" === typeof a && null !== a) { - var r = a.$$typeof; - - switch (r) { - case b: - switch (a = a.type, a) { - case d: - case f: - case e: - case m: - case n: - return a; - - default: - switch (a = a && a.$$typeof, a) { - case k: - case h: - case l: - case q: - case p: - case g: - return a; - - default: - return r; - } - - } - - case c: - return r; - } - } -} - -exports.ContextConsumer = h; -exports.ContextProvider = g; -exports.Element = b; -exports.ForwardRef = l; -exports.Fragment = d; -exports.Lazy = q; -exports.Memo = p; -exports.Portal = c; -exports.Profiler = f; -exports.StrictMode = e; -exports.Suspense = m; -exports.SuspenseList = n; - -exports.isAsyncMode = function () { - return !1; -}; - -exports.isConcurrentMode = function () { - return !1; -}; - -exports.isContextConsumer = function (a) { - return w(a) === h; -}; - -exports.isContextProvider = function (a) { - return w(a) === g; -}; - -exports.isElement = function (a) { - return "object" === typeof a && null !== a && a.$$typeof === b; -}; - -exports.isForwardRef = function (a) { - return w(a) === l; -}; - -exports.isFragment = function (a) { - return w(a) === d; -}; - -exports.isLazy = function (a) { - return w(a) === q; -}; - -exports.isMemo = function (a) { - return w(a) === p; -}; - -exports.isPortal = function (a) { - return w(a) === c; -}; - -exports.isProfiler = function (a) { - return w(a) === f; -}; - -exports.isStrictMode = function (a) { - return w(a) === e; -}; - -exports.isSuspense = function (a) { - return w(a) === m; -}; - -exports.isSuspenseList = function (a) { - return w(a) === n; -}; - -exports.isValidElementType = function (a) { - return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || a === u || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === v || void 0 !== a.getModuleId) ? !0 : !1; -}; - -exports.typeOf = w; - -/***/ }), - -/***/ 62: -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} - -function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); -} - -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -})(); - -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } -} - -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } -} - -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - - draining = false; - - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - - while (len) { - currentQueue = queue; - queue = []; - - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - - queueIndex = -1; - len = queue.length; - } - - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - - queue.push(new Item(fun, args)); - - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; // v8 likes predictible objects - - -function Item(fun, array) { - this.fun = fun; - this.array = array; -} - -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues - -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { - return []; -}; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { - return '/'; -}; - -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -process.umask = function () { - return 0; -}; - -/***/ }), - -/***/ 63: -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. - - /* istanbul ignore next */ - - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})(this, function () { - 'use strict'; - - function _isNumber(n) { - return !isNaN(parseFloat(n)) && isFinite(n); - } - - function _capitalize(str) { - return str.charAt(0).toUpperCase() + str.substring(1); - } - - function _getter(p) { - return function () { - return this[p]; - }; - } - - var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel']; - var numericProps = ['columnNumber', 'lineNumber']; - var stringProps = ['fileName', 'functionName', 'source']; - var arrayProps = ['args']; - var props = booleanProps.concat(numericProps, stringProps, arrayProps); - - function StackFrame(obj) { - if (!obj) return; - - for (var i = 0; i < props.length; i++) { - if (obj[props[i]] !== undefined) { - this['set' + _capitalize(props[i])](obj[props[i]]); - } - } - } - - StackFrame.prototype = { - getArgs: function () { - return this.args; - }, - setArgs: function (v) { - if (Object.prototype.toString.call(v) !== '[object Array]') { - throw new TypeError('Args must be an Array'); - } - - this.args = v; - }, - getEvalOrigin: function () { - return this.evalOrigin; - }, - setEvalOrigin: function (v) { - if (v instanceof StackFrame) { - this.evalOrigin = v; - } else if (v instanceof Object) { - this.evalOrigin = new StackFrame(v); - } else { - throw new TypeError('Eval Origin must be an Object or StackFrame'); - } - }, - toString: function () { - var fileName = this.getFileName() || ''; - var lineNumber = this.getLineNumber() || ''; - var columnNumber = this.getColumnNumber() || ''; - var functionName = this.getFunctionName() || ''; - - if (this.getIsEval()) { - if (fileName) { - return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; - } - - return '[eval]:' + lineNumber + ':' + columnNumber; - } - - if (functionName) { - return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; - } - - return fileName + ':' + lineNumber + ':' + columnNumber; - } - }; - - StackFrame.fromString = function StackFrame$$fromString(str) { - var argsStartIndex = str.indexOf('('); - var argsEndIndex = str.lastIndexOf(')'); - var functionName = str.substring(0, argsStartIndex); - var args = str.substring(argsStartIndex + 1, argsEndIndex).split(','); - var locationString = str.substring(argsEndIndex + 1); - - if (locationString.indexOf('@') === 0) { - var parts = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString, ''); - var fileName = parts[1]; - var lineNumber = parts[2]; - var columnNumber = parts[3]; - } - - return new StackFrame({ - functionName: functionName, - args: args || undefined, - fileName: fileName, - lineNumber: lineNumber || undefined, - columnNumber: columnNumber || undefined - }); - }; - - for (var i = 0; i < booleanProps.length; i++) { - StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]); - - StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function (p) { - return function (v) { - this[p] = Boolean(v); - }; - }(booleanProps[i]); - } - - for (var j = 0; j < numericProps.length; j++) { - StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]); - - StackFrame.prototype['set' + _capitalize(numericProps[j])] = function (p) { - return function (v) { - if (!_isNumber(v)) { - throw new TypeError(p + ' must be a Number'); - } - - this[p] = Number(v); - }; - }(numericProps[j]); - } - - for (var k = 0; k < stringProps.length; k++) { - StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]); - - StackFrame.prototype['set' + _capitalize(stringProps[k])] = function (p) { - return function (v) { - this[p] = String(v); - }; - }(stringProps[k]); - } - - return StackFrame; -}); - -/***/ }), - -/***/ 64: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -var l = Symbol.for("react.element"), - n = Symbol.for("react.portal"), - p = Symbol.for("react.fragment"), - q = Symbol.for("react.strict_mode"), - r = Symbol.for("react.profiler"), - t = Symbol.for("react.provider"), - u = Symbol.for("react.context"), - v = Symbol.for("react.server_context"), - w = Symbol.for("react.forward_ref"), - x = Symbol.for("react.suspense"), - y = Symbol.for("react.suspense_list"), - z = Symbol.for("react.memo"), - A = Symbol.for("react.lazy"), - B = Symbol.for("react.debug_trace_mode"), - C = Symbol.for("react.offscreen"), - aa = Symbol.for("react.cache"), - D = Symbol.for("react.default_value"), - E = Symbol.iterator; - -function ba(a) { - if (null === a || "object" !== typeof a) return null; - a = E && a[E] || a["@@iterator"]; - return "function" === typeof a ? a : null; -} - -var F = { - isMounted: function () { - return !1; - }, - enqueueForceUpdate: function () {}, - enqueueReplaceState: function () {}, - enqueueSetState: function () {} -}, - G = Object.assign, - H = {}; - -function I(a, b, d) { - this.props = a; - this.context = b; - this.refs = H; - this.updater = d || F; -} - -I.prototype.isReactComponent = {}; - -I.prototype.setState = function (a, b) { - if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); - this.updater.enqueueSetState(this, a, b, "setState"); -}; - -I.prototype.forceUpdate = function (a) { - this.updater.enqueueForceUpdate(this, a, "forceUpdate"); -}; - -function J() {} - -J.prototype = I.prototype; - -function K(a, b, d) { - this.props = a; - this.context = b; - this.refs = H; - this.updater = d || F; -} - -var L = K.prototype = new J(); -L.constructor = K; -G(L, I.prototype); -L.isPureReactComponent = !0; -var M = Array.isArray, - N = Object.prototype.hasOwnProperty, - O = { - current: null -}, - P = { - key: !0, - ref: !0, - __self: !0, - __source: !0 -}; - -function Q(a, b, d) { - var c, - e = {}, - k = null, - h = null; - if (null != b) for (c in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) N.call(b, c) && !P.hasOwnProperty(c) && (e[c] = b[c]); - var g = arguments.length - 2; - if (1 === g) e.children = d;else if (1 < g) { - for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2]; - - e.children = f; - } - if (a && a.defaultProps) for (c in g = a.defaultProps, g) void 0 === e[c] && (e[c] = g[c]); - return { - $$typeof: l, - type: a, - key: k, - ref: h, - props: e, - _owner: O.current - }; -} - -function ca(a, b) { - return { - $$typeof: l, - type: a.type, - key: b, - ref: a.ref, - props: a.props, - _owner: a._owner - }; -} - -function R(a) { - return "object" === typeof a && null !== a && a.$$typeof === l; -} - -function escape(a) { - var b = { - "=": "=0", - ":": "=2" - }; - return "$" + a.replace(/[=:]/g, function (a) { - return b[a]; - }); -} - -var S = /\/+/g; - -function T(a, b) { - return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36); -} - -function U(a, b, d, c, e) { - var k = typeof a; - if ("undefined" === k || "boolean" === k) a = null; - var h = !1; - if (null === a) h = !0;else switch (k) { - case "string": - case "number": - h = !0; - break; - - case "object": - switch (a.$$typeof) { - case l: - case n: - h = !0; - } - - } - if (h) return h = a, e = e(h), a = "" === c ? "." + T(h, 0) : c, M(e) ? (d = "", null != a && (d = a.replace(S, "$&/") + "/"), U(e, b, d, "", function (a) { - return a; - })) : null != e && (R(e) && (e = ca(e, d + (!e.key || h && h.key === e.key ? "" : ("" + e.key).replace(S, "$&/") + "/") + a)), b.push(e)), 1; - h = 0; - c = "" === c ? "." : c + ":"; - if (M(a)) for (var g = 0; g < a.length; g++) { - k = a[g]; - var f = c + T(k, g); - h += U(k, b, d, f, e); - } else if (f = ba(a), "function" === typeof f) for (a = f.call(a), g = 0; !(k = a.next()).done;) k = k.value, f = c + T(k, g++), h += U(k, b, d, f, e);else if ("object" === k) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead."); - return h; -} - -function V(a, b, d) { - if (null == a) return a; - var c = [], - e = 0; - U(a, c, "", "", function (a) { - return b.call(d, a, e++); - }); - return c; -} - -function da(a) { - if (-1 === a._status) { - var b = a._result; - b = b(); - b.then(function (b) { - if (0 === a._status || -1 === a._status) a._status = 1, a._result = b; - }, function (b) { - if (0 === a._status || -1 === a._status) a._status = 2, a._result = b; - }); - -1 === a._status && (a._status = 0, a._result = b); - } - - if (1 === a._status) return a._result.default; - throw a._result; -} - -var W = { - current: null -}, - X = { - transition: null -}, - Y = { - ReactCurrentDispatcher: W, - ReactCurrentBatchConfig: X, - ReactCurrentOwner: O, - ContextRegistry: {} -}, - Z = Y.ContextRegistry; -exports.Children = { - map: V, - forEach: function (a, b, d) { - V(a, function () { - b.apply(this, arguments); - }, d); - }, - count: function (a) { - var b = 0; - V(a, function () { - b++; - }); - return b; - }, - toArray: function (a) { - return V(a, function (a) { - return a; - }) || []; - }, - only: function (a) { - if (!R(a)) throw Error("React.Children.only expected to receive a single React element child."); - return a; - } -}; -exports.Component = I; -exports.Fragment = p; -exports.Profiler = r; -exports.PureComponent = K; -exports.StrictMode = q; -exports.Suspense = x; -exports.SuspenseList = y; -exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Y; - -exports.cloneElement = function (a, b, d) { - if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + "."); - var c = G({}, a.props), - e = a.key, - k = a.ref, - h = a._owner; - - if (null != b) { - void 0 !== b.ref && (k = b.ref, h = O.current); - void 0 !== b.key && (e = "" + b.key); - if (a.type && a.type.defaultProps) var g = a.type.defaultProps; - - for (f in b) N.call(b, f) && !P.hasOwnProperty(f) && (c[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]); - } - - var f = arguments.length - 2; - if (1 === f) c.children = d;else if (1 < f) { - g = Array(f); - - for (var m = 0; m < f; m++) g[m] = arguments[m + 2]; - - c.children = g; - } - return { - $$typeof: l, - type: a.type, - key: e, - ref: k, - props: c, - _owner: h - }; -}; - -exports.createContext = function (a) { - a = { - $$typeof: u, - _currentValue: a, - _currentValue2: a, - _threadCount: 0, - Provider: null, - Consumer: null, - _defaultValue: null, - _globalName: null - }; - a.Provider = { - $$typeof: t, - _context: a - }; - return a.Consumer = a; -}; - -exports.createElement = Q; - -exports.createFactory = function (a) { - var b = Q.bind(null, a); - b.type = a; - return b; -}; - -exports.createRef = function () { - return { - current: null - }; -}; - -exports.createServerContext = function (a, b) { - var d = !0; - - if (!Z[a]) { - d = !1; - var c = { - $$typeof: v, - _currentValue: b, - _currentValue2: b, - _defaultValue: b, - _threadCount: 0, - Provider: null, - Consumer: null, - _globalName: a - }; - c.Provider = { - $$typeof: t, - _context: c - }; - Z[a] = c; - } - - c = Z[a]; - if (c._defaultValue === D) c._defaultValue = b, c._currentValue === D && (c._currentValue = b), c._currentValue2 === D && (c._currentValue2 = b);else if (d) throw Error("ServerContext: " + a + " already defined"); - return c; -}; - -exports.forwardRef = function (a) { - return { - $$typeof: w, - render: a - }; -}; - -exports.isValidElement = R; - -exports.lazy = function (a) { - return { - $$typeof: A, - _payload: { - _status: -1, - _result: a - }, - _init: da - }; -}; - -exports.memo = function (a, b) { - return { - $$typeof: z, - type: a, - compare: void 0 === b ? null : b - }; -}; - -exports.startTransition = function (a) { - var b = X.transition; - X.transition = {}; - - try { - a(); - } finally { - X.transition = b; - } -}; - -exports.unstable_Cache = aa; -exports.unstable_DebugTracingMode = B; -exports.unstable_Offscreen = C; - -exports.unstable_act = function () { - throw Error("act(...) is not supported in production builds of React."); -}; - -exports.unstable_createMutableSource = function (a, b) { - return { - _getVersion: b, - _source: a, - _workInProgressVersionPrimary: null, - _workInProgressVersionSecondary: null - }; -}; - -exports.unstable_getCacheForType = function (a) { - return W.current.getCacheForType(a); -}; - -exports.unstable_getCacheSignal = function () { - return W.current.getCacheSignal(); -}; - -exports.unstable_useCacheRefresh = function () { - return W.current.useCacheRefresh(); -}; - -exports.useCallback = function (a, b) { - return W.current.useCallback(a, b); -}; - -exports.useContext = function (a) { - return W.current.useContext(a); -}; - -exports.useDebugValue = function () {}; - -exports.useDeferredValue = function (a) { - return W.current.useDeferredValue(a); -}; - -exports.useEffect = function (a, b) { - return W.current.useEffect(a, b); -}; - -exports.useId = function () { - return W.current.useId(); -}; - -exports.useImperativeHandle = function (a, b, d) { - return W.current.useImperativeHandle(a, b, d); -}; - -exports.useInsertionEffect = function (a, b) { - return W.current.useInsertionEffect(a, b); -}; - -exports.useLayoutEffect = function (a, b) { - return W.current.useLayoutEffect(a, b); -}; - -exports.useMemo = function (a, b) { - return W.current.useMemo(a, b); -}; - -exports.useReducer = function (a, b, d) { - return W.current.useReducer(a, b, d); -}; - -exports.useRef = function (a) { - return W.current.useRef(a); -}; - -exports.useState = function (a) { - return W.current.useState(a); -}; - -exports.useSyncExternalStore = function (a, b, d) { - return W.current.useSyncExternalStore(a, b, d); -}; - -exports.useTransition = function () { - return W.current.useTransition(); -}; - -exports.version = "18.0.0"; - -/***/ }), - -/***/ 65: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(82); -} else {} - -/***/ }), - -/***/ 66: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getStackByFiberInDevAndProd; }); - -// EXTERNAL MODULE: ../react-devtools-shared/src/backend/ReactSymbols.js -var ReactSymbols = __webpack_require__(4); - -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsConsolePatching.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// This is a DevTools fork of shared/ConsolePatchingDev. -// The shared console patching code is DEV-only. -// We can't use it since DevTools only ships production builds. -// Helpers to patch console.logs to avoid logging during side-effect free -// replaying on render function. This currently only patches the object -// lazily which won't cover if the log function was extracted eagerly. -// We could also eagerly patch the method. -let disabledDepth = 0; -let prevLog; -let prevInfo; -let prevWarn; -let prevError; -let prevGroup; -let prevGroupCollapsed; -let prevGroupEnd; - -function disabledLog() {} - -disabledLog.__reactDisabledLog = true; -function disableLogs() { - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - prevLog = console.log; - prevInfo = console.info; - prevWarn = console.warn; - prevError = console.error; - prevGroup = console.group; - prevGroupCollapsed = console.groupCollapsed; - prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 - - const props = { - configurable: true, - enumerable: true, - value: disabledLog, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - info: props, - log: props, - warn: props, - error: props, - group: props, - groupCollapsed: props, - groupEnd: props - }); - /* eslint-enable react-internal/no-production-logging */ - } - - disabledDepth++; -} -function reenableLogs() { - disabledDepth--; - - if (disabledDepth === 0) { - /* eslint-disable react-internal/no-production-logging */ - const props = { - configurable: true, - enumerable: true, - writable: true - }; // $FlowFixMe Flow thinks console is immutable. - - Object.defineProperties(console, { - log: { ...props, - value: prevLog - }, - info: { ...props, - value: prevInfo - }, - warn: { ...props, - value: prevWarn - }, - error: { ...props, - value: prevError - }, - group: { ...props, - value: prevGroup - }, - groupCollapsed: { ...props, - value: prevGroupCollapsed - }, - groupEnd: { ...props, - value: prevGroupEnd - } - }); - /* eslint-enable react-internal/no-production-logging */ - } - - if (disabledDepth < 0) { - console.error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); - } -} -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsComponentStackFrame.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// This is a DevTools fork of ReactComponentStackFrame. -// This fork enables DevTools to use the same "native" component stack format, -// while still maintaining support for multiple renderer versions -// (which use different values for ReactTypeOfWork). - // The shared console patching code is DEV-only. -// We can't use it since DevTools only ships production builds. - - -let prefix; -function describeBuiltInComponentFrame(name, source, ownerFn) { - if (prefix === undefined) { - // Extract the VM specific prefix used by each line. - try { - throw Error(); - } catch (x) { - const match = x.stack.trim().match(/\n( *(at )?)/); - prefix = match && match[1] || ''; - } - } // We use the prefix to ensure our stacks line up with native stack frames. - - - return '\n' + prefix + name; -} -let reentry = false; -let componentFrameCache; - -if (false) {} - -function describeNativeComponentFrame(fn, construct, currentDispatcherRef) { - // If something asked for a stack inside a fake render, it should get ignored. - if (!fn || reentry) { - return ''; - } - - if (false) {} - - let control; - const previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. - - Error.prepareStackTrace = undefined; - reentry = true; // Override the dispatcher so effects scheduled by this shallow render are thrown away. - // - // Note that unlike the code this was forked from (in ReactComponentStackFrame) - // DevTools should override the dispatcher even when DevTools is compiled in production mode, - // because the app itself may be in development mode and log errors/warnings. - - const previousDispatcher = currentDispatcherRef.current; - currentDispatcherRef.current = null; - disableLogs(); - - try { - // This should throw. - if (construct) { - // Something should be setting the props in the constructor. - const Fake = function () { - throw Error(); - }; // $FlowFixMe - - - Object.defineProperty(Fake.prototype, 'props', { - set: function () { - // We use a throwing setter instead of frozen or non-writable props - // because that won't throw in a non-strict mode function. - throw Error(); - } - }); - - if (typeof Reflect === 'object' && Reflect.construct) { - // We construct a different control for this case to include any extra - // frames added by the construct call. - try { - Reflect.construct(Fake, []); - } catch (x) { - control = x; - } - - Reflect.construct(fn, [], Fake); - } else { - try { - Fake.call(); - } catch (x) { - control = x; - } - - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x) { - control = x; - } - - fn(); - } - } catch (sample) { - // This is inlined manually because closure doesn't do it for us. - if (sample && control && typeof sample.stack === 'string') { - // This extracts the first frame from the sample that isn't also in the control. - // Skipping one frame that we assume is the frame that calls the two. - const sampleLines = sample.stack.split('\n'); - const controlLines = control.stack.split('\n'); - let s = sampleLines.length - 1; - let c = controlLines.length - 1; - - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { - // We expect at least one stack frame to be shared. - // Typically this will be the root most one. However, stack frames may be - // cut off due to maximum stack limits. In this case, one maybe cut off - // earlier than the other. We assume that the sample is longer or the same - // and there for cut off earlier. So we should find the root most frame in - // the sample somewhere in the control. - c--; - } - - for (; s >= 1 && c >= 0; s--, c--) { - // Next we find the first one that isn't the same which should be the - // frame that called our sample function and the control. - if (sampleLines[s] !== controlLines[c]) { - // In V8, the first line is describing the message but other VMs don't. - // If we're about to return the first line, and the control is also on the same - // line, that's a pretty good indicator that our sample threw at same line as - // the control. I.e. before we entered the sample frame. So we ignore this result. - // This can happen if you passed a class to function component, or non-function. - if (s !== 1 || c !== 1) { - do { - s--; - c--; // We may still have similar intermediate frames from the construct call. - // The next one that isn't the same should be our match though. - - if (c < 0 || sampleLines[s] !== controlLines[c]) { - // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. - const frame = '\n' + sampleLines[s].replace(' at new ', ' at '); - - if (false) {} // Return the line we found. - - - return frame; - } - } while (s >= 1 && c >= 0); - } - - break; - } - } - } - } finally { - reentry = false; - Error.prepareStackTrace = previousPrepareStackTrace; - currentDispatcherRef.current = previousDispatcher; - reenableLogs(); - } // Fallback to just using the name if we couldn't make it throw. - - - const name = fn ? fn.displayName || fn.name : ''; - const syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; - - if (false) {} - - return syntheticFrame; -} -function describeClassComponentFrame(ctor, source, ownerFn, currentDispatcherRef) { - return describeNativeComponentFrame(ctor, true, currentDispatcherRef); -} -function describeFunctionComponentFrame(fn, source, ownerFn, currentDispatcherRef) { - return describeNativeComponentFrame(fn, false, currentDispatcherRef); -} - -function shouldConstruct(Component) { - const prototype = Component.prototype; - return !!(prototype && prototype.isReactComponent); -} - -function describeUnknownElementTypeFrameInDEV(type, source, ownerFn, currentDispatcherRef) { - if (true) { - return ''; - } - - if (type == null) { - return ''; - } - - if (typeof type === 'function') { - return describeNativeComponentFrame(type, shouldConstruct(type), currentDispatcherRef); - } - - if (typeof type === 'string') { - return describeBuiltInComponentFrame(type, source, ownerFn); - } - - switch (type) { - case ReactSymbols["w" /* SUSPENSE_NUMBER */]: - case ReactSymbols["x" /* SUSPENSE_SYMBOL_STRING */]: - return describeBuiltInComponentFrame('Suspense', source, ownerFn); - - case ReactSymbols["u" /* SUSPENSE_LIST_NUMBER */]: - case ReactSymbols["v" /* SUSPENSE_LIST_SYMBOL_STRING */]: - return describeBuiltInComponentFrame('SuspenseList', source, ownerFn); - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case ReactSymbols["f" /* FORWARD_REF_NUMBER */]: - case ReactSymbols["g" /* FORWARD_REF_SYMBOL_STRING */]: - return describeFunctionComponentFrame(type.render, source, ownerFn, currentDispatcherRef); - - case ReactSymbols["j" /* MEMO_NUMBER */]: - case ReactSymbols["k" /* MEMO_SYMBOL_STRING */]: - // Memo may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn, currentDispatcherRef); - - case ReactSymbols["h" /* LAZY_NUMBER */]: - case ReactSymbols["i" /* LAZY_SYMBOL_STRING */]: - { - const lazyComponent = type; - const payload = lazyComponent._payload; - const init = lazyComponent._init; - - try { - // Lazy may contain any component type so we recursively resolve it. - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn, currentDispatcherRef); - } catch (x) {} - } - } - } - - return ''; -} -// CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsFiberComponentStack.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// This is a DevTools fork of ReactFiberComponentStack. -// This fork enables DevTools to use the same "native" component stack format, -// while still maintaining support for multiple renderer versions -// (which use different values for ReactTypeOfWork). - - -function describeFiber(workTagMap, workInProgress, currentDispatcherRef) { - const { - HostComponent, - LazyComponent, - SuspenseComponent, - SuspenseListComponent, - FunctionComponent, - IndeterminateComponent, - SimpleMemoComponent, - ForwardRef, - ClassComponent - } = workTagMap; - const owner = false ? undefined : null; - const source = false ? undefined : null; - - switch (workInProgress.tag) { - case HostComponent: - return describeBuiltInComponentFrame(workInProgress.type, source, owner); - - case LazyComponent: - return describeBuiltInComponentFrame('Lazy', source, owner); - - case SuspenseComponent: - return describeBuiltInComponentFrame('Suspense', source, owner); - - case SuspenseListComponent: - return describeBuiltInComponentFrame('SuspenseList', source, owner); - - case FunctionComponent: - case IndeterminateComponent: - case SimpleMemoComponent: - return describeFunctionComponentFrame(workInProgress.type, source, owner, currentDispatcherRef); - - case ForwardRef: - return describeFunctionComponentFrame(workInProgress.type.render, source, owner, currentDispatcherRef); - - case ClassComponent: - return describeClassComponentFrame(workInProgress.type, source, owner, currentDispatcherRef); - - default: - return ''; - } -} - -function getStackByFiberInDevAndProd(workTagMap, workInProgress, currentDispatcherRef) { - try { - let info = ''; - let node = workInProgress; - - do { - info += describeFiber(workTagMap, node, currentDispatcherRef); - node = node.return; - } while (node); - - return info; - } catch (x) { - return '\nError generating stack: ' + x.message + '\n' + x.stack; - } -} - -/***/ }), - -/***/ 8: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return localStorageGetItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return localStorageRemoveItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return localStorageSetItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return sessionStorageGetItem; }); -/* unused harmony export sessionStorageRemoveItem */ -/* unused harmony export sessionStorageSetItem */ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -function localStorageGetItem(key) { - try { - return localStorage.getItem(key); - } catch (error) { - return null; - } -} -function localStorageRemoveItem(key) { - try { - localStorage.removeItem(key); - } catch (error) {} -} -function localStorageSetItem(key, value) { - try { - return localStorage.setItem(key, value); - } catch (error) {} -} -function sessionStorageGetItem(key) { - try { - return sessionStorage.getItem(key); - } catch (error) { - return null; - } -} -function sessionStorageRemoveItem(key) { - try { - sessionStorage.removeItem(key); - } catch (error) {} -} -function sessionStorageSetItem(key, value) { - try { - return sessionStorage.setItem(key, value); - } catch (error) {} -} - -/***/ }), - -/***/ 82: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * @license React - * react-debug-tools.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -var h = __webpack_require__(53), - l = __webpack_require__(0), - q = Object.assign, - w = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, - x = [], - y = null; - -function z() { - if (null === y) { - var a = new Map(); - - try { - A.useContext({ - _currentValue: null - }), A.useState(null), A.useReducer(function (a) { - return a; - }, null), A.useRef(null), "function" === typeof A.useCacheRefresh && A.useCacheRefresh(), A.useLayoutEffect(function () {}), A.useInsertionEffect(function () {}), A.useEffect(function () {}), A.useImperativeHandle(void 0, function () { - return null; - }), A.useDebugValue(null), A.useCallback(function () {}), A.useMemo(function () { - return null; - }); - } finally { - var b = x; - x = []; - } - - for (var e = 0; e < b.length; e++) { - var f = b[e]; - a.set(f.primitive, h.parse(f.stackError)); - } - - y = a; - } - - return y; -} - -var B = null; - -function C() { - var a = B; - null !== a && (B = a.next); - return a; -} - -var A = { - getCacheForType: function () { - throw Error("Not implemented."); - }, - readContext: function (a) { - return a._currentValue; - }, - useCacheRefresh: function () { - var a = C(); - x.push({ - primitive: "CacheRefresh", - stackError: Error(), - value: null !== a ? a.memoizedState : function () {} - }); - return function () {}; - }, - useCallback: function (a) { - var b = C(); - x.push({ - primitive: "Callback", - stackError: Error(), - value: null !== b ? b.memoizedState[0] : a - }); - return a; - }, - useContext: function (a) { - x.push({ - primitive: "Context", - stackError: Error(), - value: a._currentValue - }); - return a._currentValue; - }, - useEffect: function (a) { - C(); - x.push({ - primitive: "Effect", - stackError: Error(), - value: a - }); - }, - useImperativeHandle: function (a) { - C(); - var b = void 0; - null !== a && "object" === typeof a && (b = a.current); - x.push({ - primitive: "ImperativeHandle", - stackError: Error(), - value: b - }); - }, - useDebugValue: function (a, b) { - x.push({ - primitive: "DebugValue", - stackError: Error(), - value: "function" === typeof b ? b(a) : a - }); - }, - useLayoutEffect: function (a) { - C(); - x.push({ - primitive: "LayoutEffect", - stackError: Error(), - value: a - }); - }, - useInsertionEffect: function (a) { - C(); - x.push({ - primitive: "InsertionEffect", - stackError: Error(), - value: a - }); - }, - useMemo: function (a) { - var b = C(); - a = null !== b ? b.memoizedState[0] : a(); - x.push({ - primitive: "Memo", - stackError: Error(), - value: a - }); - return a; - }, - useReducer: function (a, b, e) { - a = C(); - b = null !== a ? a.memoizedState : void 0 !== e ? e(b) : b; - x.push({ - primitive: "Reducer", - stackError: Error(), - value: b - }); - return [b, function () {}]; - }, - useRef: function (a) { - var b = C(); - a = null !== b ? b.memoizedState : { - current: a - }; - x.push({ - primitive: "Ref", - stackError: Error(), - value: a.current - }); - return a; - }, - useState: function (a) { - var b = C(); - a = null !== b ? b.memoizedState : "function" === typeof a ? a() : a; - x.push({ - primitive: "State", - stackError: Error(), - value: a - }); - return [a, function () {}]; - }, - useTransition: function () { - C(); - C(); - x.push({ - primitive: "Transition", - stackError: Error(), - value: void 0 - }); - return [!1, function () {}]; - }, - useMutableSource: function (a, b) { - C(); - C(); - C(); - C(); - a = b(a._source); - x.push({ - primitive: "MutableSource", - stackError: Error(), - value: a - }); - return a; - }, - useSyncExternalStore: function (a, b) { - C(); - C(); - a = b(); - x.push({ - primitive: "SyncExternalStore", - stackError: Error(), - value: a - }); - return a; - }, - useDeferredValue: function (a) { - C(); - C(); - x.push({ - primitive: "DeferredValue", - stackError: Error(), - value: a - }); - return a; - }, - useId: function () { - var a = C(); - a = null !== a ? a.memoizedState : ""; - x.push({ - primitive: "Id", - stackError: Error(), - value: a - }); - return a; - } -}, - D = 0; - -function E(a, b, e) { - var f = b[e].source, - c = 0; - - a: for (; c < a.length; c++) if (a[c].source === f) { - for (var m = e + 1, r = c + 1; m < b.length && r < a.length; m++, r++) if (a[r].source !== b[m].source) continue a; - - return c; - } - - return -1; -} - -function F(a, b) { - if (!a) return !1; - b = "use" + b; - return a.length < b.length ? !1 : a.lastIndexOf(b) === a.length - b.length; -} - -function G(a, b, e) { - for (var f = [], c = null, m = f, r = 0, t = [], v = 0; v < b.length; v++) { - var u = b[v]; - var d = a; - var k = h.parse(u.stackError); - - b: { - var n = k, - p = E(n, d, D); - if (-1 !== p) d = p;else { - for (var g = 0; g < d.length && 5 > g; g++) if (p = E(n, d, g), -1 !== p) { - D = g; - d = p; - break b; - } - - d = -1; - } - } - - b: { - n = k; - p = z().get(u.primitive); - if (void 0 !== p) for (g = 0; g < p.length && g < n.length; g++) if (p[g].source !== n[g].source) { - g < n.length - 1 && F(n[g].functionName, u.primitive) && g++; - g < n.length - 1 && F(n[g].functionName, u.primitive) && g++; - n = g; - break b; - } - n = -1; - } - - k = -1 === d || -1 === n || 2 > d - n ? null : k.slice(n, d - 1); - - if (null !== k) { - d = 0; - - if (null !== c) { - for (; d < k.length && d < c.length && k[k.length - d - 1].source === c[c.length - d - 1].source;) d++; - - for (c = c.length - 1; c > d; c--) m = t.pop(); - } - - for (c = k.length - d - 1; 1 <= c; c--) d = [], n = k[c], (p = k[c - 1].functionName) ? (g = p.lastIndexOf("."), -1 === g && (g = 0), "use" === p.substr(g, 3) && (g += 3), p = p.substr(g)) : p = "", p = { - id: null, - isStateEditable: !1, - name: p, - value: void 0, - subHooks: d - }, e && (p.hookSource = { - lineNumber: n.lineNumber, - columnNumber: n.columnNumber, - functionName: n.functionName, - fileName: n.fileName - }), m.push(p), t.push(m), m = d; - - c = k; - } - - d = u.primitive; - u = { - id: "Context" === d || "DebugValue" === d ? null : r++, - isStateEditable: "Reducer" === d || "State" === d, - name: d, - value: u.value, - subHooks: [] - }; - e && (d = { - lineNumber: null, - functionName: null, - fileName: null, - columnNumber: null - }, k && 1 <= k.length && (k = k[0], d.lineNumber = k.lineNumber, d.functionName = k.functionName, d.fileName = k.fileName, d.columnNumber = k.columnNumber), u.hookSource = d); - m.push(u); - } - - H(f, null); - return f; -} - -function H(a, b) { - for (var e = [], f = 0; f < a.length; f++) { - var c = a[f]; - "DebugValue" === c.name && 0 === c.subHooks.length ? (a.splice(f, 1), f--, e.push(c)) : H(c.subHooks, c); - } - - null !== b && (1 === e.length ? b.value = e[0].value : 1 < e.length && (b.value = e.map(function (a) { - return a.value; - }))); -} - -function I(a, b, e) { - var f = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : !1; - null == e && (e = w.ReactCurrentDispatcher); - var c = e.current; - e.current = A; - - try { - var m = Error(); - a(b); - } finally { - var r = x; - x = []; - e.current = c; - } - - c = h.parse(m); - return G(c, r, f); -} - -function J(a) { - a.forEach(function (a, e) { - return e._currentValue = a; - }); -} - -exports.inspectHooks = I; - -exports.inspectHooksOfFiber = function (a, b) { - var e = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !1; - null == b && (b = w.ReactCurrentDispatcher); - if (0 !== a.tag && 15 !== a.tag && 11 !== a.tag) throw Error("Unknown Fiber. Needs to be a function component to inspect hooks."); - z(); - var f = a.type, - c = a.memoizedProps; - - if (f !== a.elementType && f && f.defaultProps) { - c = q({}, c); - var m = f.defaultProps; - - for (r in m) void 0 === c[r] && (c[r] = m[r]); - } - - B = a.memoizedState; - var r = new Map(); - - try { - for (m = a; m;) { - if (10 === m.tag) { - var t = m.type._context; - r.has(t) || (r.set(t, t._currentValue), t._currentValue = m.memoizedProps.value); - } - - m = m.return; - } - - if (11 === a.tag) { - var v = f.render; - f = c; - var u = a.ref; - t = b; - var d = t.current; - t.current = A; - - try { - var k = Error(); - v(f, u); - } finally { - var n = x; - x = []; - t.current = d; - } - - var p = h.parse(k); - return G(p, n, e); - } - - return I(f, c, b, e); - } finally { - B = null, J(r); - } -}; - -/***/ }) - -/******/ }); \ No newline at end of file diff --git a/tools/react-dev-tools/build/main.js b/tools/react-dev-tools/build/main.js deleted file mode 100644 index 931c6a79d14c..000000000000 --- a/tools/react-dev-tools/build/main.js +++ /dev/null @@ -1,54810 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ -/******/ // add "moreModules" to the modules object, -/******/ // then flag all "chunkIds" as loaded and fire callback -/******/ var moduleId, chunkId, i = 0, resolves = []; -/******/ for(;i < chunkIds.length; i++) { -/******/ chunkId = chunkIds[i]; -/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { -/******/ modules[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(parentJsonpFunction) parentJsonpFunction(data); -/******/ -/******/ while(resolves.length) { -/******/ resolves.shift()(); -/******/ } -/******/ -/******/ }; -/******/ -/******/ -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // object to store loaded and loading chunks -/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded -/******/ var installedChunks = { -/******/ 3: 0 -/******/ }; -/******/ -/******/ -/******/ -/******/ // script path function -/******/ function jsonpScriptSrc(chunkId) { -/******/ return __webpack_require__.p + "" + ({"5":"parseHookNames","7":"vendors~parseHookNames"}[chunkId]||chunkId) + ".chunk.js" -/******/ } -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ // This file contains only the entry chunk. -/******/ // The chunk loading function for additional chunks -/******/ __webpack_require__.e = function requireEnsure(chunkId) { -/******/ var promises = []; -/******/ -/******/ -/******/ // JSONP chunk loading for javascript -/******/ -/******/ var installedChunkData = installedChunks[chunkId]; -/******/ if(installedChunkData !== 0) { // 0 means "already installed". -/******/ -/******/ // a Promise means "currently loading". -/******/ if(installedChunkData) { -/******/ promises.push(installedChunkData[2]); -/******/ } else { -/******/ // setup Promise in chunk cache -/******/ var promise = new Promise(function(resolve, reject) { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); -/******/ promises.push(installedChunkData[2] = promise); -/******/ -/******/ // start chunk loading -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = jsonpScriptSrc(chunkId); -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = function (event) { -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var chunk = installedChunks[chunkId]; -/******/ if(chunk !== 0) { -/******/ if(chunk) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ chunk[1](error); -/******/ } -/******/ installedChunks[chunkId] = undefined; -/******/ } -/******/ }; -/******/ var timeout = setTimeout(function(){ -/******/ onScriptComplete({ type: 'timeout', target: script }); -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); -/******/ } -/******/ } -/******/ return Promise.all(promises); -/******/ }; -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/build/"; -/******/ -/******/ // on error function for async loading -/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; -/******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ jsonpArray = jsonpArray.slice(); -/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); -/******/ var parentJsonpFunction = oldJsonpFunction; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 204); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(64); -} else {} - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CHROME_WEBSTORE_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return INTERNAL_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LOCAL_EXTENSION_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return __DEBUG__; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return __PERFORMANCE_PROFILE__; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return TREE_OPERATION_ADD; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return TREE_OPERATION_REMOVE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return TREE_OPERATION_REORDER_CHILDREN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return TREE_OPERATION_UPDATE_TREE_BASE_DURATION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return TREE_OPERATION_REMOVE_ROOT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return TREE_OPERATION_SET_SUBTREE_MODE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return PROFILING_FLAG_BASIC_SUPPORT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return PROFILING_FLAG_TIMELINE_SUPPORT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return LOCAL_STORAGE_DEFAULT_TAB_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return LOCAL_STORAGE_FILTER_PREFERENCES_KEY; }); -/* unused harmony export SESSION_STORAGE_LAST_SELECTION_KEY */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return LOCAL_STORAGE_OPEN_IN_EDITOR_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return SESSION_STORAGE_RELOAD_AND_PROFILE_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return PROFILER_EXPORT_VERSION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CHANGE_LOG_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return UNSUPPORTED_VERSION_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return REACT_DEVTOOLS_WORKPLACE_URL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return THEME_STYLES; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return COMFORTABLE_LINE_HEIGHT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return COMPACT_LINE_HEIGHT; }); -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -const CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi'; -const INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc'; -const LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf'; // Flip this flag to true to enable verbose console debug logging. - -const __DEBUG__ = false; // Flip this flag to true to enable performance.mark() and performance.measure() timings. - -const __PERFORMANCE_PROFILE__ = false; -const TREE_OPERATION_ADD = 1; -const TREE_OPERATION_REMOVE = 2; -const TREE_OPERATION_REORDER_CHILDREN = 3; -const TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4; -const TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5; -const TREE_OPERATION_REMOVE_ROOT = 6; -const TREE_OPERATION_SET_SUBTREE_MODE = 7; -const PROFILING_FLAG_BASIC_SUPPORT = 0b01; -const PROFILING_FLAG_TIMELINE_SUPPORT = 0b10; -const LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab'; -const LOCAL_STORAGE_FILTER_PREFERENCES_KEY = 'React::DevTools::componentFilters'; -const SESSION_STORAGE_LAST_SELECTION_KEY = 'React::DevTools::lastSelection'; -const LOCAL_STORAGE_OPEN_IN_EDITOR_URL = 'React::DevTools::openInEditorUrl'; -const LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY = 'React::DevTools::parseHookNames'; -const SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY = 'React::DevTools::recordChangeDescriptions'; -const SESSION_STORAGE_RELOAD_AND_PROFILE_KEY = 'React::DevTools::reloadAndProfile'; -const LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS = 'React::DevTools::breakOnConsoleErrors'; -const LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY = 'React::DevTools::appendComponentStack'; -const LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY = 'React::DevTools::showInlineWarningsAndErrors'; -const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY = 'React::DevTools::traceUpdatesEnabled'; -const LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE = 'React::DevTools::hideConsoleLogsInStrictMode'; -const PROFILER_EXPORT_VERSION = 5; -const CHANGE_LOG_URL = 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md'; -const UNSUPPORTED_VERSION_URL = 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back'; -const REACT_DEVTOOLS_WORKPLACE_URL = 'https://fburl.com/react-devtools-workplace-group'; -const THEME_STYLES = { - light: { - '--color-attribute-name': '#ef6632', - '--color-attribute-name-not-editable': '#23272f', - '--color-attribute-name-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-attribute-value': '#1a1aa6', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': '#1a1aa6', - '--color-background': '#ffffff', - '--color-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-background-inactive': '#e5e5e5', - '--color-background-invalid': '#fff0f0', - '--color-background-selected': '#0088fa', - '--color-button-background': '#ffffff', - '--color-button-background-focus': '#ededed', - '--color-button': '#5f6673', - '--color-button-disabled': '#cfd1d5', - '--color-button-active': '#0088fa', - '--color-button-focus': '#23272f', - '--color-button-hover': '#23272f', - '--color-border': '#eeeeee', - '--color-commit-did-not-render-fill': '#cfd1d5', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#cfd1d5', - '--color-commit-did-not-render-pattern-text': '#333333', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#6a51b2', - '--color-component-name-inverted': '#ffffff', - '--color-component-badge-background': 'rgba(0, 0, 0, 0.1)', - '--color-component-badge-background-inverted': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-count': '#777d88', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#ffffff', - '--color-console-error-background': '#fff0f0', - '--color-console-error-border': '#ffd6d6', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fe2e31', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#fffbe5', - '--color-console-warning-border': '#fff5c1', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#64460c', - '--color-context-background': 'rgba(0,0,0,.9)', - '--color-context-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-context-background-selected': '#178fb9', - '--color-context-border': '#3d424a', - '--color-context-text': '#ffffff', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#777d88', - '--color-dimmer': '#cfd1d5', - '--color-dimmest': '#eff0f1', - '--color-error-background': 'hsl(0, 100%, 97%)', - '--color-error-border': 'hsl(0, 100%, 92%)', - '--color-error-text': '#ff0000', - '--color-expand-collapse-toggle': '#777d88', - '--color-link': '#0000ff', - '--color-modal-background': 'rgba(255, 255, 255, 0.75)', - '--color-bridge-version-npm-background': '#eff0f1', - '--color-bridge-version-npm-text': '#000000', - '--color-bridge-version-number': '#0088fa', - '--color-primitive-hook-badge-background': '#e5e5e5', - '--color-primitive-hook-badge-text': '#5f6673', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#3578e5', - '--color-record-inactive': '#0088fa', - '--color-resize-bar': '#eeeeee', - '--color-resize-bar-active': '#dcdcdc', - '--color-resize-bar-border': '#d1d1d1', - '--color-resize-bar-dot': '#333333', - '--color-timeline-internal-module': '#d1d1d1', - '--color-timeline-internal-module-hover': '#c9c9c9', - '--color-timeline-internal-module-text': '#444', - '--color-timeline-native-event': '#ccc', - '--color-timeline-native-event-hover': '#aaa', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#f0e7d1', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#e3ba52', - '--color-timeline-priority-background': '#f6f6f6', - '--color-timeline-priority-border': '#eeeeee', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#d3e5f6', - '--color-timeline-react-idle-hover': '#c3d9ef', - '--color-timeline-react-render': '#9fc3f3', - '--color-timeline-react-render-hover': '#83afe9', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#c88ff0', - '--color-timeline-react-commit-hover': '#b281d6', - '--color-timeline-react-commit-text': '#3e2c4a', - '--color-timeline-react-layout-effects': '#b281d6', - '--color-timeline-react-layout-effects-hover': '#9d71bd', - '--color-timeline-react-layout-effects-text': '#3e2c4a', - '--color-timeline-react-passive-effects': '#b281d6', - '--color-timeline-react-passive-effects-hover': '#9d71bd', - '--color-timeline-react-passive-effects-text': '#3e2c4a', - '--color-timeline-react-schedule': '#9fc3f3', - '--color-timeline-react-schedule-hover': '#2683E2', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#ffdf37', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#ee1638', - '--color-timeline-thrown-error-hover': '#da1030', - '--color-timeline-text-color': '#000000', - '--color-timeline-text-dim-color': '#ccc', - '--color-timeline-react-work-border': '#eeeeee', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(0, 136, 250, 0.1)', - '--color-selected-tree-highlight-inactive': 'rgba(0, 0, 0, 0.05)', - '--color-scroll-caret': 'rgba(150, 150, 150, 0.5)', - '--color-tab-selected-border': '#0088fa', - '--color-text': '#000000', - '--color-text-invalid': '#ff0000', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#0088fa', - '--color-toggle-background-off': '#cfd1d5', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#fb3655', - '--color-warning-background-hover': '#f82042', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#fd4d69', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#c2c2c2', - '--color-scroll-track': '#fafafa', - '--color-tooltip-background': 'rgba(0, 0, 0, 0.9)', - '--color-tooltip-text': '#ffffff' - }, - dark: { - '--color-attribute-name': '#9d87d2', - '--color-attribute-name-not-editable': '#ededed', - '--color-attribute-name-inverted': '#282828', - '--color-attribute-value': '#cedae0', - '--color-attribute-value-inverted': '#ffffff', - '--color-attribute-editable-value': 'yellow', - '--color-background': '#282c34', - '--color-background-hover': 'rgba(255, 255, 255, 0.1)', - '--color-background-inactive': '#3d424a', - '--color-background-invalid': '#5c0000', - '--color-background-selected': '#178fb9', - '--color-button-background': '#282c34', - '--color-button-background-focus': '#3d424a', - '--color-button': '#afb3b9', - '--color-button-active': '#61dafb', - '--color-button-disabled': '#4f5766', - '--color-button-focus': '#a2e9fc', - '--color-button-hover': '#ededed', - '--color-border': '#3d424a', - '--color-commit-did-not-render-fill': '#777d88', - '--color-commit-did-not-render-fill-text': '#000000', - '--color-commit-did-not-render-pattern': '#666c77', - '--color-commit-did-not-render-pattern-text': '#ffffff', - '--color-commit-gradient-0': '#37afa9', - '--color-commit-gradient-1': '#63b19e', - '--color-commit-gradient-2': '#80b393', - '--color-commit-gradient-3': '#97b488', - '--color-commit-gradient-4': '#abb67d', - '--color-commit-gradient-5': '#beb771', - '--color-commit-gradient-6': '#cfb965', - '--color-commit-gradient-7': '#dfba57', - '--color-commit-gradient-8': '#efbb49', - '--color-commit-gradient-9': '#febc38', - '--color-commit-gradient-text': '#000000', - '--color-component-name': '#61dafb', - '--color-component-name-inverted': '#282828', - '--color-component-badge-background': 'rgba(255, 255, 255, 0.25)', - '--color-component-badge-background-inverted': 'rgba(0, 0, 0, 0.25)', - '--color-component-badge-count': '#8f949d', - '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', - '--color-console-error-badge-text': '#000000', - '--color-console-error-background': '#290000', - '--color-console-error-border': '#5c0000', - '--color-console-error-icon': '#eb3941', - '--color-console-error-text': '#fc7f7f', - '--color-console-warning-badge-text': '#000000', - '--color-console-warning-background': '#332b00', - '--color-console-warning-border': '#665500', - '--color-console-warning-icon': '#f4bd00', - '--color-console-warning-text': '#f5f2ed', - '--color-context-background': 'rgba(255,255,255,.95)', - '--color-context-background-hover': 'rgba(0, 136, 250, 0.1)', - '--color-context-background-selected': '#0088fa', - '--color-context-border': '#eeeeee', - '--color-context-text': '#000000', - '--color-context-text-selected': '#ffffff', - '--color-dim': '#8f949d', - '--color-dimmer': '#777d88', - '--color-dimmest': '#4f5766', - '--color-error-background': '#200', - '--color-error-border': '#900', - '--color-error-text': '#f55', - '--color-expand-collapse-toggle': '#8f949d', - '--color-link': '#61dafb', - '--color-modal-background': 'rgba(0, 0, 0, 0.75)', - '--color-bridge-version-npm-background': 'rgba(0, 0, 0, 0.25)', - '--color-bridge-version-npm-text': '#ffffff', - '--color-bridge-version-number': 'yellow', - '--color-primitive-hook-badge-background': 'rgba(0, 0, 0, 0.25)', - '--color-primitive-hook-badge-text': 'rgba(255, 255, 255, 0.7)', - '--color-record-active': '#fc3a4b', - '--color-record-hover': '#a2e9fc', - '--color-record-inactive': '#61dafb', - '--color-resize-bar': '#282c34', - '--color-resize-bar-active': '#31363f', - '--color-resize-bar-border': '#3d424a', - '--color-resize-bar-dot': '#cfd1d5', - '--color-timeline-internal-module': '#303542', - '--color-timeline-internal-module-hover': '#363b4a', - '--color-timeline-internal-module-text': '#7f8899', - '--color-timeline-native-event': '#b2b2b2', - '--color-timeline-native-event-hover': '#949494', - '--color-timeline-network-primary': '#fcf3dc', - '--color-timeline-network-primary-hover': '#e3dbc5', - '--color-timeline-network-secondary': '#efc457', - '--color-timeline-network-secondary-hover': '#d6af4d', - '--color-timeline-priority-background': '#1d2129', - '--color-timeline-priority-border': '#282c34', - '--color-timeline-user-timing': '#c9cacd', - '--color-timeline-user-timing-hover': '#93959a', - '--color-timeline-react-idle': '#3d485b', - '--color-timeline-react-idle-hover': '#465269', - '--color-timeline-react-render': '#2683E2', - '--color-timeline-react-render-hover': '#1a76d4', - '--color-timeline-react-render-text': '#11365e', - '--color-timeline-react-commit': '#731fad', - '--color-timeline-react-commit-hover': '#611b94', - '--color-timeline-react-commit-text': '#e5c1ff', - '--color-timeline-react-layout-effects': '#611b94', - '--color-timeline-react-layout-effects-hover': '#51167a', - '--color-timeline-react-layout-effects-text': '#e5c1ff', - '--color-timeline-react-passive-effects': '#611b94', - '--color-timeline-react-passive-effects-hover': '#51167a', - '--color-timeline-react-passive-effects-text': '#e5c1ff', - '--color-timeline-react-schedule': '#2683E2', - '--color-timeline-react-schedule-hover': '#1a76d4', - '--color-timeline-react-suspense-rejected': '#f1cc14', - '--color-timeline-react-suspense-rejected-hover': '#e4c00f', - '--color-timeline-react-suspense-resolved': '#a6e59f', - '--color-timeline-react-suspense-resolved-hover': '#89d281', - '--color-timeline-react-suspense-unresolved': '#c9cacd', - '--color-timeline-react-suspense-unresolved-hover': '#93959a', - '--color-timeline-thrown-error': '#fb3655', - '--color-timeline-thrown-error-hover': '#f82042', - '--color-timeline-text-color': '#282c34', - '--color-timeline-text-dim-color': '#555b66', - '--color-timeline-react-work-border': '#3d424a', - '--color-search-match': 'yellow', - '--color-search-match-current': '#f7923b', - '--color-selected-tree-highlight-active': 'rgba(23, 143, 185, 0.15)', - '--color-selected-tree-highlight-inactive': 'rgba(255, 255, 255, 0.05)', - '--color-scroll-caret': '#4f5766', - '--color-shadow': 'rgba(0, 0, 0, 0.5)', - '--color-tab-selected-border': '#178fb9', - '--color-text': '#ffffff', - '--color-text-invalid': '#ff8080', - '--color-text-selected': '#ffffff', - '--color-toggle-background-invalid': '#fc3a4b', - '--color-toggle-background-on': '#178fb9', - '--color-toggle-background-off': '#777d88', - '--color-toggle-text': '#ffffff', - '--color-warning-background': '#ee1638', - '--color-warning-background-hover': '#da1030', - '--color-warning-text-color': '#ffffff', - '--color-warning-text-color-inverted': '#ee1638', - // The styles below should be kept in sync with 'root.css' - // They are repeated there because they're used by e.g. tooltips or context menus - // which get rendered outside of the DOM subtree (where normal theme/styles are written). - '--color-scroll-thumb': '#afb3b9', - '--color-scroll-track': '#313640', - '--color-tooltip-background': 'rgba(255, 255, 255, 0.95)', - '--color-tooltip-text': '#000000' - }, - compact: { - '--font-size-monospace-small': '9px', - '--font-size-monospace-normal': '11px', - '--font-size-monospace-large': '15px', - '--font-size-sans-small': '10px', - '--font-size-sans-normal': '12px', - '--font-size-sans-large': '14px', - '--line-height-data': '18px' - }, - comfortable: { - '--font-size-monospace-small': '10px', - '--font-size-monospace-normal': '13px', - '--font-size-monospace-large': '17px', - '--font-size-sans-small': '12px', - '--font-size-sans-normal': '14px', - '--font-size-sans-large': '16px', - '--line-height-data': '22px' - } -}; // HACK -// -// Sometimes the inline target is rendered before root styles are applied, -// which would result in e.g. NaN itemSize being passed to react-window list. - -const COMFORTABLE_LINE_HEIGHT = parseInt(THEME_STYLES.comfortable['--line-height-data'], 10); -const COMPACT_LINE_HEIGHT = parseInt(THEME_STYLES.compact['--line-height-data'], 10); - - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ElementTypeClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return ElementTypeContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return ElementTypeFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return ElementTypeForwardRef; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return ElementTypeHostComponent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return ElementTypeMemo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return ElementTypeOtherOrUnknown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return ElementTypeProfiler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return ElementTypeRoot; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return ElementTypeSuspense; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return ElementTypeSuspenseList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return ElementTypeTracingMarker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ComponentFilterElementType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComponentFilterDisplayName; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ComponentFilterLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ComponentFilterHOC; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return StrictMode; }); -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// WARNING -// The values below are referenced by ComponentFilters (which are saved via localStorage). -// Do not change them or it will break previously saved user customizations. -// If new element types are added, use new numbers rather than re-ordering existing ones. -// -// Changing these types is also a backwards breaking change for the standalone shell, -// since the frontend and backend must share the same values- -// and the backend is embedded in certain environments (like React Native). -const ElementTypeClass = 1; -const ElementTypeContext = 2; -const ElementTypeFunction = 5; -const ElementTypeForwardRef = 6; -const ElementTypeHostComponent = 7; -const ElementTypeMemo = 8; -const ElementTypeOtherOrUnknown = 9; -const ElementTypeProfiler = 10; -const ElementTypeRoot = 11; -const ElementTypeSuspense = 12; -const ElementTypeSuspenseList = 13; -const ElementTypeTracingMarker = 14; // Different types of elements displayed in the Elements tree. -// These types may be used to visually distinguish types, -// or to enable/disable certain functionality. - -// WARNING -// The values below are referenced by ComponentFilters (which are saved via localStorage). -// Do not change them or it will break previously saved user customizations. -// If new filter types are added, use new numbers rather than re-ordering existing ones. -const ComponentFilterElementType = 1; -const ComponentFilterDisplayName = 2; -const ComponentFilterLocation = 3; -const ComponentFilterHOC = 4; -const StrictMode = 1; - -/***/ }), -/* 3 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ getAllEnumerableKeys; }); -__webpack_require__.d(__webpack_exports__, "i", function() { return /* binding */ getDisplayName; }); -__webpack_require__.d(__webpack_exports__, "p", function() { return /* binding */ getUID; }); -__webpack_require__.d(__webpack_exports__, "v", function() { return /* binding */ utfDecodeString; }); -__webpack_require__.d(__webpack_exports__, "w", function() { return /* binding */ utfEncodeString; }); -__webpack_require__.d(__webpack_exports__, "g", function() { return /* binding */ getDefaultComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "n", function() { return /* binding */ getSavedComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "r", function() { return /* binding */ saveComponentFilters; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ getAppendComponentStack; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ getBreakOnConsoleErrors; }); -__webpack_require__.d(__webpack_exports__, "k", function() { return /* binding */ getHideConsoleLogsInStrictMode; }); -__webpack_require__.d(__webpack_exports__, "o", function() { return /* binding */ getShowInlineWarningsAndErrors; }); -__webpack_require__.d(__webpack_exports__, "h", function() { return /* binding */ getDefaultOpenInEditorURL; }); -__webpack_require__.d(__webpack_exports__, "m", function() { return /* binding */ getOpenInEditorURL; }); -__webpack_require__.d(__webpack_exports__, "s", function() { return /* binding */ separateDisplayNameAndHOCs; }); -__webpack_require__.d(__webpack_exports__, "u", function() { return /* binding */ shallowDiffers; }); -__webpack_require__.d(__webpack_exports__, "l", function() { return /* binding */ getInObject; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ deletePathInObject; }); -__webpack_require__.d(__webpack_exports__, "q", function() { return /* binding */ renamePathInObject; }); -__webpack_require__.d(__webpack_exports__, "t", function() { return /* binding */ setInObject; }); -__webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ getDataType; }); -__webpack_require__.d(__webpack_exports__, "j", function() { return /* binding */ getDisplayNameForReactElement; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ formatDataForPreview; }); - -// UNUSED EXPORTS: alphaSortKeys, printOperationsArray, setAppendComponentStack, setBreakOnConsoleErrors, sethideConsoleLogsInStrictMode, setShowInlineWarningsAndErrors - -// EXTERNAL MODULE: /Users/kevin.le-seigle/WS/react/node_modules/lru-cache/index.js -var lru_cache = __webpack_require__(40); -var lru_cache_default = /*#__PURE__*/__webpack_require__.n(lru_cache); - -// EXTERNAL MODULE: /Users/kevin.le-seigle/WS/react/build/oss-experimental/react-is/index.js -var react_is = __webpack_require__(11); - -// CONCATENATED MODULE: ../shared/ReactSymbols.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ -// ATTENTION -// When adding new symbols to this file, -// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' -// The Symbol used to tag the ReactElement-like types. -const REACT_ELEMENT_TYPE = Symbol.for('react.element'); -const REACT_PORTAL_TYPE = Symbol.for('react.portal'); -const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); -const REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); -const REACT_PROFILER_TYPE = Symbol.for('react.profiler'); -const REACT_PROVIDER_TYPE = Symbol.for('react.provider'); -const REACT_CONTEXT_TYPE = Symbol.for('react.context'); -const REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context'); -const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); -const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); -const REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); -const REACT_MEMO_TYPE = Symbol.for('react.memo'); -const REACT_LAZY_TYPE = Symbol.for('react.lazy'); -const REACT_SCOPE_TYPE = Symbol.for('react.scope'); -const REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); -const REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); -const REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); -const REACT_CACHE_TYPE = Symbol.for('react.cache'); -const REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker'); -const REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value'); -const MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -const FAUX_ITERATOR_SYMBOL = '@@iterator'; -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; - } - - const maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - - return null; -} -// EXTERNAL MODULE: ../react-devtools-shared/src/constants.js -var constants = __webpack_require__(1); - -// EXTERNAL MODULE: ../react-devtools-shared/src/types.js -var types = __webpack_require__(2); - -// EXTERNAL MODULE: ../react-devtools-shared/src/storage.js -var storage = __webpack_require__(8); - -// EXTERNAL MODULE: ../react-devtools-shared/src/hydration.js -var hydration = __webpack_require__(10); - -// EXTERNAL MODULE: ../react-devtools-shared/src/isArray.js -var isArray = __webpack_require__(16); - -// CONCATENATED MODULE: ../react-devtools-shared/src/utils.js -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - - - - - - - - - -const cachedDisplayNames = new WeakMap(); // On large trees, encoding takes significant time. -// Try to reuse the already encoded strings. - -const encodedStringCache = new lru_cache_default.a({ - max: 1000 -}); -function alphaSortKeys(a, b) { - if (a.toString() > b.toString()) { - return 1; - } else if (b.toString() > a.toString()) { - return -1; - } else { - return 0; - } -} -function getAllEnumerableKeys(obj) { - const keys = new Set(); - let current = obj; - - while (current != null) { - const currentKeys = [...Object.keys(current), ...Object.getOwnPropertySymbols(current)]; - const descriptors = Object.getOwnPropertyDescriptors(current); - currentKeys.forEach(key => { - // $FlowFixMe: key can be a Symbol https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor - if (descriptors[key].enumerable) { - keys.add(key); - } - }); - current = Object.getPrototypeOf(current); - } - - return keys; -} -function getDisplayName(type, fallbackName = 'Anonymous') { - const nameFromCache = cachedDisplayNames.get(type); - - if (nameFromCache != null) { - return nameFromCache; - } - - let displayName = fallbackName; // The displayName property is not guaranteed to be a string. - // It's only safe to use for our purposes if it's a string. - // github.com/facebook/react-devtools/issues/803 - - if (typeof type.displayName === 'string') { - displayName = type.displayName; - } else if (typeof type.name === 'string' && type.name !== '') { - displayName = type.name; - } - - cachedDisplayNames.set(type, displayName); - return displayName; -} -let uidCounter = 0; -function getUID() { - return ++uidCounter; -} -function utfDecodeString(array) { - // Avoid spreading the array (e.g. String.fromCodePoint(...array)) - // Functions arguments are first placed on the stack before the function is called - // which throws a RangeError for large arrays. - // See github.com/facebook/react/issues/22293 - let string = ''; - - for (let i = 0; i < array.length; i++) { - const char = array[i]; - string += String.fromCodePoint(char); - } - - return string; -} - -function surrogatePairToCodePoint(charCode1, charCode2) { - return ((charCode1 & 0x3ff) << 10) + (charCode2 & 0x3ff) + 0x10000; -} // Credit for this encoding approach goes to Tim Down: -// https://stackoverflow.com/questions/4877326/how-can-i-tell-if-a-string-contains-multibyte-characters-in-javascript - - -function utfEncodeString(string) { - const cached = encodedStringCache.get(string); - - if (cached !== undefined) { - return cached; - } - - const encoded = []; - let i = 0; - let charCode; - - while (i < string.length) { - charCode = string.charCodeAt(i); // Handle multibyte unicode characters (like emoji). - - if ((charCode & 0xf800) === 0xd800) { - encoded.push(surrogatePairToCodePoint(charCode, string.charCodeAt(++i))); - } else { - encoded.push(charCode); - } - - ++i; - } - - encodedStringCache.set(string, encoded); - return encoded; -} -function printOperationsArray(operations) { - // The first two values are always rendererID and rootID - const rendererID = operations[0]; - const rootID = operations[1]; - const logs = [`operations for renderer:${rendererID} and root:${rootID}`]; - let i = 2; // Reassemble the string table. - - const stringTable = [null // ID = 0 corresponds to the null string. - ]; - const stringTableSize = operations[i++]; - const stringTableEnd = i + stringTableSize; - - while (i < stringTableEnd) { - const nextLength = operations[i++]; - const nextString = utfDecodeString(operations.slice(i, i + nextLength)); - stringTable.push(nextString); - i += nextLength; - } - - while (i < operations.length) { - const operation = operations[i]; - - switch (operation) { - case constants["w" /* TREE_OPERATION_ADD */]: - { - const id = operations[i + 1]; - const type = operations[i + 2]; - i += 3; - - if (type === types["m" /* ElementTypeRoot */]) { - logs.push(`Add new root node ${id}`); - i++; // isStrictModeCompliant - - i++; // supportsProfiling - - i++; // supportsStrictMode - - i++; // hasOwnerMetadata - } else { - const parentID = operations[i]; - i++; - i++; // ownerID - - const displayNameStringID = operations[i]; - const displayName = stringTable[displayNameStringID]; - i++; - i++; // key - - logs.push(`Add node ${id} (${displayName || 'null'}) as child of ${parentID}`); - } - - break; - } - - case constants["x" /* TREE_OPERATION_REMOVE */]: - { - const removeLength = operations[i + 1]; - i += 2; - - for (let removeIndex = 0; removeIndex < removeLength; removeIndex++) { - const id = operations[i]; - i += 1; - logs.push(`Remove node ${id}`); - } - - break; - } - - case constants["y" /* TREE_OPERATION_REMOVE_ROOT */]: - { - i += 1; - logs.push(`Remove root ${rootID}`); - break; - } - - case constants["A" /* TREE_OPERATION_SET_SUBTREE_MODE */]: - { - const id = operations[i + 1]; - const mode = operations[i + 1]; - i += 3; - logs.push(`Mode ${mode} set for subtree with root ${id}`); - break; - } - - case constants["z" /* TREE_OPERATION_REORDER_CHILDREN */]: - { - const id = operations[i + 1]; - const numChildren = operations[i + 2]; - i += 3; - const children = operations.slice(i, i + numChildren); - i += numChildren; - logs.push(`Re-order node ${id} children ${children.join(',')}`); - break; - } - - case constants["C" /* TREE_OPERATION_UPDATE_TREE_BASE_DURATION */]: - // Base duration updates are only sent while profiling is in progress. - // We can ignore them at this point. - // The profiler UI uses them lazily in order to generate the tree. - i += 3; - break; - - case constants["B" /* TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS */]: - const id = operations[i + 1]; - const numErrors = operations[i + 2]; - const numWarnings = operations[i + 3]; - i += 4; - logs.push(`Node ${id} has ${numErrors} errors and ${numWarnings} warnings`); - break; - - default: - throw Error(`Unsupported Bridge operation "${operation}"`); - } - } - - console.log(logs.join('\n ')); -} -function getDefaultComponentFilters() { - return [{ - type: types["b" /* ComponentFilterElementType */], - value: types["i" /* ElementTypeHostComponent */], - isEnabled: true - }]; -} -function getSavedComponentFilters() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["h" /* LOCAL_STORAGE_FILTER_PREFERENCES_KEY */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return getDefaultComponentFilters(); -} -function saveComponentFilters(componentFilters) { - Object(storage["c" /* localStorageSetItem */])(constants["h" /* LOCAL_STORAGE_FILTER_PREFERENCES_KEY */], JSON.stringify(componentFilters)); -} -function getAppendComponentStack() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["m" /* LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return true; -} -function setAppendComponentStack(value) { - Object(storage["c" /* localStorageSetItem */])(constants["m" /* LOCAL_STORAGE_SHOULD_PATCH_CONSOLE_KEY */], JSON.stringify(value)); -} -function getBreakOnConsoleErrors() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["l" /* LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return false; -} -function setBreakOnConsoleErrors(value) { - Object(storage["c" /* localStorageSetItem */])(constants["l" /* LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS */], JSON.stringify(value)); -} -function getHideConsoleLogsInStrictMode() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["i" /* LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return false; -} -function sethideConsoleLogsInStrictMode(value) { - Object(storage["c" /* localStorageSetItem */])(constants["i" /* LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE */], JSON.stringify(value)); -} -function getShowInlineWarningsAndErrors() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["n" /* LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return true; -} -function setShowInlineWarningsAndErrors(value) { - Object(storage["c" /* localStorageSetItem */])(constants["n" /* LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY */], JSON.stringify(value)); -} -function getDefaultOpenInEditorURL() { - return typeof null === 'string' ? null : ''; -} -function getOpenInEditorURL() { - try { - const raw = Object(storage["a" /* localStorageGetItem */])(constants["j" /* LOCAL_STORAGE_OPEN_IN_EDITOR_URL */]); - - if (raw != null) { - return JSON.parse(raw); - } - } catch (error) {} - - return getDefaultOpenInEditorURL(); -} -function separateDisplayNameAndHOCs(displayName, type) { - if (displayName === null) { - return [null, null]; - } - - let hocDisplayNames = null; - - switch (type) { - case types["e" /* ElementTypeClass */]: - case types["g" /* ElementTypeForwardRef */]: - case types["h" /* ElementTypeFunction */]: - case types["j" /* ElementTypeMemo */]: - if (displayName.indexOf('(') >= 0) { - const matches = displayName.match(/[^()]+/g); - - if (matches != null) { - displayName = matches.pop(); - hocDisplayNames = matches; - } - } - - break; - - default: - break; - } - - if (type === types["j" /* ElementTypeMemo */]) { - if (hocDisplayNames === null) { - hocDisplayNames = ['Memo']; - } else { - hocDisplayNames.unshift('Memo'); - } - } else if (type === types["g" /* ElementTypeForwardRef */]) { - if (hocDisplayNames === null) { - hocDisplayNames = ['ForwardRef']; - } else { - hocDisplayNames.unshift('ForwardRef'); - } - } - - return [displayName, hocDisplayNames]; -} // Pulled from react-compat -// https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349 - -function shallowDiffers(prev, next) { - for (const attribute in prev) { - if (!(attribute in next)) { - return true; - } - } - - for (const attribute in next) { - if (prev[attribute] !== next[attribute]) { - return true; - } - } - - return false; -} -function getInObject(object, path) { - return path.reduce((reduced, attr) => { - if (reduced) { - if (hasOwnProperty.call(reduced, attr)) { - return reduced[attr]; - } - - if (typeof reduced[Symbol.iterator] === 'function') { - // Convert iterable to array and return array[index] - // - // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - return Array.from(reduced)[attr]; - } - } - - return null; - }, object); -} -function deletePathInObject(object, path) { - const length = path.length; - const last = path[length - 1]; - - if (object != null) { - const parent = getInObject(object, path.slice(0, length - 1)); - - if (parent) { - if (Object(isArray["a" /* default */])(parent)) { - parent.splice(last, 1); - } else { - delete parent[last]; - } - } - } -} -function renamePathInObject(object, oldPath, newPath) { - const length = oldPath.length; - - if (object != null) { - const parent = getInObject(object, oldPath.slice(0, length - 1)); - - if (parent) { - const lastOld = oldPath[length - 1]; - const lastNew = newPath[length - 1]; - parent[lastNew] = parent[lastOld]; - - if (Object(isArray["a" /* default */])(parent)) { - parent.splice(lastOld, 1); - } else { - delete parent[lastOld]; - } - } - } -} -function setInObject(object, path, value) { - const length = path.length; - const last = path[length - 1]; - - if (object != null) { - const parent = getInObject(object, path.slice(0, length - 1)); - - if (parent) { - parent[last] = value; - } - } -} - -/** - * Get a enhanced/artificial type string based on the object instance - */ -function getDataType(data) { - if (data === null) { - return 'null'; - } else if (data === undefined) { - return 'undefined'; - } - - if (Object(react_is["isElement"])(data)) { - return 'react_element'; - } - - if (typeof HTMLElement !== 'undefined' && data instanceof HTMLElement) { - return 'html_element'; - } - - const type = typeof data; - - switch (type) { - case 'bigint': - return 'bigint'; - - case 'boolean': - return 'boolean'; - - case 'function': - return 'function'; - - case 'number': - if (Number.isNaN(data)) { - return 'nan'; - } else if (!Number.isFinite(data)) { - return 'infinity'; - } else { - return 'number'; - } - - case 'object': - if (Object(isArray["a" /* default */])(data)) { - return 'array'; - } else if (ArrayBuffer.isView(data)) { - return hasOwnProperty.call(data.constructor, 'BYTES_PER_ELEMENT') ? 'typed_array' : 'data_view'; - } else if (data.constructor && data.constructor.name === 'ArrayBuffer') { - // HACK This ArrayBuffer check is gross; is there a better way? - // We could try to create a new DataView with the value. - // If it doesn't error, we know it's an ArrayBuffer, - // but this seems kind of awkward and expensive. - return 'array_buffer'; - } else if (typeof data[Symbol.iterator] === 'function') { - const iterator = data[Symbol.iterator](); - - if (!iterator) {// Proxies might break assumptoins about iterators. - // See github.com/facebook/react/issues/21654 - } else { - return iterator === data ? 'opaque_iterator' : 'iterator'; - } - } else if (data.constructor && data.constructor.name === 'RegExp') { - return 'regexp'; - } else { - const toStringValue = Object.prototype.toString.call(data); - - if (toStringValue === '[object Date]') { - return 'date'; - } else if (toStringValue === '[object HTMLAllCollection]') { - return 'html_all_collection'; - } - } - - return 'object'; - - case 'string': - return 'string'; - - case 'symbol': - return 'symbol'; - - case 'undefined': - if (Object.prototype.toString.call(data) === '[object HTMLAllCollection]') { - return 'html_all_collection'; - } - - return 'undefined'; - - default: - return 'unknown'; - } -} -function getDisplayNameForReactElement(element) { - const elementType = Object(react_is["typeOf"])(element); - - switch (elementType) { - case react_is["ContextConsumer"]: - return 'ContextConsumer'; - - case react_is["ContextProvider"]: - return 'ContextProvider'; - - case react_is["ForwardRef"]: - return 'ForwardRef'; - - case react_is["Fragment"]: - return 'Fragment'; - - case react_is["Lazy"]: - return 'Lazy'; - - case react_is["Memo"]: - return 'Memo'; - - case react_is["Portal"]: - return 'Portal'; - - case react_is["Profiler"]: - return 'Profiler'; - - case react_is["StrictMode"]: - return 'StrictMode'; - - case react_is["Suspense"]: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - - case REACT_TRACING_MARKER_TYPE: - return 'TracingMarker'; - - default: - const { - type - } = element; - - if (typeof type === 'string') { - return type; - } else if (typeof type === 'function') { - return getDisplayName(type, 'Anonymous'); - } else if (type != null) { - return 'NotImplementedInDevtools'; - } else { - return 'Element'; - } - - } -} -const MAX_PREVIEW_STRING_LENGTH = 50; - -function truncateForDisplay(string, length = MAX_PREVIEW_STRING_LENGTH) { - if (string.length > length) { - return string.substr(0, length) + '…'; - } else { - return string; - } -} // Attempts to mimic Chrome's inline preview for values. -// For example, the following value... -// { -// foo: 123, -// bar: "abc", -// baz: [true, false], -// qux: { ab: 1, cd: 2 } -// }; -// -// Would show a preview of... -// {foo: 123, bar: "abc", baz: Array(2), qux: {…}} -// -// And the following value... -// [ -// 123, -// "abc", -// [true, false], -// { foo: 123, bar: "abc" } -// ]; -// -// Would show a preview of... -// [123, "abc", Array(2), {…}] - - -function formatDataForPreview(data, showFormattedValue) { - if (data != null && hasOwnProperty.call(data, hydration["d" /* meta */].type)) { - return showFormattedValue ? data[hydration["d" /* meta */].preview_long] : data[hydration["d" /* meta */].preview_short]; - } - - const type = getDataType(data); - - switch (type) { - case 'html_element': - return `<${truncateForDisplay(data.tagName.toLowerCase())} />`; - - case 'function': - return truncateForDisplay(`ƒ ${typeof data.name === 'function' ? '' : data.name}() {}`); - - case 'string': - return `"${data}"`; - - case 'bigint': - return truncateForDisplay(data.toString() + 'n'); - - case 'regexp': - return truncateForDisplay(data.toString()); - - case 'symbol': - return truncateForDisplay(data.toString()); - - case 'react_element': - return `<${truncateForDisplay(getDisplayNameForReactElement(data) || 'Unknown')} />`; - - case 'array_buffer': - return `ArrayBuffer(${data.byteLength})`; - - case 'data_view': - return `DataView(${data.buffer.byteLength})`; - - case 'array': - if (showFormattedValue) { - let formatted = ''; - - for (let i = 0; i < data.length; i++) { - if (i > 0) { - formatted += ', '; - } - - formatted += formatDataForPreview(data[i], false); - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `[${truncateForDisplay(formatted)}]`; - } else { - const length = hasOwnProperty.call(data, hydration["d" /* meta */].size) ? data[hydration["d" /* meta */].size] : data.length; - return `Array(${length})`; - } - - case 'typed_array': - const shortName = `${data.constructor.name}(${data.length})`; - - if (showFormattedValue) { - let formatted = ''; - - for (let i = 0; i < data.length; i++) { - if (i > 0) { - formatted += ', '; - } - - formatted += data[i]; - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `${shortName} [${truncateForDisplay(formatted)}]`; - } else { - return shortName; - } - - case 'iterator': - const name = data.constructor.name; - - if (showFormattedValue) { - // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - const array = Array.from(data); - let formatted = ''; - - for (let i = 0; i < array.length; i++) { - const entryOrEntries = array[i]; - - if (i > 0) { - formatted += ', '; - } // TRICKY - // Browsers display Maps and Sets differently. - // To mimic their behavior, detect if we've been given an entries tuple. - // Map(2) {"abc" => 123, "def" => 123} - // Set(2) {"abc", 123} - - - if (Object(isArray["a" /* default */])(entryOrEntries)) { - const key = formatDataForPreview(entryOrEntries[0], true); - const value = formatDataForPreview(entryOrEntries[1], false); - formatted += `${key} => ${value}`; - } else { - formatted += formatDataForPreview(entryOrEntries, false); - } - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `${name}(${data.size}) {${truncateForDisplay(formatted)}}`; - } else { - return `${name}(${data.size})`; - } - - case 'opaque_iterator': - { - return data[Symbol.toStringTag]; - } - - case 'date': - return data.toString(); - - case 'object': - if (showFormattedValue) { - const keys = Array.from(getAllEnumerableKeys(data)).sort(alphaSortKeys); - let formatted = ''; - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - - if (i > 0) { - formatted += ', '; - } - - formatted += `${key.toString()}: ${formatDataForPreview(data[key], false)}`; - - if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { - // Prevent doing a lot of unnecessary iteration... - break; - } - } - - return `{${truncateForDisplay(formatted)}}`; - } else { - return '{…}'; - } - - case 'boolean': - case 'number': - case 'infinity': - case 'nan': - case 'null': - case 'undefined': - return data; - - default: - try { - return truncateForDisplay(String(data)); - } catch (error) { - return 'unserializable'; - } - - } -} - -/***/ }), -/* 4 */, -/* 5 */ -/***/ (function(module, exports) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function (useSourceMap) { - var list = []; // return the list of modules as css string - - list.toString = function toString() { - return this.map(function (item) { - var content = cssWithMappingToString(item, useSourceMap); - - if (item[2]) { - return "@media " + item[2] + "{" + content + "}"; - } else { - return content; - } - }).join(""); - }; // import a list of modules into the list - - - list.i = function (modules, mediaQuery) { - if (typeof modules === "string") modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - - for (var i = 0; i < this.length; i++) { - var id = this[i][0]; - if (typeof id === "number") alreadyImportedModules[id] = true; - } - - for (i = 0; i < modules.length; i++) { - var item = modules[i]; // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - - if (typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if (mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if (mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - - list.push(item); - } - } - }; - - return list; -}; - -function cssWithMappingToString(item, useSourceMap) { - var content = item[1] || ''; - var cssMapping = item[3]; - - if (!cssMapping) { - return content; - } - - if (useSourceMap && typeof btoa === 'function') { - var sourceMapping = toComment(cssMapping); - var sourceURLs = cssMapping.sources.map(function (source) { - return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; - }); - return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); - } - - return [content].join('\n'); -} // Adapted from convert-source-map (MIT) - - -function toComment(sourceMap) { - // eslint-disable-next-line no-undef - var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); - var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; - return '/*# ' + data + ' */'; -} - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -var stylesInDom = {}; - -var memoize = function (fn) { - var memo; - - return function () { - if (typeof memo === "undefined") memo = fn.apply(this, arguments); - return memo; - }; -}; - -var isOldIE = memoize(function () { - // Test for IE <= 9 as proposed by Browserhacks - // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 - // Tests for existence of standard globals is to allow style-loader - // to operate correctly into non-standard environments - // @see https://github.com/webpack-contrib/style-loader/issues/177 - return window && document && document.all && !window.atob; -}); - -var getTarget = function (target, parent) { - if (parent){ - return parent.querySelector(target); - } - return document.querySelector(target); -}; - -var getElement = (function (fn) { - var memo = {}; - - return function(target, parent) { - // If passing function in options, then use it for resolve "head" element. - // Useful for Shadow Root style i.e - // { - // insertInto: function () { return document.querySelector("#foo").shadowRoot } - // } - if (typeof target === 'function') { - return target(); - } - if (typeof memo[target] === "undefined") { - var styleTarget = getTarget.call(this, target, parent); - // Special case to return head of iframe instead of iframe itself - if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { - try { - // This will throw an exception if access to iframe is blocked - // due to cross-origin restrictions - styleTarget = styleTarget.contentDocument.head; - } catch(e) { - styleTarget = null; - } - } - memo[target] = styleTarget; - } - return memo[target] - }; -})(); - -var singleton = null; -var singletonCounter = 0; -var stylesInsertedAtTop = []; - -var fixUrls = __webpack_require__(124); - -module.exports = function(list, options) { - if (typeof DEBUG !== "undefined" && DEBUG) { - if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); - } - - options = options || {}; - - options.attrs = typeof options.attrs === "object" ? options.attrs : {}; - - // Force single-tag solution on IE6-9, which has a hard limit on the # of development780780 \ No newline at end of file diff --git a/tools/react-dev-tools/icons/development.svg b/tools/react-dev-tools/icons/development.svg deleted file mode 100644 index ccd6e669061f..000000000000 --- a/tools/react-dev-tools/icons/development.svg +++ /dev/null @@ -1 +0,0 @@ -development780780 \ No newline at end of file diff --git a/tools/react-dev-tools/icons/disabled.svg b/tools/react-dev-tools/icons/disabled.svg deleted file mode 100644 index 73c2bb51cdbb..000000000000 --- a/tools/react-dev-tools/icons/disabled.svg +++ /dev/null @@ -1 +0,0 @@ -disabled \ No newline at end of file diff --git a/tools/react-dev-tools/icons/outdated.svg b/tools/react-dev-tools/icons/outdated.svg deleted file mode 100644 index 03b83c1eb559..000000000000 --- a/tools/react-dev-tools/icons/outdated.svg +++ /dev/null @@ -1 +0,0 @@ -outdated \ No newline at end of file diff --git a/tools/react-dev-tools/icons/production.svg b/tools/react-dev-tools/icons/production.svg deleted file mode 100644 index 1e974f513101..000000000000 --- a/tools/react-dev-tools/icons/production.svg +++ /dev/null @@ -1 +0,0 @@ -production \ No newline at end of file diff --git a/tools/react-dev-tools/icons/restricted.svg b/tools/react-dev-tools/icons/restricted.svg deleted file mode 100644 index 73c2bb51cdbb..000000000000 --- a/tools/react-dev-tools/icons/restricted.svg +++ /dev/null @@ -1 +0,0 @@ -disabled \ No newline at end of file diff --git a/tools/react-dev-tools/main.html b/tools/react-dev-tools/main.html deleted file mode 100644 index f1c96d4a7a09..000000000000 --- a/tools/react-dev-tools/main.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tools/react-dev-tools/manifest.json b/tools/react-dev-tools/manifest.json deleted file mode 100644 index b7aa37668970..000000000000 --- a/tools/react-dev-tools/manifest.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "manifest_version": 2, - "name": "React Developer Tools", - "description": "Adds React debugging tools to the Chrome Developer Tools.\n\nCreated from revision 34aa5cfe0 on 6/26/2023.", - "version": "4.24.2", - "version_name": "4.24.2 (6/26/2023)", - "minimum_chrome_version": "60", - "icons": { - "16": "icons/16-production.png", - "32": "icons/32-production.png", - "48": "icons/48-production.png", - "128": "icons/128-production.png" - }, - "browser_action": { - "default_icon": { - "16": "icons/16-disabled.png", - "32": "icons/32-disabled.png", - "48": "icons/48-disabled.png", - "128": "icons/128-disabled.png" - }, - "default_popup": "popups/disabled.html" - }, - "devtools_page": "main.html", - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", - "web_accessible_resources": [ - "main.html", - "panel.html", - "build/react_devtools_backend.js", - "build/renderer.js" - ], - "background": { - "scripts": [ - "build/background.js" - ], - "persistent": false - }, - "permissions": [ - "file:///*", - "http://*/*", - "https://*/*" - ], - "content_scripts": [ - { - "matches": [ - "" - ], - "js": [ - "build/injectGlobalHook.js" - ], - "run_at": "document_start" - } - ] -} \ No newline at end of file diff --git a/tools/react-dev-tools/package.json b/tools/react-dev-tools/package.json deleted file mode 100644 index 2807ef07ee8b..000000000000 --- a/tools/react-dev-tools/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@ledgerhq/react-devtools", - "version": "0.0.0", - "private": true -} diff --git a/tools/react-dev-tools/panel.html b/tools/react-dev-tools/panel.html deleted file mode 100644 index 60fd1bdf13ff..000000000000 --- a/tools/react-dev-tools/panel.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - -
Unable to find React on the page.
- - - diff --git a/tools/react-dev-tools/popups/deadcode.html b/tools/react-dev-tools/popups/deadcode.html deleted file mode 100644 index 5b458981e006..000000000000 --- a/tools/react-dev-tools/popups/deadcode.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -

- This page includes an extra development build of React. 🚧 -

-

- The React build on this page includes both development and production versions because dead code elimination has not been applied correctly. -
-
- This makes its size larger, and causes React to run slower. -
-
- Make sure to
set up dead code elimination before deployment. -

-
-

- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

diff --git a/tools/react-dev-tools/popups/development.html b/tools/react-dev-tools/popups/development.html deleted file mode 100644 index a0d27ecc6e50..000000000000 --- a/tools/react-dev-tools/popups/development.html +++ /dev/null @@ -1,24 +0,0 @@ - - - -

- This page is using the development build of React. 🚧 -

-

- Note that the development build is not suitable for production. -
- Make sure to use the production build before deployment. -

-
-

- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

diff --git a/tools/react-dev-tools/popups/disabled.html b/tools/react-dev-tools/popups/disabled.html deleted file mode 100644 index 52f762253ffd..000000000000 --- a/tools/react-dev-tools/popups/disabled.html +++ /dev/null @@ -1,17 +0,0 @@ - - - -

- This page doesn’t appear to be using React. -
- If this seems wrong, follow the troubleshooting instructions. -

diff --git a/tools/react-dev-tools/popups/outdated.html b/tools/react-dev-tools/popups/outdated.html deleted file mode 100644 index ebeabc778740..000000000000 --- a/tools/react-dev-tools/popups/outdated.html +++ /dev/null @@ -1,25 +0,0 @@ - - - -

- This page is using an outdated version of React. ⌛ -

-

- We recommend updating React to ensure that you receive important bugfixes and performance improvements. -
-
- You can find the upgrade instructions on the React blog. -

-
-

- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

diff --git a/tools/react-dev-tools/popups/production.html b/tools/react-dev-tools/popups/production.html deleted file mode 100644 index 44ae17939e26..000000000000 --- a/tools/react-dev-tools/popups/production.html +++ /dev/null @@ -1,17 +0,0 @@ - - - -

- This page is using the production build of React. ✅ -
- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

diff --git a/tools/react-dev-tools/popups/restricted.html b/tools/react-dev-tools/popups/restricted.html deleted file mode 100644 index 77acf08f37bb..000000000000 --- a/tools/react-dev-tools/popups/restricted.html +++ /dev/null @@ -1,14 +0,0 @@ - - - -

- This is a restricted browser page. -
- React devtools cannot access this page. -

diff --git a/tools/react-dev-tools/popups/shared.css b/tools/react-dev-tools/popups/shared.css deleted file mode 100644 index cd3d35d00589..000000000000 --- a/tools/react-dev-tools/popups/shared.css +++ /dev/null @@ -1,7 +0,0 @@ -html, body { - font-size: 14px; -} - -body { - margin: 8px; -} \ No newline at end of file diff --git a/tools/react-dev-tools/popups/shared.js b/tools/react-dev-tools/popups/shared.js deleted file mode 100644 index 53b2bc1d16e2..000000000000 --- a/tools/react-dev-tools/popups/shared.js +++ /dev/null @@ -1,25 +0,0 @@ -/* globals chrome */ - -'use strict'; - -document.addEventListener('DOMContentLoaded', function() { - // Make links work - const links = document.getElementsByTagName('a'); - for (let i = 0; i < links.length; i++) { - (function() { - const ln = links[i]; - const location = ln.href; - ln.onclick = function() { - chrome.tabs.create({active: true, url: location}); - return false; - }; - })(); - } - - // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=428044 - document.body.style.opacity = 0; - document.body.style.transition = 'opacity ease-out .4s'; - requestAnimationFrame(function() { - document.body.style.opacity = 1; - }); -}); diff --git a/tools/react-dev-tools/popups/unminified.html b/tools/react-dev-tools/popups/unminified.html deleted file mode 100644 index b61fb78519b2..000000000000 --- a/tools/react-dev-tools/popups/unminified.html +++ /dev/null @@ -1,31 +0,0 @@ - - -

- This page is using an unminified build of React. 🚧 -

-

- The React build on this page appears to be unminified. -
- This makes its size larger, and causes React to run slower. -
-
- Make sure to set up minification before deployment. -

-
-

- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right. -

From 94b2e3df4e7f8004d195e6ab6e5447f5e0218567 Mon Sep 17 00:00:00 2001 From: Theophile Sandoz Date: Tue, 1 Oct 2024 15:41:52 +0200 Subject: [PATCH 60/94] =?UTF-8?q?chore(llm):=20=F0=9F=94=8D=20accept=20ana?= =?UTF-8?q?lytics=20during=20onboarding=20tests=20(#7959)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chore(llm): accept analytics during onboarding tests --- .changeset/five-ties-sniff.md | 5 +++++ .../e2e/page/onboarding/onboardingSteps.page.ts | 8 ++++++++ .../src/screens/AnalyticsOptInPrompt/variantA/Main.tsx | 1 + .../src/screens/AnalyticsOptInPrompt/variantB/Main.tsx | 1 + 4 files changed, 15 insertions(+) create mode 100644 .changeset/five-ties-sniff.md diff --git a/.changeset/five-ties-sniff.md b/.changeset/five-ties-sniff.md new file mode 100644 index 000000000000..95ef6f583904 --- /dev/null +++ b/.changeset/five-ties-sniff.md @@ -0,0 +1,5 @@ +--- +"live-mobile": patch +--- + +Accept analytics during onboarding tests diff --git a/apps/ledger-live-mobile/e2e/page/onboarding/onboardingSteps.page.ts b/apps/ledger-live-mobile/e2e/page/onboarding/onboardingSteps.page.ts index 0409645118f2..c7f19ffe6b4d 100644 --- a/apps/ledger-live-mobile/e2e/page/onboarding/onboardingSteps.page.ts +++ b/apps/ledger-live-mobile/e2e/page/onboarding/onboardingSteps.page.ts @@ -10,11 +10,13 @@ import { expect } from "detox"; export default class OnboardingStepsPage { getStartedButtonId = "onboarding-getStarted-button"; + acceptAnalyticsButtonId = "accept-analytics-button"; exploreWithoutDeviceButtonId = "discoverLive-exploreWithoutADevice"; readyToScanButtonID = "onboarding-scan-button"; scanAndImportAccountsPageID = "onboarding-import-accounts-title"; discoverLiveTitle = (index: number) => `onboarding-discoverLive-${index}-title`; onboardingGetStartedButton = () => getElementById(this.getStartedButtonId); + acceptAnalyticsButton = () => getElementById(this.acceptAnalyticsButtonId); accessWalletButton = () => getElementById("onboarding-accessWallet"); noLedgerYetButton = () => getElementById("onboarding-noLedgerYet"); exploreAppButton = () => getElementById("onboarding-noLedgerYetModal-explore"); @@ -64,6 +66,12 @@ export default class OnboardingStepsPage { async startOnboarding() { await waitForElementById(this.getStartedButtonId); await tapByElement(this.onboardingGetStartedButton()); + await waitForElementById(new RegExp(`${this.setupLedger}|${this.acceptAnalyticsButtonId}`)); + try { + await tapByElement(this.acceptAnalyticsButton()); + } catch { + // Analytics prompt not enabled + } } // Exploring App diff --git a/apps/ledger-live-mobile/src/screens/AnalyticsOptInPrompt/variantA/Main.tsx b/apps/ledger-live-mobile/src/screens/AnalyticsOptInPrompt/variantA/Main.tsx index 47c52f5ac71a..445c64ad01c4 100644 --- a/apps/ledger-live-mobile/src/screens/AnalyticsOptInPrompt/variantA/Main.tsx +++ b/apps/ledger-live-mobile/src/screens/AnalyticsOptInPrompt/variantA/Main.tsx @@ -125,6 +125,7 @@ function Main({ route, navigation }: Props) { />