From 861201290aead8d829a2a3ffcb7e19be4a388c83 Mon Sep 17 00:00:00 2001 From: Kelly Date: Sun, 7 Dec 2025 12:18:13 -0700 Subject: [PATCH] ci: Switch to Woodpecker CI pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces Gitea Actions with Woodpecker CI config. Pipeline: - CI: typecheck backend, build all 3 frontends (all branches) - CD: build 4 Docker images, deploy to k8s (master only) Required secrets in Woodpecker: - registry_username - registry_password - kubeconfig_data (base64 encoded) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .gitea/workflows/ci.yml | 85 ----- .gitea/workflows/deploy.yml | 143 -------- .gitignore | 4 + .woodpecker.yml | 137 ++++++++ backend/.env | 33 +- backend/node_modules/.package-lock.json | 281 +++++++++++++++- backend/package-lock.json | 284 +++++++++++++++- cannaiq/dist/assets/index-B94shhsw.css | 1 - cannaiq/dist/assets/index-Cg0c5RUA.js | 421 ------------------------ cannaiq/dist/index.html | 4 +- 10 files changed, 728 insertions(+), 665 deletions(-) delete mode 100644 .gitea/workflows/ci.yml delete mode 100644 .gitea/workflows/deploy.yml create mode 100644 .woodpecker.yml delete mode 100644 cannaiq/dist/assets/index-B94shhsw.css delete mode 100644 cannaiq/dist/assets/index-Cg0c5RUA.js diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml deleted file mode 100644 index 6697851e..00000000 --- a/.gitea/workflows/ci.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: CI - -on: - push: - branches: ['*'] - pull_request: - branches: [master, main] - -jobs: - typecheck-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install dependencies - working-directory: backend - run: npm ci - - - name: TypeScript check - working-directory: backend - run: npx tsc --noEmit - continue-on-error: true # TODO: Remove once all legacy type errors are fixed - - build-cannaiq: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install dependencies - working-directory: cannaiq - run: npm ci - - - name: TypeScript check - working-directory: cannaiq - run: npx tsc --noEmit - - - name: Build - working-directory: cannaiq - run: npm run build - - build-findadispo: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install dependencies - working-directory: findadispo/frontend - run: npm ci - - - name: Build - working-directory: findadispo/frontend - run: npm run build - - build-findagram: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install dependencies - working-directory: findagram/frontend - run: npm ci - - - name: Build - working-directory: findagram/frontend - run: npm run build diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml deleted file mode 100644 index a5382022..00000000 --- a/.gitea/workflows/deploy.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: Deploy - -on: - push: - branches: [master, main] - -jobs: - # CI jobs run first in parallel - typecheck-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - - name: Install dependencies - working-directory: backend - run: npm ci - - name: TypeScript check - working-directory: backend - run: npx tsc --noEmit - continue-on-error: true # TODO: Remove once legacy errors fixed - - build-cannaiq: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - - name: Install & Build - working-directory: cannaiq - run: | - npm ci - npx tsc --noEmit - npm run build - - build-findadispo: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - - name: Install & Build - working-directory: findadispo/frontend - run: | - npm ci - npm run build - - build-findagram: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - - name: Install & Build - working-directory: findagram/frontend - run: | - npm ci - npm run build - - # Deploy only after ALL CI jobs pass - deploy: - needs: [typecheck-backend, build-cannaiq, build-findadispo, build-findagram] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Gitea Registry - uses: docker/login-action@v3 - with: - registry: code.cannabrands.app - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - # Build and push all 4 images - - name: Build and push Backend - uses: docker/build-push-action@v5 - with: - context: ./backend - push: true - tags: | - code.cannabrands.app/creationshop/dispensary-scraper:latest - code.cannabrands.app/creationshop/dispensary-scraper:${{ github.sha }} - - - name: Build and push CannaiQ - uses: docker/build-push-action@v5 - with: - context: ./cannaiq - push: true - tags: | - code.cannabrands.app/creationshop/cannaiq-frontend:latest - code.cannabrands.app/creationshop/cannaiq-frontend:${{ github.sha }} - - - name: Build and push FindADispo - uses: docker/build-push-action@v5 - with: - context: ./findadispo/frontend - push: true - tags: | - code.cannabrands.app/creationshop/findadispo-frontend:latest - code.cannabrands.app/creationshop/findadispo-frontend:${{ github.sha }} - - - name: Build and push Findagram - uses: docker/build-push-action@v5 - with: - context: ./findagram/frontend - push: true - tags: | - code.cannabrands.app/creationshop/findagram-frontend:latest - code.cannabrands.app/creationshop/findagram-frontend:${{ github.sha }} - - # Deploy to Kubernetes - - name: Set up kubectl - uses: azure/setup-kubectl@v3 - - - name: Configure kubeconfig - run: | - mkdir -p ~/.kube - echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config - chmod 600 ~/.kube/config - - - name: Deploy to Kubernetes - run: | - kubectl set image deployment/scraper scraper=code.cannabrands.app/creationshop/dispensary-scraper:${{ github.sha }} -n dispensary-scraper - kubectl set image deployment/scraper-worker scraper-worker=code.cannabrands.app/creationshop/dispensary-scraper:${{ github.sha }} -n dispensary-scraper - kubectl set image deployment/cannaiq-frontend cannaiq-frontend=code.cannabrands.app/creationshop/cannaiq-frontend:${{ github.sha }} -n dispensary-scraper - kubectl set image deployment/findadispo-frontend findadispo-frontend=code.cannabrands.app/creationshop/findadispo-frontend:${{ github.sha }} -n dispensary-scraper - kubectl set image deployment/findagram-frontend findagram-frontend=code.cannabrands.app/creationshop/findagram-frontend:${{ github.sha }} -n dispensary-scraper - - - name: Wait for rollout - run: | - kubectl rollout status deployment/scraper -n dispensary-scraper --timeout=300s - kubectl rollout status deployment/scraper-worker -n dispensary-scraper --timeout=300s - kubectl rollout status deployment/cannaiq-frontend -n dispensary-scraper --timeout=120s - kubectl rollout status deployment/findadispo-frontend -n dispensary-scraper --timeout=120s - kubectl rollout status deployment/findagram-frontend -n dispensary-scraper --timeout=120s - echo "All deployments rolled out successfully" diff --git a/.gitignore b/.gitignore index a1723d09..cffd2939 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,10 @@ npm-debug.log* # Local storage (runtime data, not source) backend/storage/ +# Product images (crawled data, not source) +backend/public/images/products/ +backend/public/images/brands/ + # Vite cache **/node_modules/.vite/ diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 00000000..aca4db17 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,137 @@ +variables: + - &node_image 'node:20' + - &docker_image 'plugins/docker' + +# CI Pipeline - runs on all branches +pipeline: + # Build checks run in parallel + typecheck-backend: + image: *node_image + commands: + - cd backend + - npm ci + - npx tsc --noEmit || true # TODO: Remove || true once legacy errors fixed + when: + event: [push, pull_request] + + build-cannaiq: + image: *node_image + commands: + - cd cannaiq + - npm ci + - npx tsc --noEmit + - npm run build + when: + event: [push, pull_request] + + build-findadispo: + image: *node_image + commands: + - cd findadispo/frontend + - npm ci + - npm run build + when: + event: [push, pull_request] + + build-findagram: + image: *node_image + commands: + - cd findagram/frontend + - npm ci + - npm run build + when: + event: [push, pull_request] + + # Docker builds - only on master + docker-backend: + image: *docker_image + settings: + registry: code.cannabrands.app + repo: code.cannabrands.app/creationshop/dispensary-scraper + tags: + - latest + - ${CI_COMMIT_SHA:0:8} + dockerfile: backend/Dockerfile + context: backend + username: + from_secret: registry_username + password: + from_secret: registry_password + when: + branch: master + event: push + + docker-cannaiq: + image: *docker_image + settings: + registry: code.cannabrands.app + repo: code.cannabrands.app/creationshop/cannaiq-frontend + tags: + - latest + - ${CI_COMMIT_SHA:0:8} + dockerfile: cannaiq/Dockerfile + context: cannaiq + username: + from_secret: registry_username + password: + from_secret: registry_password + when: + branch: master + event: push + + docker-findadispo: + image: *docker_image + settings: + registry: code.cannabrands.app + repo: code.cannabrands.app/creationshop/findadispo-frontend + tags: + - latest + - ${CI_COMMIT_SHA:0:8} + dockerfile: findadispo/frontend/Dockerfile + context: findadispo/frontend + username: + from_secret: registry_username + password: + from_secret: registry_password + when: + branch: master + event: push + + docker-findagram: + image: *docker_image + settings: + registry: code.cannabrands.app + repo: code.cannabrands.app/creationshop/findagram-frontend + tags: + - latest + - ${CI_COMMIT_SHA:0:8} + dockerfile: findagram/frontend/Dockerfile + context: findagram/frontend + username: + from_secret: registry_username + password: + from_secret: registry_password + when: + branch: master + event: push + + # Deploy to Kubernetes - only after docker builds on master + deploy: + image: bitnami/kubectl:latest + commands: + - echo "$KUBECONFIG_DATA" | base64 -d > /tmp/kubeconfig + - export KUBECONFIG=/tmp/kubeconfig + - kubectl set image deployment/scraper scraper=code.cannabrands.app/creationshop/dispensary-scraper:${CI_COMMIT_SHA:0:8} -n dispensary-scraper + - kubectl set image deployment/scraper-worker scraper-worker=code.cannabrands.app/creationshop/dispensary-scraper:${CI_COMMIT_SHA:0:8} -n dispensary-scraper + - kubectl set image deployment/cannaiq-frontend cannaiq-frontend=code.cannabrands.app/creationshop/cannaiq-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper + - kubectl set image deployment/findadispo-frontend findadispo-frontend=code.cannabrands.app/creationshop/findadispo-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper + - kubectl set image deployment/findagram-frontend findagram-frontend=code.cannabrands.app/creationshop/findagram-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper + - kubectl rollout status deployment/scraper -n dispensary-scraper --timeout=300s + - kubectl rollout status deployment/scraper-worker -n dispensary-scraper --timeout=300s + - kubectl rollout status deployment/cannaiq-frontend -n dispensary-scraper --timeout=120s + - kubectl rollout status deployment/findadispo-frontend -n dispensary-scraper --timeout=120s + - kubectl rollout status deployment/findagram-frontend -n dispensary-scraper --timeout=120s + secrets: [kubeconfig_data] + when: + branch: master + event: push diff --git a/backend/.env b/backend/.env index 5fac8142..74a2486e 100644 --- a/backend/.env +++ b/backend/.env @@ -1,17 +1,30 @@ PORT=3010 NODE_ENV=development -# Database -DATABASE_URL=postgresql://dutchie:dutchie_local_pass@localhost:54320/dutchie_menus +# ============================================================================= +# CannaiQ Database (dutchie_menus) - PRIMARY DATABASE +# ============================================================================= +# This is where all schema migrations run and where canonical tables live. +# All CANNAIQ_DB_* variables are REQUIRED - connection will fail if missing. +CANNAIQ_DB_HOST=localhost +CANNAIQ_DB_PORT=54320 +CANNAIQ_DB_NAME=dutchie_menus +CANNAIQ_DB_USER=dutchie +CANNAIQ_DB_PASS=dutchie_local_pass -# MinIO (connecting to Docker from host) -MINIO_ENDPOINT=localhost -MINIO_PORT=9020 -MINIO_USE_SSL=false -MINIO_ACCESS_KEY=minioadmin -MINIO_SECRET_KEY=minioadmin -MINIO_BUCKET=dutchie -MINIO_PUBLIC_ENDPOINT=http://localhost:9020 +# ============================================================================= +# Legacy Database (dutchie_legacy) - READ-ONLY SOURCE +# ============================================================================= +# Used ONLY by ETL scripts to read historical data. +# NEVER run migrations against this database. +LEGACY_DB_HOST=localhost +LEGACY_DB_PORT=54320 +LEGACY_DB_NAME=dutchie_legacy +LEGACY_DB_USER=dutchie +LEGACY_DB_PASS=dutchie_local_pass + +# Local image storage (no MinIO per CLAUDE.md) +LOCAL_IMAGES_PATH=./public/images # JWT JWT_SECRET=your-secret-key-change-in-production diff --git a/backend/node_modules/.package-lock.json b/backend/node_modules/.package-lock.json index 37f4ccbb..4526ecb8 100644 --- a/backend/node_modules/.package-lock.json +++ b/backend/node_modules/.package-lock.json @@ -1,6 +1,6 @@ { "name": "dutchie-menus-backend", - "version": "1.0.0", + "version": "1.5.1", "lockfileVersion": 3, "requires": true, "packages": { @@ -575,6 +575,11 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, "node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", @@ -685,6 +690,46 @@ "node": ">=6" } }, + "node_modules/cheerio": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.1.2.tgz", + "integrity": "sha512-IkxPpb5rS/d1IiLbHMgfPuS0FgiWTtFIm/Nj+2woXDLTZ7fOT2eqzgYbdMlLweqlHbsZjxEChoVK+7iph7jyQg==", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.2", + "encoding-sniffer": "^0.2.1", + "htmlparser2": "^10.0.0", + "parse5": "^7.3.0", + "parse5-htmlparser2-tree-adapter": "^7.1.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^7.12.0", + "whatwg-mimetype": "^4.0.0" + }, + "engines": { + "node": ">=20.18.1" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -876,6 +921,32 @@ "node-fetch": "^2.6.12" } }, + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/data-uri-to-buffer": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", @@ -1002,6 +1073,57 @@ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1232444.tgz", "integrity": "sha512-pM27vqEfxSxRkTMnF+XCmxSEb6duO5R+t8A9DEEJgy4Wz2RVanje2mmj99B6A3zv2r/qGfYlOvYznUhuokizmg==" }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/dotenv": { "version": "16.6.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", @@ -1052,6 +1174,29 @@ "node": ">= 0.8" } }, + "node_modules/encoding-sniffer": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz", + "integrity": "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==", + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, + "node_modules/encoding-sniffer/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/end-of-stream": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", @@ -1060,6 +1205,17 @@ "once": "^1.4.0" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -1765,6 +1921,35 @@ "node": ">=16.0.0" } }, + "node_modules/htmlparser2": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.0.0.tgz", + "integrity": "sha512-TwAZM+zE5Tq3lrEHvOlvwgj1XLWQCtaaibSN11Q+gGBAS7Y1uZSWwXXRe4iF6OXnaq1riyQAPFOBtYc77Mxq0g==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.1", + "entities": "^6.0.0" + } + }, + "node_modules/htmlparser2/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -2530,6 +2715,17 @@ "set-blocking": "^2.0.0" } }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -2647,6 +2843,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "dependencies": { + "domhandler": "^5.0.3", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -4040,6 +4281,14 @@ "through": "^2.3.8" } }, + "node_modules/undici": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.16.0.tgz", + "integrity": "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==", + "engines": { + "node": ">=20.18.1" + } + }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", @@ -4128,6 +4377,36 @@ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "engines": { + "node": ">=18" + } + }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", diff --git a/backend/package-lock.json b/backend/package-lock.json index 7a703c09..0a430dc7 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -1,15 +1,16 @@ { "name": "dutchie-menus-backend", - "version": "1.0.0", + "version": "1.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dutchie-menus-backend", - "version": "1.0.0", + "version": "1.5.1", "dependencies": { "axios": "^1.6.2", "bcrypt": "^5.1.1", + "cheerio": "^1.1.2", "cors": "^2.8.5", "dotenv": "^16.3.1", "express": "^4.18.2", @@ -1015,6 +1016,11 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, "node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", @@ -1125,6 +1131,46 @@ "node": ">=6" } }, + "node_modules/cheerio": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.1.2.tgz", + "integrity": "sha512-IkxPpb5rS/d1IiLbHMgfPuS0FgiWTtFIm/Nj+2woXDLTZ7fOT2eqzgYbdMlLweqlHbsZjxEChoVK+7iph7jyQg==", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.2", + "encoding-sniffer": "^0.2.1", + "htmlparser2": "^10.0.0", + "parse5": "^7.3.0", + "parse5-htmlparser2-tree-adapter": "^7.1.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^7.12.0", + "whatwg-mimetype": "^4.0.0" + }, + "engines": { + "node": ">=20.18.1" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -1316,6 +1362,32 @@ "node-fetch": "^2.6.12" } }, + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/data-uri-to-buffer": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", @@ -1442,6 +1514,57 @@ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1232444.tgz", "integrity": "sha512-pM27vqEfxSxRkTMnF+XCmxSEb6duO5R+t8A9DEEJgy4Wz2RVanje2mmj99B6A3zv2r/qGfYlOvYznUhuokizmg==" }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/dotenv": { "version": "16.6.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", @@ -1492,6 +1615,29 @@ "node": ">= 0.8" } }, + "node_modules/encoding-sniffer": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz", + "integrity": "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==", + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, + "node_modules/encoding-sniffer/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/end-of-stream": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", @@ -1500,6 +1646,17 @@ "once": "^1.4.0" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -2219,6 +2376,35 @@ "node": ">=16.0.0" } }, + "node_modules/htmlparser2": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.0.0.tgz", + "integrity": "sha512-TwAZM+zE5Tq3lrEHvOlvwgj1XLWQCtaaibSN11Q+gGBAS7Y1uZSWwXXRe4iF6OXnaq1riyQAPFOBtYc77Mxq0g==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.1", + "entities": "^6.0.0" + } + }, + "node_modules/htmlparser2/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -2984,6 +3170,17 @@ "set-blocking": "^2.0.0" } }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3101,6 +3298,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "dependencies": { + "domhandler": "^5.0.3", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -4507,6 +4749,14 @@ "through": "^2.3.8" } }, + "node_modules/undici": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.16.0.tgz", + "integrity": "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==", + "engines": { + "node": ">=20.18.1" + } + }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", @@ -4595,6 +4845,36 @@ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "engines": { + "node": ">=18" + } + }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", diff --git a/cannaiq/dist/assets/index-B94shhsw.css b/cannaiq/dist/assets/index-B94shhsw.css deleted file mode 100644 index 12d7796e..00000000 --- a/cannaiq/dist/assets/index-B94shhsw.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root,[data-theme]{background-color:var(--fallback-b1,oklch(var(--b1)/1));color:var(--fallback-bc,oklch(var(--bc)/1))}@supports not (color: oklch(0% 0 0)){:root{color-scheme:light;--fallback-p: #491eff;--fallback-pc: #d4dbff;--fallback-s: #ff41c7;--fallback-sc: #fff9fc;--fallback-a: #00cfbd;--fallback-ac: #00100d;--fallback-n: #2b3440;--fallback-nc: #d7dde4;--fallback-b1: #ffffff;--fallback-b2: #e5e6e6;--fallback-b3: #e5e6e6;--fallback-bc: #1f2937;--fallback-in: #00b3f0;--fallback-inc: #000000;--fallback-su: #00ca92;--fallback-suc: #000000;--fallback-wa: #ffc22d;--fallback-wac: #000000;--fallback-er: #ff6f70;--fallback-erc: #000000}@media (prefers-color-scheme: dark){:root{color-scheme:dark;--fallback-p: #7582ff;--fallback-pc: #050617;--fallback-s: #ff71cf;--fallback-sc: #190211;--fallback-a: #00c7b5;--fallback-ac: #000e0c;--fallback-n: #2a323c;--fallback-nc: #a6adbb;--fallback-b1: #1d232a;--fallback-b2: #191e24;--fallback-b3: #15191e;--fallback-bc: #a6adbb;--fallback-in: #00b3f0;--fallback-inc: #000000;--fallback-su: #00ca92;--fallback-suc: #000000;--fallback-wa: #ffc22d;--fallback-wac: #000000;--fallback-er: #ff6f70;--fallback-erc: #000000}}}html{-webkit-tap-highlight-color:transparent}*{scrollbar-color:color-mix(in oklch,currentColor 35%,transparent) transparent}*:hover{scrollbar-color:color-mix(in oklch,currentColor 60%,transparent) transparent}:root{color-scheme:light;--in: 72.06% .191 231.6;--su: 64.8% .15 160;--wa: 84.71% .199 83.87;--er: 71.76% .221 22.18;--pc: 89.824% .06192 275.75;--ac: 15.352% .0368 183.61;--inc: 0% 0 0;--suc: 0% 0 0;--wac: 0% 0 0;--erc: 0% 0 0;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--p: 49.12% .3096 275.75;--s: 69.71% .329 342.55;--sc: 98.71% .0106 342.55;--a: 76.76% .184 183.61;--n: 32.1785% .02476 255.701624;--nc: 89.4994% .011585 252.096176;--b1: 100% 0 0;--b2: 96.1151% 0 0;--b3: 92.4169% .00108 197.137559;--bc: 27.8078% .029596 256.847952}@media (prefers-color-scheme: dark){:root{color-scheme:dark;--in: 72.06% .191 231.6;--su: 64.8% .15 160;--wa: 84.71% .199 83.87;--er: 71.76% .221 22.18;--pc: 13.138% .0392 275.75;--sc: 14.96% .052 342.55;--ac: 14.902% .0334 183.61;--inc: 0% 0 0;--suc: 0% 0 0;--wac: 0% 0 0;--erc: 0% 0 0;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--p: 65.69% .196 275.75;--s: 74.8% .26 342.55;--a: 74.51% .167 183.61;--n: 31.3815% .021108 254.139175;--nc: 74.6477% .0216 264.435964;--b1: 25.3267% .015896 252.417568;--b2: 23.2607% .013807 253.100675;--b3: 21.1484% .01165 254.087939;--bc: 74.6477% .0216 264.435964}}[data-theme=light]{color-scheme:light;--in: 72.06% .191 231.6;--su: 64.8% .15 160;--wa: 84.71% .199 83.87;--er: 71.76% .221 22.18;--pc: 89.824% .06192 275.75;--ac: 15.352% .0368 183.61;--inc: 0% 0 0;--suc: 0% 0 0;--wac: 0% 0 0;--erc: 0% 0 0;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--p: 49.12% .3096 275.75;--s: 69.71% .329 342.55;--sc: 98.71% .0106 342.55;--a: 76.76% .184 183.61;--n: 32.1785% .02476 255.701624;--nc: 89.4994% .011585 252.096176;--b1: 100% 0 0;--b2: 96.1151% 0 0;--b3: 92.4169% .00108 197.137559;--bc: 27.8078% .029596 256.847952}[data-theme=dark]{color-scheme:dark;--in: 72.06% .191 231.6;--su: 64.8% .15 160;--wa: 84.71% .199 83.87;--er: 71.76% .221 22.18;--pc: 13.138% .0392 275.75;--sc: 14.96% .052 342.55;--ac: 14.902% .0334 183.61;--inc: 0% 0 0;--suc: 0% 0 0;--wac: 0% 0 0;--erc: 0% 0 0;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--p: 65.69% .196 275.75;--s: 74.8% .26 342.55;--a: 74.51% .167 183.61;--n: 31.3815% .021108 254.139175;--nc: 74.6477% .0216 264.435964;--b1: 25.3267% .015896 252.417568;--b2: 23.2607% .013807 253.100675;--b3: 21.1484% .01165 254.087939;--bc: 74.6477% .0216 264.435964}[data-theme=cupcake]{color-scheme:light;--in: 72.06% .191 231.6;--su: 64.8% .15 160;--wa: 84.71% .199 83.87;--er: 71.76% .221 22.18;--pc: 15.2344% .017892 200.026556;--sc: 15.787% .020249 356.29965;--ac: 15.8762% .029206 78.618794;--nc: 84.7148% .013247 313.189598;--inc: 0% 0 0;--suc: 0% 0 0;--wac: 0% 0 0;--erc: 0% 0 0;--rounded-box: 1rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--p: 76.172% .089459 200.026556;--s: 78.9351% .101246 356.29965;--a: 79.3811% .146032 78.618794;--n: 23.5742% .066235 313.189598;--b1: 97.7882% .00418 56.375637;--b2: 93.9822% .007638 61.449292;--b3: 91.5861% .006811 53.440502;--bc: 23.5742% .066235 313.189598;--rounded-btn: 1.9rem;--tab-border: 2px;--tab-radius: .7rem}.alert{display:grid;width:100%;grid-auto-flow:row;align-content:flex-start;align-items:center;justify-items:center;gap:1rem;text-align:center;border-radius:var(--rounded-box, 1rem);border-width:1px;--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));padding:1rem;--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--alert-bg: var(--fallback-b2,oklch(var(--b2)/1));--alert-bg-mix: var(--fallback-b1,oklch(var(--b1)/1));background-color:var(--alert-bg)}@media (min-width: 640px){.alert{grid-auto-flow:column;grid-template-columns:auto minmax(auto,1fr);justify-items:start;text-align:start}}.avatar.placeholder>div{display:flex;align-items:center;justify-content:center}.badge{display:inline-flex;align-items:center;justify-content:center;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.2s;height:1.25rem;font-size:.875rem;line-height:1.25rem;width:-moz-fit-content;width:fit-content;padding-left:.563rem;padding-right:.563rem;border-radius:var(--rounded-badge, 1.9rem);border-width:1px;--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)))}@media (hover:hover){.label a:hover{--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)))}.menu li>*:not(ul,.menu-title,details,.btn):active,.menu li>*:not(ul,.menu-title,details,.btn).active,.menu li>details>summary:active{--tw-bg-opacity: 1;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)))}.tab:hover{--tw-text-opacity: 1}.table tr.hover:hover,.table tr.hover:nth-child(2n):hover{--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)))}.table-zebra tr.hover:hover,.table-zebra tr.hover:nth-child(2n):hover{--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)))}}.btn{display:inline-flex;height:3rem;min-height:3rem;flex-shrink:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-wrap:wrap;align-items:center;justify-content:center;border-radius:var(--rounded-btn, .5rem);border-color:transparent;border-color:oklch(var(--btn-color, var(--b2)) / var(--tw-border-opacity));padding-left:1rem;padding-right:1rem;text-align:center;font-size:.875rem;line-height:1em;gap:.5rem;font-weight:600;text-decoration-line:none;transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);border-width:var(--border-btn, 1px);transition-property:color,background-color,border-color,opacity,box-shadow,transform;--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);outline-color:var(--fallback-bc,oklch(var(--bc)/1));background-color:oklch(var(--btn-color, var(--b2)) / var(--tw-bg-opacity));--tw-bg-opacity: 1;--tw-border-opacity: 1}.btn-disabled,.btn[disabled],.btn:disabled{pointer-events:none}.btn-circle{height:3rem;width:3rem;border-radius:9999px;padding:0}:where(.btn:is(input[type=checkbox])),:where(.btn:is(input[type=radio])){width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none}.btn:is(input[type=checkbox]):after,.btn:is(input[type=radio]):after{--tw-content: attr(aria-label);content:var(--tw-content)}.card{position:relative;display:flex;flex-direction:column;border-radius:var(--rounded-box, 1rem)}.card:focus{outline:2px solid transparent;outline-offset:2px}.card-body{display:flex;flex:1 1 auto;flex-direction:column;padding:var(--padding-card, 2rem);gap:.5rem}.card-body :where(p){flex-grow:1}.card-actions{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.5rem}.card figure{display:flex;align-items:center;justify-content:center}.card.image-full{display:grid}.card.image-full:before{position:relative;content:"";z-index:10;border-radius:var(--rounded-box, 1rem);--tw-bg-opacity: 1;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));opacity:.75}.card.image-full:before,.card.image-full>*{grid-column-start:1;grid-row-start:1}.card.image-full>figure img{height:100%;-o-object-fit:cover;object-fit:cover}.card.image-full>.card-body{position:relative;z-index:20;--tw-text-opacity: 1;color:var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)))}.carousel{display:inline-flex;overflow-x:scroll;scroll-snap-type:x mandatory;scroll-behavior:smooth;-ms-overflow-style:none;scrollbar-width:none}.checkbox{flex-shrink:0;--chkbg: var(--fallback-bc,oklch(var(--bc)/1));--chkfg: var(--fallback-b1,oklch(var(--b1)/1));height:1.5rem;width:1.5rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--rounded-btn, .5rem);border-width:1px;border-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));--tw-border-opacity: .2}.collapse:not(td):not(tr):not(colgroup){visibility:visible}.collapse{position:relative;display:grid;overflow:hidden;grid-template-rows:max-content 0fr;transition:grid-template-rows .2s;width:100%;border-radius:var(--rounded-box, 1rem)}.collapse-title,.collapse>input[type=checkbox],.collapse>input[type=radio],.collapse-content{grid-column-start:1;grid-row-start:1}.collapse>input[type=checkbox],.collapse>input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0}:where(.collapse>input[type=checkbox]),:where(.collapse>input[type=radio]){height:100%;width:100%;z-index:1}.collapse[open],.collapse-open,.collapse:focus:not(.collapse-close){grid-template-rows:max-content 1fr}.collapse:not(.collapse-close):has(>input[type=checkbox]:checked),.collapse:not(.collapse-close):has(>input[type=radio]:checked){grid-template-rows:max-content 1fr}.collapse[open]>.collapse-content,.collapse-open>.collapse-content,.collapse:focus:not(.collapse-close)>.collapse-content,.collapse:not(.collapse-close)>input[type=checkbox]:checked~.collapse-content,.collapse:not(.collapse-close)>input[type=radio]:checked~.collapse-content{visibility:visible;min-height:-moz-fit-content;min-height:fit-content}.dropdown{position:relative;display:inline-block}.dropdown>*:not(summary):focus{outline:2px solid transparent;outline-offset:2px}.dropdown .dropdown-content{position:absolute}.dropdown:is(:not(details)) .dropdown-content{visibility:hidden;opacity:0;transform-origin:top;--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.2s}.dropdown.dropdown-open .dropdown-content,.dropdown:not(.dropdown-hover):focus .dropdown-content,.dropdown:focus-within .dropdown-content{visibility:visible;opacity:1}@media (hover: hover){.dropdown.dropdown-hover:hover .dropdown-content{visibility:visible;opacity:1}.btm-nav>*.disabled:hover,.btm-nav>*[disabled]:hover{pointer-events:none;--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}.btn:hover{--tw-border-opacity: 1;border-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn:hover{background-color:color-mix(in oklab,oklch(var(--btn-color, var(--b2)) / var(--tw-bg-opacity, 1)) 90%,black);border-color:color-mix(in oklab,oklch(var(--btn-color, var(--b2)) / var(--tw-border-opacity, 1)) 90%,black)}}@supports not (color: oklch(0% 0 0)){.btn:hover{background-color:var(--btn-color, var(--fallback-b2));border-color:var(--btn-color, var(--fallback-b2))}}.btn.glass:hover{--glass-opacity: 25%;--glass-border-opacity: 15%}.btn-ghost:hover{border-color:transparent}@supports (color: oklch(0% 0 0)){.btn-ghost:hover{background-color:var(--fallback-bc,oklch(var(--bc)/.2))}}.btn-outline:hover{--tw-border-opacity: 1;border-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-b1,oklch(var(--b1)/var(--tw-text-opacity)))}.btn-outline.btn-primary:hover{--tw-text-opacity: 1;color:var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-primary:hover{background-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black)}}.btn-outline.btn-secondary:hover{--tw-text-opacity: 1;color:var(--fallback-sc,oklch(var(--sc)/var(--tw-text-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-secondary:hover{background-color:color-mix(in oklab,var(--fallback-s,oklch(var(--s)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-s,oklch(var(--s)/1)) 90%,black)}}.btn-outline.btn-accent:hover{--tw-text-opacity: 1;color:var(--fallback-ac,oklch(var(--ac)/var(--tw-text-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-accent:hover{background-color:color-mix(in oklab,var(--fallback-a,oklch(var(--a)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-a,oklch(var(--a)/1)) 90%,black)}}.btn-outline.btn-success:hover{--tw-text-opacity: 1;color:var(--fallback-suc,oklch(var(--suc)/var(--tw-text-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-success:hover{background-color:color-mix(in oklab,var(--fallback-su,oklch(var(--su)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-su,oklch(var(--su)/1)) 90%,black)}}.btn-outline.btn-info:hover{--tw-text-opacity: 1;color:var(--fallback-inc,oklch(var(--inc)/var(--tw-text-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-info:hover{background-color:color-mix(in oklab,var(--fallback-in,oklch(var(--in)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-in,oklch(var(--in)/1)) 90%,black)}}.btn-outline.btn-warning:hover{--tw-text-opacity: 1;color:var(--fallback-wac,oklch(var(--wac)/var(--tw-text-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-warning:hover{background-color:color-mix(in oklab,var(--fallback-wa,oklch(var(--wa)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-wa,oklch(var(--wa)/1)) 90%,black)}}.btn-outline.btn-error:hover{--tw-text-opacity: 1;color:var(--fallback-erc,oklch(var(--erc)/var(--tw-text-opacity)))}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-error:hover{background-color:color-mix(in oklab,var(--fallback-er,oklch(var(--er)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-er,oklch(var(--er)/1)) 90%,black)}}.btn-disabled:hover,.btn[disabled]:hover,.btn:disabled:hover{--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .2;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}@supports (color: color-mix(in oklab,black,black)){.btn:is(input[type=checkbox]:checked):hover,.btn:is(input[type=radio]:checked):hover{background-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black)}}.dropdown.dropdown-hover:hover .dropdown-content{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):not(.active,.btn):hover,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):not(.active,.btn):hover{cursor:pointer;outline:2px solid transparent;outline-offset:2px}@supports (color: oklch(0% 0 0)){:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):not(.active,.btn):hover,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):not(.active,.btn):hover{background-color:var(--fallback-bc,oklch(var(--bc)/.1))}}.tab[disabled],.tab[disabled]:hover{cursor:not-allowed;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}}.dropdown:is(details) summary::-webkit-details-marker{display:none}.footer{display:grid;width:100%;grid-auto-flow:row;place-items:start;-moz-column-gap:1rem;column-gap:1rem;row-gap:2.5rem;font-size:.875rem;line-height:1.25rem}.footer>*{display:grid;place-items:start;gap:.5rem}@media (min-width: 48rem){.footer{grid-auto-flow:column}.footer-center{grid-auto-flow:row dense}}.label{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;justify-content:space-between;padding:.5rem .25rem}.input{flex-shrink:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:3rem;padding-left:1rem;padding-right:1rem;font-size:1rem;line-height:2;line-height:1.5rem;border-radius:var(--rounded-btn, .5rem);border-width:1px;border-color:transparent;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.input[type=number]::-webkit-inner-spin-button,.input-md[type=number]::-webkit-inner-spin-button{margin-top:-1rem;margin-bottom:-1rem;margin-inline-end:-1rem}.input-sm[type=number]::-webkit-inner-spin-button{margin-top:0;margin-bottom:0;margin-inline-end:-0px}.join{display:inline-flex;align-items:stretch;border-radius:var(--rounded-btn, .5rem)}.join :where(.join-item){border-start-end-radius:0;border-end-end-radius:0;border-end-start-radius:0;border-start-start-radius:0}.join .join-item:not(:first-child):not(:last-child),.join *:not(:first-child):not(:last-child) .join-item{border-start-end-radius:0;border-end-end-radius:0;border-end-start-radius:0;border-start-start-radius:0}.join .join-item:first-child:not(:last-child),.join *:first-child:not(:last-child) .join-item{border-start-end-radius:0;border-end-end-radius:0}.join .dropdown .join-item:first-child:not(:last-child),.join *:first-child:not(:last-child) .dropdown .join-item{border-start-end-radius:inherit;border-end-end-radius:inherit}.join :where(.join-item:first-child:not(:last-child)),.join :where(*:first-child:not(:last-child) .join-item){border-end-start-radius:inherit;border-start-start-radius:inherit}.join .join-item:last-child:not(:first-child),.join *:last-child:not(:first-child) .join-item{border-end-start-radius:0;border-start-start-radius:0}.join :where(.join-item:last-child:not(:first-child)),.join :where(*:last-child:not(:first-child) .join-item){border-start-end-radius:inherit;border-end-end-radius:inherit}@supports not selector(:has(*)){:where(.join *){border-radius:inherit}}@supports selector(:has(*)){:where(.join *:has(.join-item)){border-radius:inherit}}.link{cursor:pointer;text-decoration-line:underline}.menu{display:flex;flex-direction:column;flex-wrap:wrap;font-size:.875rem;line-height:1.25rem;padding:.5rem}.menu :where(li ul){position:relative;white-space:nowrap;margin-inline-start:1rem;padding-inline-start:.5rem}.menu :where(li:not(.menu-title)>*:not(ul,details,.menu-title,.btn)),.menu :where(li:not(.menu-title)>details>summary:not(.menu-title)){display:grid;grid-auto-flow:column;align-content:flex-start;align-items:center;gap:.5rem;grid-auto-columns:minmax(auto,max-content) auto max-content;-webkit-user-select:none;-moz-user-select:none;user-select:none}.menu li.disabled{cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;user-select:none;color:var(--fallback-bc,oklch(var(--bc)/.3))}.menu :where(li>.menu-dropdown:not(.menu-dropdown-show)){display:none}:where(.menu li){position:relative;display:flex;flex-shrink:0;flex-direction:column;flex-wrap:wrap;align-items:stretch}:where(.menu li) .badge{justify-self:end}.progress{position:relative;width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;overflow:hidden;height:.5rem;border-radius:var(--rounded-box, 1rem);background-color:var(--fallback-bc,oklch(var(--bc)/.2))}.range{height:1.5rem;width:100%;cursor:pointer;-moz-appearance:none;appearance:none;-webkit-appearance:none;--range-shdw: var(--fallback-bc,oklch(var(--bc)/1));overflow:hidden;border-radius:var(--rounded-box, 1rem);background-color:transparent}.range:focus{outline:none}.select{display:inline-flex;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:3rem;min-height:3rem;padding-inline-start:1rem;padding-inline-end:2.5rem;font-size:.875rem;line-height:1.25rem;line-height:2;border-radius:var(--rounded-btn, .5rem);border-width:1px;border-color:transparent;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 20px) calc(1px + 50%),calc(100% - 16.1px) calc(1px + 50%);background-size:4px 4px,4px 4px;background-repeat:no-repeat}.select[multiple]{height:auto}.stats{display:inline-grid;border-radius:var(--rounded-box, 1rem);--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)))}:where(.stats){grid-auto-flow:column;overflow-x:auto}.stat{display:inline-grid;width:100%;grid-template-columns:repeat(1,1fr);-moz-column-gap:1rem;column-gap:1rem;border-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));--tw-border-opacity: .1;padding:1rem 1.5rem}.stat-title{grid-column-start:1;white-space:nowrap;color:var(--fallback-bc,oklch(var(--bc)/.6))}.stat-value{grid-column-start:1;white-space:nowrap;font-size:2.25rem;line-height:2.5rem;font-weight:800}.stat-desc{grid-column-start:1;white-space:nowrap;font-size:.75rem;line-height:1rem;color:var(--fallback-bc,oklch(var(--bc)/.6))}.steps .step{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));grid-template-columns:auto;grid-template-rows:repeat(2,minmax(0,1fr));grid-template-rows:40px 1fr;place-items:center;text-align:center;min-width:4rem}.tabs-lifted:has(.tab-content[class^=rounded-]) .tab:first-child:not(:is(.tab-active,[aria-selected=true])),.tabs-lifted:has(.tab-content[class*=" rounded-"]) .tab:first-child:not(:is(.tab-active,[aria-selected=true])){border-bottom-color:transparent}.tab{position:relative;grid-row-start:1;display:inline-flex;height:2rem;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;flex-wrap:wrap;align-items:center;justify-content:center;text-align:center;font-size:.875rem;line-height:1.25rem;line-height:2;--tab-padding: 1rem;--tw-text-opacity: .5;--tab-color: var(--fallback-bc,oklch(var(--bc)/1));--tab-bg: var(--fallback-b1,oklch(var(--b1)/1));--tab-border-color: var(--fallback-b3,oklch(var(--b3)/1));color:var(--tab-color);padding-inline-start:var(--tab-padding, 1rem);padding-inline-end:var(--tab-padding, 1rem)}.tab:is(input[type=radio]){width:auto;border-bottom-right-radius:0;border-bottom-left-radius:0}.tab:is(input[type=radio]):after{--tw-content: attr(aria-label);content:var(--tw-content)}.tab:not(input):empty{cursor:default;grid-column-start:span 9999}input.tab:checked+.tab-content,:is(.tab-active,[aria-selected=true])+.tab-content{display:block}.table{position:relative;width:100%;border-radius:var(--rounded-box, 1rem);text-align:left;font-size:.875rem;line-height:1.25rem}.table :where(.table-pin-rows thead tr){position:sticky;top:0;z-index:1;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.table :where(.table-pin-rows tfoot tr){position:sticky;bottom:0;z-index:1;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.table :where(.table-pin-cols tr th){position:sticky;left:0;right:0;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.table-zebra tbody tr:nth-child(2n) :where(.table-pin-cols tr th){--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)))}.textarea{min-height:3rem;flex-shrink:1;padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem;line-height:2;border-radius:var(--rounded-btn, .5rem);border-width:1px;border-color:transparent;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.toggle{flex-shrink:0;--tglbg: var(--fallback-b1,oklch(var(--b1)/1));--handleoffset: 1.5rem;--handleoffsetcalculator: calc(var(--handleoffset) * -1);--togglehandleborder: 0 0;height:1.5rem;width:3rem;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--rounded-badge, 1.9rem);border-width:1px;border-color:currentColor;background-color:currentColor;color:var(--fallback-bc,oklch(var(--bc)/.5));transition:background,box-shadow var(--animation-input, .2s) ease-out;box-shadow:var(--handleoffsetcalculator) 0 0 2px var(--tglbg) inset,0 0 0 2px var(--tglbg) inset,var(--togglehandleborder)}.alert-info{border-color:var(--fallback-in,oklch(var(--in)/.2));--tw-text-opacity: 1;color:var(--fallback-inc,oklch(var(--inc)/var(--tw-text-opacity)));--alert-bg: var(--fallback-in,oklch(var(--in)/1));--alert-bg-mix: var(--fallback-b1,oklch(var(--b1)/1))}.alert-error{border-color:var(--fallback-er,oklch(var(--er)/.2));--tw-text-opacity: 1;color:var(--fallback-erc,oklch(var(--erc)/var(--tw-text-opacity)));--alert-bg: var(--fallback-er,oklch(var(--er)/1));--alert-bg-mix: var(--fallback-b1,oklch(var(--b1)/1))}.badge-primary{--tw-border-opacity: 1;border-color:var(--fallback-p,oklch(var(--p)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-p,oklch(var(--p)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)))}.badge-secondary{--tw-border-opacity: 1;border-color:var(--fallback-s,oklch(var(--s)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-s,oklch(var(--s)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-sc,oklch(var(--sc)/var(--tw-text-opacity)))}.badge-accent{--tw-border-opacity: 1;border-color:var(--fallback-a,oklch(var(--a)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-a,oklch(var(--a)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-ac,oklch(var(--ac)/var(--tw-text-opacity)))}.badge-info{border-color:transparent;--tw-bg-opacity: 1;background-color:var(--fallback-in,oklch(var(--in)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-inc,oklch(var(--inc)/var(--tw-text-opacity)))}.badge-success{border-color:transparent;--tw-bg-opacity: 1;background-color:var(--fallback-su,oklch(var(--su)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-suc,oklch(var(--suc)/var(--tw-text-opacity)))}.badge-warning{border-color:transparent;--tw-bg-opacity: 1;background-color:var(--fallback-wa,oklch(var(--wa)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-wac,oklch(var(--wac)/var(--tw-text-opacity)))}.badge-error{border-color:transparent;--tw-bg-opacity: 1;background-color:var(--fallback-er,oklch(var(--er)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-erc,oklch(var(--erc)/var(--tw-text-opacity)))}.badge-ghost{--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)))}.badge-outline.badge-primary{--tw-text-opacity: 1;color:var(--fallback-p,oklch(var(--p)/var(--tw-text-opacity)))}.badge-outline.badge-secondary{--tw-text-opacity: 1;color:var(--fallback-s,oklch(var(--s)/var(--tw-text-opacity)))}.badge-outline.badge-accent{--tw-text-opacity: 1;color:var(--fallback-a,oklch(var(--a)/var(--tw-text-opacity)))}.badge-outline.badge-info{--tw-text-opacity: 1;color:var(--fallback-in,oklch(var(--in)/var(--tw-text-opacity)))}.badge-outline.badge-success{--tw-text-opacity: 1;color:var(--fallback-su,oklch(var(--su)/var(--tw-text-opacity)))}.badge-outline.badge-warning{--tw-text-opacity: 1;color:var(--fallback-wa,oklch(var(--wa)/var(--tw-text-opacity)))}.badge-outline.badge-error{--tw-text-opacity: 1;color:var(--fallback-er,oklch(var(--er)/var(--tw-text-opacity)))}.btm-nav>*:where(.active){border-top-width:2px;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.btm-nav>*.disabled,.btm-nav>*[disabled]{pointer-events:none;--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}.btm-nav>* .label{font-size:1rem;line-height:1.5rem}@media (prefers-reduced-motion: no-preference){.btn{animation:button-pop var(--animation-btn, .25s) ease-out}}.btn:active:hover,.btn:active:focus{animation:button-pop 0s ease-out;transform:scale(var(--btn-focus-scale, .97))}@supports not (color: oklch(0% 0 0)){.btn{background-color:var(--btn-color, var(--fallback-b2));border-color:var(--btn-color, var(--fallback-b2))}.btn-primary{--btn-color: var(--fallback-p)}.btn-secondary{--btn-color: var(--fallback-s)}.btn-error{--btn-color: var(--fallback-er)}}@supports (color: color-mix(in oklab,black,black)){.btn-outline.btn-primary.btn-active{background-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 90%,black)}.btn-outline.btn-secondary.btn-active{background-color:color-mix(in oklab,var(--fallback-s,oklch(var(--s)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-s,oklch(var(--s)/1)) 90%,black)}.btn-outline.btn-accent.btn-active{background-color:color-mix(in oklab,var(--fallback-a,oklch(var(--a)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-a,oklch(var(--a)/1)) 90%,black)}.btn-outline.btn-success.btn-active{background-color:color-mix(in oklab,var(--fallback-su,oklch(var(--su)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-su,oklch(var(--su)/1)) 90%,black)}.btn-outline.btn-info.btn-active{background-color:color-mix(in oklab,var(--fallback-in,oklch(var(--in)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-in,oklch(var(--in)/1)) 90%,black)}.btn-outline.btn-warning.btn-active{background-color:color-mix(in oklab,var(--fallback-wa,oklch(var(--wa)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-wa,oklch(var(--wa)/1)) 90%,black)}.btn-outline.btn-error.btn-active{background-color:color-mix(in oklab,var(--fallback-er,oklch(var(--er)/1)) 90%,black);border-color:color-mix(in oklab,var(--fallback-er,oklch(var(--er)/1)) 90%,black)}}.btn:focus-visible{outline-style:solid;outline-width:2px;outline-offset:2px}.btn-primary{--tw-text-opacity: 1;color:var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)));outline-color:var(--fallback-p,oklch(var(--p)/1))}@supports (color: oklch(0% 0 0)){.btn-primary{--btn-color: var(--p)}.btn-secondary{--btn-color: var(--s)}.btn-error{--btn-color: var(--er)}}.btn-secondary{--tw-text-opacity: 1;color:var(--fallback-sc,oklch(var(--sc)/var(--tw-text-opacity)));outline-color:var(--fallback-s,oklch(var(--s)/1))}.btn-error{--tw-text-opacity: 1;color:var(--fallback-erc,oklch(var(--erc)/var(--tw-text-opacity)));outline-color:var(--fallback-er,oklch(var(--er)/1))}.btn.glass{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);outline-color:currentColor}.btn.glass.btn-active{--glass-opacity: 25%;--glass-border-opacity: 15%}.btn-ghost{border-width:1px;border-color:transparent;background-color:transparent;color:currentColor;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);outline-color:currentColor}.btn-ghost.btn-active{border-color:transparent;background-color:var(--fallback-bc,oklch(var(--bc)/.2))}.btn-outline{border-color:currentColor;background-color:transparent;--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.btn-outline.btn-active{--tw-border-opacity: 1;border-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-b1,oklch(var(--b1)/var(--tw-text-opacity)))}.btn-outline.btn-primary{--tw-text-opacity: 1;color:var(--fallback-p,oklch(var(--p)/var(--tw-text-opacity)))}.btn-outline.btn-primary.btn-active{--tw-text-opacity: 1;color:var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)))}.btn-outline.btn-secondary{--tw-text-opacity: 1;color:var(--fallback-s,oklch(var(--s)/var(--tw-text-opacity)))}.btn-outline.btn-secondary.btn-active{--tw-text-opacity: 1;color:var(--fallback-sc,oklch(var(--sc)/var(--tw-text-opacity)))}.btn-outline.btn-accent{--tw-text-opacity: 1;color:var(--fallback-a,oklch(var(--a)/var(--tw-text-opacity)))}.btn-outline.btn-accent.btn-active{--tw-text-opacity: 1;color:var(--fallback-ac,oklch(var(--ac)/var(--tw-text-opacity)))}.btn-outline.btn-success{--tw-text-opacity: 1;color:var(--fallback-su,oklch(var(--su)/var(--tw-text-opacity)))}.btn-outline.btn-success.btn-active{--tw-text-opacity: 1;color:var(--fallback-suc,oklch(var(--suc)/var(--tw-text-opacity)))}.btn-outline.btn-info{--tw-text-opacity: 1;color:var(--fallback-in,oklch(var(--in)/var(--tw-text-opacity)))}.btn-outline.btn-info.btn-active{--tw-text-opacity: 1;color:var(--fallback-inc,oklch(var(--inc)/var(--tw-text-opacity)))}.btn-outline.btn-warning{--tw-text-opacity: 1;color:var(--fallback-wa,oklch(var(--wa)/var(--tw-text-opacity)))}.btn-outline.btn-warning.btn-active{--tw-text-opacity: 1;color:var(--fallback-wac,oklch(var(--wac)/var(--tw-text-opacity)))}.btn-outline.btn-error{--tw-text-opacity: 1;color:var(--fallback-er,oklch(var(--er)/var(--tw-text-opacity)))}.btn-outline.btn-error.btn-active{--tw-text-opacity: 1;color:var(--fallback-erc,oklch(var(--erc)/var(--tw-text-opacity)))}.btn.btn-disabled,.btn[disabled],.btn:disabled{--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .2;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}.btn:is(input[type=checkbox]:checked),.btn:is(input[type=radio]:checked){--tw-border-opacity: 1;border-color:var(--fallback-p,oklch(var(--p)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-p,oklch(var(--p)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)))}.btn:is(input[type=checkbox]:checked):focus-visible,.btn:is(input[type=radio]:checked):focus-visible{outline-color:var(--fallback-p,oklch(var(--p)/1))}@keyframes button-pop{0%{transform:scale(var(--btn-focus-scale, .98))}40%{transform:scale(1.02)}to{transform:scale(1)}}.card :where(figure:first-child){overflow:hidden;border-start-start-radius:inherit;border-start-end-radius:inherit;border-end-start-radius:unset;border-end-end-radius:unset}.card :where(figure:last-child){overflow:hidden;border-start-start-radius:unset;border-start-end-radius:unset;border-end-start-radius:inherit;border-end-end-radius:inherit}.card:focus-visible{outline:2px solid currentColor;outline-offset:2px}.card.bordered{border-width:1px;--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)))}.card.compact .card-body{padding:1rem;font-size:.875rem;line-height:1.25rem}.card-title{display:flex;align-items:center;gap:.5rem;font-size:1.25rem;line-height:1.75rem;font-weight:600}.card.image-full :where(figure){overflow:hidden;border-radius:inherit}.carousel::-webkit-scrollbar{display:none}.checkbox:focus{box-shadow:none}.checkbox:focus-visible{outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:var(--fallback-bc,oklch(var(--bc)/1))}.checkbox:disabled{border-width:0px;cursor:not-allowed;border-color:transparent;--tw-bg-opacity: 1;background-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));opacity:.2}.checkbox:checked,.checkbox[aria-checked=true]{background-repeat:no-repeat;animation:checkmark var(--animation-input, .2s) ease-out;background-color:var(--chkbg);background-image:linear-gradient(-45deg,transparent 65%,var(--chkbg) 65.99%),linear-gradient(45deg,transparent 75%,var(--chkbg) 75.99%),linear-gradient(-45deg,var(--chkbg) 40%,transparent 40.99%),linear-gradient(45deg,var(--chkbg) 30%,var(--chkfg) 30.99%,var(--chkfg) 40%,transparent 40.99%),linear-gradient(-45deg,var(--chkfg) 50%,var(--chkbg) 50.99%)}.checkbox:indeterminate{--tw-bg-opacity: 1;background-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));background-repeat:no-repeat;animation:checkmark var(--animation-input, .2s) ease-out;background-image:linear-gradient(90deg,transparent 80%,var(--chkbg) 80%),linear-gradient(-90deg,transparent 80%,var(--chkbg) 80%),linear-gradient(0deg,var(--chkbg) 43%,var(--chkfg) 43%,var(--chkfg) 57%,var(--chkbg) 57%)}@keyframes checkmark{0%{background-position-y:5px}50%{background-position-y:-2px}to{background-position-y:0}}details.collapse{width:100%}details.collapse summary{position:relative;display:block;outline:2px solid transparent;outline-offset:2px}details.collapse summary::-webkit-details-marker{display:none}.collapse:focus-visible{outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:var(--fallback-bc,oklch(var(--bc)/1))}.collapse:has(.collapse-title:focus-visible),.collapse:has(>input[type=checkbox]:focus-visible),.collapse:has(>input[type=radio]:focus-visible){outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:var(--fallback-bc,oklch(var(--bc)/1))}.collapse:not(.collapse-open):not(.collapse-close)>input[type=checkbox],.collapse:not(.collapse-open):not(.collapse-close)>input[type=radio]:not(:checked),.collapse:not(.collapse-open):not(.collapse-close)>.collapse-title{cursor:pointer}.collapse:focus:not(.collapse-open):not(.collapse-close):not(.collapse[open])>.collapse-title{cursor:unset}.collapse-title,:where(.collapse>input[type=checkbox]),:where(.collapse>input[type=radio]){padding:1rem;padding-inline-end:3rem;min-height:3.75rem;transition:background-color .2s ease-out}.collapse[open]>:where(.collapse-content),.collapse-open>:where(.collapse-content),.collapse:focus:not(.collapse-close)>:where(.collapse-content),.collapse:not(.collapse-close)>:where(input[type=checkbox]:checked~.collapse-content),.collapse:not(.collapse-close)>:where(input[type=radio]:checked~.collapse-content){padding-bottom:1rem;transition:padding .2s ease-out,background-color .2s ease-out}.collapse[open].collapse-arrow>.collapse-title:after,.collapse-open.collapse-arrow>.collapse-title:after,.collapse-arrow:focus:not(.collapse-close)>.collapse-title:after,.collapse-arrow:not(.collapse-close)>input[type=checkbox]:checked~.collapse-title:after,.collapse-arrow:not(.collapse-close)>input[type=radio]:checked~.collapse-title:after{--tw-translate-y: -50%;--tw-rotate: 225deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.collapse[open].collapse-plus>.collapse-title:after,.collapse-open.collapse-plus>.collapse-title:after,.collapse-plus:focus:not(.collapse-close)>.collapse-title:after,.collapse-plus:not(.collapse-close)>input[type=checkbox]:checked~.collapse-title:after,.collapse-plus:not(.collapse-close)>input[type=radio]:checked~.collapse-title:after{content:"−"}.dropdown.dropdown-open .dropdown-content,.dropdown:focus .dropdown-content,.dropdown:focus-within .dropdown-content{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.input input{--tw-bg-opacity: 1;background-color:var(--fallback-p,oklch(var(--p)/var(--tw-bg-opacity)));background-color:transparent}.input input:focus{outline:2px solid transparent;outline-offset:2px}.input[list]::-webkit-calendar-picker-indicator{line-height:1em}.input-bordered{border-color:var(--fallback-bc,oklch(var(--bc)/.2))}.input:focus,.input:focus-within{box-shadow:none;border-color:var(--fallback-bc,oklch(var(--bc)/.2));outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:var(--fallback-bc,oklch(var(--bc)/.2))}.input:has(>input[disabled]),.input-disabled,.input:disabled,.input[disabled]{cursor:not-allowed;--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));color:var(--fallback-bc,oklch(var(--bc)/.4))}.input:has(>input[disabled])::-moz-placeholder,.input-disabled::-moz-placeholder,.input:disabled::-moz-placeholder,.input[disabled]::-moz-placeholder{color:var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));--tw-placeholder-opacity: .2}.input:has(>input[disabled])::placeholder,.input-disabled::placeholder,.input:disabled::placeholder,.input[disabled]::placeholder{color:var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));--tw-placeholder-opacity: .2}.input:has(>input[disabled])>input[disabled]{cursor:not-allowed}.input::-webkit-date-and-time-value{text-align:inherit}.join>:where(*:not(:first-child)){margin-top:0;margin-bottom:0;margin-inline-start:-1px}.join>:where(*:not(:first-child)):is(.btn){margin-inline-start:calc(var(--border-btn) * -1)}.link-primary{--tw-text-opacity: 1;color:var(--fallback-p,oklch(var(--p)/var(--tw-text-opacity)))}@supports (color:color-mix(in oklab,black,black)){@media (hover:hover){.link-primary:hover{color:color-mix(in oklab,var(--fallback-p,oklch(var(--p)/1)) 80%,black)}}}.link:focus{outline:2px solid transparent;outline-offset:2px}.link:focus-visible{outline:2px solid currentColor;outline-offset:2px}.loading{pointer-events:none;display:inline-block;aspect-ratio:1 / 1;width:1.5rem;background-color:currentColor;-webkit-mask-size:100%;mask-size:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='black' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform-origin='center'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='2s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dasharray' values='0,150;42,150;42,150' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dashoffset' values='0;-16;-59' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='black' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform-origin='center'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='2s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dasharray' values='0,150;42,150;42,150' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dashoffset' values='0;-16;-59' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/g%3E%3C/svg%3E")}.loading-spinner{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='black' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform-origin='center'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='2s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dasharray' values='0,150;42,150;42,150' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dashoffset' values='0;-16;-59' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='black' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform-origin='center'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='2s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dasharray' values='0,150;42,150;42,150' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dashoffset' values='0;-16;-59' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/g%3E%3C/svg%3E")}.loading-xs{width:1rem}.loading-lg{width:2.5rem}:where(.menu li:empty){--tw-bg-opacity: 1;background-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));opacity:.1;margin:.5rem 1rem;height:1px}.menu :where(li ul):before{position:absolute;bottom:.75rem;inset-inline-start:0px;top:.75rem;width:1px;--tw-bg-opacity: 1;background-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));opacity:.1;content:""}.menu :where(li:not(.menu-title)>*:not(ul,details,.menu-title,.btn)),.menu :where(li:not(.menu-title)>details>summary:not(.menu-title)){border-radius:var(--rounded-btn, .5rem);padding:.5rem 1rem;text-align:start;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.2s;text-wrap:balance}:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):not(summary,.active,.btn).focus,:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):not(summary,.active,.btn):focus,:where(.menu li:not(.menu-title,.disabled)>*:not(ul,details,.menu-title)):is(summary):not(.active,.btn):focus-visible,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):not(summary,.active,.btn).focus,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):not(summary,.active,.btn):focus,:where(.menu li:not(.menu-title,.disabled)>details>summary:not(.menu-title)):is(summary):not(.active,.btn):focus-visible{cursor:pointer;background-color:var(--fallback-bc,oklch(var(--bc)/.1));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));outline:2px solid transparent;outline-offset:2px}.menu li>*:not(ul,.menu-title,details,.btn):active,.menu li>*:not(ul,.menu-title,details,.btn).active,.menu li>details>summary:active{--tw-bg-opacity: 1;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)))}.menu :where(li>details>summary)::-webkit-details-marker{display:none}.menu :where(li>details>summary):after,.menu :where(li>.menu-dropdown-toggle):after{justify-self:end;display:block;margin-top:-.5rem;height:.5rem;width:.5rem;transform:rotate(45deg);transition-property:transform,margin-top;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);content:"";transform-origin:75% 75%;box-shadow:2px 2px;pointer-events:none}.menu :where(li>details[open]>summary):after,.menu :where(li>.menu-dropdown-toggle.menu-dropdown-show):after{transform:rotate(225deg);margin-top:0}.mockup-phone .display{overflow:hidden;border-radius:40px;margin-top:-25px}.mockup-browser .mockup-browser-toolbar .input{position:relative;margin-left:auto;margin-right:auto;display:block;height:1.75rem;width:24rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));padding-left:2rem;direction:ltr}.mockup-browser .mockup-browser-toolbar .input:before{content:"";position:absolute;left:.5rem;top:50%;aspect-ratio:1 / 1;height:.75rem;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:2px;border-color:currentColor;opacity:.6}.mockup-browser .mockup-browser-toolbar .input:after{content:"";position:absolute;left:1.25rem;top:50%;height:.5rem;--tw-translate-y: 25%;--tw-rotate: -45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;border-color:currentColor;opacity:.6}@keyframes modal-pop{0%{opacity:0}}.progress::-moz-progress-bar{border-radius:var(--rounded-box, 1rem);background-color:currentColor}.progress:indeterminate{--progress-color: var(--fallback-bc,oklch(var(--bc)/1));background-image:repeating-linear-gradient(90deg,var(--progress-color) -1%,var(--progress-color) 10%,transparent 10%,transparent 90%);background-size:200%;background-position-x:15%;animation:progress-loading 5s ease-in-out infinite}.progress::-webkit-progress-bar{border-radius:var(--rounded-box, 1rem);background-color:transparent}.progress::-webkit-progress-value{border-radius:var(--rounded-box, 1rem);background-color:currentColor}.progress:indeterminate::-moz-progress-bar{background-color:transparent;background-image:repeating-linear-gradient(90deg,var(--progress-color) -1%,var(--progress-color) 10%,transparent 10%,transparent 90%);background-size:200%;background-position-x:15%;animation:progress-loading 5s ease-in-out infinite}@keyframes progress-loading{50%{background-position-x:-115%}}@keyframes radiomark{0%{box-shadow:0 0 0 12px var(--fallback-b1,oklch(var(--b1)/1)) inset,0 0 0 12px var(--fallback-b1,oklch(var(--b1)/1)) inset}50%{box-shadow:0 0 0 3px var(--fallback-b1,oklch(var(--b1)/1)) inset,0 0 0 3px var(--fallback-b1,oklch(var(--b1)/1)) inset}to{box-shadow:0 0 0 4px var(--fallback-b1,oklch(var(--b1)/1)) inset,0 0 0 4px var(--fallback-b1,oklch(var(--b1)/1)) inset}}.range:focus-visible::-webkit-slider-thumb{--focus-shadow: 0 0 0 6px var(--fallback-b1,oklch(var(--b1)/1)) inset, 0 0 0 2rem var(--range-shdw) inset}.range:focus-visible::-moz-range-thumb{--focus-shadow: 0 0 0 6px var(--fallback-b1,oklch(var(--b1)/1)) inset, 0 0 0 2rem var(--range-shdw) inset}.range::-webkit-slider-runnable-track{height:.5rem;width:100%;border-radius:var(--rounded-box, 1rem);background-color:var(--fallback-bc,oklch(var(--bc)/.1))}.range::-moz-range-track{height:.5rem;width:100%;border-radius:var(--rounded-box, 1rem);background-color:var(--fallback-bc,oklch(var(--bc)/.1))}.range::-webkit-slider-thumb{position:relative;height:1.5rem;width:1.5rem;border-radius:var(--rounded-box, 1rem);border-style:none;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));-moz-appearance:none;appearance:none;-webkit-appearance:none;top:50%;color:var(--range-shdw);transform:translateY(-50%);--filler-size: 100rem;--filler-offset: .6rem;box-shadow:0 0 0 3px var(--range-shdw) inset,var(--focus-shadow, 0 0),calc(var(--filler-size) * -1 - var(--filler-offset)) 0 0 var(--filler-size)}.range::-moz-range-thumb{position:relative;height:1.5rem;width:1.5rem;border-radius:var(--rounded-box, 1rem);border-style:none;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));top:50%;color:var(--range-shdw);--filler-size: 100rem;--filler-offset: .5rem;box-shadow:0 0 0 3px var(--range-shdw) inset,var(--focus-shadow, 0 0),calc(var(--filler-size) * -1 - var(--filler-offset)) 0 0 var(--filler-size)}@keyframes rating-pop{0%{transform:translateY(-.125em)}40%{transform:translateY(-.125em)}to{transform:translateY(0)}}.select-bordered{border-color:var(--fallback-bc,oklch(var(--bc)/.2))}.select:focus{box-shadow:none;border-color:var(--fallback-bc,oklch(var(--bc)/.2));outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:var(--fallback-bc,oklch(var(--bc)/.2))}.select-disabled,.select:disabled,.select[disabled]{cursor:not-allowed;--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));color:var(--fallback-bc,oklch(var(--bc)/.4))}.select-disabled::-moz-placeholder,.select:disabled::-moz-placeholder,.select[disabled]::-moz-placeholder{color:var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));--tw-placeholder-opacity: .2}.select-disabled::placeholder,.select:disabled::placeholder,.select[disabled]::placeholder{color:var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));--tw-placeholder-opacity: .2}.select-multiple,.select[multiple],.select[size].select:not([size="1"]){background-image:none;padding-right:1rem}[dir=rtl] .select{background-position:calc(0% + 12px) calc(1px + 50%),calc(0% + 16px) calc(1px + 50%)}@keyframes skeleton{0%{background-position:150%}to{background-position:-50%}}:where(.stats)>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)));--tw-divide-y-reverse: 0;border-top-width:calc(0px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(0px * var(--tw-divide-y-reverse))}[dir=rtl] .stats>*:not([hidden])~*:not([hidden]){--tw-divide-x-reverse: 1}.steps .step:before{top:0;grid-column-start:1;grid-row-start:1;height:.5rem;width:100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));content:"";margin-inline-start:-100%}.steps .step:after{content:counter(step);counter-increment:step;z-index:1;position:relative;grid-column-start:1;grid-row-start:1;display:grid;height:2rem;width:2rem;place-items:center;place-self:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)))}.steps .step:first-child:before{content:none}.steps .step[data-content]:after{content:attr(data-content)}.tabs-lifted>.tab:focus-visible{border-end-end-radius:0;border-end-start-radius:0}.tab:is(.tab-active,[aria-selected=true]):not(.tab-disabled):not([disabled]),.tab:is(input:checked){border-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));--tw-border-opacity: 1;--tw-text-opacity: 1}.tab:focus{outline:2px solid transparent;outline-offset:2px}.tab:focus-visible{outline:2px solid currentColor;outline-offset:-5px}.tab-disabled,.tab[disabled]{cursor:not-allowed;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}.tabs-bordered>.tab{border-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));--tw-border-opacity: .2;border-style:solid;border-bottom-width:calc(var(--tab-border, 1px) + 1px)}.tabs-lifted>.tab{border:var(--tab-border, 1px) solid transparent;border-width:0 0 var(--tab-border, 1px) 0;border-start-start-radius:var(--tab-radius, .5rem);border-start-end-radius:var(--tab-radius, .5rem);border-bottom-color:var(--tab-border-color);padding-inline-start:var(--tab-padding, 1rem);padding-inline-end:var(--tab-padding, 1rem);padding-top:var(--tab-border, 1px)}.tabs-lifted>.tab:is(.tab-active,[aria-selected=true]):not(.tab-disabled):not([disabled]),.tabs-lifted>.tab:is(input:checked){background-color:var(--tab-bg);border-width:var(--tab-border, 1px) var(--tab-border, 1px) 0 var(--tab-border, 1px);border-inline-start-color:var(--tab-border-color);border-inline-end-color:var(--tab-border-color);border-top-color:var(--tab-border-color);padding-inline-start:calc(var(--tab-padding, 1rem) - var(--tab-border, 1px));padding-inline-end:calc(var(--tab-padding, 1rem) - var(--tab-border, 1px));padding-bottom:var(--tab-border, 1px);padding-top:0}.tabs-lifted>.tab:is(.tab-active,[aria-selected=true]):not(.tab-disabled):not([disabled]):before,.tabs-lifted>.tab:is(input:checked):before{z-index:1;content:"";display:block;position:absolute;width:calc(100% + var(--tab-radius, .5rem) * 2);height:var(--tab-radius, .5rem);bottom:0;background-size:var(--tab-radius, .5rem);background-position:top left,top right;background-repeat:no-repeat;--tab-grad: calc(69% - var(--tab-border, 1px));--radius-start: radial-gradient( circle at top left, transparent var(--tab-grad), var(--tab-border-color) calc(var(--tab-grad) + .25px), var(--tab-border-color) calc(var(--tab-grad) + var(--tab-border, 1px)), var(--tab-bg) calc(var(--tab-grad) + var(--tab-border, 1px) + .25px) );--radius-end: radial-gradient( circle at top right, transparent var(--tab-grad), var(--tab-border-color) calc(var(--tab-grad) + .25px), var(--tab-border-color) calc(var(--tab-grad) + var(--tab-border, 1px)), var(--tab-bg) calc(var(--tab-grad) + var(--tab-border, 1px) + .25px) );background-image:var(--radius-start),var(--radius-end)}.tabs-lifted>.tab:is(.tab-active,[aria-selected=true]):not(.tab-disabled):not([disabled]):first-child:before,.tabs-lifted>.tab:is(input:checked):first-child:before{background-image:var(--radius-end);background-position:top right}[dir=rtl] .tabs-lifted>.tab:is(.tab-active,[aria-selected=true]):not(.tab-disabled):not([disabled]):first-child:before,[dir=rtl] .tabs-lifted>.tab:is(input:checked):first-child:before{background-image:var(--radius-start);background-position:top left}.tabs-lifted>.tab:is(.tab-active,[aria-selected=true]):not(.tab-disabled):not([disabled]):last-child:before,.tabs-lifted>.tab:is(input:checked):last-child:before{background-image:var(--radius-start);background-position:top left}[dir=rtl] .tabs-lifted>.tab:is(.tab-active,[aria-selected=true]):not(.tab-disabled):not([disabled]):last-child:before,[dir=rtl] .tabs-lifted>.tab:is(input:checked):last-child:before{background-image:var(--radius-end);background-position:top right}.tabs-lifted>:is(.tab-active,[aria-selected=true]):not(.tab-disabled):not([disabled])+.tabs-lifted :is(.tab-active,[aria-selected=true]):not(.tab-disabled):not([disabled]):before,.tabs-lifted>.tab:is(input:checked)+.tabs-lifted .tab:is(input:checked):before{background-image:var(--radius-end);background-position:top right}.tabs-boxed .tab{border-radius:var(--rounded-btn, .5rem)}.table:where([dir=rtl],[dir=rtl] *){text-align:right}.table :where(th,td){padding:.75rem 1rem;vertical-align:middle}.table tr.active,.table tr.active:nth-child(2n),.table-zebra tbody tr:nth-child(2n){--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)))}.table-zebra tr.active,.table-zebra tr.active:nth-child(2n),.table-zebra-zebra tbody tr:nth-child(2n){--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)))}.table :where(thead tr,tbody tr:not(:last-child),tbody tr:first-child:last-child){border-bottom-width:1px;--tw-border-opacity: 1;border-bottom-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)))}.table :where(thead,tfoot){white-space:nowrap;font-size:.75rem;line-height:1rem;font-weight:700;color:var(--fallback-bc,oklch(var(--bc)/.6))}.table :where(tfoot){border-top-width:1px;--tw-border-opacity: 1;border-top-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)))}.textarea:focus{box-shadow:none;border-color:var(--fallback-bc,oklch(var(--bc)/.2));outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:var(--fallback-bc,oklch(var(--bc)/.2))}.textarea-disabled,.textarea:disabled,.textarea[disabled]{cursor:not-allowed;--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));color:var(--fallback-bc,oklch(var(--bc)/.4))}.textarea-disabled::-moz-placeholder,.textarea:disabled::-moz-placeholder,.textarea[disabled]::-moz-placeholder{color:var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));--tw-placeholder-opacity: .2}.textarea-disabled::placeholder,.textarea:disabled::placeholder,.textarea[disabled]::placeholder{color:var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));--tw-placeholder-opacity: .2}@keyframes toast-pop{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}[dir=rtl] .toggle{--handleoffsetcalculator: calc(var(--handleoffset) * 1)}.toggle:focus-visible{outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:var(--fallback-bc,oklch(var(--bc)/.2))}.toggle:hover{background-color:currentColor}.toggle:checked,.toggle[aria-checked=true]{background-image:none;--handleoffsetcalculator: var(--handleoffset);--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)))}[dir=rtl] .toggle:checked,[dir=rtl] .toggle[aria-checked=true]{--handleoffsetcalculator: calc(var(--handleoffset) * -1)}.toggle:indeterminate{--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));box-shadow:calc(var(--handleoffset) / 2) 0 0 2px var(--tglbg) inset,calc(var(--handleoffset) / -2) 0 0 2px var(--tglbg) inset,0 0 0 2px var(--tglbg) inset}[dir=rtl] .toggle:indeterminate{box-shadow:calc(var(--handleoffset) / 2) 0 0 2px var(--tglbg) inset,calc(var(--handleoffset) / -2) 0 0 2px var(--tglbg) inset,0 0 0 2px var(--tglbg) inset}.toggle:disabled{cursor:not-allowed;--tw-border-opacity: 1;border-color:var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));background-color:transparent;opacity:.3;--togglehandleborder: 0 0 0 3px var(--fallback-bc,oklch(var(--bc)/1)) inset, var(--handleoffsetcalculator) 0 0 3px var(--fallback-bc,oklch(var(--bc)/1)) inset}.artboard.phone{width:320px}.badge-sm{height:1rem;font-size:.75rem;line-height:1rem;padding-left:.438rem;padding-right:.438rem}.badge-lg{height:1.5rem;font-size:1rem;line-height:1.5rem;padding-left:.688rem;padding-right:.688rem}.btm-nav-xs>*:where(.active){border-top-width:1px}.btm-nav-sm>*:where(.active){border-top-width:2px}.btm-nav-md>*:where(.active){border-top-width:2px}.btm-nav-lg>*:where(.active){border-top-width:4px}.btn-xs{height:1.5rem;min-height:1.5rem;padding-left:.5rem;padding-right:.5rem;font-size:.75rem}.btn-sm{height:2rem;min-height:2rem;padding-left:.75rem;padding-right:.75rem;font-size:.875rem}.btn-square:where(.btn-xs){height:1.5rem;width:1.5rem;padding:0}.btn-square:where(.btn-sm){height:2rem;width:2rem;padding:0}.btn-circle:where(.btn-xs){height:1.5rem;width:1.5rem;border-radius:9999px;padding:0}.btn-circle:where(.btn-sm){height:2rem;width:2rem;border-radius:9999px;padding:0}.btn-circle:where(.btn-md){height:3rem;width:3rem;border-radius:9999px;padding:0}.btn-circle:where(.btn-lg){height:4rem;width:4rem;border-radius:9999px;padding:0}.input-sm{height:2rem;padding-left:.75rem;padding-right:.75rem;font-size:.875rem;line-height:2rem}.join.join-vertical{flex-direction:column}.join.join-vertical .join-item:first-child:not(:last-child),.join.join-vertical *:first-child:not(:last-child) .join-item{border-end-start-radius:0;border-end-end-radius:0;border-start-start-radius:inherit;border-start-end-radius:inherit}.join.join-vertical .join-item:last-child:not(:first-child),.join.join-vertical *:last-child:not(:first-child) .join-item{border-start-start-radius:0;border-start-end-radius:0;border-end-start-radius:inherit;border-end-end-radius:inherit}.join.join-horizontal{flex-direction:row}.join.join-horizontal .join-item:first-child:not(:last-child),.join.join-horizontal *:first-child:not(:last-child) .join-item{border-end-end-radius:0;border-start-end-radius:0;border-end-start-radius:inherit;border-start-start-radius:inherit}.join.join-horizontal .join-item:last-child:not(:first-child),.join.join-horizontal *:last-child:not(:first-child) .join-item{border-end-start-radius:0;border-start-start-radius:0;border-end-end-radius:inherit;border-start-end-radius:inherit}.select-sm{height:2rem;min-height:2rem;padding-left:.75rem;padding-right:2rem;font-size:.875rem;line-height:2rem}[dir=rtl] .select-sm{padding-left:2rem;padding-right:.75rem}.steps-horizontal .step{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));place-items:center;text-align:center}.steps-vertical .step{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(1,minmax(0,1fr))}.tabs-md :where(.tab){height:2rem;font-size:.875rem;line-height:1.25rem;line-height:2;--tab-padding: 1rem}.tabs-lg :where(.tab){height:3rem;font-size:1.125rem;line-height:1.75rem;line-height:2;--tab-padding: 1.25rem}.tabs-sm :where(.tab){height:1.5rem;font-size:.875rem;line-height:.75rem;--tab-padding: .75rem}.tabs-xs :where(.tab){height:1.25rem;font-size:.75rem;line-height:.75rem;--tab-padding: .5rem}.card-compact .card-body{padding:1rem;font-size:.875rem;line-height:1.25rem}.card-compact .card-title{margin-bottom:.25rem}.card-normal .card-body{padding:var(--padding-card, 2rem);font-size:1rem;line-height:1.5rem}.card-normal .card-title{margin-bottom:.75rem}.join.join-vertical>:where(*:not(:first-child)){margin-left:0;margin-right:0;margin-top:-1px}.join.join-vertical>:where(*:not(:first-child)):is(.btn){margin-top:calc(var(--border-btn) * -1)}.join.join-horizontal>:where(*:not(:first-child)){margin-top:0;margin-bottom:0;margin-inline-start:-1px}.join.join-horizontal>:where(*:not(:first-child)):is(.btn){margin-inline-start:calc(var(--border-btn) * -1);margin-top:0}.steps-horizontal .step{grid-template-rows:40px 1fr;grid-template-columns:auto;min-width:4rem}.steps-horizontal .step:before{height:.5rem;width:100%;--tw-translate-x: 0px;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));content:"";margin-inline-start:-100%}.steps-horizontal .step:where([dir=rtl],[dir=rtl] *):before{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.steps-vertical .step{gap:.5rem;grid-template-columns:40px 1fr;grid-template-rows:auto;min-height:4rem;justify-items:start}.steps-vertical .step:before{height:100%;width:.5rem;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));margin-inline-start:50%}.steps-vertical .step:where([dir=rtl],[dir=rtl] *):before{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.table-xs :not(thead):not(tfoot) tr{font-size:.75rem;line-height:1rem}.table-xs :where(th,td){padding:.25rem .5rem}.table-sm :not(thead):not(tfoot) tr{font-size:.875rem;line-height:1.25rem}.table-sm :where(th,td){padding:.5rem .75rem}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-\[-150px\]{bottom:-150px}.left-3{left:.75rem}.left-\[-100px\]{left:-100px}.right-0{right:0}.right-2{right:.5rem}.right-\[-100px\]{right:-100px}.top-1\/2{top:50%}.top-2{top:.5rem}.top-\[-100px\]{top:-100px}.z-10{z-index:10}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-8{height:2rem}.h-\[400px\]{height:400px}.h-\[500px\]{height:500px}.h-full{height:100%}.max-h-\[90vh\]{max-height:90vh}.min-h-\[70vh\]{min-height:70vh}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-8{width:2rem}.w-\[120px\]{width:120px}.w-\[400px\]{width:400px}.w-\[500px\]{width:500px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-md{max-width:28rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity, 1))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity, 1))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity, 1))}.border-yellow-700{--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.border-t-blue-600{--tw-border-opacity: 1;border-top-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.bg-base-100{--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity, 1)))}.bg-base-200{--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity, 1)))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-cyan-50{--tw-bg-opacity: 1;background-color:rgb(236 254 255 / var(--tw-bg-opacity, 1))}.bg-emerald-100{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-indigo-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-pink-100{--tw-bg-opacity: 1;background-color:rgb(252 231 243 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/20{background-color:#fff3}.bg-white\/5{background-color:#ffffff0d}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-600{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-emerald-600{--tw-gradient-from: #059669 var(--tw-gradient-from-position);--tw-gradient-to: rgb(5 150 105 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-emerald-700{--tw-gradient-to: rgb(4 120 87 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #047857 var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-emerald-700{--tw-gradient-to: #047857 var(--tw-gradient-to-position)}.to-emerald-800{--tw-gradient-to: #065f46 var(--tw-gradient-to-position)}.to-teal-800{--tw-gradient-to: #115e59 var(--tw-gradient-to-position)}.stroke-current{stroke:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-12{padding:3rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pl-16{padding-left:4rem}.pr-3{padding-right:.75rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-6xl{font-size:3.75rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-5{line-height:1.25rem}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-wider{letter-spacing:.05em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-cyan-600{--tw-text-opacity: 1;color:rgb(8 145 178 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-error{--tw-text-opacity: 1;color:var(--fallback-er,oklch(var(--er)/var(--tw-text-opacity, 1)))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-indigo-900{--tw-text-opacity: 1;color:rgb(49 46 129 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-pink-700{--tw-text-opacity: 1;color:rgb(190 24 93 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:var(--fallback-p,oklch(var(--p)/var(--tw-text-opacity, 1)))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-red-900{--tw-text-opacity: 1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.text-success{--tw-text-opacity: 1;color:var(--fallback-su,oklch(var(--su)/var(--tw-text-opacity, 1)))}.text-warning{--tw-text-opacity: 1;color:var(--fallback-wa,oklch(var(--wa)/var(--tw-text-opacity, 1)))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/70{color:#ffffffb3}.text-white\/80{color:#fffc}.text-white\/90{color:#ffffffe6}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.opacity-25{opacity:.25}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.hover\:border-blue-300:hover{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.hover\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:border-orange-300:hover{--tw-border-opacity: 1;border-color:rgb(253 186 116 / var(--tw-border-opacity, 1))}.hover\:border-purple-300:hover{--tw-border-opacity: 1;border-color:rgb(216 180 254 / var(--tw-border-opacity, 1))}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-700:hover{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-50:hover{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-700:hover{--tw-bg-opacity: 1;background-color:rgb(4 120 87 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-700:hover{--tw-bg-opacity: 1;background-color:rgb(161 98 7 / var(--tw-bg-opacity, 1))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.hover\:text-emerald-700:hover{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-indigo-700:hover{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-red-800:hover{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.hover\:text-yellow-800:hover{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.hover\:shadow-2xl:hover{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-emerald-500:focus{--tw-border-opacity: 1;border-color:rgb(16 185 129 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-emerald-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(16 185 129 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width: 768px){.md\:col-span-2{grid-column:span 2 / span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-1\/2{width:50%}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}} diff --git a/cannaiq/dist/assets/index-Cg0c5RUA.js b/cannaiq/dist/assets/index-Cg0c5RUA.js deleted file mode 100644 index 196569fe..00000000 --- a/cannaiq/dist/assets/index-Cg0c5RUA.js +++ /dev/null @@ -1,421 +0,0 @@ -var Ek=Object.defineProperty;var Dk=(e,t,r)=>t in e?Ek(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var mo=(e,t,r)=>Dk(e,typeof t!="symbol"?t+"":t,r);function Tk(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();function Tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pv={exports:{}},_c={},_v={exports:{}},ie={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Vs=Symbol.for("react.element"),Mk=Symbol.for("react.portal"),Ik=Symbol.for("react.fragment"),$k=Symbol.for("react.strict_mode"),Lk=Symbol.for("react.profiler"),zk=Symbol.for("react.provider"),Rk=Symbol.for("react.context"),Bk=Symbol.for("react.forward_ref"),Fk=Symbol.for("react.suspense"),Wk=Symbol.for("react.memo"),Uk=Symbol.for("react.lazy"),hg=Symbol.iterator;function qk(e){return e===null||typeof e!="object"?null:(e=hg&&e[hg]||e["@@iterator"],typeof e=="function"?e:null)}var Cv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Av=Object.assign,Ov={};function ja(e,t,r){this.props=e,this.context=t,this.refs=Ov,this.updater=r||Cv}ja.prototype.isReactComponent={};ja.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")};ja.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ev(){}Ev.prototype=ja.prototype;function Ap(e,t,r){this.props=e,this.context=t,this.refs=Ov,this.updater=r||Cv}var Op=Ap.prototype=new Ev;Op.constructor=Ap;Av(Op,ja.prototype);Op.isPureReactComponent=!0;var mg=Array.isArray,Dv=Object.prototype.hasOwnProperty,Ep={current:null},Tv={key:!0,ref:!0,__self:!0,__source:!0};function Mv(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Dv.call(t,n)&&!Tv.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1>>1,H=O[F];if(0>>1;Fi(Me,L))Ei(J,Me)?(O[F]=J,O[E]=L,F=E):(O[F]=Me,O[re]=L,F=re);else if(Ei(J,L))O[F]=J,O[E]=L,F=E;else break e}}return k}function i(O,k){var L=O.sortIndex-k.sortIndex;return L!==0?L:O.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,f=null,p=3,m=!1,x=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,j=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(O){for(var k=r(d);k!==null;){if(k.callback===null)n(d);else if(k.startTime<=O)n(d),k.sortIndex=k.expirationTime,t(c,k);else break;k=r(d)}}function w(O){if(g=!1,y(O),!x)if(r(c)!==null)x=!0,P(S);else{var k=r(d);k!==null&&T(w,k.startTime-O)}}function S(O,k){x=!1,g&&(g=!1,b(C),C=-1),m=!0;var L=p;try{for(y(k),f=r(c);f!==null&&(!(f.expirationTime>k)||O&&!I());){var F=f.callback;if(typeof F=="function"){f.callback=null,p=f.priorityLevel;var H=F(f.expirationTime<=k);k=e.unstable_now(),typeof H=="function"?f.callback=H:f===r(c)&&n(c),y(k)}else n(c);f=r(c)}if(f!==null)var ee=!0;else{var re=r(d);re!==null&&T(w,re.startTime-k),ee=!1}return ee}finally{f=null,p=L,m=!1}}var N=!1,_=null,C=-1,D=5,M=-1;function I(){return!(e.unstable_now()-MO||125F?(O.sortIndex=L,t(d,O),r(c)===null&&O===r(d)&&(g?(b(C),C=-1):g=!0,T(w,L-F))):(O.sortIndex=H,t(c,O),x||m||(x=!0,P(S))),O},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(O){var k=p;return function(){var L=p;p=k;try{return O.apply(this,arguments)}finally{p=L}}}})(Bv);Rv.exports=Bv;var tP=Rv.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var rP=h,Ft=tP;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Md=Object.prototype.hasOwnProperty,nP=/^[: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]*$/,xg={},yg={};function iP(e){return Md.call(yg,e)?!0:Md.call(xg,e)?!1:nP.test(e)?yg[e]=!0:(xg[e]=!0,!1)}function aP(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function sP(e,t,r,n){if(t===null||typeof t>"u"||aP(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function vt(e,t,r,n,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){tt[e]=new vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];tt[t]=new vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){tt[e]=new vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){tt[e]=new vt(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){tt[e]=new vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){tt[e]=new vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){tt[e]=new vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){tt[e]=new vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){tt[e]=new vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tp=/[\-:]([a-z])/g;function Mp(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(Tp,Mp);tt[t]=new vt(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(Tp,Mp);tt[t]=new vt(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(Tp,Mp);tt[t]=new vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){tt[e]=new vt(e,1,!1,e.toLowerCase(),null,!1,!1)});tt.xlinkHref=new vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){tt[e]=new vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ip(e,t,r,n){var i=tt.hasOwnProperty(t)?tt[t]:null;(i!==null?i.type!==0:n||!(2l||i[o]!==s[l]){var c=` -`+i[o].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Ru=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Xa(e):""}function oP(e){switch(e.tag){case 5:return Xa(e.type);case 16:return Xa("Lazy");case 13:return Xa("Suspense");case 19:return Xa("SuspenseList");case 0:case 2:case 15:return e=Bu(e.type,!1),e;case 11:return e=Bu(e.type.render,!1),e;case 1:return e=Bu(e.type,!0),e;default:return""}}function zd(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 Li:return"Fragment";case $i:return"Portal";case Id:return"Profiler";case $p:return"StrictMode";case $d:return"Suspense";case Ld:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Uv:return(e.displayName||"Context")+".Consumer";case Wv:return(e._context.displayName||"Context")+".Provider";case Lp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case zp:return t=e.displayName||null,t!==null?t:zd(e.type)||"Memo";case gn:t=e._payload,e=e._init;try{return zd(e(t))}catch{}}return null}function lP(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("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zd(t);case 8:return t===$p?"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 $n(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Hv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cP(e){var t=Hv(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yo(e){e._valueTracker||(e._valueTracker=cP(e))}function Kv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Hv(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function dl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rd(e,t){var r=t.checked;return Ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function bg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=$n(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vv(e,t){t=t.checked,t!=null&&Ip(e,"checked",t,!1)}function Bd(e,t){Vv(e,t);var r=$n(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Fd(e,t.type,r):t.hasOwnProperty("defaultValue")&&Fd(e,t.type,$n(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Fd(e,t,r){(t!=="number"||dl(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ja=Array.isArray;function Xi(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=vo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gs(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ns={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},uP=["Webkit","ms","Moz","O"];Object.keys(ns).forEach(function(e){uP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ns[t]=ns[e]})});function Xv(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ns.hasOwnProperty(e)&&ns[e]?(""+t).trim():t+"px"}function Jv(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Xv(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var dP=Ne({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 qd(e,t){if(t){if(dP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function Hd(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 Kd=null;function Rp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vd=null,Ji=null,Qi=null;function Ng(e){if(e=Gs(e)){if(typeof Vd!="function")throw Error(W(280));var t=e.stateNode;t&&(t=Dc(t),Vd(e.stateNode,e.type,t))}}function Qv(e){Ji?Qi?Qi.push(e):Qi=[e]:Ji=e}function eb(){if(Ji){var e=Ji,t=Qi;if(Qi=Ji=null,Ng(e),t)for(e=0;e>>=0,e===0?32:31-(wP(e)/SP|0)|0}var bo=64,jo=4194304;function Qa(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 ml(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=Qa(l):(s&=o,s!==0&&(n=Qa(s)))}else o=r&~i,o!==0?n=Qa(o):s!==0&&(n=Qa(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Ys(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hr(t),e[t]=r}function _P(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=as),Tg=" ",Mg=!1;function bb(e,t){switch(e){case"keyup":return t_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zi=!1;function n_(e,t){switch(e){case"compositionend":return jb(t);case"keypress":return t.which!==32?null:(Mg=!0,Tg);case"textInput":return e=t.data,e===Tg&&Mg?null:e;default:return null}}function i_(e,t){if(zi)return e==="compositionend"||!Vp&&bb(e,t)?(e=yb(),Jo=qp=Sn=null,zi=!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)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=zg(r)}}function kb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pb(){for(var e=window,t=dl();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=dl(e.document)}return t}function Yp(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 p_(e){var t=Pb(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&kb(r.ownerDocument.documentElement,r)){if(n!==null&&Yp(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=Rg(r,s);var o=Rg(r,n);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(),s>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Ri=null,Qd=null,os=null,ef=!1;function Bg(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ef||Ri==null||Ri!==dl(n)||(n=Ri,"selectionStart"in n&&Yp(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),os&&ws(os,n)||(os=n,n=yl(Qd,"onSelect"),0Wi||(e.current=of[Wi],of[Wi]=null,Wi--)}function me(e,t){Wi++,of[Wi]=e.current,e.current=t}var Ln={},ct=Fn(Ln),Pt=Fn(!1),pi=Ln;function oa(e,t){var r=e.type.contextTypes;if(!r)return Ln;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function _t(e){return e=e.childContextTypes,e!=null}function bl(){ve(Pt),ve(ct)}function Vg(e,t,r){if(ct.current!==Ln)throw Error(W(168));me(ct,t),me(Pt,r)}function Ib(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(W(108,lP(e)||"Unknown",i));return Ne({},r,n)}function jl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ln,pi=ct.current,me(ct,e),me(Pt,Pt.current),!0}function Yg(e,t,r){var n=e.stateNode;if(!n)throw Error(W(169));r?(e=Ib(e,t,pi),n.__reactInternalMemoizedMergedChildContext=e,ve(Pt),ve(ct),me(ct,e)):ve(Pt),me(Pt,r)}var Lr=null,Tc=!1,ed=!1;function $b(e){Lr===null?Lr=[e]:Lr.push(e)}function k_(e){Tc=!0,$b(e)}function Wn(){if(!ed&&Lr!==null){ed=!0;var e=0,t=ce;try{var r=Lr;for(ce=1;e>=o,i-=o,Br=1<<32-hr(t)+i|r<C?(D=_,_=null):D=_.sibling;var M=p(b,_,y[C],w);if(M===null){_===null&&(_=D);break}e&&_&&M.alternate===null&&t(b,_),j=s(M,j,C),N===null?S=M:N.sibling=M,N=M,_=D}if(C===y.length)return r(b,_),be&&Zn(b,C),S;if(_===null){for(;CC?(D=_,_=null):D=_.sibling;var I=p(b,_,M.value,w);if(I===null){_===null&&(_=D);break}e&&_&&I.alternate===null&&t(b,_),j=s(I,j,C),N===null?S=I:N.sibling=I,N=I,_=D}if(M.done)return r(b,_),be&&Zn(b,C),S;if(_===null){for(;!M.done;C++,M=y.next())M=f(b,M.value,w),M!==null&&(j=s(M,j,C),N===null?S=M:N.sibling=M,N=M);return be&&Zn(b,C),S}for(_=n(b,_);!M.done;C++,M=y.next())M=m(_,b,C,M.value,w),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?C:M.key),j=s(M,j,C),N===null?S=M:N.sibling=M,N=M);return e&&_.forEach(function(A){return t(b,A)}),be&&Zn(b,C),S}function v(b,j,y,w){if(typeof y=="object"&&y!==null&&y.type===Li&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case xo:e:{for(var S=y.key,N=j;N!==null;){if(N.key===S){if(S=y.type,S===Li){if(N.tag===7){r(b,N.sibling),j=i(N,y.props.children),j.return=b,b=j;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===gn&&Xg(S)===N.type){r(b,N.sibling),j=i(N,y.props),j.ref=Fa(b,N,y),j.return=b,b=j;break e}r(b,N);break}else t(b,N);N=N.sibling}y.type===Li?(j=oi(y.props.children,b.mode,w,y.key),j.return=b,b=j):(w=sl(y.type,y.key,y.props,null,b.mode,w),w.ref=Fa(b,j,y),w.return=b,b=w)}return o(b);case $i:e:{for(N=y.key;j!==null;){if(j.key===N)if(j.tag===4&&j.stateNode.containerInfo===y.containerInfo&&j.stateNode.implementation===y.implementation){r(b,j.sibling),j=i(j,y.children||[]),j.return=b,b=j;break e}else{r(b,j);break}else t(b,j);j=j.sibling}j=ld(y,b.mode,w),j.return=b,b=j}return o(b);case gn:return N=y._init,v(b,j,N(y._payload),w)}if(Ja(y))return x(b,j,y,w);if($a(y))return g(b,j,y,w);Co(b,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,j!==null&&j.tag===6?(r(b,j.sibling),j=i(j,y),j.return=b,b=j):(r(b,j),j=od(y,b.mode,w),j.return=b,b=j),o(b)):r(b,j)}return v}var ca=Bb(!0),Fb=Bb(!1),Nl=Fn(null),kl=null,Hi=null,Jp=null;function Qp(){Jp=Hi=kl=null}function eh(e){var t=Nl.current;ve(Nl),e._currentValue=t}function uf(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ta(e,t){kl=e,Jp=Hi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Nt=!0),e.firstContext=null)}function tr(e){var t=e._currentValue;if(Jp!==e)if(e={context:e,memoizedValue:t,next:null},Hi===null){if(kl===null)throw Error(W(308));Hi=e,kl.dependencies={lanes:0,firstContext:e}}else Hi=Hi.next=e;return t}var ti=null;function th(e){ti===null?ti=[e]:ti.push(e)}function Wb(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,th(t)):(r.next=i.next,i.next=r),t.interleaved=r,Gr(e,n)}function Gr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var xn=!1;function rh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ub(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 qr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function On(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ae&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Gr(e,r)}return i=n.interleaved,i===null?(t.next=t,th(n)):(t.next=i.next,i.next=t),n.interleaved=t,Gr(e,r)}function el(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Fp(e,r)}}function Jg(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Pl(e,t,r,n){var i=e.updateQueue;xn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?s=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(s!==null){var f=i.baseState;o=0,u=d=c=null,l=s;do{var p=l.lane,m=l.eventTime;if((n&p)===p){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,g=l;switch(p=t,m=r,g.tag){case 1:if(x=g.payload,typeof x=="function"){f=x.call(m,f,p);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,p=typeof x=="function"?x.call(m,f,p):x,p==null)break e;f=Ne({},f,p);break e;case 2:xn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=f):u=u.next=m,o|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(u===null&&(c=f),i.baseState=c,i.firstBaseUpdate=d,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);gi|=o,e.lanes=o,e.memoizedState=f}}function Qg(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=rd.transition;rd.transition={};try{e(!1),t()}finally{ce=r,rd.transition=n}}function s1(){return rr().memoizedState}function A_(e,t,r){var n=Dn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},o1(e))l1(t,r);else if(r=Wb(e,t,r,n),r!==null){var i=gt();mr(r,e,n,i),c1(r,t,n)}}function O_(e,t,r){var n=Dn(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(o1(e))l1(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,r);if(i.hasEagerState=!0,i.eagerState=l,gr(l,o)){var c=t.interleaved;c===null?(i.next=i,th(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}r=Wb(e,t,i,n),r!==null&&(i=gt(),mr(r,e,n,i),c1(r,t,n))}}function o1(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function l1(e,t){ls=Cl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function c1(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Fp(e,r)}}var Al={readContext:tr,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useInsertionEffect:nt,useLayoutEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useMutableSource:nt,useSyncExternalStore:nt,useId:nt,unstable_isNewReconciler:!1},E_={readContext:tr,useCallback:function(e,t){return jr().memoizedState=[e,t===void 0?null:t],e},useContext:tr,useEffect:tx,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,rl(4194308,4,t1.bind(null,t,e),r)},useLayoutEffect:function(e,t){return rl(4194308,4,e,t)},useInsertionEffect:function(e,t){return rl(4,2,e,t)},useMemo:function(e,t){var r=jr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=jr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=A_.bind(null,Se,e),[n.memoizedState,e]},useRef:function(e){var t=jr();return e={current:e},t.memoizedState=e},useState:ex,useDebugValue:uh,useDeferredValue:function(e){return jr().memoizedState=e},useTransition:function(){var e=ex(!1),t=e[0];return e=C_.bind(null,e[1]),jr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Se,i=jr();if(be){if(r===void 0)throw Error(W(407));r=r()}else{if(r=t(),Ve===null)throw Error(W(349));mi&30||Vb(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,tx(Zb.bind(null,n,s,e),[e]),n.flags|=2048,Os(9,Yb.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=jr(),t=Ve.identifierPrefix;if(be){var r=Fr,n=Br;r=(n&~(1<<32-hr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Cs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Sr]=t,e[ks]=n,v1(e,t,!1,!1),t.stateNode=e;e:{switch(o=Hd(r,n),r){case"dialog":xe("cancel",e),xe("close",e),i=n;break;case"iframe":case"object":case"embed":xe("load",e),i=n;break;case"video":case"audio":for(i=0;ifa&&(t.flags|=128,n=!0,Wa(s,!1),t.lanes=4194304)}else{if(!n)if(e=_l(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Wa(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!be)return it(t),null}else 2*Ce()-s.renderingStartTime>fa&&r!==1073741824&&(t.flags|=128,n=!0,Wa(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ce(),t.sibling=null,r=we.current,me(we,n?r&1|2:r&1),t):(it(t),null);case 22:case 23:return gh(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?It&1073741824&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function R_(e,t){switch(Gp(t),t.tag){case 1:return _t(t.type)&&bl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ua(),ve(Pt),ve(ct),ah(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ih(t),null;case 13:if(ve(we),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ve(we),null;case 4:return ua(),null;case 10:return eh(t.type._context),null;case 22:case 23:return gh(),null;case 24:return null;default:return null}}var Oo=!1,st=!1,B_=typeof WeakSet=="function"?WeakSet:Set,K=null;function Ki(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ke(e,t,n)}else r.current=null}function vf(e,t,r){try{r()}catch(n){ke(e,t,n)}}var fx=!1;function F_(e,t){if(tf=gl,e=Pb(),Yp(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,d=0,u=0,f=e,p=null;t:for(;;){for(var m;f!==r||i!==0&&f.nodeType!==3||(l=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===r&&++d===i&&(l=o),p===s&&++u===n&&(c=o),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(rf={focusedElem:e,selectionRange:r},gl=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var g=x.memoizedProps,v=x.memoizedState,b=t.stateNode,j=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:cr(t.type,g),v);b.__reactInternalSnapshotBeforeUpdate=j}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(W(163))}}catch(w){ke(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return x=fx,fx=!1,x}function cs(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&vf(t,r,s)}i=i.next}while(i!==n)}}function $c(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function bf(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function w1(e){var t=e.alternate;t!==null&&(e.alternate=null,w1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Sr],delete t[ks],delete t[sf],delete t[S_],delete t[N_])),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 S1(e){return e.tag===5||e.tag===3||e.tag===4}function px(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||S1(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 e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=vl));else if(n!==4&&(e=e.child,e!==null))for(jf(e,t,r),e=e.sibling;e!==null;)jf(e,t,r),e=e.sibling}function wf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(wf(e,t,r),e=e.sibling;e!==null;)wf(e,t,r),e=e.sibling}var Xe=null,ur=!1;function mn(e,t,r){for(r=r.child;r!==null;)N1(e,t,r),r=r.sibling}function N1(e,t,r){if(kr&&typeof kr.onCommitFiberUnmount=="function")try{kr.onCommitFiberUnmount(Cc,r)}catch{}switch(r.tag){case 5:st||Ki(r,t);case 6:var n=Xe,i=ur;Xe=null,mn(e,t,r),Xe=n,ur=i,Xe!==null&&(ur?(e=Xe,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Xe.removeChild(r.stateNode));break;case 18:Xe!==null&&(ur?(e=Xe,r=r.stateNode,e.nodeType===8?Qu(e.parentNode,r):e.nodeType===1&&Qu(e,r),bs(e)):Qu(Xe,r.stateNode));break;case 4:n=Xe,i=ur,Xe=r.stateNode.containerInfo,ur=!0,mn(e,t,r),Xe=n,ur=i;break;case 0:case 11:case 14:case 15:if(!st&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&vf(r,t,o),i=i.next}while(i!==n)}mn(e,t,r);break;case 1:if(!st&&(Ki(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){ke(r,t,l)}mn(e,t,r);break;case 21:mn(e,t,r);break;case 22:r.mode&1?(st=(n=st)||r.memoizedState!==null,mn(e,t,r),st=n):mn(e,t,r);break;default:mn(e,t,r)}}function hx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new B_),t.forEach(function(n){var i=G_.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function lr(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Ce()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*U_(n/1960))-n,10e?16:e,Nn===null)var n=!1;else{if(e=Nn,Nn=null,Dl=0,ae&6)throw Error(W(331));var i=ae;for(ae|=4,K=e.current;K!==null;){var s=K,o=s.child;if(K.flags&16){var l=s.deletions;if(l!==null){for(var c=0;cCe()-hh?si(e,0):ph|=r),Ct(e,t)}function D1(e,t){t===0&&(e.mode&1?(t=jo,jo<<=1,!(jo&130023424)&&(jo=4194304)):t=1);var r=gt();e=Gr(e,t),e!==null&&(Ys(e,t,r),Ct(e,r))}function Z_(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),D1(e,r)}function G_(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(W(314))}n!==null&&n.delete(t),D1(e,r)}var T1;T1=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)Nt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Nt=!1,L_(e,t,r);Nt=!!(e.flags&131072)}else Nt=!1,be&&t.flags&1048576&&Lb(t,Sl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;nl(e,t),e=t.pendingProps;var i=oa(t,ct.current);ta(t,r),i=oh(null,t,n,e,i,r);var s=lh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_t(n)?(s=!0,jl(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,rh(t),i.updater=Ic,t.stateNode=i,i._reactInternals=t,ff(t,n,e,r),t=mf(null,t,n,!0,s,r)):(t.tag=0,be&&s&&Zp(t),ht(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(nl(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=J_(n),e=cr(n,e),i){case 0:t=hf(null,t,n,e,r);break e;case 1:t=cx(null,t,n,e,r);break e;case 11:t=ox(null,t,n,e,r);break e;case 14:t=lx(null,t,n,cr(n.type,e),r);break e}throw Error(W(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cr(n,i),hf(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cr(n,i),cx(e,t,n,i,r);case 3:e:{if(g1(t),e===null)throw Error(W(387));n=t.pendingProps,s=t.memoizedState,i=s.element,Ub(e,t),Pl(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=da(Error(W(423)),t),t=ux(e,t,n,r,i);break e}else if(n!==i){i=da(Error(W(424)),t),t=ux(e,t,n,r,i);break e}else for(zt=An(t.stateNode.containerInfo.firstChild),Rt=t,be=!0,dr=null,r=Fb(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(la(),n===i){t=Xr(e,t,r);break e}ht(e,t,n,r)}t=t.child}return t;case 5:return qb(t),e===null&&cf(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,nf(n,i)?o=null:s!==null&&nf(n,s)&&(t.flags|=32),m1(e,t),ht(e,t,o,r),t.child;case 6:return e===null&&cf(t),null;case 13:return x1(e,t,r);case 4:return nh(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ca(t,null,n,r):ht(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cr(n,i),ox(e,t,n,i,r);case 7:return ht(e,t,t.pendingProps,r),t.child;case 8:return ht(e,t,t.pendingProps.children,r),t.child;case 12:return ht(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,me(Nl,n._currentValue),n._currentValue=o,s!==null)if(gr(s.value,o)){if(s.children===i.children&&!Pt.current){t=Xr(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=qr(-1,r&-r),c.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),uf(s.return,r,t),l.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(W(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),uf(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ht(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ta(t,r),i=tr(i),n=n(i),t.flags|=1,ht(e,t,n,r),t.child;case 14:return n=t.type,i=cr(n,t.pendingProps),i=cr(n.type,i),lx(e,t,n,i,r);case 15:return p1(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cr(n,i),nl(e,t),t.tag=1,_t(n)?(e=!0,jl(t)):e=!1,ta(t,r),u1(t,n,i),ff(t,n,i,r),mf(null,t,n,!0,e,r);case 19:return y1(e,t,r);case 22:return h1(e,t,r)}throw Error(W(156,t.tag))};function M1(e,t){return ob(e,t)}function X_(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,r,n){return new X_(e,t,r,n)}function yh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function J_(e){if(typeof e=="function")return yh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Lp)return 11;if(e===zp)return 14}return 2}function Tn(e,t){var r=e.alternate;return r===null?(r=Gt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function sl(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")yh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Li:return oi(r.children,i,s,t);case $p:o=8,i|=8;break;case Id:return e=Gt(12,r,t,i|2),e.elementType=Id,e.lanes=s,e;case $d:return e=Gt(13,r,t,i),e.elementType=$d,e.lanes=s,e;case Ld:return e=Gt(19,r,t,i),e.elementType=Ld,e.lanes=s,e;case qv:return zc(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Wv:o=10;break e;case Uv:o=9;break e;case Lp:o=11;break e;case zp:o=14;break e;case gn:o=16,n=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=Gt(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function oi(e,t,r,n){return e=Gt(7,e,n,t),e.lanes=r,e}function zc(e,t,r,n){return e=Gt(22,e,n,t),e.elementType=qv,e.lanes=r,e.stateNode={isHidden:!1},e}function od(e,t,r){return e=Gt(6,e,null,t),e.lanes=r,e}function ld(e,t,r){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Q_(e,t,r,n,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=Wu(0),this.expirationTimes=Wu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wu(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function vh(e,t,r,n,i,s,o,l,c){return e=new Q_(e,t,r,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Gt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},rh(s),e}function eC(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(z1)}catch(e){console.error(e)}}z1(),zv.exports=Ut;var Sh=zv.exports,wx=Sh;Td.createRoot=wx.createRoot,Td.hydrateRoot=wx.hydrateRoot;/** - * @remix-run/router v1.23.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Ds(){return Ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Nh(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sC(){return Math.random().toString(36).substr(2,8)}function Nx(e,t){return{usr:e.state,key:e.key,idx:t}}function _f(e,t,r,n){return r===void 0&&(r=null),Ds({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Na(t):t,{state:r,key:t&&t.key||n||sC()})}function Il(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Na(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function oC(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,l=kn.Pop,c=null,d=u();d==null&&(d=0,o.replaceState(Ds({},o.state,{idx:d}),""));function u(){return(o.state||{idx:null}).idx}function f(){l=kn.Pop;let v=u(),b=v==null?null:v-d;d=v,c&&c({action:l,location:g.location,delta:b})}function p(v,b){l=kn.Push;let j=_f(g.location,v,b);d=u()+1;let y=Nx(j,d),w=g.createHref(j);try{o.pushState(y,"",w)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(w)}s&&c&&c({action:l,location:g.location,delta:1})}function m(v,b){l=kn.Replace;let j=_f(g.location,v,b);d=u();let y=Nx(j,d),w=g.createHref(j);o.replaceState(y,"",w),s&&c&&c({action:l,location:g.location,delta:0})}function x(v){let b=i.location.origin!=="null"?i.location.origin:i.location.href,j=typeof v=="string"?v:Il(v);return j=j.replace(/ $/,"%20"),Ae(b,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,b)}let g={get action(){return l},get location(){return e(i,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Sx,f),c=v,()=>{i.removeEventListener(Sx,f),c=null}},createHref(v){return t(i,v)},createURL:x,encodeLocation(v){let b=x(v);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:p,replace:m,go(v){return o.go(v)}};return g}var kx;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(kx||(kx={}));function lC(e,t,r){return r===void 0&&(r="/"),cC(e,t,r)}function cC(e,t,r,n){let i=typeof t=="string"?Na(t):t,s=kh(i.pathname||"/",r);if(s==null)return null;let o=R1(e);uC(o);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(Ae(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let d=Mn([n,c.relativePath]),u=r.concat(c);s.children&&s.children.length>0&&(Ae(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),R1(s.children,t,u,d)),!(s.path==null&&!s.index)&&t.push({path:d,score:xC(d,s.index),routesMeta:u})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,o);else for(let c of B1(s.path))i(s,o,c)}),t}function B1(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=B1(n.join("/")),l=[];return l.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function uC(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:yC(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const dC=/^:[\w-]+$/,fC=3,pC=2,hC=1,mC=10,gC=-2,Px=e=>e==="*";function xC(e,t){let r=e.split("/"),n=r.length;return r.some(Px)&&(n+=gC),t&&(n+=pC),r.filter(i=>!Px(i)).reduce((i,s)=>i+(dC.test(s)?fC:s===""?hC:mC),n)}function yC(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function vC(e,t,r){let{routesMeta:n}=e,i={},s="/",o=[];for(let l=0;l{let{paramName:p,isOptional:m}=u;if(p==="*"){let g=l[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const x=l[f];return m&&!x?d[p]=void 0:d[p]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:o,pattern:e}}function jC(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Nh(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function wC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Nh(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function kh(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const SC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,NC=e=>SC.test(e);function kC(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Na(e):e,s;if(r)if(NC(r))s=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),Nh(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?s=_x(r.substring(1),"/"):s=_x(r,t)}else s=t;return{pathname:s,search:CC(n),hash:AC(i)}}function _x(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function cd(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function PC(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ph(e,t){let r=PC(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function _h(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Na(e):(i=Ds({},e),Ae(!i.pathname||!i.pathname.includes("?"),cd("?","pathname","search",i)),Ae(!i.pathname||!i.pathname.includes("#"),cd("#","pathname","hash",i)),Ae(!i.search||!i.search.includes("#"),cd("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,l;if(o==null)l=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}l=f>=0?t[f]:"/"}let c=kC(i,l),d=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Mn=e=>e.join("/").replace(/\/\/+/g,"/"),_C=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),CC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function OC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const F1=["post","put","patch","delete"];new Set(F1);const EC=["get",...F1];new Set(EC);/** - * React Router v6.30.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Ts(){return Ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),h.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let f=_h(d,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Mn([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,s,e])}function Pa(){let{matches:e}=h.useContext(ln),t=e[e.length-1];return t?t.params:{}}function q1(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=h.useContext(Un),{matches:i}=h.useContext(ln),{pathname:s}=_i(),o=JSON.stringify(Ph(i,n.v7_relativeSplatPath));return h.useMemo(()=>_h(e,JSON.parse(o),s,r==="path"),[e,o,s,r])}function IC(e,t){return $C(e,t)}function $C(e,t,r,n){ka()||Ae(!1);let{navigator:i}=h.useContext(Un),{matches:s}=h.useContext(ln),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=_i(),u;if(t){var f;let v=typeof t=="string"?Na(t):t;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||Ae(!1),u=v}else u=d;let p=u.pathname||"/",m=p;if(c!=="/"){let v=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let x=lC(e,{pathname:m}),g=FC(x&&x.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:Mn([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:Mn([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,r,n);return t&&g?h.createElement(Uc.Provider,{value:{location:Ts({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:kn.Pop}},g):g}function LC(){let e=HC(),t=OC(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:i},r):null,null)}const zC=h.createElement(LC,null);class RC extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?h.createElement(ln.Provider,{value:this.props.routeContext},h.createElement(W1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function BC(e){let{routeContext:t,match:r,children:n}=e,i=h.useContext(Ch);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),h.createElement(ln.Provider,{value:t},n)}function FC(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var s;if(!r)return null;if(r.errors)e=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(i=r)==null?void 0:i.errors;if(l!=null){let u=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);u>=0||Ae(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((u,f,p)=>{let m,x=!1,g=null,v=null;r&&(m=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||zC,c&&(d<0&&p===0?(VC("route-fallback"),x=!0,v=null):d===p&&(x=!0,v=f.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,p+1)),j=()=>{let y;return m?y=g:x?y=v:f.route.Component?y=h.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=u,h.createElement(BC,{match:f,routeContext:{outlet:u,matches:b,isDataRoute:r!=null},children:y})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?h.createElement(RC,{location:r.location,revalidation:r.revalidation,component:g,error:m,children:j(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):j()},null)}var H1=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(H1||{}),K1=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(K1||{});function WC(e){let t=h.useContext(Ch);return t||Ae(!1),t}function UC(e){let t=h.useContext(DC);return t||Ae(!1),t}function qC(e){let t=h.useContext(ln);return t||Ae(!1),t}function V1(e){let t=qC(),r=t.matches[t.matches.length-1];return r.route.id||Ae(!1),r.route.id}function HC(){var e;let t=h.useContext(W1),r=UC(),n=V1();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function KC(){let{router:e}=WC(H1.UseNavigateStable),t=V1(K1.UseNavigateStable),r=h.useRef(!1);return U1(()=>{r.current=!0}),h.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ts({fromRouteId:t},s)))},[e,t])}const Cx={};function VC(e,t,r){Cx[e]||(Cx[e]=!0)}function YC(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Cf(e){let{to:t,replace:r,state:n,relative:i}=e;ka()||Ae(!1);let{future:s,static:o}=h.useContext(Un),{matches:l}=h.useContext(ln),{pathname:c}=_i(),d=dt(),u=_h(t,Ph(l,s.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(u);return h.useEffect(()=>d(JSON.parse(f),{replace:r,state:n,relative:i}),[d,f,i,r,n]),null}function oe(e){Ae(!1)}function ZC(e){let{basename:t="/",children:r=null,location:n,navigationType:i=kn.Pop,navigator:s,static:o=!1,future:l}=e;ka()&&Ae(!1);let c=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:c,navigator:s,static:o,future:Ts({v7_relativeSplatPath:!1},l)}),[c,l,s,o]);typeof n=="string"&&(n=Na(n));let{pathname:u="/",search:f="",hash:p="",state:m=null,key:x="default"}=n,g=h.useMemo(()=>{let v=kh(u,c);return v==null?null:{location:{pathname:v,search:f,hash:p,state:m,key:x},navigationType:i}},[c,u,f,p,m,x,i]);return g==null?null:h.createElement(Un.Provider,{value:d},h.createElement(Uc.Provider,{children:r,value:g}))}function GC(e){let{children:t,location:r}=e;return IC(Af(t),r)}new Promise(()=>{});function Af(e,t){t===void 0&&(t=[]);let r=[];return h.Children.forEach(e,(n,i)=>{if(!h.isValidElement(n))return;let s=[...t,i];if(n.type===h.Fragment){r.push.apply(r,Af(n.props.children,s));return}n.type!==oe&&Ae(!1),!n.props.index||!n.props.children||Ae(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Af(n.props.children,s)),r.push(o)}),r}/** - * React Router DOM v6.30.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Of(){return Of=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function JC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function QC(e,t){return e.button===0&&(!t||t==="_self")&&!JC(e)}function Ef(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function eA(e,t){let r=Ef(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(s=>{r.append(i,s)})}),r}const tA=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],rA="6";try{window.__reactRouterVersion=rA}catch{}const nA="startTransition",Ax=$v[nA];function iA(e){let{basename:t,children:r,future:n,window:i}=e,s=h.useRef();s.current==null&&(s.current=aC({window:i,v5Compat:!0}));let o=s.current,[l,c]=h.useState({action:o.action,location:o.location}),{v7_startTransition:d}=n||{},u=h.useCallback(f=>{d&&Ax?Ax(()=>c(f)):c(f)},[c,d]);return h.useLayoutEffect(()=>o.listen(u),[o,u]),h.useEffect(()=>YC(n),[n]),h.createElement(ZC,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const aA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Y1=h.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:s,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:f}=t,p=XC(t,tA),{basename:m}=h.useContext(Un),x,g=!1;if(typeof d=="string"&&sA.test(d)&&(x=d,aA))try{let y=new URL(window.location.href),w=d.startsWith("//")?new URL(y.protocol+d):new URL(d),S=kh(w.pathname,m);w.origin===y.origin&&S!=null?d=S+w.search+w.hash:g=!0}catch{}let v=TC(d,{relative:i}),b=oA(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:i,viewTransition:f});function j(y){n&&n(y),y.defaultPrevented||b(y)}return h.createElement("a",Of({},p,{href:x||v,onClick:g||s?n:j,ref:r,target:c}))});var Ox;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ox||(Ox={}));var Ex;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ex||(Ex={}));function oA(e,t){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,viewTransition:l}=t===void 0?{}:t,c=dt(),d=_i(),u=q1(e,{relative:o});return h.useCallback(f=>{if(QC(f,r)){f.preventDefault();let p=n!==void 0?n:Il(d)===Il(u);c(e,{replace:p,state:i,preventScrollReset:s,relative:o,viewTransition:l})}},[d,c,u,n,i,r,e,s,o,l])}function lA(e){let t=h.useRef(Ef(e)),r=h.useRef(!1),n=_i(),i=h.useMemo(()=>eA(n.search,r.current?null:t.current),[n.search]),s=dt(),o=h.useCallback((l,c)=>{const d=Ef(typeof l=="function"?l(i):l);r.current=!0,s("?"+d,c)},[s,i]);return[i,o]}const cA={},Dx=e=>{let t;const r=new Set,n=(u,f)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const m=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(x=>x(t,m))}},i=()=>t,c={setState:n,getState:i,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(cA?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(n,i,c);return c},uA=e=>e?Dx(e):Dx;var Z1={exports:{}},G1={},X1={exports:{}},J1={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var pa=h;function dA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fA=typeof Object.is=="function"?Object.is:dA,pA=pa.useState,hA=pa.useEffect,mA=pa.useLayoutEffect,gA=pa.useDebugValue;function xA(e,t){var r=t(),n=pA({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return mA(function(){i.value=r,i.getSnapshot=t,ud(i)&&s({inst:i})},[e,r,t]),hA(function(){return ud(i)&&s({inst:i}),e(function(){ud(i)&&s({inst:i})})},[e]),gA(r),r}function ud(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!fA(e,r)}catch{return!0}}function yA(e,t){return t()}var vA=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?yA:xA;J1.useSyncExternalStore=pa.useSyncExternalStore!==void 0?pa.useSyncExternalStore:vA;X1.exports=J1;var bA=X1.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var qc=h,jA=bA;function wA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var SA=typeof Object.is=="function"?Object.is:wA,NA=jA.useSyncExternalStore,kA=qc.useRef,PA=qc.useEffect,_A=qc.useMemo,CA=qc.useDebugValue;G1.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var s=kA(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=_A(function(){function c(m){if(!d){if(d=!0,u=m,m=n(m),i!==void 0&&o.hasValue){var x=o.value;if(i(x,m))return f=x}return f=m}if(x=f,SA(u,m))return x;var g=n(m);return i!==void 0&&i(x,g)?(u=m,x):(u=m,f=g)}var d=!1,u,f,p=r===void 0?null:r;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,r,n,i]);var l=NA(e,s[0],s[1]);return PA(function(){o.hasValue=!0,o.value=l},[l]),CA(l),l};Z1.exports=G1;var Q1=Z1.exports;const AA=Tr(Q1),ej={},{useDebugValue:OA}=hs,{useSyncExternalStoreWithSelector:EA}=AA;let Tx=!1;const DA=e=>e;function TA(e,t=DA,r){(ej?"production":void 0)!=="production"&&r&&!Tx&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Tx=!0);const n=EA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return OA(n),n}const Mx=e=>{(ej?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?uA(e):e,r=(n,i)=>TA(t,n,i);return Object.assign(r,t),r},MA=e=>e?Mx(e):Mx,IA="";class $A{constructor(t){mo(this,"baseUrl");this.baseUrl=t}getHeaders(){const t=localStorage.getItem("token");return{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{}}}async request(t,r){const n=`${this.baseUrl}${t}`,i=await fetch(n,{...r,headers:{...this.getHeaders(),...r==null?void 0:r.headers}});if(!i.ok){const s=await i.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||`HTTP ${i.status}`)}return i.json()}async login(t,r){return this.request("/api/auth/login",{method:"POST",body:JSON.stringify({email:t,password:r})})}async getMe(){return this.request("/api/auth/me")}async getDashboardStats(){return this.request("/api/dashboard/stats")}async getDashboardActivity(){return this.request("/api/dashboard/activity")}async getStores(){return this.request("/api/stores")}async getStore(t){return this.request(`/api/stores/${t}`)}async createStore(t){return this.request("/api/stores",{method:"POST",body:JSON.stringify(t)})}async updateStore(t,r){return this.request(`/api/stores/${t}`,{method:"PUT",body:JSON.stringify(r)})}async getDispensaries(){return this.request("/api/dispensaries")}async getDispensary(t){return this.request(`/api/dispensaries/${t}`)}async updateDispensary(t,r){return this.request(`/api/dispensaries/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteStore(t){return this.request(`/api/stores/${t}`,{method:"DELETE"})}async scrapeStore(t,r,n){return this.request(`/api/stores/${t}/scrape`,{method:"POST",body:JSON.stringify({parallel:r,userAgent:n})})}async downloadStoreImages(t){return this.request(`/api/stores/${t}/download-images`,{method:"POST"})}async discoverStoreCategories(t){return this.request(`/api/stores/${t}/discover-categories`,{method:"POST"})}async debugScrapeStore(t){return this.request(`/api/stores/${t}/debug-scrape`,{method:"POST"})}async getStoreBrands(t){return this.request(`/api/stores/${t}/brands`)}async getStoreSpecials(t,r){const n=r?`?date=${r}`:"";return this.request(`/api/stores/${t}/specials${n}`)}async getCategories(t){const r=t?`?store_id=${t}`:"";return this.request(`/api/categories${r}`)}async getCategoryTree(t){return this.request(`/api/categories/tree?store_id=${t}`)}async getProducts(t){const r=new URLSearchParams(t).toString();return this.request(`/api/products${r?`?${r}`:""}`)}async getProduct(t){return this.request(`/api/products/${t}`)}async getCampaigns(){return this.request("/api/campaigns")}async getCampaign(t){return this.request(`/api/campaigns/${t}`)}async createCampaign(t){return this.request("/api/campaigns",{method:"POST",body:JSON.stringify(t)})}async updateCampaign(t,r){return this.request(`/api/campaigns/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteCampaign(t){return this.request(`/api/campaigns/${t}`,{method:"DELETE"})}async addProductToCampaign(t,r,n){return this.request(`/api/campaigns/${t}/products`,{method:"POST",body:JSON.stringify({product_id:r,display_order:n})})}async removeProductFromCampaign(t,r){return this.request(`/api/campaigns/${t}/products/${r}`,{method:"DELETE"})}async getAnalyticsOverview(t){return this.request(`/api/analytics/overview${t?`?days=${t}`:""}`)}async getProductAnalytics(t,r){return this.request(`/api/analytics/products/${t}${r?`?days=${r}`:""}`)}async getCampaignAnalytics(t,r){return this.request(`/api/analytics/campaigns/${t}${r?`?days=${r}`:""}`)}async getSettings(){return this.request("/api/settings")}async updateSetting(t,r){return this.request(`/api/settings/${t}`,{method:"PUT",body:JSON.stringify({value:r})})}async updateSettings(t){return this.request("/api/settings",{method:"PUT",body:JSON.stringify({settings:t})})}async getProxies(){return this.request("/api/proxies")}async getProxy(t){return this.request(`/api/proxies/${t}`)}async addProxy(t){return this.request("/api/proxies",{method:"POST",body:JSON.stringify(t)})}async addProxiesBulk(t){return this.request("/api/proxies/bulk",{method:"POST",body:JSON.stringify({proxies:t})})}async testProxy(t){return this.request(`/api/proxies/${t}/test`,{method:"POST"})}async testAllProxies(){return this.request("/api/proxies/test-all",{method:"POST"})}async getProxyTestJob(t){return this.request(`/api/proxies/test-job/${t}`)}async getActiveProxyTestJob(){return this.request("/api/proxies/test-job")}async cancelProxyTestJob(t){return this.request(`/api/proxies/test-job/${t}/cancel`,{method:"POST"})}async updateProxy(t,r){return this.request(`/api/proxies/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteProxy(t){return this.request(`/api/proxies/${t}`,{method:"DELETE"})}async updateProxyLocations(){return this.request("/api/proxies/update-locations",{method:"POST"})}async getLogs(t,r,n){const i=new URLSearchParams;return t&&i.append("limit",t.toString()),r&&i.append("level",r),n&&i.append("category",n),this.request(`/api/logs?${i.toString()}`)}async clearLogs(){return this.request("/api/logs",{method:"DELETE"})}async getActiveScrapers(){return this.request("/api/scraper-monitor/active")}async getScraperHistory(t){const r=t?`?store_id=${t}`:"";return this.request(`/api/scraper-monitor/history${r}`)}async getJobStats(t){const r=t?`?dispensary_id=${t}`:"";return this.request(`/api/scraper-monitor/jobs/stats${r}`)}async getActiveJobs(t){const r=t?`?dispensary_id=${t}`:"";return this.request(`/api/scraper-monitor/jobs/active${r}`)}async getRecentJobs(t){const r=new URLSearchParams;t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.dispensaryId&&r.append("dispensary_id",t.dispensaryId.toString()),t!=null&&t.status&&r.append("status",t.status);const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/scraper-monitor/jobs/recent${n}`)}async getWorkerStats(t){const r=t?`?dispensary_id=${t}`:"";return this.request(`/api/scraper-monitor/jobs/workers${r}`)}async getAZMonitorActiveJobs(){return this.request("/api/az/monitor/active-jobs")}async getAZMonitorRecentJobs(t){const r=t?`?limit=${t}`:"";return this.request(`/api/az/monitor/recent-jobs${r}`)}async getAZMonitorErrors(t){const r=new URLSearchParams;t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.hours&&r.append("hours",t.hours.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/monitor/errors${n}`)}async getAZMonitorSummary(){return this.request("/api/az/monitor/summary")}async getChanges(t){const r=t?`?status=${t}`:"";return this.request(`/api/changes${r}`)}async getChangeStats(){return this.request("/api/changes/stats")}async approveChange(t){return this.request(`/api/changes/${t}/approve`,{method:"POST"})}async rejectChange(t,r){return this.request(`/api/changes/${t}/reject`,{method:"POST",body:JSON.stringify({reason:r})})}async getDispensaryProducts(t,r){const n=r?`?category=${r}`:"";return this.request(`/api/dispensaries/${t}/products${n}`)}async getDispensaryBrands(t){return this.request(`/api/dispensaries/${t}/brands`)}async getDispensarySpecials(t){return this.request(`/api/dispensaries/${t}/specials`)}async getApiPermissions(){return this.request("/api/api-permissions")}async getApiPermissionDispensaries(){return this.request("/api/api-permissions/dispensaries")}async createApiPermission(t){return this.request("/api/api-permissions",{method:"POST",body:JSON.stringify(t)})}async updateApiPermission(t,r){return this.request(`/api/api-permissions/${t}`,{method:"PUT",body:JSON.stringify(r)})}async toggleApiPermission(t){return this.request(`/api/api-permissions/${t}/toggle`,{method:"PATCH"})}async deleteApiPermission(t){return this.request(`/api/api-permissions/${t}`,{method:"DELETE"})}async getGlobalSchedule(){return this.request("/api/schedule/global")}async updateGlobalSchedule(t,r){return this.request(`/api/schedule/global/${t}`,{method:"PUT",body:JSON.stringify(r)})}async getStoreSchedules(){return this.request("/api/schedule/stores")}async getStoreSchedule(t){return this.request(`/api/schedule/stores/${t}`)}async updateStoreSchedule(t,r){return this.request(`/api/schedule/stores/${t}`,{method:"PUT",body:JSON.stringify(r)})}async getDispensarySchedules(t){const r=new URLSearchParams;t!=null&&t.state&&r.append("state",t.state),t!=null&&t.search&&r.append("search",t.search);const n=r.toString();return this.request(`/api/schedule/dispensaries${n?`?${n}`:""}`)}async getDispensarySchedule(t){return this.request(`/api/schedule/dispensaries/${t}`)}async updateDispensarySchedule(t,r){return this.request(`/api/schedule/dispensaries/${t}`,{method:"PUT",body:JSON.stringify(r)})}async getDispensaryCrawlJobs(t){const r=t?`?limit=${t}`:"";return this.request(`/api/schedule/dispensary-jobs${r}`)}async triggerDispensaryCrawl(t){return this.request(`/api/schedule/trigger/dispensary/${t}`,{method:"POST"})}async resolvePlatformId(t){return this.request(`/api/schedule/dispensaries/${t}/resolve-platform-id`,{method:"POST"})}async detectMenuType(t){return this.request(`/api/schedule/dispensaries/${t}/detect-menu-type`,{method:"POST"})}async refreshDetection(t){return this.request(`/api/schedule/dispensaries/${t}/refresh-detection`,{method:"POST"})}async toggleDispensarySchedule(t,r){return this.request(`/api/schedule/dispensaries/${t}/toggle-active`,{method:"PUT",body:JSON.stringify({is_active:r})})}async deleteDispensarySchedule(t){return this.request(`/api/schedule/dispensaries/${t}/schedule`,{method:"DELETE"})}async getCrawlJobs(t){const r=t?`?limit=${t}`:"";return this.request(`/api/schedule/jobs${r}`)}async getStoreCrawlJobs(t,r){const n=r?`?limit=${r}`:"";return this.request(`/api/schedule/jobs/store/${t}${n}`)}async cancelCrawlJob(t){return this.request(`/api/schedule/jobs/${t}/cancel`,{method:"POST"})}async triggerStoreCrawl(t){return this.request(`/api/schedule/trigger/store/${t}`,{method:"POST"})}async triggerAllCrawls(){return this.request("/api/schedule/trigger/all",{method:"POST"})}async restartScheduler(){return this.request("/api/schedule/restart",{method:"POST"})}async getVersion(){return this.request("/api/version")}async getDutchieAZDashboard(){return this.request("/api/az/dashboard")}async getDutchieAZSchedules(){return this.request("/api/az/admin/schedules")}async getDutchieAZSchedule(t){return this.request(`/api/az/admin/schedules/${t}`)}async createDutchieAZSchedule(t){return this.request("/api/az/admin/schedules",{method:"POST",body:JSON.stringify(t)})}async updateDutchieAZSchedule(t,r){return this.request(`/api/az/admin/schedules/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteDutchieAZSchedule(t){return this.request(`/api/az/admin/schedules/${t}`,{method:"DELETE"})}async triggerDutchieAZSchedule(t){return this.request(`/api/az/admin/schedules/${t}/trigger`,{method:"POST"})}async initDutchieAZSchedules(){return this.request("/api/az/admin/schedules/init",{method:"POST"})}async getDutchieAZScheduleLogs(t,r,n){const i=new URLSearchParams;r&&i.append("limit",r.toString()),n&&i.append("offset",n.toString());const s=i.toString()?`?${i.toString()}`:"";return this.request(`/api/az/admin/schedules/${t}/logs${s}`)}async getDutchieAZRunLogs(t){const r=new URLSearchParams;t!=null&&t.scheduleId&&r.append("scheduleId",t.scheduleId.toString()),t!=null&&t.jobName&&r.append("jobName",t.jobName),t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/admin/run-logs${n}`)}async getDutchieAZSchedulerStatus(){return this.request("/api/az/admin/scheduler/status")}async startDutchieAZScheduler(){return this.request("/api/az/admin/scheduler/start",{method:"POST"})}async stopDutchieAZScheduler(){return this.request("/api/az/admin/scheduler/stop",{method:"POST"})}async triggerDutchieAZImmediateCrawl(){return this.request("/api/az/admin/scheduler/trigger",{method:"POST"})}async getDutchieAZStores(t){const r=new URLSearchParams;t!=null&&t.city&&r.append("city",t.city),(t==null?void 0:t.hasPlatformId)!==void 0&&r.append("hasPlatformId",String(t.hasPlatformId)),t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/stores${n}`)}async getDutchieAZStore(t){return this.request(`/api/az/stores/${t}`)}async getDutchieAZStoreSummary(t){return this.request(`/api/az/stores/${t}/summary`)}async getDutchieAZStoreProducts(t,r){const n=new URLSearchParams;r!=null&&r.stockStatus&&n.append("stockStatus",r.stockStatus),r!=null&&r.type&&n.append("type",r.type),r!=null&&r.subcategory&&n.append("subcategory",r.subcategory),r!=null&&r.brandName&&n.append("brandName",r.brandName),r!=null&&r.search&&n.append("search",r.search),r!=null&&r.limit&&n.append("limit",r.limit.toString()),r!=null&&r.offset&&n.append("offset",r.offset.toString());const i=n.toString()?`?${n.toString()}`:"";return this.request(`/api/az/stores/${t}/products${i}`)}async getDutchieAZStoreBrands(t){return this.request(`/api/az/stores/${t}/brands`)}async getDutchieAZStoreCategories(t){return this.request(`/api/az/stores/${t}/categories`)}async getDutchieAZBrands(t){const r=new URLSearchParams;t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/brands${n}`)}async getDutchieAZCategories(){return this.request("/api/az/categories")}async getDutchieAZDebugSummary(){return this.request("/api/az/debug/summary")}async getDutchieAZDebugStore(t){return this.request(`/api/az/debug/store/${t}`)}async triggerDutchieAZCrawl(t,r){return this.request(`/api/az/admin/crawl/${t}`,{method:"POST",body:JSON.stringify(r||{})})}async getDetectionStats(){return this.request("/api/az/admin/detection/stats")}async getDispensariesNeedingDetection(t){const r=new URLSearchParams;t!=null&&t.state&&r.append("state",t.state),t!=null&&t.limit&&r.append("limit",t.limit.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/admin/detection/pending${n}`)}async detectDispensary(t){return this.request(`/api/az/admin/detection/detect/${t}`,{method:"POST"})}async detectAllDispensaries(t){return this.request("/api/az/admin/detection/detect-all",{method:"POST",body:JSON.stringify(t||{})})}async triggerMenuDetectionJob(){return this.request("/api/az/admin/detection/trigger",{method:"POST"})}async getUsers(){return this.request("/api/users")}async getUser(t){return this.request(`/api/users/${t}`)}async createUser(t){return this.request("/api/users",{method:"POST",body:JSON.stringify(t)})}async updateUser(t,r){return this.request(`/api/users/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteUser(t){return this.request(`/api/users/${t}`,{method:"DELETE"})}}const z=new $A(IA),Hc=MA(e=>({user:null,token:localStorage.getItem("token"),isAuthenticated:!!localStorage.getItem("token"),login:async(t,r)=>{const n=await z.login(t,r);localStorage.setItem("token",n.token),e({user:n.user,token:n.token,isAuthenticated:!0})},logout:()=>{localStorage.removeItem("token"),e({user:null,token:null,isAuthenticated:!1})},checkAuth:async()=>{try{const t=await z.getMe();e({user:t.user,isAuthenticated:!0})}catch{localStorage.removeItem("token"),e({user:null,token:null,isAuthenticated:!1})}}}));/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const LA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),Ix=e=>{const t=zA(e);return t.charAt(0).toUpperCase()+t.slice(1)},tj=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),RA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var BA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const FA=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:o,...l},c)=>h.createElement("svg",{ref:c,...BA,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:tj("lucide",i),...!s&&!RA(l)&&{"aria-hidden":"true"},...l},[...o.map(([d,u])=>h.createElement(d,u)),...Array.isArray(s)?s:[s]]));/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Q=(e,t)=>{const r=h.forwardRef(({className:n,...i},s)=>h.createElement(FA,{ref:s,iconNode:t,className:tj(`lucide-${LA(Ix(e))}`,`lucide-${e}`,n),...i}));return r.displayName=Ix(e),r};/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WA=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],na=Q("activity",WA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ah=Q("arrow-left",UA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qA=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],zn=Q("building-2",qA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HA=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],KA=Q("building",HA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const VA=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Oh=Q("calendar",VA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const YA=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],rj=Q("chart-column",YA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],GA=Q("check",ZA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const XA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],nj=Q("chevron-down",XA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Df=Q("chevron-right",JA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ha=Q("circle-alert",QA);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e6=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],_r=Q("circle-check-big",e6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Hr=Q("circle-x",t6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const r6=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],xr=Q("clock",r6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const n6=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],i6=Q("dollar-sign",n6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a6=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Jr=Q("external-link",a6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const s6=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],o6=Q("eye",s6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const l6=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],c6=Q("file-text",l6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const u6=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],d6=Q("folder-open",u6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const f6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],p6=Q("image",f6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const h6=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],m6=Q("key",h6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const g6=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],$x=Q("layers",g6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const x6=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],y6=Q("layout-dashboard",x6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const v6=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],b6=Q("log-out",v6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const j6=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],ij=Q("mail",j6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const w6=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],yi=Q("map-pin",w6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const S6=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],xt=Q("package",S6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const N6=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],aj=Q("pencil",N6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const k6=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Eh=Q("phone",k6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const P6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$l=Q("plus",P6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _6=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Xt=Q("refresh-cw",_6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const C6=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],A6=Q("save",C6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const O6=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],E6=Q("search",O6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const D6=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],T6=Q("settings",D6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const M6=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ol=Q("shield",M6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const I6=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],Ll=Q("store",I6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $6=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Cr=Q("tag",$6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const L6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],sj=Q("target",L6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const z6=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Lx=Q("toggle-left",z6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const R6=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],zx=Q("toggle-right",R6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const B6=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],oj=Q("trash-2",B6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const F6=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],W6=Q("trending-down",F6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const U6=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Qr=Q("trending-up",U6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const q6=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],lj=Q("triangle-alert",q6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const H6=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],K6=Q("upload",H6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const V6=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],cj=Q("users",V6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y6=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Z6=Q("wrench",Y6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Dh=Q("x",G6);/** - * @license lucide-react v0.553.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const X6=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Rx=Q("zap",X6);function dd({icon:e,title:t,description:r}){return a.jsxs("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl p-4 flex items-start gap-3",children:[a.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-white/20 rounded-lg flex items-center justify-center",children:e}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-semibold text-sm",children:t}),a.jsx("p",{className:"text-white/70 text-xs mt-0.5",children:r})]})]})}function J6(){const[e,t]=h.useState(""),[r,n]=h.useState(""),[i,s]=h.useState(""),[o,l]=h.useState(!1),c=dt(),d=Hc(f=>f.login),u=async f=>{f.preventDefault(),s(""),l(!0);try{await d(e,r),c("/dashboard")}catch(p){s(p.message||"Login failed")}finally{l(!1)}};return a.jsxs("div",{className:"flex min-h-screen",children:[a.jsxs("div",{className:"hidden lg:flex lg:w-1/2 bg-gradient-to-br from-emerald-600 via-emerald-700 to-teal-800 p-12 flex-col justify-between relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-[-100px] right-[-100px] w-[400px] h-[400px] bg-white/5 rounded-full"}),a.jsx("div",{className:"absolute bottom-[-150px] left-[-100px] w-[500px] h-[500px] bg-white/5 rounded-full"}),a.jsxs("div",{className:"relative z-10",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-10 h-10 bg-white rounded-lg flex items-center justify-center",children:a.jsxs("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-emerald-600",fill:"currentColor",children:[a.jsx("path",{d:"M12 2C8.5 2 5.5 3.5 3.5 6L12 12L20.5 6C18.5 3.5 15.5 2 12 2Z"}),a.jsx("path",{d:"M3.5 6C2 8 1 10.5 1 13C1 18.5 6 22 12 22C18 22 23 18.5 23 13C23 10.5 22 8 20.5 6L12 12L3.5 6Z",opacity:"0.7"})]})}),a.jsx("span",{className:"text-white text-2xl font-bold",children:"Canna IQ"})]}),a.jsxs("h1",{className:"text-white text-4xl font-bold leading-tight mt-8",children:["Cannabis Market",a.jsx("br",{}),"Intelligence Platform"]}),a.jsx("p",{className:"text-white/80 text-lg mt-4 max-w-md",children:"Real-time competitive insights for Arizona dispensaries. Track products, prices, and market trends."})]}),a.jsxs("div",{className:"relative z-10 space-y-4 mt-auto",children:[a.jsx(dd,{icon:a.jsx(Qr,{className:"w-5 h-5 text-white"}),title:"Sales Intelligence",description:"Track competitor pricing and identify market opportunities"}),a.jsx(dd,{icon:a.jsx(rj,{className:"w-5 h-5 text-white"}),title:"Market Analysis",description:"Comprehensive analytics on Arizona cannabis market trends"}),a.jsx(dd,{icon:a.jsx(xt,{className:"w-5 h-5 text-white"}),title:"Inventory Tracking",description:"Monitor product availability across all dispensaries"})]})]}),a.jsx("div",{className:"flex-1 flex items-center justify-center p-8 bg-gray-50",children:a.jsxs("div",{className:"w-full max-w-md",children:[a.jsxs("div",{className:"lg:hidden flex items-center gap-3 mb-8 justify-center",children:[a.jsx("div",{className:"w-10 h-10 bg-emerald-600 rounded-lg flex items-center justify-center",children:a.jsxs("svg",{viewBox:"0 0 24 24",className:"w-6 h-6 text-white",fill:"currentColor",children:[a.jsx("path",{d:"M12 2C8.5 2 5.5 3.5 3.5 6L12 12L20.5 6C18.5 3.5 15.5 2 12 2Z"}),a.jsx("path",{d:"M3.5 6C2 8 1 10.5 1 13C1 18.5 6 22 12 22C18 22 23 18.5 23 13C23 10.5 22 8 20.5 6L12 12L3.5 6Z",opacity:"0.7"})]})}),a.jsx("span",{className:"text-gray-900 text-2xl font-bold",children:"Canna IQ"})]}),a.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Welcome back"}),a.jsx("p",{className:"text-gray-500 mt-2",children:"Sign in to your account"})]}),i&&a.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg mb-6 text-sm",children:i}),a.jsxs("form",{onSubmit:u,className:"space-y-5",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1.5",children:"Email address"}),a.jsx("input",{id:"email",type:"email",value:e,onChange:f=>t(f.target.value),required:!0,placeholder:"you@company.com",className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 transition-colors text-gray-900 placeholder-gray-400"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:"Password"}),a.jsx("a",{href:"#",className:"text-sm text-emerald-600 hover:text-emerald-700",children:"Forgot password?"})]}),a.jsx("input",{id:"password",type:"password",value:r,onChange:f=>n(f.target.value),required:!0,placeholder:"Enter your password",className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 transition-colors text-gray-900 placeholder-gray-400"})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("input",{id:"remember",type:"checkbox",className:"h-4 w-4 text-emerald-600 focus:ring-emerald-500 border-gray-300 rounded"}),a.jsx("label",{htmlFor:"remember",className:"ml-2 block text-sm text-gray-700",children:"Remember me"})]}),a.jsx("button",{type:"submit",disabled:o,className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white font-semibold py-3 px-4 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:o?a.jsxs("span",{className:"flex items-center justify-center gap-2",children:[a.jsxs("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Signing in..."]}):"Sign in"})]}),a.jsxs("p",{className:"mt-6 text-center text-sm text-gray-500",children:["Don't have an account?"," ",a.jsx("a",{href:"#",className:"text-emerald-600 hover:text-emerald-700 font-medium",children:"Contact us"})]})]})]})})]})}function qe({to:e,icon:t,label:r,isActive:n}){return a.jsxs("a",{href:e,className:`flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${n?"bg-emerald-50 text-emerald-700":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"}`,children:[a.jsx("span",{className:`flex-shrink-0 ${n?"text-emerald-600":"text-gray-400"}`,children:t}),a.jsx("span",{children:r})]})}function To({title:e,children:t}){return a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"px-3 mb-2",children:a.jsx("h3",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider",children:e})}),t]})}function X({children:e}){const t=dt(),r=_i(),{user:n,logout:i}=Hc(),[s,o]=h.useState(null);h.useEffect(()=>{(async()=>{try{const u=await z.getVersion();o(u)}catch(u){console.error("Failed to fetch version info:",u)}})()},[]);const l=()=>{i(),t("/login")},c=(d,u=!0)=>u?r.pathname===d:r.pathname.startsWith(d);return a.jsxs("div",{className:"flex min-h-screen bg-gray-50",children:[a.jsxs("div",{className:"w-64 bg-white border-r border-gray-200 flex flex-col",style:{position:"sticky",top:0,height:"100vh",overflowY:"auto"},children:[a.jsxs("div",{className:"px-6 py-5 border-b border-gray-200",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-emerald-600 rounded-lg flex items-center justify-center",children:a.jsxs("svg",{viewBox:"0 0 24 24",className:"w-5 h-5 text-white",fill:"currentColor",children:[a.jsx("path",{d:"M12 2C8.5 2 5.5 3.5 3.5 6L12 12L20.5 6C18.5 3.5 15.5 2 12 2Z"}),a.jsx("path",{d:"M3.5 6C2 8 1 10.5 1 13C1 18.5 6 22 12 22C18 22 23 18.5 23 13C23 10.5 22 8 20.5 6L12 12L3.5 6Z",opacity:"0.7"})]})}),a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"CannaIQ"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:n==null?void 0:n.email})]}),a.jsxs("nav",{className:"flex-1 px-3 py-4 space-y-6",children:[a.jsxs(To,{title:"Main",children:[a.jsx(qe,{to:"/dashboard",icon:a.jsx(y6,{className:"w-4 h-4"}),label:"Dashboard",isActive:c("/dashboard",!0)}),a.jsx(qe,{to:"/dispensaries",icon:a.jsx(zn,{className:"w-4 h-4"}),label:"Dispensaries",isActive:c("/dispensaries")}),a.jsx(qe,{to:"/categories",icon:a.jsx(d6,{className:"w-4 h-4"}),label:"Categories",isActive:c("/categories")}),a.jsx(qe,{to:"/products",icon:a.jsx(xt,{className:"w-4 h-4"}),label:"Products",isActive:c("/products")}),a.jsx(qe,{to:"/campaigns",icon:a.jsx(sj,{className:"w-4 h-4"}),label:"Campaigns",isActive:c("/campaigns")}),a.jsx(qe,{to:"/analytics",icon:a.jsx(Qr,{className:"w-4 h-4"}),label:"Analytics",isActive:c("/analytics")})]}),a.jsxs(To,{title:"AZ Data",children:[a.jsx(qe,{to:"/wholesale-analytics",icon:a.jsx(Qr,{className:"w-4 h-4"}),label:"Wholesale Analytics",isActive:c("/wholesale-analytics")}),a.jsx(qe,{to:"/az",icon:a.jsx(Ll,{className:"w-4 h-4"}),label:"AZ Stores",isActive:c("/az",!1)}),a.jsx(qe,{to:"/az-schedule",icon:a.jsx(Oh,{className:"w-4 h-4"}),label:"AZ Schedule",isActive:c("/az-schedule")})]}),a.jsxs(To,{title:"Scraper",children:[a.jsx(qe,{to:"/scraper-tools",icon:a.jsx(Z6,{className:"w-4 h-4"}),label:"Tools",isActive:c("/scraper-tools")}),a.jsx(qe,{to:"/scraper-schedule",icon:a.jsx(xr,{className:"w-4 h-4"}),label:"Schedule",isActive:c("/scraper-schedule")}),a.jsx(qe,{to:"/scraper-monitor",icon:a.jsx(na,{className:"w-4 h-4"}),label:"Monitor",isActive:c("/scraper-monitor")})]}),a.jsxs(To,{title:"System",children:[a.jsx(qe,{to:"/changes",icon:a.jsx(_r,{className:"w-4 h-4"}),label:"Change Approval",isActive:c("/changes")}),a.jsx(qe,{to:"/api-permissions",icon:a.jsx(m6,{className:"w-4 h-4"}),label:"API Permissions",isActive:c("/api-permissions")}),a.jsx(qe,{to:"/proxies",icon:a.jsx(ol,{className:"w-4 h-4"}),label:"Proxies",isActive:c("/proxies")}),a.jsx(qe,{to:"/logs",icon:a.jsx(c6,{className:"w-4 h-4"}),label:"Logs",isActive:c("/logs")}),a.jsx(qe,{to:"/settings",icon:a.jsx(T6,{className:"w-4 h-4"}),label:"Settings",isActive:c("/settings")}),a.jsx(qe,{to:"/users",icon:a.jsx(cj,{className:"w-4 h-4"}),label:"Users",isActive:c("/users")})]})]}),a.jsx("div",{className:"px-3 py-4 border-t border-gray-200",children:a.jsxs("button",{onClick:l,className:"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium text-red-600 hover:bg-red-50 transition-colors",children:[a.jsx(b6,{className:"w-4 h-4"}),a.jsx("span",{children:"Logout"})]})}),s&&a.jsxs("div",{className:"px-3 py-2 border-t border-gray-200 bg-gray-50",children:[a.jsxs("p",{className:"text-xs text-gray-500 text-center",children:[s.build_version," (",s.git_sha.slice(0,7),")"]}),a.jsx("p",{className:"text-xs text-gray-400 text-center mt-0.5",children:s.image_tag})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:a.jsx("div",{className:"max-w-7xl mx-auto px-8 py-8",children:e})})]})}function uj(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{var[n]=r;return dj(n)||fj(n)});return Object.fromEntries(t)}function Kc(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return nr(t)}return typeof e=="object"&&!Array.isArray(e)?nr(e):null}function ut(e){var t=Object.entries(e).filter(r=>{var[n]=r;return dj(n)||fj(n)||Th(n)});return Object.fromEntries(t)}function t4(e){return e==null?null:h.isValidElement(e)?ut(e.props):typeof e=="object"&&!Array.isArray(e)?ut(e):null}var r4=["children","width","height","viewBox","className","style","title","desc"];function Tf(){return Tf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:r,width:n,height:i,viewBox:s,className:o,style:l,title:c,desc:d}=e,u=n4(e,r4),f=s||{width:n,height:i,x:0,y:0},p=ue("recharts-surface",o);return h.createElement("svg",Tf({},ut(u),{className:p,width:n,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),h.createElement("title",null,c),h.createElement("desc",null,d),r)}),a4=["children","className"];function Mf(){return Mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:r,className:n}=e,i=s4(e,a4),s=ue("recharts-layer",n);return h.createElement("g",Mf({className:s},ut(i),{ref:t}),r)}),l4=h.createContext(null);function he(e){return function(){return e}}const hj=Math.cos,zl=Math.sin,vr=Math.sqrt,Rl=Math.PI,Vc=2*Rl,If=Math.PI,$f=2*If,Xn=1e-6,c4=$f-Xn;function mj(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return mj;const r=10**t;return function(n){this._+=n[0];for(let i=1,s=n.length;iXn)if(!(Math.abs(f*c-d*u)>Xn)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let m=n-o,x=i-l,g=c*c+d*d,v=m*m+x*x,b=Math.sqrt(g),j=Math.sqrt(p),y=s*Math.tan((If-Math.acos((g+p-v)/(2*b*j)))/2),w=y/j,S=y/b;Math.abs(w-1)>Xn&&this._append`L${t+w*u},${r+w*f}`,this._append`A${s},${s},0,0,${+(f*m>u*x)},${this._x1=t+S*c},${this._y1=r+S*d}`}}arc(t,r,n,i,s,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),d=t+l,u=r+c,f=1^o,p=o?i-s:s-i;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>Xn||Math.abs(this._y1-u)>Xn)&&this._append`L${d},${u}`,n&&(p<0&&(p=p%$f+$f),p>c4?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=d},${this._y1=u}`:p>Xn&&this._append`A${n},${n},0,${+(p>=If)},${f},${this._x1=t+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Mh(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new d4(t)}function Ih(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gj(e){this._context=e}gj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Yc(e){return new gj(e)}function xj(e){return e[0]}function yj(e){return e[1]}function vj(e,t){var r=he(!0),n=null,i=Yc,s=null,o=Mh(l);e=typeof e=="function"?e:e===void 0?xj:he(e),t=typeof t=="function"?t:t===void 0?yj:he(t);function l(c){var d,u=(c=Ih(c)).length,f,p=!1,m;for(n==null&&(s=i(m=o())),d=0;d<=u;++d)!(d=m;--x)l.point(y[x],w[x]);l.lineEnd(),l.areaEnd()}b&&(y[p]=+e(v,p,f),w[p]=+t(v,p,f),l.point(n?+n(v,p,f):y[p],r?+r(v,p,f):w[p]))}if(j)return l=null,j+""||null}function u(){return vj().defined(i).curve(o).context(s)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:he(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:he(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:he(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:he(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:he(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:he(+f),d):r},d.lineX0=d.lineY0=function(){return u().x(e).y(t)},d.lineY1=function(){return u().x(e).y(r)},d.lineX1=function(){return u().x(n).y(t)},d.defined=function(f){return arguments.length?(i=typeof f=="function"?f:he(!!f),d):i},d.curve=function(f){return arguments.length?(o=f,s!=null&&(l=o(s)),d):o},d.context=function(f){return arguments.length?(f==null?s=l=null:l=o(s=f),d):s},d}class bj{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function f4(e){return new bj(e,!0)}function p4(e){return new bj(e,!1)}const $h={draw(e,t){const r=vr(t/Rl);e.moveTo(r,0),e.arc(0,0,r,0,Vc)}},h4={draw(e,t){const r=vr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},jj=vr(1/3),m4=jj*2,g4={draw(e,t){const r=vr(t/m4),n=r*jj;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},x4={draw(e,t){const r=vr(t),n=-r/2;e.rect(n,n,r,r)}},y4=.8908130915292852,wj=zl(Rl/10)/zl(7*Rl/10),v4=zl(Vc/10)*wj,b4=-hj(Vc/10)*wj,j4={draw(e,t){const r=vr(t*y4),n=v4*r,i=b4*r;e.moveTo(0,-r),e.lineTo(n,i);for(let s=1;s<5;++s){const o=Vc*s/5,l=hj(o),c=zl(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},fd=vr(3),w4={draw(e,t){const r=-vr(t/(fd*3));e.moveTo(0,r*2),e.lineTo(-fd*r,-r),e.lineTo(fd*r,-r),e.closePath()}},Ht=-.5,Kt=vr(3)/2,Lf=1/vr(12),S4=(Lf/2+1)*3,N4={draw(e,t){const r=vr(t/S4),n=r/2,i=r*Lf,s=n,o=r*Lf+r,l=-s,c=o;e.moveTo(n,i),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(Ht*n-Kt*i,Kt*n+Ht*i),e.lineTo(Ht*s-Kt*o,Kt*s+Ht*o),e.lineTo(Ht*l-Kt*c,Kt*l+Ht*c),e.lineTo(Ht*n+Kt*i,Ht*i-Kt*n),e.lineTo(Ht*s+Kt*o,Ht*o-Kt*s),e.lineTo(Ht*l+Kt*c,Ht*c-Kt*l),e.closePath()}};function k4(e,t){let r=null,n=Mh(i);e=typeof e=="function"?e:he(e||$h),t=typeof t=="function"?t:he(t===void 0?64:+t);function i(){let s;if(r||(r=s=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:he(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:he(+s),i):t},i.context=function(s){return arguments.length?(r=s??null,i):r},i}function Bl(){}function Fl(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Sj(e){this._context=e}Sj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Fl(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Fl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function P4(e){return new Sj(e)}function Nj(e){this._context=e}Nj.prototype={areaStart:Bl,areaEnd:Bl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Fl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _4(e){return new Nj(e)}function kj(e){this._context=e}kj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Fl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function C4(e){return new kj(e)}function Pj(e){this._context=e}Pj.prototype={areaStart:Bl,areaEnd:Bl,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function A4(e){return new Pj(e)}function Bx(e){return e<0?-1:1}function Fx(e,t,r){var n=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(s*i+o*n)/(n+i);return(Bx(s)+Bx(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function Wx(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function pd(e,t,r){var n=e._x0,i=e._y0,s=e._x1,o=e._y1,l=(s-n)/3;e._context.bezierCurveTo(n+l,i+l*t,s-l,o-l*r,s,o)}function Wl(e){this._context=e}Wl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:pd(this,this._t0,Wx(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,pd(this,Wx(this,r=Fx(this,e,t)),r);break;default:pd(this,this._t0,r=Fx(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function _j(e){this._context=new Cj(e)}(_j.prototype=Object.create(Wl.prototype)).point=function(e,t){Wl.prototype.point.call(this,t,e)};function Cj(e){this._context=e}Cj.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,s){this._context.bezierCurveTo(t,e,n,r,s,i)}};function O4(e){return new Wl(e)}function E4(e){return new _j(e)}function Aj(e){this._context=e}Aj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Ux(e),i=Ux(t),s=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/s[t];for(s[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function T4(e){return new Zc(e,.5)}function M4(e){return new Zc(e,0)}function I4(e){return new Zc(e,1)}function ma(e,t){if((o=e.length)>1)for(var r=1,n,i,s=e[t[0]],o,l=s.length;r=0;)r[t]=t;return r}function $4(e,t){return e[t]}function L4(e){const t=[];return t.key=e,t}function z4(){var e=he([]),t=zf,r=ma,n=$4;function i(s){var o=Array.from(e.apply(this,arguments),L4),l,c=o.length,d=-1,u;for(const f of s)for(l=0,++d;l0){for(var r,n,i=0,s=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,s=n.length;r0)||!((s=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,s,o;ne===0?0:e>0?1:-1,yr=e=>typeof e=="number"&&e!=+e,en=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Z=e=>(typeof e=="number"||e instanceof Number)&&!yr(e),Or=e=>Z(e)||typeof e=="string",U4=0,Ms=e=>{var t=++U4;return"".concat(e||"").concat(t)},Rn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Z(t)&&typeof t!="string")return n;var s;if(en(t)){if(r==null)return n;var o=t.indexOf("%");s=r*parseFloat(t.slice(0,o))/100}else s=+t;return yr(s)&&(s=n),i&&r!=null&&s>r&&(s=r),s},Dj=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):Qc(n,t))===r)}var Re=e=>e===null||typeof e>"u",Js=e=>Re(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function q4(e){return e!=null}function _a(){}var H4=["type","size","sizeType"];function Rf(){return Rf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(Js(e));return Mj[t]||$h},Q4=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*X4;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},eO=(e,t)=>{Mj["symbol".concat(Js(e))]=t},Ij=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=Z4(e,H4),s=Hx(Hx({},i),{},{type:t,size:r,sizeType:n}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var p=J4(o),m=k4().type(p).size(Q4(r,n,o)),x=m();if(x!==null)return x},{className:c,cx:d,cy:u}=s,f=ut(s);return Z(d)&&Z(u)&&Z(r)?h.createElement("path",Rf({},f,{className:ue("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};Ij.registerSymbol=eO;var $j=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,zh=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(h.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Th(i)&&(n[i]=s=>r[i](r,s))}),n},tO=(e,t,r)=>n=>(e(t,r,n),null),rO=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var s=e[i];Th(i)&&typeof s=="function"&&(n||(n={}),n[i]=tO(s,t,r))}),n};function Kx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nO(e){for(var t=1;t(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return s}var Lj={},zj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const i=new Map;for(let s=0;s=0}e.isLength=t})(Bj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bj;function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(eu);var Fj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(Fj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=eu,r=Fj;function n(i){return r.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=n})(Rj);var Wj={},Uj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Gc;function r(n){return function(i){return t.get(i,n)}}e.property=r})(Uj);var qj={},Bh={},Hj={},Fh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(Fh);var Wh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Wh);var Uh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.eq=t})(Uh);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Fh,r=Wh,n=Uh;function i(u,f,p){return typeof p!="function"?i(u,f,()=>{}):s(u,f,function m(x,g,v,b,j,y){const w=p(x,g,v,b,j,y);return w!==void 0?!!w:s(x,g,m,y)},new Map)}function s(u,f,p,m){if(f===u)return!0;switch(typeof f){case"object":return o(u,f,p,m);case"function":return Object.keys(f).length>0?s(u,{...f},p,m):n.eq(u,f);default:return t.isObject(u)?typeof f=="string"?f==="":!0:n.eq(u,f)}}function o(u,f,p,m){if(f==null)return!0;if(Array.isArray(f))return c(u,f,p,m);if(f instanceof Map)return l(u,f,p,m);if(f instanceof Set)return d(u,f,p,m);const x=Object.keys(f);if(u==null)return x.length===0;if(x.length===0)return!0;if(m!=null&&m.has(f))return m.get(f)===u;m==null||m.set(f,u);try{for(let g=0;g{})}e.isMatch=r})(Bh);var Kj={},qh={},Vj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t})(Vj);var Hh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(Hh);var Kh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",i="[object Boolean]",s="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",d="[object Set]",u="[object Array]",f="[object Function]",p="[object ArrayBuffer]",m="[object Object]",x="[object Error]",g="[object DataView]",v="[object Uint8Array]",b="[object Uint8ClampedArray]",j="[object Uint16Array]",y="[object Uint32Array]",w="[object BigUint64Array]",S="[object Int8Array]",N="[object Int16Array]",_="[object Int32Array]",C="[object BigInt64Array]",D="[object Float32Array]",M="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=p,e.arrayTag=u,e.bigInt64ArrayTag=C,e.bigUint64ArrayTag=w,e.booleanTag=i,e.dataViewTag=g,e.dateTag=l,e.errorTag=x,e.float32ArrayTag=D,e.float64ArrayTag=M,e.functionTag=f,e.int16ArrayTag=N,e.int32ArrayTag=_,e.int8ArrayTag=S,e.mapTag=c,e.numberTag=n,e.objectTag=m,e.regexpTag=t,e.setTag=d,e.stringTag=r,e.symbolTag=o,e.uint16ArrayTag=j,e.uint32ArrayTag=y,e.uint8ArrayTag=v,e.uint8ClampedArrayTag=b})(Kh);var Yj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(Yj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Vj,r=Hh,n=Kh,i=Wh,s=Yj;function o(u,f){return l(u,void 0,u,new Map,f)}function l(u,f,p,m=new Map,x=void 0){const g=x==null?void 0:x(u,f,p,m);if(g!==void 0)return g;if(i.isPrimitive(u))return u;if(m.has(u))return m.get(u);if(Array.isArray(u)){const v=new Array(u.length);m.set(u,v);for(let b=0;bt.isMatch(s,i)}e.matches=n})(qj);var Zj={},Gj={},Xj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qh,r=Kh;function n(i,s){return t.cloneDeepWith(i,(o,l,c,d)=>{const u=s==null?void 0:s(o,l,c,d);if(u!==void 0)return u;if(typeof i=="object")switch(Object.prototype.toString.call(i)){case r.numberTag:case r.stringTag:case r.booleanTag:{const f=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(f,i),f}case r.argumentsTag:{const f={};return t.copyProperties(f,i),f.length=i.length,f[Symbol.iterator]=i[Symbol.iterator],f}default:return}})}e.cloneDeepWith=n})(Xj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xj;function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(Gj);var Jj={},Vh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,i=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&ne,Ye=()=>{var e=h.useContext(Yh);return e?e.store.dispatch:cO},ll=()=>{},uO=()=>ll,dO=(e,t)=>e===t;function G(e){var t=h.useContext(Yh);return Q1.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:uO,t?t.store.getState:ll,t?t.store.getState:ll,t?e:ll,dO)}function fO(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function pO(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function hO(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Yx=e=>Array.isArray(e)?e:[e];function mO(e){const t=Array.isArray(e[0])?e[0]:e;return hO(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function gO(e,t){const r=[],{length:n}=e;for(let i=0;i{r=Io(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function bO(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let s=0,o=0,l,c={},d=i.pop();typeof d=="object"&&(c=d,d=i.pop()),fO(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const u={...r,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:m=ew,argsMemoizeOptions:x=[]}=u,g=Yx(p),v=Yx(x),b=mO(i),j=f(function(){return s++,d.apply(null,arguments)},...g),y=m(function(){o++;const S=gO(b,arguments);return l=j.apply(null,S),l},...v);return Object.assign(y,{resultFunc:d,memoizedResultFunc:j,dependencies:b,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var $=bO(ew),jO=Object.assign((e,t=$)=>{pO(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(s=>e[s]);return t(n,(...s)=>s.reduce((o,l,c)=>(o[r[c]]=l,o),{}))},{withTypes:()=>jO}),tw={},rw={},nw={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const r=(n,i,s)=>{if(n!==i){const o=t(n),l=t(i);if(o===l&&o===0){if(ni)return s==="desc"?-1:1}return s==="desc"?l-o:o-l}return 0};e.compareValues=r})(nw);var iw={},Zh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(Zh);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zh,r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(s,o){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||t.isSymbol(s)?!0:typeof s=="string"&&(n.test(s)||!r.test(s))||o!=null&&Object.hasOwn(o,s)}e.isKey=i})(iw);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nw,r=iw,n=Jc;function i(s,o,l,c){if(s==null)return[];l=c?void 0:l,Array.isArray(s)||(s=Object.values(s)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(m=>String(m));const d=(m,x)=>{let g=m;for(let v=0;vx==null||m==null?x:typeof m=="object"&&"key"in m?Object.hasOwn(x,m.key)?x[m.key]:d(x,m.path):typeof m=="function"?m(x):Array.isArray(m)?d(x,m):typeof x=="object"?x[m]:x,f=o.map(m=>(Array.isArray(m)&&m.length===1&&(m=m[0]),m==null||typeof m=="function"||Array.isArray(m)||r.isKey(m)?m:{key:m,path:n.toPath(m)}));return s.map(m=>({original:m,criteria:f.map(x=>u(x,m))})).slice().sort((m,x)=>{for(let g=0;gm.original)}e.orderBy=i})(rw);var aw={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n=1){const i=[],s=Math.floor(n),o=(l,c)=>{for(let d=0;d1&&n.isIterateeCall(s,o[0],o[1])?o=[]:l>2&&n.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(s,r.flatten(o),["asc"])}e.sortBy=i})(tw);var wO=tw.sortBy;const tu=Tr(wO);var sw=e=>e.legend.settings,SO=e=>e.legend.size,NO=e=>e.legend.payload;$([NO,sw],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?tu(n,r):n});var $o=1;function kO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=h.useState({height:0,left:0,top:0,width:0}),n=h.useCallback(i=>{if(i!=null){var s=i.getBoundingClientRect(),o={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(o.height-t.height)>$o||Math.abs(o.left-t.left)>$o||Math.abs(o.top-t.top)>$o||Math.abs(o.width-t.width)>$o)&&r({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,n]}function Ge(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var PO=typeof Symbol=="function"&&Symbol.observable||"@@observable",Gx=PO,hd=()=>Math.random().toString(36).substring(7).split("").join("."),_O={INIT:`@@redux/INIT${hd()}`,REPLACE:`@@redux/REPLACE${hd()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${hd()}`},Ul=_O;function Xh(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ow(e,t,r){if(typeof e!="function")throw new Error(Ge(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ge(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ge(1));return r(ow)(e,t)}let n=e,i=t,s=new Map,o=s,l=0,c=!1;function d(){o===s&&(o=new Map,s.forEach((v,b)=>{o.set(b,v)}))}function u(){if(c)throw new Error(Ge(3));return i}function f(v){if(typeof v!="function")throw new Error(Ge(4));if(c)throw new Error(Ge(5));let b=!0;d();const j=l++;return o.set(j,v),function(){if(b){if(c)throw new Error(Ge(6));b=!1,d(),o.delete(j),s=null}}}function p(v){if(!Xh(v))throw new Error(Ge(7));if(typeof v.type>"u")throw new Error(Ge(8));if(typeof v.type!="string")throw new Error(Ge(17));if(c)throw new Error(Ge(9));try{c=!0,i=n(i,v)}finally{c=!1}return(s=o).forEach(j=>{j()}),v}function m(v){if(typeof v!="function")throw new Error(Ge(10));n=v,p({type:Ul.REPLACE})}function x(){const v=f;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(Ge(11));function j(){const w=b;w.next&&w.next(u())}return j(),{unsubscribe:v(j)}},[Gx](){return this}}}return p({type:Ul.INIT}),{dispatch:p,subscribe:f,getState:u,replaceReducer:m,[Gx]:x}}function CO(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Ul.INIT})>"u")throw new Error(Ge(12));if(typeof r(void 0,{type:Ul.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ge(13))})}function lw(e){const t=Object.keys(e),r={};for(let s=0;s"u")throw l&&l.type,new Error(Ge(14));d[f]=x,c=c||x!==m}return c=c||n.length!==Object.keys(o).length,c?d:o}}function ql(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function AO(...e){return t=>(r,n)=>{const i=t(r,n);let s=()=>{throw new Error(Ge(15))};const o={getState:i.getState,dispatch:(c,...d)=>s(c,...d)},l=e.map(c=>c(o));return s=ql(...l)(i.dispatch),{...i,dispatch:s}}}function cw(e){return Xh(e)&&"type"in e&&typeof e.type=="string"}var uw=Symbol.for("immer-nothing"),Xx=Symbol.for("immer-draftable"),Wt=Symbol.for("immer-state");function fr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Is=Object.getPrototypeOf;function vi(e){return!!e&&!!e[Wt]}function tn(e){var t;return e?dw(e)||Array.isArray(e)||!!e[Xx]||!!((t=e.constructor)!=null&&t[Xx])||Qs(e)||nu(e):!1}var OO=Object.prototype.constructor.toString(),Jx=new WeakMap;function dw(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Jx.get(r);return n===void 0&&(n=Function.toString.call(r),Jx.set(r,n)),n===OO}function Hl(e,t,r=!0){ru(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function ru(e){const t=e[Wt];return t?t.type_:Array.isArray(e)?1:Qs(e)?2:nu(e)?3:0}function Bf(e,t){return ru(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fw(e,t,r){const n=ru(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function EO(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Qs(e){return e instanceof Map}function nu(e){return e instanceof Set}function Jn(e){return e.copy_||e.base_}function Ff(e,t){if(Qs(e))return new Map(e);if(nu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=dw(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Wt];let i=Reflect.ownKeys(n);for(let s=0;s1&&Object.defineProperties(e,{set:Lo,add:Lo,clear:Lo,delete:Lo}),Object.freeze(e),t&&Object.values(e).forEach(r=>Jh(r,!0))),e}function DO(){fr(2)}var Lo={value:DO};function iu(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var TO={};function bi(e){const t=TO[e];return t||fr(0,e),t}var $s;function pw(){return $s}function MO(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Qx(e,t){t&&(bi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Wf(e){Uf(e),e.drafts_.forEach(IO),e.drafts_=null}function Uf(e){e===$s&&($s=e.parent_)}function e0(e){return $s=MO($s,e)}function IO(e){const t=e[Wt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function t0(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Wt].modified_&&(Wf(t),fr(4)),tn(e)&&(e=Kl(t,e),t.parent_||Vl(t,e)),t.patches_&&bi("Patches").generateReplacementPatches_(r[Wt].base_,e,t.patches_,t.inversePatches_)):e=Kl(t,r,[]),Wf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==uw?e:void 0}function Kl(e,t,r){if(iu(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[Wt];if(!i)return Hl(t,(s,o)=>r0(e,i,t,s,o,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return Vl(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let o=s,l=!1;i.type_===3&&(o=new Set(s),s.clear(),l=!0),Hl(o,(c,d)=>r0(e,i,s,c,d,r,l),n),Vl(e,s,!1),r&&e.patches_&&bi("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function r0(e,t,r,n,i,s,o){if(i==null||typeof i!="object"&&!o)return;const l=iu(i);if(!(l&&!o)){if(vi(i)){const c=s&&t&&t.type_!==3&&!Bf(t.assigned_,n)?s.concat(n):void 0,d=Kl(e,i,c);if(fw(r,n,d),vi(d))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(tn(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&l)return;Kl(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Qs(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Vl(e,i)}}}function Vl(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Jh(t,r)}function $O(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:pw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,s=Qh;r&&(i=[n],s=Ls);const{revoke:o,proxy:l}=Proxy.revocable(i,s);return n.draft_=l,n.revoke_=o,l}var Qh={get(e,t){if(t===Wt)return e;const r=Jn(e);if(!Bf(r,t))return LO(e,r,t);const n=r[t];return e.finalized_||!tn(n)?n:n===md(e.base_,t)?(gd(e),e.copy_[t]=Hf(n,e)):n},has(e,t){return t in Jn(e)},ownKeys(e){return Reflect.ownKeys(Jn(e))},set(e,t,r){const n=hw(Jn(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=md(Jn(e),t),s=i==null?void 0:i[Wt];if(s&&s.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(EO(r,i)&&(r!==void 0||Bf(e.base_,t)))return!0;gd(e),qf(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return md(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,gd(e),qf(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Jn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){fr(11)},getPrototypeOf(e){return Is(e.base_)},setPrototypeOf(){fr(12)}},Ls={};Hl(Qh,(e,t)=>{Ls[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ls.deleteProperty=function(e,t){return Ls.set.call(this,e,t,void 0)};Ls.set=function(e,t,r){return Qh.set.call(this,e[0],t,r,e[0])};function md(e,t){const r=e[Wt];return(r?Jn(r):e)[t]}function LO(e,t,r){var i;const n=hw(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function hw(e,t){if(!(t in e))return;let r=Is(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Is(r)}}function qf(e){e.modified_||(e.modified_=!0,e.parent_&&qf(e.parent_))}function gd(e){e.copy_||(e.copy_=Ff(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zO=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const s=r;r=t;const o=this;return function(c=s,...d){return o.produce(c,u=>r.call(this,u,...d))}}typeof r!="function"&&fr(6),n!==void 0&&typeof n!="function"&&fr(7);let i;if(tn(t)){const s=e0(this),o=Hf(t,void 0);let l=!0;try{i=r(o),l=!1}finally{l?Wf(s):Uf(s)}return Qx(s,n),t0(i,s)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===uw&&(i=void 0),this.autoFreeze_&&Jh(i,!0),n){const s=[],o=[];bi("Patches").generateReplacementPatches_(t,i,s,o),n(s,o)}return i}else fr(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let n,i;return[this.produce(t,r,(o,l)=>{n=o,i=l}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){tn(e)||fr(8),vi(e)&&(e=Kr(e));const t=e0(this),r=Hf(e,void 0);return r[Wt].isManual_=!0,Uf(t),r}finishDraft(e,t){const r=e&&e[Wt];(!r||!r.isManual_)&&fr(9);const{scope_:n}=r;return Qx(n,t),t0(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=bi("Patches").applyPatches_;return vi(e)?n(e,t):this.produce(e,i=>n(i,t))}};function Hf(e,t){const r=Qs(e)?bi("MapSet").proxyMap_(e,t):nu(e)?bi("MapSet").proxySet_(e,t):$O(e,t);return(t?t.scope_:pw()).drafts_.push(r),r}function Kr(e){return vi(e)||fr(10,e),mw(e)}function mw(e){if(!tn(e)||iu(e))return e;const t=e[Wt];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Ff(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Ff(e,!0);return Hl(r,(i,s)=>{fw(r,i,mw(s))},n),t&&(t.finalized_=!1),r}var Kf=new zO,gw=Kf.produce,RO=Kf.setUseStrictIteration.bind(Kf);function xw(e){return({dispatch:r,getState:n})=>i=>s=>typeof s=="function"?s(r,n,e):i(s)}var BO=xw(),FO=xw,WO=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ql:ql.apply(null,arguments)};function ar(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Bt(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>cw(n)&&n.type===e,r}var yw=class ts extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,ts.prototype)}static get[Symbol.species](){return ts}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new ts(...t[0].concat(this)):new ts(...t.concat(this))}};function n0(e){return tn(e)?gw(e,()=>{}):e}function zo(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function UO(e){return typeof e=="boolean"}var qO=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let o=new yw;return r&&(UO(r)?o.push(BO):o.push(FO(r.extraArgument))),o},vw="RTK_autoBatch",Le=()=>e=>({payload:e,meta:{[vw]:!0}}),i0=e=>t=>{setTimeout(t,e)},bw=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,s=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:i0(10):e.type==="callback"?e.queueNotification:i0(e.timeout),d=()=>{o=!1,s&&(s=!1,l.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const f=()=>i&&u(),p=n.subscribe(f);return l.add(u),()=>{p(),l.delete(u)}},dispatch(u){var f;try{return i=!((f=u==null?void 0:u.meta)!=null&&f[vw]),s=!i,s&&(o||(o=!0,c(d))),n.dispatch(u)}finally{i=!0}}})},HO=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new yw(e);return n&&i.push(bw(typeof n=="object"?n:void 0)),i};function KO(e){const t=qO(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:s=void 0,enhancers:o=void 0}=e||{};let l;if(typeof r=="function")l=r;else if(Xh(r))l=lw(r);else throw new Error(Bt(1));let c;typeof n=="function"?c=n(t):c=t();let d=ql;i&&(d=WO({trace:!1,...typeof i=="object"&&i}));const u=AO(...c),f=HO(u);let p=typeof o=="function"?o(f):f();const m=d(...p);return ow(l,s,m)}function jw(e){const t={},r=[];let n;const i={addCase(s,o){const l=typeof s=="string"?s:s.type;if(!l)throw new Error(Bt(28));if(l in t)throw new Error(Bt(29));return t[l]=o,i},addAsyncThunk(s,o){return o.pending&&(t[s.pending.type]=o.pending),o.rejected&&(t[s.rejected.type]=o.rejected),o.fulfilled&&(t[s.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:s.settled,reducer:o.settled}),i},addMatcher(s,o){return r.push({matcher:s,reducer:o}),i},addDefaultCase(s){return n=s,i}};return e(i),[t,r,n]}RO(!1);function VO(e){return typeof e=="function"}function YO(e,t){let[r,n,i]=jw(t),s;if(VO(e))s=()=>n0(e());else{const l=n0(e);s=()=>l}function o(l=s(),c){let d=[r[c.type],...n.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return d.filter(u=>!!u).length===0&&(d=[i]),d.reduce((u,f)=>{if(f)if(vi(u)){const m=f(u,c);return m===void 0?u:m}else{if(tn(u))return gw(u,p=>f(p,c));{const p=f(u,c);if(p===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return u},l)}return o.getInitialState=s,o}var ZO="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",GO=(e=21)=>{let t="",r=e;for(;r--;)t+=ZO[Math.random()*64|0];return t},XO=Symbol.for("rtk-slice-createasyncthunk");function JO(e,t){return`${e}/${t}`}function QO({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[XO];return function(i){const{name:s,reducerPath:o=s}=i;if(!s)throw new Error(Bt(11));const l=(typeof i.reducers=="function"?i.reducers(tE()):i.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(w,S){const N=typeof w=="string"?w:w.type;if(!N)throw new Error(Bt(12));if(N in d.sliceCaseReducersByType)throw new Error(Bt(13));return d.sliceCaseReducersByType[N]=S,u},addMatcher(w,S){return d.sliceMatchers.push({matcher:w,reducer:S}),u},exposeAction(w,S){return d.actionCreators[w]=S,u},exposeCaseReducer(w,S){return d.sliceCaseReducersByName[w]=S,u}};c.forEach(w=>{const S=l[w],N={reducerName:w,type:JO(s,w),createNotation:typeof i.reducers=="function"};nE(S)?aE(N,S,u,t):rE(N,S,u)});function f(){const[w={},S=[],N=void 0]=typeof i.extraReducers=="function"?jw(i.extraReducers):[i.extraReducers],_={...w,...d.sliceCaseReducersByType};return YO(i.initialState,C=>{for(let D in _)C.addCase(D,_[D]);for(let D of d.sliceMatchers)C.addMatcher(D.matcher,D.reducer);for(let D of S)C.addMatcher(D.matcher,D.reducer);N&&C.addDefaultCase(N)})}const p=w=>w,m=new Map,x=new WeakMap;let g;function v(w,S){return g||(g=f()),g(w,S)}function b(){return g||(g=f()),g.getInitialState()}function j(w,S=!1){function N(C){let D=C[w];return typeof D>"u"&&S&&(D=zo(x,N,b)),D}function _(C=p){const D=zo(m,S,()=>new WeakMap);return zo(D,C,()=>{const M={};for(const[I,A]of Object.entries(i.selectors??{}))M[I]=eE(A,C,()=>zo(x,C,b),S);return M})}return{reducerPath:w,getSelectors:_,get selectors(){return _(N)},selectSlice:N}}const y={name:s,reducer:v,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:b,...j(o),injectInto(w,{reducerPath:S,...N}={}){const _=S??o;return w.inject({reducerPath:_,reducer:v},N),{...y,...j(_,!0)}}};return y}}function eE(e,t,r,n){function i(s,...o){let l=t(s);return typeof l>"u"&&n&&(l=r()),e(l,...o)}return i.unwrapped=e,i}var At=QO();function tE(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function rE({type:e,reducerName:t,createNotation:r},n,i){let s,o;if("reducer"in n){if(r&&!iE(n))throw new Error(Bt(17));s=n.reducer,o=n.prepare}else s=n;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,o?ar(e,o):ar(e))}function nE(e){return e._reducerDefinitionType==="asyncThunk"}function iE(e){return e._reducerDefinitionType==="reducerWithPrepare"}function aE({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Bt(18));const{payloadCreator:s,fulfilled:o,pending:l,rejected:c,settled:d,options:u}=r,f=i(e,s,u);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),l&&n.addCase(f.pending,l),c&&n.addCase(f.rejected,c),d&&n.addMatcher(f.settled,d),n.exposeCaseReducer(t,{fulfilled:o||Ro,pending:l||Ro,rejected:c||Ro,settled:d||Ro})}function Ro(){}var sE="task",ww="listener",Sw="completed",em="cancelled",oE=`task-${em}`,lE=`task-${Sw}`,Vf=`${ww}-${em}`,cE=`${ww}-${Sw}`,au=class{constructor(e){mo(this,"name","TaskAbortError");mo(this,"message");this.code=e,this.message=`${sE} ${em} (reason: ${e})`}},tm=(e,t)=>{if(typeof e!="function")throw new TypeError(Bt(32))},Yl=()=>{},Nw=(e,t=Yl)=>(e.catch(t),e),kw=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),li=(e,t)=>{const r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},ci=e=>{if(e.aborted){const{reason:t}=e;throw new au(t)}};function Pw(e,t){let r=Yl;return new Promise((n,i)=>{const s=()=>i(new au(e.reason));if(e.aborted){s();return}r=kw(e,s),t.finally(()=>r()).then(n,i)}).finally(()=>{r=Yl})}var uE=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof au?"cancelled":"rejected",error:r}}finally{t==null||t()}},Zl=e=>t=>Nw(Pw(e,t).then(r=>(ci(e),r))),_w=e=>{const t=Zl(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:ia}=Object,a0={},su="listenerMiddleware",dE=(e,t)=>{const r=n=>kw(e,()=>li(n,e.reason));return(n,i)=>{tm(n);const s=new AbortController;r(s);const o=uE(async()=>{ci(e),ci(s.signal);const l=await n({pause:Zl(s.signal),delay:_w(s.signal),signal:s.signal});return ci(s.signal),l},()=>li(s,lE));return i!=null&&i.autoJoin&&t.push(o.catch(Yl)),{result:Zl(e)(o),cancel(){li(s,oE)}}}},fE=(e,t)=>{const r=async(n,i)=>{ci(t);let s=()=>{};const l=[new Promise((c,d)=>{let u=e({predicate:n,effect:(f,p)=>{p.unsubscribe(),c([f,p.getState(),p.getOriginalState()])}});s=()=>{u(),d()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await Pw(t,Promise.race(l));return ci(t),c}finally{s()}};return(n,i)=>Nw(r(n,i))},Cw=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:s}=e;if(t)i=ar(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error(Bt(21));return tm(s),{predicate:i,type:t,effect:s}},Aw=ia(e=>{const{type:t,predicate:r,effect:n}=Cw(e);return{id:GO(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Bt(22))}}},{withTypes:()=>Aw}),s0=(e,t)=>{const{type:r,effect:n,predicate:i}=Cw(t);return Array.from(e.values()).find(s=>(typeof r=="string"?s.type===r:s.predicate===i)&&s.effect===n)},Yf=e=>{e.pending.forEach(t=>{li(t,Vf)})},pE=(e,t)=>()=>{for(const r of t.keys())Yf(r);e.clear()},o0=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Ow=ia(ar(`${su}/add`),{withTypes:()=>Ow}),hE=ar(`${su}/removeAll`),Ew=ia(ar(`${su}/remove`),{withTypes:()=>Ew}),mE=(...e)=>{console.error(`${su}/error`,...e)},eo=(e={})=>{const t=new Map,r=new Map,n=m=>{const x=r.get(m)??0;r.set(m,x+1)},i=m=>{const x=r.get(m)??1;x===1?r.delete(m):r.set(m,x-1)},{extra:s,onError:o=mE}=e;tm(o);const l=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),x=>{m.unsubscribe(),x!=null&&x.cancelActive&&Yf(m)}),c=m=>{const x=s0(t,m)??Aw(m);return l(x)};ia(c,{withTypes:()=>c});const d=m=>{const x=s0(t,m);return x&&(x.unsubscribe(),m.cancelActive&&Yf(x)),!!x};ia(d,{withTypes:()=>d});const u=async(m,x,g,v)=>{const b=new AbortController,j=fE(c,b.signal),y=[];try{m.pending.add(b),n(m),await Promise.resolve(m.effect(x,ia({},g,{getOriginalState:v,condition:(w,S)=>j(w,S).then(Boolean),take:j,delay:_w(b.signal),pause:Zl(b.signal),extra:s,signal:b.signal,fork:dE(b.signal,y),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((w,S,N)=>{w!==b&&(li(w,Vf),N.delete(w))})},cancel:()=>{li(b,Vf),m.pending.delete(b)},throwIfCancelled:()=>{ci(b.signal)}})))}catch(w){w instanceof au||o0(o,w,{raisedBy:"effect"})}finally{await Promise.all(y),li(b,cE),i(m),m.pending.delete(b)}},f=pE(t,r);return{middleware:m=>x=>g=>{if(!cw(g))return x(g);if(Ow.match(g))return c(g.payload);if(hE.match(g)){f();return}if(Ew.match(g))return d(g.payload);let v=m.getState();const b=()=>{if(v===a0)throw new Error(Bt(23));return v};let j;try{if(j=x(g),t.size>0){const y=m.getState(),w=Array.from(t.values());for(const S of w){let N=!1;try{N=S.predicate(g,y,v)}catch(_){N=!1,o0(o,_,{raisedBy:"predicate"})}N&&u(S,g,m,b)}}}finally{v=a0}return j},startListening:c,stopListening:d,clearListeners:f}};function Bt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var gE={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Dw=At({name:"chartLayout",initialState:gE,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,s;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(s=t.payload.left)!==null&&s!==void 0?s:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:xE,setLayout:yE,setChartSize:vE,setScale:bE}=Dw.actions,jE=Dw.reducer;function Tw(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function l0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Yi(e){for(var t=1;t{if(t&&r){var{width:n,height:i}=r,{align:s,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&s!=="center"&&Z(e[s]))return Yi(Yi({},e),{},{[s]:e[s]+(n||0)});if((l==="horizontal"||l==="vertical"&&s==="center")&&o!=="middle"&&Z(e[o]))return Yi(Yi({},e),{},{[o]:e[o]+(i||0)})}return e},Mr=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",Mw=(e,t,r,n)=>{if(n)return e.map(l=>l.coordinate);var i,s,o=e.map(l=>(l.coordinate===t&&(i=!0),l.coordinate===r&&(s=!0),l.coordinate));return i||o.push(t),s||o.push(r),o},Iw=(e,t,r)=>{if(!e)return null;var{duplicateDomain:n,type:i,range:s,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:d,tickCount:u,ticks:f,niceTicks:p,axisType:m}=e;if(!o)return null;var x=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,g=i==="category"&&o.bandwidth?o.bandwidth()/x:0;if(g=m==="angleAxis"&&s&&s.length>=2?Jt(s[0]-s[1])*2*g:g,f||p){var v=(f||p||[]).map((b,j)=>{var y=n?n.indexOf(b):b;return{coordinate:o(y)+g,value:b,offset:g,index:j}});return v.filter(b=>!yr(b.coordinate))}return c&&d?d.map((b,j)=>({coordinate:o(b)+g,value:b,index:j,offset:g})):o.ticks&&u!=null?o.ticks(u).map((b,j)=>({coordinate:o(b)+g,value:b,offset:g,index:j})):o.domain().map((b,j)=>({coordinate:o(b)+g,value:n?n[b]:b,index:j,offset:g}))},c0=1e-4,PE=e=>{var t=e.domain();if(!(!t||t.length<=2)){var r=t.length,n=e.range(),i=Math.min(n[0],n[1])-c0,s=Math.max(n[0],n[1])+c0,o=e(t[0]),l=e(t[r-1]);(os||ls)&&e.domain([t[0],t[r-1]])}},_E=e=>{var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r=0?(e[o][r][0]=i,e[o][r][1]=i+l,i=e[o][r][1]):(e[o][r][0]=s,e[o][r][1]=s+l,s=e[o][r][1])}},CE=e=>{var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r=0?(e[s][r][0]=i,e[s][r][1]=i+o,i=e[s][r][1]):(e[s][r][0]=0,e[s][r][1]=0)}},AE={sign:_E,expand:R4,none:ma,silhouette:B4,wiggle:F4,positive:CE},OE=(e,t,r)=>{var n=AE[r],i=z4().keys(t).value((s,o)=>Number(et(s,o,0))).order(zf).offset(n);return i(e)};function EE(e){return e==null?void 0:String(e)}function Gl(e){var{axis:t,ticks:r,bandSize:n,entry:i,index:s,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Re(i[t.dataKey])){var l=Tj(r,"value",i[t.dataKey]);if(l)return l.coordinate+n/2}return r[s]?r[s].coordinate+n/2:null}var c=et(i,Re(o)?t.dataKey:o);return Re(c)?null:t.scale(c)}var DE=e=>{var t=e.flat(2).filter(Z);return[Math.min(...t),Math.max(...t)]},TE=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ME=(e,t,r)=>{if(e!=null)return TE(Object.keys(e).reduce((n,i)=>{var s=e[i],{stackedData:o}=s,l=o.reduce((c,d)=>{var u=Tw(d,t,r),f=DE(u);return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],n[0]),Math.max(l[1],n[1])]},[1/0,-1/0]))},u0=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,d0=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ga=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=tu(t,u=>u.coordinate),s=1/0,o=1,l=i.length;o{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},$E=(e,t)=>t==="centric"?e.angle:e.radius,cn=e=>e.layout.width,un=e=>e.layout.height,LE=e=>e.layout.scale,$w=e=>e.layout.margin,lu=$(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),cu=$(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),zE="data-recharts-item-index",RE="data-recharts-item-data-key",to=60;function p0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bo(e){for(var t=1;te.brush.height;function qE(e){var t=cu(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:to;return r+i}return r},0)}function HE(e){var t=cu(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:to;return r+i}return r},0)}function KE(e){var t=lu(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function VE(e){var t=lu(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var rt=$([cn,un,$w,UE,qE,HE,KE,VE,sw,SO],(e,t,r,n,i,s,o,l,c,d)=>{var u={left:(r.left||0)+i,right:(r.right||0)+s},f={top:(r.top||0)+o,bottom:(r.bottom||0)+l},p=Bo(Bo({},f),u),m=p.bottom;p.bottom+=n,p=kE(p,c,d);var x=e-p.left-p.right,g=t-p.top-p.bottom;return Bo(Bo({brushBottom:m},p),{},{width:Math.max(x,0),height:Math.max(g,0)})}),YE=$(rt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Lw=$(cn,un,(e,t)=>({x:0,y:0,width:e,height:t})),ZE=h.createContext(null),pt=()=>h.useContext(ZE)!=null,uu=e=>e.brush,du=$([uu,rt,$w],(e,t,r)=>({height:e.height,x:Z(e.x)?e.x:t.left,y:Z(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Z(e.width)?e.width:t.width})),zw={},Rw={},Bw={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n,{signal:i,edges:s}={}){let o,l=null;const c=s!=null&&s.includes("leading"),d=s==null||s.includes("trailing"),u=()=>{l!==null&&(r.apply(o,l),o=void 0,l=null)},f=()=>{d&&u(),g()};let p=null;const m=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,f()},n)},x=()=>{p!==null&&(clearTimeout(p),p=null)},g=()=>{x(),o=void 0,l=null},v=()=>{u()},b=function(...j){if(i!=null&&i.aborted)return;o=this,l=j;const y=p==null;m(),c&&y&&u()};return b.schedule=m,b.cancel=g,b.flush=v,i==null||i.addEventListener("abort",g,{once:!0}),b}e.debounce=t})(Bw);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bw;function r(n,i=0,s={}){typeof s!="object"&&(s={});const{leading:o=!1,trailing:l=!0,maxWait:c}=s,d=Array(2);o&&(d[0]="leading"),l&&(d[1]="trailing");let u,f=null;const p=t.debounce(function(...g){u=n.apply(this,g),f=null},i,{edges:d}),m=function(...g){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(u=n.apply(this,g),f=Date.now(),p.cancel(),p.schedule(),u):(p.apply(this,g),u)},x=()=>(p.flush(),u);return m.cancel=p.cancel,m.flush=x,m}e.debounce=r})(Rw);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rw;function r(n,i=0,s={}){const{leading:o=!0,trailing:l=!0}=s;return t.debounce(n,i,{leading:o,maxWait:i,trailing:l})}e.throttle=r})(zw);var GE=zw.throttle;const XE=Tr(GE);var Xl=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s{var{width:n="100%",height:i="100%",aspect:s,maxHeight:o}=r,l=en(n)?e:Number(n),c=en(i)?t:Number(i);return s&&s>0&&(l?c=l/s:c&&(l=c*s),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},JE={width:0,height:0,overflow:"visible"},QE={width:0,overflowX:"visible"},e5={height:0,overflowY:"visible"},t5={},r5=e=>{var{width:t,height:r}=e,n=en(t),i=en(r);return n&&i?JE:n?QE:i?e5:t5};function n5(e){var{width:t,height:r,aspect:n}=e,i=t,s=r;return i===void 0&&s===void 0?(i="100%",s="100%"):i===void 0?i=n&&n>0?void 0:"100%":s===void 0&&(s=n&&n>0?void 0:"100%"),{width:i,height:s}}function Pe(e){return Number.isFinite(e)}function Er(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Zf(){return Zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:r,height:n}),[r,n]);return o5(i)?h.createElement(Ww.Provider,{value:i},t):null}var rm=()=>h.useContext(Ww),l5=h.forwardRef((e,t)=>{var{aspect:r,initialDimension:n={width:-1,height:-1},width:i,height:s,minWidth:o=0,minHeight:l,maxHeight:c,children:d,debounce:u=0,id:f,className:p,onResize:m,style:x={}}=e,g=h.useRef(null),v=h.useRef();v.current=m,h.useImperativeHandle(t,()=>g.current);var[b,j]=h.useState({containerWidth:n.width,containerHeight:n.height}),y=h.useCallback((C,D)=>{j(M=>{var I=Math.round(C),A=Math.round(D);return M.containerWidth===I&&M.containerHeight===A?M:{containerWidth:I,containerHeight:A}})},[]);h.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return _a;var C=A=>{var R,{width:q,height:Y}=A[0].contentRect;y(q,Y),(R=v.current)===null||R===void 0||R.call(v,q,Y)};u>0&&(C=XE(C,u,{trailing:!0,leading:!1}));var D=new ResizeObserver(C),{width:M,height:I}=g.current.getBoundingClientRect();return y(M,I),D.observe(g.current),()=>{D.disconnect()}},[y,u]);var{containerWidth:w,containerHeight:S}=b;Xl(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:N,calculatedHeight:_}=Fw(w,S,{width:i,height:s,aspect:r,maxHeight:c});return Xl(N!=null&&N>0||_!=null&&_>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,N,_,i,s,o,l,r),h.createElement("div",{id:f?"".concat(f):void 0,className:ue("recharts-responsive-container",p),style:m0(m0({},x),{},{width:i,height:s,minWidth:o,minHeight:l,maxHeight:c}),ref:g},h.createElement("div",{style:r5({width:i,height:s})},h.createElement(Uw,{width:N,height:_},d)))}),g0=h.forwardRef((e,t)=>{var r=rm();if(Er(r.width)&&Er(r.height))return e.children;var{width:n,height:i}=n5({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:o}=Fw(void 0,void 0,{width:n,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Z(s)&&Z(o)?h.createElement(Uw,{width:s,height:o},e.children):h.createElement(l5,Zf({},e,{width:n,height:i,ref:t}))});function qw(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var fu=()=>{var e,t=pt(),r=G(YE),n=G(du),i=(e=G(uu))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},c5={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Hw=()=>{var e;return(e=G(rt))!==null&&e!==void 0?e:c5},Kw=()=>G(cn),Vw=()=>G(un),de=e=>e.layout.layoutType,ro=()=>G(de),u5=()=>{var e=ro();return e!==void 0},pu=e=>{var t=Ye(),r=pt(),{width:n,height:i}=e,s=rm(),o=n,l=i;return s&&(o=s.width>0?s.width:n,l=s.height>0?s.height:i),h.useEffect(()=>{!r&&Er(o)&&Er(l)&&t(vE({width:o,height:l}))},[t,r,o,l]),null},d5={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},Yw=At({name:"legend",initialState:d5,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:Le()},removeLegendPayload:{reducer(e,t){var r=Kr(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:Le()}}}),{setLegendSize:E7,setLegendSettings:D7,addLegendPayload:f5,removeLegendPayload:p5}=Yw.actions,h5=Yw.reducer;function Gf(){return Gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=" : ",contentStyle:r={},itemStyle:n={},labelStyle:i={},payload:s,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:u,labelFormatter:f,accessibilityLayer:p=!1}=e,m=()=>{if(s&&s.length){var S={padding:0,margin:0},N=(l?tu(s,l):s).map((_,C)=>{if(_.type==="none")return null;var D=_.formatter||o||y5,{value:M,name:I}=_,A=M,R=I;if(D){var q=D(M,I,_,C,s);if(Array.isArray(q))[A,R]=q;else if(q!=null)A=q;else return null}var Y=xd({display:"block",paddingTop:4,paddingBottom:4,color:_.color||"#000"},n);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(C),style:Y},Or(R)?h.createElement("span",{className:"recharts-tooltip-item-name"},R):null,Or(R)?h.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,h.createElement("span",{className:"recharts-tooltip-item-value"},A),h.createElement("span",{className:"recharts-tooltip-item-unit"},_.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:S},N)}return null},x=xd({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},r),g=xd({margin:0},i),v=!Re(u),b=v?u:"",j=ue("recharts-default-tooltip",c),y=ue("recharts-tooltip-label",d);v&&f&&s!==void 0&&s!==null&&(b=f(u,s));var w=p?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",Gf({className:j,style:x},w),h.createElement("p",{className:y,style:g},h.isValidElement(b)?b:"".concat(b)),m())},qa="recharts-tooltip-wrapper",b5={visibility:"hidden"};function j5(e){var{coordinate:t,translateX:r,translateY:n}=e;return ue(qa,{["".concat(qa,"-right")]:Z(r)&&t&&Z(t.x)&&r>=t.x,["".concat(qa,"-left")]:Z(r)&&t&&Z(t.x)&&r=t.y,["".concat(qa,"-top")]:Z(n)&&t&&Z(t.y)&&n0?i:0),f=r[n]+i;if(t[n])return o[n]?u:f;var p=c[n];if(p==null)return 0;if(o[n]){var m=u,x=p;return mv?Math.max(u,p):Math.max(f,p)}function w5(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function S5(e){var{allowEscapeViewBox:t,coordinate:r,offsetTopLeft:n,position:i,reverseDirection:s,tooltipBox:o,useTranslate3d:l,viewBox:c}=e,d,u,f;return o.height>0&&o.width>0&&r?(u=y0({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=y0({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),d=w5({translateX:u,translateY:f,useTranslate3d:l})):d=b5,{cssProperties:d,cssClasses:j5({translateX:u,translateY:f,coordinate:r})}}function v0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fo(e){for(var t=1;t{if(t.key==="Escape"){var r,n,i,s;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(r=(n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==null&&r!==void 0?r:0,y:(i=(s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,r;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:r,animationDuration:n,animationEasing:i,children:s,coordinate:o,hasPayload:l,isAnimationActive:c,offset:d,position:u,reverseDirection:f,useTranslate3d:p,viewBox:m,wrapperStyle:x,lastBoundingBox:g,innerRef:v,hasPortalFromProps:b}=this.props,{cssClasses:j,cssProperties:y}=S5({allowEscapeViewBox:r,coordinate:o,offsetTopLeft:d,position:u,reverseDirection:f,tooltipBox:{height:g.height,width:g.width},useTranslate3d:p,viewBox:m}),w=b?{}:Fo(Fo({transition:c&&t?"transform ".concat(n,"ms ").concat(i):void 0},y),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),S=Fo(Fo({},w),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},x);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:j,style:S,ref:v},s)}}var _5=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Ci={devToolsEnabled:!1,isSsr:_5()},Zw=()=>{var e;return(e=G(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Jf(){return Jf=Object.assign?Object.assign.bind():function(e){for(var t=1;tPe(e.x)&&Pe(e.y),S0=e=>e.base!=null&&Jl(e.base)&&Jl(e),Ha=e=>e.x,Ka=e=>e.y,E5=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Js(e));return(r==="curveMonotone"||r==="curveBump")&&t?w0["".concat(r).concat(t==="vertical"?"Y":"X")]:w0[r]||Yc},D5=e=>{var{type:t="linear",points:r=[],baseLine:n,layout:i,connectNulls:s=!1}=e,o=E5(t,i),l=s?r.filter(Jl):r,c;if(Array.isArray(n)){var d=r.map((m,x)=>j0(j0({},m),{},{base:n[x]}));i==="vertical"?c=Mo().y(Ka).x1(Ha).x0(m=>m.base.x):c=Mo().x(Ha).y1(Ka).y0(m=>m.base.y);var u=c.defined(S0).curve(o),f=s?d.filter(S0):d;return u(f)}i==="vertical"&&Z(n)?c=Mo().y(Ka).x1(Ha).x0(n):Z(n)?c=Mo().x(Ha).y1(Ka).y0(n):c=vj().x(Ha).y(Ka);var p=c.defined(Jl).curve(o);return p(l)},fs=e=>{var{className:t,points:r,path:n,pathRef:i}=e;if((!r||!r.length)&&!n)return null;var s=r&&r.length?D5(e):n;return h.createElement("path",Jf({},nr(e),zh(e),{className:ue("recharts-curve",t),d:s===null?void 0:s,ref:i}))},T5=["x","y","top","left","width","height","className"];function Qf(){return Qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(n,"M").concat(s,",").concat(t,"h").concat(r),F5=e=>{var{x:t=0,y:r=0,top:n=0,left:i=0,width:s=0,height:o=0,className:l}=e,c=z5(e,T5),d=M5({x:t,y:r,top:n,left:i,width:s,height:o},c);return!Z(t)||!Z(r)||!Z(s)||!Z(o)||!Z(n)||!Z(i)?null:h.createElement("path",Qf({},ut(d),{className:ue("recharts-cross",l),d:B5(t,r,s,o,n,i)}))};function W5(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function k0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function P0(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Gw=(e,t,r)=>e.map(n=>"".concat(K5(n)," ").concat(t,"ms ").concat(r)).join(","),V5=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(i=>n.includes(i))),zs=(e,t)=>Object.keys(t).reduce((r,n)=>P0(P0({},r),{},{[n]:e(n,t[n])}),{});function _0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $e(e){for(var t=1;te+(t-e)*r,ep=e=>{var{from:t,to:r}=e;return t!==r},Xw=(e,t,r)=>{var n=zs((i,s)=>{if(ep(s)){var[o,l]=e(s.from,s.to,s.velocity);return $e($e({},s),{},{from:o,velocity:l})}return s},t);return r<1?zs((i,s)=>ep(s)?$e($e({},s),{},{velocity:Ql(s.velocity,n[i].velocity,r),from:Ql(s.from,n[i].from,r)}):s,t):Xw(e,n,r-1)};function X5(e,t,r,n,i,s){var o,l=n.reduce((p,m)=>$e($e({},p),{},{[m]:{from:e[m],velocity:0,to:t[m]}}),{}),c=()=>zs((p,m)=>m.from,l),d=()=>!Object.values(l).filter(ep).length,u=null,f=p=>{o||(o=p);var m=p-o,x=m/r.dt;l=Xw(r,l,x),i($e($e($e({},e),t),c())),o=p,d()||(u=s.setTimeout(f))};return()=>(u=s.setTimeout(f),()=>{var p;(p=u)===null||p===void 0||p()})}function J5(e,t,r,n,i,s,o){var l=null,c=i.reduce((f,p)=>$e($e({},f),{},{[p]:[e[p],t[p]]}),{}),d,u=f=>{d||(d=f);var p=(f-d)/n,m=zs((g,v)=>Ql(...v,r(p)),c);if(s($e($e($e({},e),t),m)),p<1)l=o.setTimeout(u);else{var x=zs((g,v)=>Ql(...v,r(1)),c);s($e($e($e({},e),t),x))}};return()=>(l=o.setTimeout(u),()=>{var f;(f=l)===null||f===void 0||f()})}const Q5=(e,t,r,n,i,s)=>{var o=V5(e,t);return r==null?()=>(i($e($e({},e),t)),()=>{}):r.isStepper===!0?X5(e,t,r,o,i,s):J5(e,t,r,n,o,i,s)};var ec=1e-4,Jw=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],Qw=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),C0=(e,t)=>r=>{var n=Jw(e,t);return Qw(n,r)},e3=(e,t)=>r=>{var n=Jw(e,t),i=[...n.map((s,o)=>s*o).slice(1),0];return Qw(i,r)},t3=function(){for(var t=arguments.length,r=new Array(t),n=0;nparseFloat(l));return[o[0],o[1],o[2],o[3]]}}}return r.length===4?r:[0,0,1,1]},r3=(e,t,r,n)=>{var i=C0(e,r),s=C0(t,n),o=e3(e,r),l=d=>d>1?1:d<0?0:d,c=d=>{for(var u=d>1?1:d,f=u,p=0;p<8;++p){var m=i(f)-u,x=o(f);if(Math.abs(m-u)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:n=8,dt:i=17}=t,s=(o,l,c)=>{var d=-(o-l)*r,u=c*n,f=c+(d-u)*i/1e3,p=c*i/1e3+o;return Math.abs(p-l){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return A0(e);case"spring":return n3();default:if(e.split("(")[0]==="cubic-bezier")return A0(e)}return typeof e=="function"?e:null};function a3(e){var t,r=()=>null,n=!1,i=null,s=o=>{if(!n){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...d]=l;if(typeof c=="number"){i=e.setTimeout(s.bind(null,d),c);return}s(c),i=e.setTimeout(s.bind(null,d));return}typeof o=="string"&&(t=o,r(t)),typeof o=="object"&&(t=o,r(t)),typeof o=="function"&&o()}};return{stop:()=>{n=!0},start:o=>{n=!1,i&&(i(),i=null),s(o)},subscribe:o=>(r=o,()=>{r=()=>null}),getTimeoutController:()=>e}}class s3{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,s=o=>{o-n>=r?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(s))};return i=requestAnimationFrame(s),()=>{i!=null&&cancelAnimationFrame(i)}}}function o3(){return a3(new s3)}var l3=h.createContext(o3);function c3(e,t){var r=h.useContext(l3);return h.useMemo(()=>t??r(e),[e,t,r])}var u3={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},O0={t:0},yd={t:1};function hu(e){var t=ft(e,u3),{isActive:r,canBegin:n,duration:i,easing:s,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,u=c3(t.animationId,t.animationManager),[f,p]=h.useState(r?O0:yd),m=h.useRef(null);return h.useEffect(()=>{r||p(yd)},[r]),h.useEffect(()=>{if(!r||!n)return _a;var x=Q5(O0,yd,i3(s),i,p,u.getTimeoutController()),g=()=>{m.current=x()};return u.start([c,o,g,i,l]),()=>{u.stop(),m.current&&m.current(),l()}},[r,n,i,s,o,c,l,u]),d(f.t)}function mu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=h.useRef(Ms(t)),n=h.useRef(e);return n.current!==e&&(r.current=Ms(t),n.current=e),r.current}var d3=["radius"],f3=["radius"];function E0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function D0(e){for(var t=1;t{var s=Math.min(Math.abs(r)/2,Math.abs(n)/2),o=n>=0?1:-1,l=r>=0?1:-1,c=n>=0&&r>=0||n<0&&r<0?1:0,d;if(s>0&&i instanceof Array){for(var u=[0,0,0,0],f=0,p=4;fs?s:i[f];d="M".concat(e,",").concat(t+o*u[0]),u[0]>0&&(d+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(c,",").concat(e+l*u[0],",").concat(t)),d+="L ".concat(e+r-l*u[1],",").concat(t),u[1]>0&&(d+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(c,`, - `).concat(e+r,",").concat(t+o*u[1])),d+="L ".concat(e+r,",").concat(t+n-o*u[2]),u[2]>0&&(d+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(c,`, - `).concat(e+r-l*u[2],",").concat(t+n)),d+="L ".concat(e+l*u[3],",").concat(t+n),u[3]>0&&(d+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(c,`, - `).concat(e,",").concat(t+n-o*u[3])),d+="Z"}else if(s>0&&i===+i&&i>0){var m=Math.min(s,i);d="M ".concat(e,",").concat(t+o*m,` - A `).concat(m,",").concat(m,",0,0,").concat(c,",").concat(e+l*m,",").concat(t,` - L `).concat(e+r-l*m,",").concat(t,` - A `).concat(m,",").concat(m,",0,0,").concat(c,",").concat(e+r,",").concat(t+o*m,` - L `).concat(e+r,",").concat(t+n-o*m,` - A `).concat(m,",").concat(m,",0,0,").concat(c,",").concat(e+r-l*m,",").concat(t+n,` - L `).concat(e+l*m,",").concat(t+n,` - A `).concat(m,",").concat(m,",0,0,").concat(c,",").concat(e,",").concat(t+n-o*m," Z")}else d="M ".concat(e,",").concat(t," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return d},I0={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},e2=e=>{var t=ft(e,I0),r=h.useRef(null),[n,i]=h.useState(-1);h.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var T=r.current.getTotalLength();T&&i(T)}catch{}},[]);var{x:s,y:o,width:l,height:c,radius:d,className:u}=t,{animationEasing:f,animationDuration:p,animationBegin:m,isAnimationActive:x,isUpdateAnimationActive:g}=t,v=h.useRef(l),b=h.useRef(c),j=h.useRef(s),y=h.useRef(o),w=h.useMemo(()=>({x:s,y:o,width:l,height:c,radius:d}),[s,o,l,c,d]),S=mu(w,"rectangle-");if(s!==+s||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var N=ue("recharts-rectangle",u);if(!g){var _=ut(t),{radius:C}=_,D=T0(_,d3);return h.createElement("path",tc({},D,{radius:typeof d=="number"?d:void 0,className:N,d:M0(s,o,l,c,d)}))}var M=v.current,I=b.current,A=j.current,R=y.current,q="0px ".concat(n===-1?1:n,"px"),Y="".concat(n,"px 0px"),P=Gw(["strokeDasharray"],p,typeof f=="string"?f:I0.animationEasing);return h.createElement(hu,{animationId:S,key:S,canBegin:n>0,duration:p,easing:f,isActive:g,begin:m},T=>{var O=Ee(M,l,T),k=Ee(I,c,T),L=Ee(A,s,T),F=Ee(R,o,T);r.current&&(v.current=O,b.current=k,j.current=L,y.current=F);var H;x?T>0?H={transition:P,strokeDasharray:Y}:H={strokeDasharray:q}:H={strokeDasharray:Y};var ee=ut(t),{radius:re}=ee,Me=T0(ee,f3);return h.createElement("path",tc({},Me,{radius:typeof d=="number"?d:void 0,className:N,d:M0(L,F,O,k,d),ref:r,style:D0(D0({},H),t.style)}))})};function $0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function L0(e){for(var t=1;te*180/Math.PI,Je=(e,t,r,n)=>({x:e+Math.cos(-rc*n)*r,y:t+Math.sin(-rc*n)*r}),j3=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},w3=(e,t)=>{var{x:r,y:n}=e,{x:i,y:s}=t;return Math.sqrt((r-i)**2+(n-s)**2)},S3=(e,t)=>{var{x:r,y:n}=e,{cx:i,cy:s}=t,o=w3({x:r,y:n},{x:i,y:s});if(o<=0)return{radius:o,angle:0};var l=(r-i)/o,c=Math.acos(l);return n>s&&(c=2*Math.PI-c),{radius:o,angle:b3(c),angleInRadian:c}},N3=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),i=Math.floor(r/360),s=Math.min(n,i);return{startAngle:t-s*360,endAngle:r-s*360}},k3=(e,t)=>{var{startAngle:r,endAngle:n}=t,i=Math.floor(r/360),s=Math.floor(n/360),o=Math.min(i,s);return e+o*360},P3=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:i,angle:s}=S3({x:r,y:n},t),{innerRadius:o,outerRadius:l}=t;if(il||i===0)return null;var{startAngle:c,endAngle:d}=N3(t),u=s,f;if(c<=d){for(;u>d;)u-=360;for(;u=c&&u<=d}else{for(;u>c;)u-=360;for(;u=d&&u<=c}return f?L0(L0({},t),{},{radius:i,angle:k3(u,t)}):null};function t2(e){var{cx:t,cy:r,radius:n,startAngle:i,endAngle:s}=e,o=Je(t,r,n,i),l=Je(t,r,n,s);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:i,endAngle:s}}function tp(){return tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=Jt(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},Wo=e=>{var{cx:t,cy:r,radius:n,angle:i,sign:s,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,d=l*(o?1:-1)+n,u=Math.asin(l/d)/rc,f=c?i:i+s*u,p=Je(t,r,d,f),m=Je(t,r,n,f),x=c?i-s*u:i,g=Je(t,r,d*Math.cos(u*rc),x);return{center:p,circleTangency:m,lineTangency:g,theta:u}},r2=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:s,endAngle:o}=e,l=_3(s,o),c=s+l,d=Je(t,r,i,s),u=Je(t,r,i,c),f="M ".concat(d.x,",").concat(d.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(s>c),`, - `).concat(u.x,",").concat(u.y,` - `);if(n>0){var p=Je(t,r,n,s),m=Je(t,r,n,c);f+="L ".concat(m.x,",").concat(m.y,` - A `).concat(n,",").concat(n,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(s<=c),`, - `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(t,",").concat(r," Z");return f},C3=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,cornerRadius:s,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,u=Jt(d-c),{circleTangency:f,lineTangency:p,theta:m}=Wo({cx:t,cy:r,radius:i,angle:c,sign:u,cornerRadius:s,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:v}=Wo({cx:t,cy:r,radius:i,angle:d,sign:-u,cornerRadius:s,cornerIsExternal:l}),b=l?Math.abs(c-d):Math.abs(c-d)-m-v;if(b<0)return o?"M ".concat(p.x,",").concat(p.y,` - a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 - a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 - `):r2({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:c,endAngle:d});var j="M ".concat(p.x,",").concat(p.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(u<0),",").concat(f.x,",").concat(f.y,` - A`).concat(i,",").concat(i,",0,").concat(+(b>180),",").concat(+(u<0),",").concat(x.x,",").concat(x.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(u<0),",").concat(g.x,",").concat(g.y,` - `);if(n>0){var{circleTangency:y,lineTangency:w,theta:S}=Wo({cx:t,cy:r,radius:n,angle:c,sign:u,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),{circleTangency:N,lineTangency:_,theta:C}=Wo({cx:t,cy:r,radius:n,angle:d,sign:-u,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),D=l?Math.abs(c-d):Math.abs(c-d)-S-C;if(D<0&&s===0)return"".concat(j,"L").concat(t,",").concat(r,"Z");j+="L".concat(_.x,",").concat(_.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(u<0),",").concat(N.x,",").concat(N.y,` - A`).concat(n,",").concat(n,",0,").concat(+(D>180),",").concat(+(u>0),",").concat(y.x,",").concat(y.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(u<0),",").concat(w.x,",").concat(w.y,"Z")}else j+="L".concat(t,",").concat(r,"Z");return j},A3={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},n2=e=>{var t=ft(e,A3),{cx:r,cy:n,innerRadius:i,outerRadius:s,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u,className:f}=t;if(s0&&Math.abs(d-u)<360?g=C3({cx:r,cy:n,innerRadius:i,outerRadius:s,cornerRadius:Math.min(x,m/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):g=r2({cx:r,cy:n,innerRadius:i,outerRadius:s,startAngle:d,endAngle:u}),h.createElement("path",tp({},ut(t),{className:p,d:g}))};function O3(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if($j(t)){if(e==="centric"){var{cx:n,cy:i,innerRadius:s,outerRadius:o,angle:l}=t,c=Je(n,i,s,l),d=Je(n,i,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return t2(t)}}var i2={},a2={},s2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zh;function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(s2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=s2;function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(a2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Gh,r=a2;function n(i,s,o){o&&typeof o!="number"&&t.isIterateeCall(i,s,o)&&(s=o=void 0),i=r.toFinite(i),s===void 0?(s=i,i=0):s=r.toFinite(s),o=o===void 0?it?1:e>=t?0:NaN}function D3(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function nm(e){let t,r,n;e.length!==2?(t=In,r=(l,c)=>In(e(l),c),n=(l,c)=>e(l)-c):(t=e===In||e===D3?e:T3,r=e,n=e);function i(l,c,d=0,u=l.length){if(d>>1;r(l[f],c)<0?d=f+1:u=f}while(d>>1;r(l[f],c)<=0?d=f+1:u=f}while(dd&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:i,center:o,right:s}}function T3(){return 0}function l2(e){return e===null?NaN:+e}function*M3(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const I3=nm(In),no=I3.right;nm(l2).center;class z0 extends Map{constructor(t,r=z3){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(R0(this,t))}has(t){return super.has(R0(this,t))}set(t,r){return super.set($3(this,t),r)}delete(t){return super.delete(L3(this,t))}}function R0({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function $3({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function L3({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function z3(e){return e!==null&&typeof e=="object"?e.valueOf():e}function R3(e=In){if(e===In)return c2;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function c2(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const B3=Math.sqrt(50),F3=Math.sqrt(10),W3=Math.sqrt(2);function nc(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),o=s>=B3?10:s>=F3?5:s>=W3?2:1;let l,c,d;return i<0?(d=Math.pow(10,-i)/o,l=Math.round(e*d),c=Math.round(t*d),l/dt&&--c,d=-d):(d=Math.pow(10,i)*o,l=Math.round(e/d),c=Math.round(t/d),l*dt&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const l=s-i+1,c=new Array(l);if(n)if(o<0)for(let d=0;d=n)&&(r=n);return r}function F0(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function u2(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?c2:R3(i);n>r;){if(n-r>600){const c=n-r+1,d=t-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*f*(c-f)/c)*(d-c/2<0?-1:1),m=Math.max(r,Math.floor(t-d*f/c+p)),x=Math.min(n,Math.floor(t+(c-d)*f/c+p));u2(e,t,m,x,i)}const s=e[t];let o=r,l=n;for(Va(e,r,t),i(e[n],s)>0&&Va(e,r,n);o0;)--l}i(e[r],s)===0?Va(e,r,l):(++l,Va(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Va(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function U3(e,t,r){if(e=Float64Array.from(M3(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return F0(e);if(t>=1)return B0(e);var n,i=(n-1)*t,s=Math.floor(i),o=B0(u2(e,s).subarray(0,s+1)),l=F0(e.subarray(s+1));return o+(l-o)*(i-s)}}function q3(e,t,r=l2){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,s=Math.floor(i),o=+r(e[s],s,e),l=+r(e[s+1],s+1,e);return o+(l-o)*(i-s)}}function H3(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,s=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Uo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Uo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Y3.exec(e))?new kt(t[1],t[2],t[3],1):(t=Z3.exec(e))?new kt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=G3.exec(e))?Uo(t[1],t[2],t[3],t[4]):(t=X3.exec(e))?Uo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=J3.exec(e))?Y0(t[1],t[2]/100,t[3]/100,1):(t=Q3.exec(e))?Y0(t[1],t[2]/100,t[3]/100,t[4]):W0.hasOwnProperty(e)?H0(W0[e]):e==="transparent"?new kt(NaN,NaN,NaN,0):null}function H0(e){return new kt(e>>16&255,e>>8&255,e&255,1)}function Uo(e,t,r,n){return n<=0&&(e=t=r=NaN),new kt(e,t,r,n)}function rD(e){return e instanceof io||(e=Fs(e)),e?(e=e.rgb(),new kt(e.r,e.g,e.b,e.opacity)):new kt}function sp(e,t,r,n){return arguments.length===1?rD(e):new kt(e,t,r,n??1)}function kt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}sm(kt,sp,f2(io,{brighter(e){return e=e==null?ic:Math.pow(ic,e),new kt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Rs:Math.pow(Rs,e),new kt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kt(ui(this.r),ui(this.g),ui(this.b),ac(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:K0,formatHex:K0,formatHex8:nD,formatRgb:V0,toString:V0}));function K0(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}`}function nD(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}${ni((isNaN(this.opacity)?1:this.opacity)*255)}`}function V0(){const e=ac(this.opacity);return`${e===1?"rgb(":"rgba("}${ui(this.r)}, ${ui(this.g)}, ${ui(this.b)}${e===1?")":`, ${e})`}`}function ac(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ui(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ni(e){return e=ui(e),(e<16?"0":"")+e.toString(16)}function Y0(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new pr(e,t,r,n)}function p2(e){if(e instanceof pr)return new pr(e.h,e.s,e.l,e.opacity);if(e instanceof io||(e=Fs(e)),!e)return new pr;if(e instanceof pr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),s=Math.max(t,r,n),o=NaN,l=s-i,c=(s+i)/2;return l?(t===s?o=(r-n)/l+(r0&&c<1?0:o,new pr(o,l,c,e.opacity)}function iD(e,t,r,n){return arguments.length===1?p2(e):new pr(e,t,r,n??1)}function pr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}sm(pr,iD,f2(io,{brighter(e){return e=e==null?ic:Math.pow(ic,e),new pr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rs:Math.pow(Rs,e),new pr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new kt(vd(e>=240?e-240:e+120,i,n),vd(e,i,n),vd(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new pr(Z0(this.h),qo(this.s),qo(this.l),ac(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ac(this.opacity);return`${e===1?"hsl(":"hsla("}${Z0(this.h)}, ${qo(this.s)*100}%, ${qo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Z0(e){return e=(e||0)%360,e<0?e+360:e}function qo(e){return Math.max(0,Math.min(1,e||0))}function vd(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const om=e=>()=>e;function aD(e,t){return function(r){return e+r*t}}function sD(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function oD(e){return(e=+e)==1?h2:function(t,r){return r-t?sD(t,r,e):om(isNaN(t)?r:t)}}function h2(e,t){var r=t-e;return r?aD(e,r):om(isNaN(e)?t:e)}const G0=function e(t){var r=oD(t);function n(i,s){var o=r((i=sp(i)).r,(s=sp(s)).r),l=r(i.g,s.g),c=r(i.b,s.b),d=h2(i.opacity,s.opacity);return function(u){return i.r=o(u),i.g=l(u),i.b=c(u),i.opacity=d(u),i+""}}return n.gamma=e,n}(1);function lD(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(s){for(i=0;ir&&(s=t.slice(r,s),l[o]?l[o]+=s:l[++o]=s),(n=n[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:sc(n,i)})),r=bd.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function vD(e,t,r){var n=e[0],i=e[1],s=t[0],o=t[1];return i2?bD:vD,c=d=null,f}function f(p){return p==null||isNaN(p=+p)?s:(c||(c=l(e.map(n),t,r)))(n(o(p)))}return f.invert=function(p){return o(i((d||(d=l(t,e.map(n),sc)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,oc),u()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),u()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),r=lm,u()},f.clamp=function(p){return arguments.length?(o=p?!0:mt,u()):o!==mt},f.interpolate=function(p){return arguments.length?(r=p,u()):r},f.unknown=function(p){return arguments.length?(s=p,f):s},function(p,m){return n=p,i=m,u()}}function cm(){return gu()(mt,mt)}function jD(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function lc(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function xa(e){return e=lc(Math.abs(e)),e?e[1]:NaN}function wD(e,t){return function(r,n){for(var i=r.length,s=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),s.push(r.substring(i-=l,i+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function SD(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var ND=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ws(e){if(!(t=ND.exec(e)))throw new Error("invalid format: "+e);var t;return new um({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ws.prototype=um.prototype;function um(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}um.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function kD(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var m2;function PD(e,t){var r=lc(e,t);if(!r)return e+"";var n=r[0],i=r[1],s=i-(m2=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return s===o?n:s>o?n+new Array(s-o+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+lc(e,Math.max(0,t+s-1))[0]}function J0(e,t){var r=lc(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Q0={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:jD,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>J0(e*100,t),r:J0,s:PD,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ey(e){return e}var ty=Array.prototype.map,ry=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _D(e){var t=e.grouping===void 0||e.thousands===void 0?ey:wD(ty.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?ey:SD(ty.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(f){f=Ws(f);var p=f.fill,m=f.align,x=f.sign,g=f.symbol,v=f.zero,b=f.width,j=f.comma,y=f.precision,w=f.trim,S=f.type;S==="n"?(j=!0,S="g"):Q0[S]||(y===void 0&&(y=12),w=!0,S="g"),(v||p==="0"&&m==="=")&&(v=!0,p="0",m="=");var N=g==="$"?r:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",_=g==="$"?n:/[%p]/.test(S)?o:"",C=Q0[S],D=/[defgprs%]/.test(S);y=y===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function M(I){var A=N,R=_,q,Y,P;if(S==="c")R=C(I)+R,I="";else{I=+I;var T=I<0||1/I<0;if(I=isNaN(I)?c:C(Math.abs(I),y),w&&(I=kD(I)),T&&+I==0&&x!=="+"&&(T=!1),A=(T?x==="("?x:l:x==="-"||x==="("?"":x)+A,R=(S==="s"?ry[8+m2/3]:"")+R+(T&&x==="("?")":""),D){for(q=-1,Y=I.length;++qP||P>57){R=(P===46?i+I.slice(q+1):I.slice(q))+R,I=I.slice(0,q);break}}}j&&!v&&(I=t(I,1/0));var O=A.length+I.length+R.length,k=O>1)+A+I+R+k.slice(O);break;default:I=k+A+I+R;break}return s(I)}return M.toString=function(){return f+""},M}function u(f,p){var m=d((f=Ws(f),f.type="f",f)),x=Math.max(-8,Math.min(8,Math.floor(xa(p)/3)))*3,g=Math.pow(10,-x),v=ry[8+x/3];return function(b){return m(g*b)+v}}return{format:d,formatPrefix:u}}var Ho,dm,g2;CD({thousands:",",grouping:[3],currency:["$",""]});function CD(e){return Ho=_D(e),dm=Ho.format,g2=Ho.formatPrefix,Ho}function AD(e){return Math.max(0,-xa(Math.abs(e)))}function OD(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xa(t)/3)))*3-xa(Math.abs(e)))}function ED(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xa(t)-xa(e))+1}function x2(e,t,r,n){var i=ip(e,t,r),s;switch(n=Ws(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(s=OD(i,o))&&(n.precision=s),g2(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=ED(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=AD(i))&&(n.precision=s-(n.type==="%")*2);break}}return dm(n)}function qn(e){var t=e.domain;return e.ticks=function(r){var n=t();return rp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return x2(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,s=n.length-1,o=n[i],l=n[s],c,d,u=10;for(l0;){if(d=np(o,l,r),d===c)return n[i]=o,n[s]=l,t(n);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function y2(){var e=cm();return e.copy=function(){return ao(e,y2())},or.apply(e,arguments),qn(e)}function v2(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,oc),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return v2(e).unknown(t)},e=arguments.length?Array.from(e,oc):[0,1],qn(r)}function b2(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],s=e[n],o;return sMath.pow(e,t)}function $D(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function ay(e){return(t,r)=>-e(-t,r)}function fm(e){const t=e(ny,iy),r=t.domain;let n=10,i,s;function o(){return i=$D(n),s=ID(n),r()[0]<0?(i=ay(i),s=ay(s),e(DD,TD)):e(ny,iy),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let d=c[0],u=c[c.length-1];const f=u0){for(;p<=m;++p)for(x=1;xu)break;b.push(g)}}else for(;p<=m;++p)for(x=n-1;x>=1;--x)if(g=p>0?x/s(-p):x*s(p),!(gu)break;b.push(g)}b.length*2{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Ws(c)).precision==null&&(c.trim=!0),c=dm(c)),l===1/0)return c;const d=Math.max(1,n*l/t.ticks().length);return u=>{let f=u/s(Math.round(i(u)));return f*nr(b2(r(),{floor:l=>s(Math.floor(i(l))),ceil:l=>s(Math.ceil(i(l)))})),t}function j2(){const e=fm(gu()).domain([1,10]);return e.copy=()=>ao(e,j2()).base(e.base()),or.apply(e,arguments),e}function sy(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function oy(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function pm(e){var t=1,r=e(sy(t),oy(t));return r.constant=function(n){return arguments.length?e(sy(t=+n),oy(t)):t},qn(r)}function w2(){var e=pm(gu());return e.copy=function(){return ao(e,w2()).constant(e.constant())},or.apply(e,arguments)}function ly(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function LD(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function zD(e){return e<0?-e*e:e*e}function hm(e){var t=e(mt,mt),r=1;function n(){return r===1?e(mt,mt):r===.5?e(LD,zD):e(ly(r),ly(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},qn(t)}function mm(){var e=hm(gu());return e.copy=function(){return ao(e,mm()).exponent(e.exponent())},or.apply(e,arguments),e}function RD(){return mm.apply(null,arguments).exponent(.5)}function cy(e){return Math.sign(e)*e*e}function BD(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function S2(){var e=cm(),t=[0,1],r=!1,n;function i(s){var o=BD(e(s));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(s){return e.invert(cy(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,oc)).map(cy)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(r=!!s,i):r},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return S2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},or.apply(i,arguments),qn(i)}function N2(){var e=[],t=[],r=[],n;function i(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o0?r[l-1]:e[0],l=r?[n[r-1],t]:[n[d-1],n[d]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return k2().domain([e,t]).range(i).unknown(s)},or.apply(qn(o),arguments)}function P2(){var e=[.5],t=[0,1],r,n=1;function i(s){return s!=null&&s<=s?t[no(e,s,0,n)]:r}return i.domain=function(s){return arguments.length?(e=Array.from(s),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return P2().domain(e).range(t).unknown(r)},or.apply(i,arguments)}const jd=new Date,wd=new Date;function Be(e,t,r,n){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),l=i.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,l)=>{const c=[];if(s=i.ceil(s),l=l==null?1:Math.floor(l),!(s0))return c;let d;do c.push(d=new Date(+s)),t(s,l),e(s);while(dBe(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),r&&(i.count=(s,o)=>(jd.setTime(+s),wd.setTime(+o),e(jd),e(wd),Math.floor(r(jd,wd))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?o=>n(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const cc=Be(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);cc.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Be(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):cc);cc.range;const Wr=1e3,Qt=Wr*60,Ur=Qt*60,rn=Ur*24,gm=rn*7,uy=rn*30,Sd=rn*365,ii=Be(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Wr)},(e,t)=>(t-e)/Wr,e=>e.getUTCSeconds());ii.range;const xm=Be(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Wr)},(e,t)=>{e.setTime(+e+t*Qt)},(e,t)=>(t-e)/Qt,e=>e.getMinutes());xm.range;const ym=Be(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Qt)},(e,t)=>(t-e)/Qt,e=>e.getUTCMinutes());ym.range;const vm=Be(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Wr-e.getMinutes()*Qt)},(e,t)=>{e.setTime(+e+t*Ur)},(e,t)=>(t-e)/Ur,e=>e.getHours());vm.range;const bm=Be(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ur)},(e,t)=>(t-e)/Ur,e=>e.getUTCHours());bm.range;const so=Be(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Qt)/rn,e=>e.getDate()-1);so.range;const xu=Be(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/rn,e=>e.getUTCDate()-1);xu.range;const _2=Be(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/rn,e=>Math.floor(e/rn));_2.range;function Ai(e){return Be(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Qt)/gm)}const yu=Ai(0),uc=Ai(1),FD=Ai(2),WD=Ai(3),ya=Ai(4),UD=Ai(5),qD=Ai(6);yu.range;uc.range;FD.range;WD.range;ya.range;UD.range;qD.range;function Oi(e){return Be(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/gm)}const vu=Oi(0),dc=Oi(1),HD=Oi(2),KD=Oi(3),va=Oi(4),VD=Oi(5),YD=Oi(6);vu.range;dc.range;HD.range;KD.range;va.range;VD.range;YD.range;const jm=Be(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());jm.range;const wm=Be(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());wm.range;const nn=Be(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());nn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Be(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});nn.range;const an=Be(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());an.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Be(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});an.range;function C2(e,t,r,n,i,s){const o=[[ii,1,Wr],[ii,5,5*Wr],[ii,15,15*Wr],[ii,30,30*Wr],[s,1,Qt],[s,5,5*Qt],[s,15,15*Qt],[s,30,30*Qt],[i,1,Ur],[i,3,3*Ur],[i,6,6*Ur],[i,12,12*Ur],[n,1,rn],[n,2,2*rn],[r,1,gm],[t,1,uy],[t,3,3*uy],[e,1,Sd]];function l(d,u,f){const p=uv).right(o,p);if(m===o.length)return e.every(ip(d/Sd,u/Sd,f));if(m===0)return cc.every(Math.max(ip(d,u,f),1));const[x,g]=o[p/o[m-1][2]53)return null;"w"in U||(U.w=1),"Z"in U?(pe=kd(Ya(U.y,0,1)),Et=pe.getUTCDay(),pe=Et>4||Et===0?dc.ceil(pe):dc(pe),pe=xu.offset(pe,(U.V-1)*7),U.y=pe.getUTCFullYear(),U.m=pe.getUTCMonth(),U.d=pe.getUTCDate()+(U.w+6)%7):(pe=Nd(Ya(U.y,0,1)),Et=pe.getDay(),pe=Et>4||Et===0?uc.ceil(pe):uc(pe),pe=so.offset(pe,(U.V-1)*7),U.y=pe.getFullYear(),U.m=pe.getMonth(),U.d=pe.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),Et="Z"in U?kd(Ya(U.y,0,1)).getUTCDay():Nd(Ya(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(Et+5)%7:U.w+U.U*7-(Et+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,kd(U)):Nd(U)}}function C(B,te,ne,U){for(var jt=0,pe=te.length,Et=ne.length,Dt,Yn;jt=Et)return-1;if(Dt=te.charCodeAt(jt++),Dt===37){if(Dt=te.charAt(jt++),Yn=S[Dt in dy?te.charAt(jt++):Dt],!Yn||(U=Yn(B,ne,U))<0)return-1}else if(Dt!=ne.charCodeAt(U++))return-1}return U}function D(B,te,ne){var U=d.exec(te.slice(ne));return U?(B.p=u.get(U[0].toLowerCase()),ne+U[0].length):-1}function M(B,te,ne){var U=m.exec(te.slice(ne));return U?(B.w=x.get(U[0].toLowerCase()),ne+U[0].length):-1}function I(B,te,ne){var U=f.exec(te.slice(ne));return U?(B.w=p.get(U[0].toLowerCase()),ne+U[0].length):-1}function A(B,te,ne){var U=b.exec(te.slice(ne));return U?(B.m=j.get(U[0].toLowerCase()),ne+U[0].length):-1}function R(B,te,ne){var U=g.exec(te.slice(ne));return U?(B.m=v.get(U[0].toLowerCase()),ne+U[0].length):-1}function q(B,te,ne){return C(B,t,te,ne)}function Y(B,te,ne){return C(B,r,te,ne)}function P(B,te,ne){return C(B,n,te,ne)}function T(B){return o[B.getDay()]}function O(B){return s[B.getDay()]}function k(B){return c[B.getMonth()]}function L(B){return l[B.getMonth()]}function F(B){return i[+(B.getHours()>=12)]}function H(B){return 1+~~(B.getMonth()/3)}function ee(B){return o[B.getUTCDay()]}function re(B){return s[B.getUTCDay()]}function Me(B){return c[B.getUTCMonth()]}function E(B){return l[B.getUTCMonth()]}function J(B){return i[+(B.getUTCHours()>=12)]}function Ot(B){return 1+~~(B.getUTCMonth()/3)}return{format:function(B){var te=N(B+="",y);return te.toString=function(){return B},te},parse:function(B){var te=_(B+="",!1);return te.toString=function(){return B},te},utcFormat:function(B){var te=N(B+="",w);return te.toString=function(){return B},te},utcParse:function(B){var te=_(B+="",!0);return te.toString=function(){return B},te}}}var dy={"-":"",_:" ",0:"0"},Ze=/^\s*\d+/,eT=/^%/,tT=/[\\^$*+?|[\]().{}]/g;function se(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",s=i.length;return n+(s[t.toLowerCase(),r]))}function nT(e,t,r){var n=Ze.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function iT(e,t,r){var n=Ze.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function aT(e,t,r){var n=Ze.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function sT(e,t,r){var n=Ze.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function oT(e,t,r){var n=Ze.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function fy(e,t,r){var n=Ze.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function py(e,t,r){var n=Ze.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function lT(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function cT(e,t,r){var n=Ze.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function uT(e,t,r){var n=Ze.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function hy(e,t,r){var n=Ze.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function dT(e,t,r){var n=Ze.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function my(e,t,r){var n=Ze.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function fT(e,t,r){var n=Ze.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function pT(e,t,r){var n=Ze.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function hT(e,t,r){var n=Ze.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function mT(e,t,r){var n=Ze.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function gT(e,t,r){var n=eT.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function xT(e,t,r){var n=Ze.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function yT(e,t,r){var n=Ze.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function gy(e,t){return se(e.getDate(),t,2)}function vT(e,t){return se(e.getHours(),t,2)}function bT(e,t){return se(e.getHours()%12||12,t,2)}function jT(e,t){return se(1+so.count(nn(e),e),t,3)}function A2(e,t){return se(e.getMilliseconds(),t,3)}function wT(e,t){return A2(e,t)+"000"}function ST(e,t){return se(e.getMonth()+1,t,2)}function NT(e,t){return se(e.getMinutes(),t,2)}function kT(e,t){return se(e.getSeconds(),t,2)}function PT(e){var t=e.getDay();return t===0?7:t}function _T(e,t){return se(yu.count(nn(e)-1,e),t,2)}function O2(e){var t=e.getDay();return t>=4||t===0?ya(e):ya.ceil(e)}function CT(e,t){return e=O2(e),se(ya.count(nn(e),e)+(nn(e).getDay()===4),t,2)}function AT(e){return e.getDay()}function OT(e,t){return se(uc.count(nn(e)-1,e),t,2)}function ET(e,t){return se(e.getFullYear()%100,t,2)}function DT(e,t){return e=O2(e),se(e.getFullYear()%100,t,2)}function TT(e,t){return se(e.getFullYear()%1e4,t,4)}function MT(e,t){var r=e.getDay();return e=r>=4||r===0?ya(e):ya.ceil(e),se(e.getFullYear()%1e4,t,4)}function IT(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+se(t/60|0,"0",2)+se(t%60,"0",2)}function xy(e,t){return se(e.getUTCDate(),t,2)}function $T(e,t){return se(e.getUTCHours(),t,2)}function LT(e,t){return se(e.getUTCHours()%12||12,t,2)}function zT(e,t){return se(1+xu.count(an(e),e),t,3)}function E2(e,t){return se(e.getUTCMilliseconds(),t,3)}function RT(e,t){return E2(e,t)+"000"}function BT(e,t){return se(e.getUTCMonth()+1,t,2)}function FT(e,t){return se(e.getUTCMinutes(),t,2)}function WT(e,t){return se(e.getUTCSeconds(),t,2)}function UT(e){var t=e.getUTCDay();return t===0?7:t}function qT(e,t){return se(vu.count(an(e)-1,e),t,2)}function D2(e){var t=e.getUTCDay();return t>=4||t===0?va(e):va.ceil(e)}function HT(e,t){return e=D2(e),se(va.count(an(e),e)+(an(e).getUTCDay()===4),t,2)}function KT(e){return e.getUTCDay()}function VT(e,t){return se(dc.count(an(e)-1,e),t,2)}function YT(e,t){return se(e.getUTCFullYear()%100,t,2)}function ZT(e,t){return e=D2(e),se(e.getUTCFullYear()%100,t,2)}function GT(e,t){return se(e.getUTCFullYear()%1e4,t,4)}function XT(e,t){var r=e.getUTCDay();return e=r>=4||r===0?va(e):va.ceil(e),se(e.getUTCFullYear()%1e4,t,4)}function JT(){return"+0000"}function yy(){return"%"}function vy(e){return+e}function by(e){return Math.floor(+e/1e3)}var Di,T2,M2;QT({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function QT(e){return Di=QD(e),T2=Di.format,Di.parse,M2=Di.utcFormat,Di.utcParse,Di}function eM(e){return new Date(e)}function tM(e){return e instanceof Date?+e:+new Date(+e)}function Sm(e,t,r,n,i,s,o,l,c,d){var u=cm(),f=u.invert,p=u.domain,m=d(".%L"),x=d(":%S"),g=d("%I:%M"),v=d("%I %p"),b=d("%a %d"),j=d("%b %d"),y=d("%B"),w=d("%Y");function S(N){return(c(N)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,s)=>U3(e,s/n))},r.copy=function(){return z2(t).domain(e)},dn.apply(r,arguments)}function ju(){var e=0,t=.5,r=1,n=1,i,s,o,l,c,d=mt,u,f=!1,p;function m(g){return isNaN(g=+g)?p:(g=.5+((g=+u(g))-s)*(n*ge.chartData,sM=$([Kn],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),wu=(e,t,r,n)=>n?sM(e):Kn(e);function ji(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Pe(t)&&Pe(r))return!0}return!1}function jy(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function W2(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,i,s;if(Pe(r))i=r;else if(typeof r=="function")return;if(Pe(n))s=n;else if(typeof n=="function")return;var o=[i,s];if(ji(o))return o}}function oM(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(ji(n))return jy(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[i,s]=e,o,l;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Z(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&u0.test(i)){var c=u0.exec(i);if(c==null||t==null)o=void 0;else{var d=+c[1];o=t[0]-d}}else o=t==null?void 0:t[0];if(s==="auto")t!=null&&(l=Math.max(...t));else if(Z(s))l=s;else if(typeof s=="function")try{t!=null&&(l=s(t==null?void 0:t[1]))}catch{}else if(typeof s=="string"&&d0.test(s)){var u=d0.exec(s);if(u==null||t==null)l=void 0;else{var f=+u[1];l=t[1]+f}}else l=t==null?void 0:t[1];var p=[o,l];if(ji(p))return t==null?p:jy(p,t,r)}}}var Aa=1e9,lM={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_m,je=!0,sr="[DecimalError] ",di=sr+"Invalid argument: ",Pm=sr+"Exponent out of range: ",Oa=Math.floor,Qn=Math.pow,cM=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Lt,He=1e7,ye=7,U2=9007199254740991,fc=Oa(U2/ye),V={};V.absoluteValue=V.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};V.comparedTo=V.cmp=function(e){var t,r,n,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(n=s.d.length,i=e.d.length,t=0,r=ne.d[t]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};V.decimalPlaces=V.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ye;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};V.dividedBy=V.div=function(e){return Vr(this,new this.constructor(e))};V.dividedToIntegerBy=V.idiv=function(e){var t=this,r=t.constructor;return fe(Vr(t,new r(e),0,1),r.precision)};V.equals=V.eq=function(e){return!this.cmp(e)};V.exponent=function(){return Te(this)};V.greaterThan=V.gt=function(e){return this.cmp(e)>0};V.greaterThanOrEqualTo=V.gte=function(e){return this.cmp(e)>=0};V.isInteger=V.isint=function(){return this.e>this.d.length-2};V.isNegative=V.isneg=function(){return this.s<0};V.isPositive=V.ispos=function(){return this.s>0};V.isZero=function(){return this.s===0};V.lessThan=V.lt=function(e){return this.cmp(e)<0};V.lessThanOrEqualTo=V.lte=function(e){return this.cmp(e)<1};V.logarithm=V.log=function(e){var t,r=this,n=r.constructor,i=n.precision,s=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Lt))throw Error(sr+"NaN");if(r.s<1)throw Error(sr+(r.s?"NaN":"-Infinity"));return r.eq(Lt)?new n(0):(je=!1,t=Vr(Us(r,s),Us(e,s),s),je=!0,fe(t,i))};V.minus=V.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?K2(t,e):q2(t,(e.s=-e.s,e))};V.modulo=V.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(sr+"NaN");return r.s?(je=!1,t=Vr(r,e,0,1).times(e),je=!0,r.minus(t)):fe(new n(r),i)};V.naturalExponential=V.exp=function(){return H2(this)};V.naturalLogarithm=V.ln=function(){return Us(this)};V.negated=V.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};V.plus=V.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?q2(t,e):K2(t,(e.s=-e.s,e))};V.precision=V.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(di+e);if(t=Te(i)+1,n=i.d.length-1,r=n*ye+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};V.squareRoot=V.sqrt=function(){var e,t,r,n,i,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(sr+"NaN")}for(e=Te(l),je=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Nr(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Oa((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(s=n,n=s.plus(Vr(l,s,o+2)).times(.5),Nr(s.d).slice(0,o)===(t=Nr(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(fe(s,r+1,0),s.times(s).eq(l)){n=s;break}}else if(t!="9999")break;o+=4}return je=!0,fe(n,r)};V.times=V.mul=function(e){var t,r,n,i,s,o,l,c,d,u=this,f=u.constructor,p=u.d,m=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,r=u.e+e.e,c=p.length,d=m.length,c=0;){for(t=0,i=c+n;i>n;)l=s[i]+m[n]*p[i-n-1]+t,s[i--]=l%He|0,t=l/He|0;s[i]=(s[i]+t)%He|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,je?fe(e,f.precision):e};V.toDecimalPlaces=V.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Dr(e,0,Aa),t===void 0?t=n.rounding:Dr(t,0,8),fe(r,e+Te(r)+1,t))};V.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=wi(n,!0):(Dr(e,0,Aa),t===void 0?t=i.rounding:Dr(t,0,8),n=fe(new i(n),e+1,t),r=wi(n,!0,e+1)),r};V.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?wi(i):(Dr(e,0,Aa),t===void 0?t=s.rounding:Dr(t,0,8),n=fe(new s(i),e+Te(i)+1,t),r=wi(n.abs(),!1,e+Te(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};V.toInteger=V.toint=function(){var e=this,t=e.constructor;return fe(new t(e),Te(e)+1,t.rounding)};V.toNumber=function(){return+this};V.toPower=V.pow=function(e){var t,r,n,i,s,o,l=this,c=l.constructor,d=12,u=+(e=new c(e));if(!e.s)return new c(Lt);if(l=new c(l),!l.s){if(e.s<1)throw Error(sr+"Infinity");return l}if(l.eq(Lt))return l;if(n=c.precision,e.eq(Lt))return fe(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,s=l.s,o){if((r=u<0?-u:u)<=U2){for(i=new c(Lt),t=Math.ceil(n/ye+4),je=!1;r%2&&(i=i.times(l),Sy(i.d,t)),r=Oa(r/2),r!==0;)l=l.times(l),Sy(l.d,t);return je=!0,e.s<0?new c(Lt).div(i):fe(i,n)}}else if(s<0)throw Error(sr+"NaN");return s=s<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,je=!1,i=e.times(Us(l,n+d)),je=!0,i=H2(i),i.s=s,i};V.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=Te(i),n=wi(i,r<=s.toExpNeg||r>=s.toExpPos)):(Dr(e,1,Aa),t===void 0?t=s.rounding:Dr(t,0,8),i=fe(new s(i),e,t),r=Te(i),n=wi(i,e<=r||r<=s.toExpNeg,e)),n};V.toSignificantDigits=V.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Dr(e,1,Aa),t===void 0?t=n.rounding:Dr(t,0,8)),fe(new n(r),e,t)};V.toString=V.valueOf=V.val=V.toJSON=V[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Te(e),r=e.constructor;return wi(e,t<=r.toExpNeg||t>=r.toExpPos)};function q2(e,t){var r,n,i,s,o,l,c,d,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),je?fe(t,f):t;if(c=e.d,d=t.d,o=e.e,i=t.e,c=c.slice(),s=o-i,s){for(s<0?(n=c,s=-s,l=d.length):(n=d,i=o,l=c.length),o=Math.ceil(f/ye),l=o>l?o+1:l+1,s>l&&(s=l,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(l=c.length,s=d.length,l-s<0&&(s=l,n=d,d=c,c=n),r=0;s;)r=(c[--s]=c[s]+d[s]+r)/He|0,c[s]%=He;for(r&&(c.unshift(r),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,je?fe(t,f):t}function Dr(e,t,r){if(e!==~~e||er)throw Error(di+e)}function Nr(e){var t,r,n,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;to?1:-1;else for(l=c=0;li[l]?1:-1;break}return c}function r(n,i,s){for(var o=0;s--;)n[s]-=o,o=n[s]1;)n.shift()}return function(n,i,s,o){var l,c,d,u,f,p,m,x,g,v,b,j,y,w,S,N,_,C,D=n.constructor,M=n.s==i.s?1:-1,I=n.d,A=i.d;if(!n.s)return new D(n);if(!i.s)throw Error(sr+"Division by zero");for(c=n.e-i.e,_=A.length,S=I.length,m=new D(M),x=m.d=[],d=0;A[d]==(I[d]||0);)++d;if(A[d]>(I[d]||0)&&--c,s==null?j=s=D.precision:o?j=s+(Te(n)-Te(i))+1:j=s,j<0)return new D(0);if(j=j/ye+2|0,d=0,_==1)for(u=0,A=A[0],j++;(d1&&(A=e(A,u),I=e(I,u),_=A.length,S=I.length),w=_,g=I.slice(0,_),v=g.length;v<_;)g[v++]=0;C=A.slice(),C.unshift(0),N=A[0],A[1]>=He/2&&++N;do u=0,l=t(A,g,_,v),l<0?(b=g[0],_!=v&&(b=b*He+(g[1]||0)),u=b/N|0,u>1?(u>=He&&(u=He-1),f=e(A,u),p=f.length,v=g.length,l=t(f,g,p,v),l==1&&(u--,r(f,_16)throw Error(Pm+Te(e));if(!e.s)return new u(Lt);for(je=!1,l=f,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(n=Math.log(Qn(2,d))/Math.LN10*2+5|0,l+=n,r=i=s=new u(Lt),u.precision=l;;){if(i=fe(i.times(e),l),r=r.times(++c),o=s.plus(Vr(i,r,l)),Nr(o.d).slice(0,l)===Nr(s.d).slice(0,l)){for(;d--;)s=fe(s.times(s),l);return u.precision=f,t==null?(je=!0,fe(s,f)):s}s=o}}function Te(e){for(var t=e.e*ye,r=e.d[0];r>=10;r/=10)t++;return t}function Pd(e,t,r){if(t>e.LN10.sd())throw je=!0,r&&(e.precision=r),Error(sr+"LN10 precision limit exceeded");return fe(new e(e.LN10),t)}function yn(e){for(var t="";e--;)t+="0";return t}function Us(e,t){var r,n,i,s,o,l,c,d,u,f=1,p=10,m=e,x=m.d,g=m.constructor,v=g.precision;if(m.s<1)throw Error(sr+(m.s?"NaN":"-Infinity"));if(m.eq(Lt))return new g(0);if(t==null?(je=!1,d=v):d=t,m.eq(10))return t==null&&(je=!0),Pd(g,d);if(d+=p,g.precision=d,r=Nr(x),n=r.charAt(0),s=Te(m),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(e),r=Nr(m.d),n=r.charAt(0),f++;s=Te(m),n>1?(m=new g("0."+r),s++):m=new g(n+"."+r.slice(1))}else return c=Pd(g,d+2,v).times(s+""),m=Us(new g(n+"."+r.slice(1)),d-p).plus(c),g.precision=v,t==null?(je=!0,fe(m,v)):m;for(l=o=m=Vr(m.minus(Lt),m.plus(Lt),d),u=fe(m.times(m),d),i=3;;){if(o=fe(o.times(u),d),c=l.plus(Vr(o,new g(i),d)),Nr(c.d).slice(0,d)===Nr(l.d).slice(0,d))return l=l.times(2),s!==0&&(l=l.plus(Pd(g,d+2,v).times(s+""))),l=Vr(l,new g(f),d),g.precision=v,t==null?(je=!0,fe(l,v)):l;l=c,i+=2}}function wy(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Oa(r/ye),e.d=[],n=(r+1)%ye,r<0&&(n+=ye),nfc||e.e<-fc))throw Error(Pm+r)}else e.s=0,e.e=0,e.d=[0];return e}function fe(e,t,r){var n,i,s,o,l,c,d,u,f=e.d;for(o=1,s=f[0];s>=10;s/=10)o++;if(n=t-o,n<0)n+=ye,i=t,d=f[u=0];else{if(u=Math.ceil((n+1)/ye),s=f.length,u>=s)return e;for(d=s=f[u],o=1;s>=10;s/=10)o++;n%=ye,i=n-ye+o}if(r!==void 0&&(s=Qn(10,o-i-1),l=d/s%10|0,c=t<0||f[u+1]!==void 0||d%s,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?i>0?d/Qn(10,o-i):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(s=Te(e),f.length=1,t=t-s-1,f[0]=Qn(10,(ye-t%ye)%ye),e.e=Oa(-t/ye)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=u,s=1,u--):(f.length=u+1,s=Qn(10,ye-n),f[u]=i>0?(d/Qn(10,o-i)%Qn(10,i)|0)*s:0),c)for(;;)if(u==0){(f[0]+=s)==He&&(f[0]=1,++e.e);break}else{if(f[u]+=s,f[u]!=He)break;f[u--]=0,s=1}for(n=f.length;f[--n]===0;)f.pop();if(je&&(e.e>fc||e.e<-fc))throw Error(Pm+Te(e));return e}function K2(e,t){var r,n,i,s,o,l,c,d,u,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),je?fe(t,m):t;if(c=e.d,f=t.d,n=t.e,d=e.e,c=c.slice(),o=d-n,o){for(u=o<0,u?(r=c,o=-o,l=f.length):(r=f,n=d,l=c.length),i=Math.max(Math.ceil(m/ye),l)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,l=f.length,u=i0;--i)c[l++]=0;for(i=f.length;i>o;){if(c[--i]0?s=s.charAt(0)+"."+s.slice(1)+yn(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+yn(-i-1)+s,r&&(n=r-o)>0&&(s+=yn(n))):i>=o?(s+=yn(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+yn(n))):((n=i+1)0&&(i+1===o&&(s+="."),s+=yn(n))),e.s<0?"-"+s:s}function Sy(e,t){if(e.length>t)return e.length=t,!0}function V2(e){var t,r,n;function i(s){var o=this;if(!(o instanceof i))return new i(s);if(o.constructor=i,s instanceof i){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(di+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return wy(o,s.toString())}else if(typeof s!="string")throw Error(di+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,cM.test(s))wy(o,s);else throw Error(di+s)}if(i.prototype=V,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=V2,i.config=i.set=uM,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(di+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(di+r+": "+n);return this}var _m=V2(lM);Lt=new _m(1);const le=_m;var dM=e=>e,Y2={},Z2=e=>e===Y2,Ny=e=>function t(){return arguments.length===0||arguments.length===1&&Z2(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},G2=(e,t)=>e===1?t:Ny(function(){for(var r=arguments.length,n=new Array(r),i=0;io!==Y2).length;return s>=e?t(...n):G2(e-s,Ny(function(){for(var o=arguments.length,l=new Array(o),c=0;cZ2(u)?l.shift():u);return t(...d,...l)}))}),Su=e=>G2(e.length,e),cp=(e,t)=>{for(var r=[],n=e;nArray.isArray(t)?t.map(e):Object.keys(t).map(r=>t[r]).map(e)),pM=function(){for(var t=arguments.length,r=new Array(t),n=0;nc(l),s(...arguments))}},up=e=>Array.isArray(e)?e.reverse():e.split("").reverse().join(""),X2=e=>{var t=null,r=null;return function(){for(var n=arguments.length,i=new Array(n),s=0;s{var c;return o===((c=t)===null||c===void 0?void 0:c[l])})||(t=i,r=e(...i)),r}};function J2(e){var t;return e===0?t=1:t=Math.floor(new le(e).abs().log(10).toNumber())+1,t}function Q2(e,t,r){for(var n=new le(e),i=0,s=[];n.lt(t)&&i<1e5;)s.push(n.toNumber()),n=n.add(r),i++;return s}Su((e,t,r)=>{var n=+e,i=+t;return n+r*(i-n)});Su((e,t,r)=>{var n=t-+e;return n=n||1/0,(r-e)/n});Su((e,t,r)=>{var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});var eS=e=>{var[t,r]=e,[n,i]=[t,r];return t>r&&([n,i]=[r,t]),[n,i]},tS=(e,t,r)=>{if(e.lte(0))return new le(0);var n=J2(e.toNumber()),i=new le(10).pow(n),s=e.div(i),o=n!==1?.05:.1,l=new le(Math.ceil(s.div(o).toNumber())).add(r).mul(o),c=l.mul(i);return t?new le(c.toNumber()):new le(Math.ceil(c.toNumber()))},hM=(e,t,r)=>{var n=new le(1),i=new le(e);if(!i.isint()&&r){var s=Math.abs(e);s<1?(n=new le(10).pow(J2(e)-1),i=new le(Math.floor(i.div(n).toNumber())).mul(n)):s>1&&(i=new le(Math.floor(e)))}else e===0?i=new le(Math.floor((t-1)/2)):r||(i=new le(Math.floor(e)));var o=Math.floor((t-1)/2),l=pM(fM(c=>i.add(new le(c-o).mul(n)).toNumber()),cp);return l(0,t)},rS=function(t,r,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new le(0),tickMin:new le(0),tickMax:new le(0)};var o=tS(new le(r).sub(t).div(n-1),i,s),l;t<=0&&r>=0?l=new le(0):(l=new le(t).add(r).div(2),l=l.sub(new le(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),d=Math.ceil(new le(r).sub(l).div(o).toNumber()),u=c+d+1;return u>n?rS(t,r,n,i,s+1):(u0?d+(n-u):d,c=r>0?c:c+(n-u)),{step:o,tickMin:l.sub(new le(c).mul(o)),tickMax:l.add(new le(d).mul(o))})};function mM(e){var[t,r]=e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(n,2),[o,l]=eS([t,r]);if(o===-1/0||l===1/0){var c=l===1/0?[o,...cp(0,n-1).map(()=>1/0)]:[...cp(0,n-1).map(()=>-1/0),l];return t>r?up(c):c}if(o===l)return hM(o,n,i);var{step:d,tickMin:u,tickMax:f}=rS(o,l,s,i,0),p=Q2(u,f.add(new le(.1).mul(d)),d);return t>r?up(p):p}function gM(e,t){var[r,n]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[s,o]=eS([r,n]);if(s===-1/0||o===1/0)return[r,n];if(s===o)return[s];var l=Math.max(t,2),c=tS(new le(o).sub(s).div(l-1),i,0),d=[...Q2(new le(s),new le(o),c),o];return i===!1&&(d=d.map(u=>Math.round(u))),r>n?up(d):d}var xM=X2(mM),yM=X2(gM),vM=e=>e.rootProps.barCategoryGap,Nu=e=>e.rootProps.stackOffset,Cm=e=>e.options.chartName,Am=e=>e.rootProps.syncId,nS=e=>e.rootProps.syncMethod,Om=e=>e.options.eventEmitter,bM=e=>e.rootProps.baseValue,lt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},zr={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},$t={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},ku=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},jM={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:zr.angleAxisId,includeHidden:!1,name:void 0,reversed:zr.reversed,scale:zr.scale,tick:zr.tick,tickCount:void 0,ticks:void 0,type:zr.type,unit:void 0},wM={allowDataOverflow:$t.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:$t.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:$t.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:$t.scale,tick:$t.tick,tickCount:$t.tickCount,ticks:void 0,type:$t.type,unit:void 0},SM={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:zr.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:zr.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:zr.scale,tick:zr.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},NM={allowDataOverflow:$t.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:$t.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:$t.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:$t.scale,tick:$t.tick,tickCount:$t.tickCount,ticks:void 0,type:"category",unit:void 0},Em=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?SM:jM,Dm=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?NM:wM,Pu=e=>e.polarOptions,Tm=$([cn,un,rt],j3),iS=$([Pu,Tm],(e,t)=>{if(e!=null)return Rn(e.innerRadius,t,0)}),aS=$([Pu,Tm],(e,t)=>{if(e!=null)return Rn(e.outerRadius,t,t*.8)}),kM=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},sS=$([Pu],kM);$([Em,sS],ku);var oS=$([Tm,iS,aS],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});$([Dm,oS],ku);var lS=$([de,Pu,iS,aS,cn,un],(e,t,r,n,i,s)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:o,cy:l,startAngle:c,endAngle:d}=t;return{cx:Rn(o,i,i/2),cy:Rn(l,s,s/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:d,clockWise:!1}}}),Fe=(e,t)=>t,_u=(e,t,r)=>r;function Mm(e){return e==null?void 0:e.id}function cS(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:i,dataKey:s}=r,o=new Map;return e.forEach(l=>{var c,d=(c=l.data)!==null&&c!==void 0?c:n;if(!(d==null||d.length===0)){var u=Mm(l);d.forEach((f,p)=>{var m=s==null||i?p:String(et(f,s,null)),x=et(f,l.dataKey,0),g;o.has(m)?g=o.get(m):g={},Object.assign(g,{[u]:x}),o.set(m,g)})}}),Array.from(o.values())}function Im(e){return e.stackId!=null&&e.dataKey!=null}var Cu=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Au(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function PM(e,t){if(e.length===t.length){for(var r=0;r{var t=de(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Ea=e=>e.tooltip.settings.axisId;function ky(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pc(e){for(var t=1;te.cartesianAxis.xAxis[t],fn=(e,t)=>{var r=uS(e,t);return r??Tt},Mt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:dp,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:to},dS=(e,t)=>e.cartesianAxis.yAxis[t],pn=(e,t)=>{var r=dS(e,t);return r??Mt},OM={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},$m=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??OM},bt=(e,t,r)=>{switch(t){case"xAxis":return fn(e,r);case"yAxis":return pn(e,r);case"zAxis":return $m(e,r);case"angleAxis":return Em(e,r);case"radiusAxis":return Dm(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},EM=(e,t,r)=>{switch(t){case"xAxis":return fn(e,r);case"yAxis":return pn(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},oo=(e,t,r)=>{switch(t){case"xAxis":return fn(e,r);case"yAxis":return pn(e,r);case"angleAxis":return Em(e,r);case"radiusAxis":return Dm(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},fS=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function pS(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var Lm=e=>e.graphicalItems.cartesianItems,DM=$([Fe,_u],pS),hS=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),lo=$([Lm,bt,DM],hS,{memoizeOptions:{resultEqualityCheck:Au}}),mS=$([lo],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Im)),gS=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),TM=$([lo],gS),xS=e=>e.map(t=>t.data).filter(Boolean).flat(1),MM=$([lo],xS,{memoizeOptions:{resultEqualityCheck:Au}}),yS=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:i}=t;return e.length>0?e:r.slice(n,i+1)},zm=$([MM,wu],yS),vS=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:et(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:et(i,n)}))):e.map(n=>({value:n})),Ou=$([zm,bt,lo],vS);function bS(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function cl(e){if(Or(e)||e instanceof Date){var t=Number(e);if(Pe(t))return t}}function Py(e){if(Array.isArray(e)){var t=[cl(e[0]),cl(e[1])];return ji(t)?t:void 0}var r=cl(e);if(r!=null)return[r,r]}function sn(e){return e.map(cl).filter(q4)}function IM(e,t,r){return!r||typeof t!="number"||yr(t)?[]:r.length?sn(r.flatMap(n=>{var i=et(e,n.dataKey),s,o;if(Array.isArray(i)?[s,o]=i:s=o=i,!(!Pe(s)||!Pe(o)))return[t-s,t+o]})):[]}var Ue=e=>{var t=We(e),r=Ea(e);return oo(e,t,r)},jS=$([Ue],e=>e==null?void 0:e.dataKey),$M=$([mS,wu,Ue],cS),wS=(e,t,r)=>{var n={},i=t.reduce((s,o)=>(o.stackId==null||(s[o.stackId]==null&&(s[o.stackId]=[]),s[o.stackId].push(o)),s),n);return Object.fromEntries(Object.entries(i).map(s=>{var[o,l]=s,c=l.map(Mm);return[o,{stackedData:OE(e,c,r),graphicalItems:l}]}))},fp=$([$M,mS,Nu],wS),SS=(e,t,r,n)=>{var{dataStartIndex:i,dataEndIndex:s}=t;if(n==null&&r!=="zAxis"){var o=ME(e,i,s);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},LM=$([bt],e=>e.allowDataOverflow),Rm=e=>{var t;if(e==null||!("domain"in e))return dp;if(e.domain!=null)return e.domain;if(e.ticks!=null){if(e.type==="number"){var r=sn(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:dp},NS=$([bt],Rm),kS=$([NS,LM],W2),zM=$([fp,Kn,Fe,kS],SS,{memoizeOptions:{resultEqualityCheck:Cu}}),Bm=e=>e.errorBars,RM=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>bS(r,n)),hc=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var s,o;if(r.length>0&&e.forEach(l=>{r.forEach(c=>{var d,u,f=(d=n[c.id])===null||d===void 0?void 0:d.filter(b=>bS(i,b)),p=et(l,(u=t.dataKey)!==null&&u!==void 0?u:c.dataKey),m=IM(l,p,f);if(m.length>=2){var x=Math.min(...m),g=Math.max(...m);(s==null||xo)&&(o=g)}var v=Py(p);v!=null&&(s=s==null?v[0]:Math.min(s,v[0]),o=o==null?v[1]:Math.max(o,v[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=Py(et(l,t.dataKey));c!=null&&(s=s==null?c[0]:Math.min(s,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),Pe(s)&&Pe(o))return[s,o]},BM=$([zm,bt,TM,Bm,Fe],PS,{memoizeOptions:{resultEqualityCheck:Cu}});function FM(e){var{value:t}=e;if(Or(t)||t instanceof Date)return t}var WM=(e,t,r)=>{var n=e.map(FM).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&Dj(n))?o2(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},_S=e=>e.referenceElements.dots,Da=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),UM=$([_S,Fe,_u],Da),CS=e=>e.referenceElements.areas,qM=$([CS,Fe,_u],Da),AS=e=>e.referenceElements.lines,HM=$([AS,Fe,_u],Da),OS=(e,t)=>{var r=sn(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]},KM=$(UM,Fe,OS),ES=(e,t)=>{var r=sn(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]},VM=$([qM,Fe],ES);function YM(e){var t;if(e.x!=null)return sn([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:sn(r)}function ZM(e){var t;if(e.y!=null)return sn([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:sn(r)}var DS=(e,t)=>{var r=e.flatMap(n=>t==="xAxis"?YM(n):ZM(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]},GM=$([HM,Fe],DS),XM=$(KM,GM,VM,(e,t,r)=>hc(e,r,t)),TS=(e,t,r,n,i,s,o,l)=>{if(r!=null)return r;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",d=c?hc(n,s,i):hc(s,i);return oM(t,d,e.allowDataOverflow)},JM=$([bt,NS,kS,zM,BM,XM,de,Fe],TS,{memoizeOptions:{resultEqualityCheck:Cu}}),QM=[0,1],MS=(e,t,r,n,i,s,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,d=Mr(t,s);if(d&&l==null){var u;return o2(0,(u=r==null?void 0:r.length)!==null&&u!==void 0?u:0)}return c==="category"?WM(n,e,d):i==="expand"?QM:o}},Fm=$([bt,de,zm,Ou,Nu,Fe,JM],MS),IS=(e,t,r,n,i)=>{if(e!=null){var{scale:s,type:o}=e;if(s==="auto")return t==="radial"&&i==="radiusAxis"?"band":t==="radial"&&i==="angleAxis"?"linear":o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?"point":o==="category"?"band":"linear";if(typeof s=="string"){var l="scale".concat(Js(s));return l in rs?l:"point"}}},co=$([bt,de,fS,Cm,Fe],IS);function eI(e){if(e!=null){if(e in rs)return rs[e]();var t="scale".concat(Js(e));if(t in rs)return rs[t]()}}function Wm(e,t,r,n){if(!(r==null||n==null)){if(typeof e.scale=="function")return e.scale.copy().domain(r).range(n);var i=eI(t);if(i!=null){var s=i.domain(r).range(n);return PE(s),s}}}var $S=(e,t,r)=>{var n=Rm(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&ji(e))return xM(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&ji(e))return yM(e,t.tickCount,t.allowDecimals)}},Um=$([Fm,oo,co],$S),LS=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&ji(t)&&Array.isArray(r)&&r.length>0){var i=t[0],s=r[0],o=t[1],l=r[r.length-1];return[Math.min(i,s),Math.max(o,l)]}return t},tI=$([bt,Fm,Um,Fe],LS),rI=$(Ou,bt,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(sn(e.map(l=>l.value))).sort((l,c)=>l-c);if(n.length<2)return 1/0;var i=n[n.length-1]-n[0];if(i===0)return 1/0;for(var s=0;sn,(e,t,r,n,i)=>{if(!Pe(e))return 0;var s=t==="vertical"?n.height:n.width;if(i==="gap")return e*s/2;if(i==="no-gap"){var o=Rn(r,e*s),l=e*s/2;return l-o-(l-o)/s*o}return 0}),nI=(e,t)=>{var r=fn(e,t);return r==null||typeof r.padding!="string"?0:zS(e,"xAxis",t,r.padding)},iI=(e,t)=>{var r=pn(e,t);return r==null||typeof r.padding!="string"?0:zS(e,"yAxis",t,r.padding)},aI=$(fn,nI,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),sI=$(pn,iI,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),oI=$([rt,aI,du,uu,(e,t,r)=>r],(e,t,r,n,i)=>{var{padding:s}=n;return i?[s.left,r.width-s.right]:[e.left+t.left,e.left+e.width-t.right]}),lI=$([rt,de,sI,du,uu,(e,t,r)=>r],(e,t,r,n,i,s)=>{var{padding:o}=i;return s?[n.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),uo=(e,t,r,n)=>{var i;switch(t){case"xAxis":return oI(e,r,n);case"yAxis":return lI(e,r,n);case"zAxis":return(i=$m(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return sS(e);case"radiusAxis":return oS(e,r);default:return}},RS=$([bt,uo],ku),Ta=$([bt,co,tI,RS],Wm);$([lo,Bm,Fe],RM);function BS(e,t){return e.idt.id?1:0}var Eu=(e,t)=>t,Du=(e,t,r)=>r,cI=$(lu,Eu,Du,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(BS)),uI=$(cu,Eu,Du,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(BS)),FS=(e,t)=>({width:e.width,height:t.height}),dI=(e,t)=>{var r=typeof t.width=="number"?t.width:to;return{width:r,height:e.height}},fI=$(rt,fn,FS),pI=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},hI=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},mI=$(un,rt,cI,Eu,Du,(e,t,r,n,i)=>{var s={},o;return r.forEach(l=>{var c=FS(t,l);o==null&&(o=pI(t,n,e));var d=n==="top"&&!i||n==="bottom"&&i;s[l.id]=o-Number(d)*c.height,o+=(d?-1:1)*c.height}),s}),gI=$(cn,rt,uI,Eu,Du,(e,t,r,n,i)=>{var s={},o;return r.forEach(l=>{var c=dI(t,l);o==null&&(o=hI(t,n,e));var d=n==="left"&&!i||n==="right"&&i;s[l.id]=o-Number(d)*c.width,o+=(d?-1:1)*c.width}),s}),xI=(e,t)=>{var r=fn(e,t);if(r!=null)return mI(e,r.orientation,r.mirror)},yI=$([rt,fn,xI,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),vI=(e,t)=>{var r=pn(e,t);if(r!=null)return gI(e,r.orientation,r.mirror)},bI=$([rt,pn,vI,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),jI=$(rt,pn,(e,t)=>{var r=typeof t.width=="number"?t.width:to;return{width:r,height:e.height}}),WS=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:i,type:s,dataKey:o}=r,l=Mr(e,n),c=t.map(d=>d.value);if(o&&l&&s==="category"&&i&&Dj(c))return c}},qm=$([de,Ou,bt,Fe],WS),US=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:i,scale:s}=r,o=Mr(e,n);if(o&&(i==="number"||s!=="auto"))return t.map(l=>l.value)}},Hm=$([de,Ou,oo,Fe],US),_y=$([de,EM,co,Ta,qm,Hm,uo,Um,Fe],(e,t,r,n,i,s,o,l,c)=>{if(t!=null){var d=Mr(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:s,duplicateDomain:i,isCategorical:d,niceTicks:l,range:o,realScaleType:r,scale:n}}}),wI=(e,t,r,n,i,s,o,l,c)=>{if(!(t==null||n==null)){var d=Mr(e,c),{type:u,ticks:f,tickCount:p}=t,m=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,x=u==="category"&&n.bandwidth?n.bandwidth()/m:0;x=c==="angleAxis"&&s!=null&&s.length>=2?Jt(s[0]-s[1])*2*x:x;var g=f||i;if(g){var v=g.map((b,j)=>{var y=o?o.indexOf(b):b;return{index:j,coordinate:n(y)+x,value:b,offset:x}});return v.filter(b=>Pe(b.coordinate))}return d&&l?l.map((b,j)=>({coordinate:n(b)+x,value:b,index:j,offset:x})).filter(b=>Pe(b.coordinate)):n.ticks?n.ticks(p).map(b=>({coordinate:n(b)+x,value:b,offset:x})):n.domain().map((b,j)=>({coordinate:n(b)+x,value:o?o[b]:b,index:j,offset:x}))}},qS=$([de,oo,co,Ta,Um,uo,qm,Hm,Fe],wI),SI=(e,t,r,n,i,s,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=Mr(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(n==null?void 0:n.length)>=2?Jt(n[0]-n[1])*2*d:d,l&&s?s.map((u,f)=>({coordinate:r(u)+d,value:u,index:f,offset:d})):r.ticks?r.ticks(c).map(u=>({coordinate:r(u)+d,value:u,offset:d})):r.domain().map((u,f)=>({coordinate:r(u)+d,value:i?i[u]:u,index:f,offset:d}))}},Tu=$([de,oo,Ta,uo,qm,Hm,Fe],SI),Mu=$(bt,Ta,(e,t)=>{if(!(e==null||t==null))return pc(pc({},e),{},{scale:t})}),NI=$([bt,co,Fm,RS],Wm);$((e,t,r)=>$m(e,r),NI,(e,t)=>{if(!(e==null||t==null))return pc(pc({},e),{},{scale:t})});var kI=$([de,lu,cu],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),HS=e=>e.options.defaultTooltipEventType,KS=e=>e.options.validateTooltipEventTypes;function VS(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Km(e,t){var r=HS(e),n=KS(e);return VS(t,r,n)}function PI(e){return G(t=>Km(t,e))}var YS=(e,t)=>{var r,n=Number(t);if(!(yr(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},_I=e=>e.tooltip.settings,wn={active:!1,index:null,dataKey:void 0,coordinate:void 0},CI={itemInteraction:{click:wn,hover:wn},axisInteraction:{click:wn,hover:wn},keyboardInteraction:wn,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},ZS=At({name:"tooltip",initialState:CI,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Le()},removeTooltipEntrySettings:{reducer(e,t){var r=Kr(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:Le()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate,e.keyboardInteraction.dataKey=t.payload.activeDataKey}}}),{addTooltipEntrySettings:AI,removeTooltipEntrySettings:OI,setTooltipSettingsState:EI,setActiveMouseOverItemIndex:DI,mouseLeaveItem:T7,mouseLeaveChart:GS,setActiveClickItemIndex:M7,setMouseOverAxisIndex:XS,setMouseClickAxisIndex:TI,setSyncInteraction:pp,setKeyboardInteraction:hp}=ZS.actions,MI=ZS.reducer;function Cy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ko(e){for(var t=1;t{if(t==null)return wn;var i=zI(e,t,r);if(i==null)return wn;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var s=e.settings.active===!0;if(RI(i)){if(s)return Ko(Ko({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n};return Ko(Ko({},wn),{},{coordinate:i.coordinate})},Vm=(e,t)=>{var r=e==null?void 0:e.index;if(r==null)return null;var n=Number(r);if(!Pe(n))return r;var i=0,s=1/0;return t.length>0&&(s=t.length-1),String(Math.max(i,Math.min(n,s)))},QS=(e,t,r,n,i,s,o,l)=>{if(!(s==null||l==null)){var c=o[0],d=c==null?void 0:l(c.positions,s);if(d!=null)return d;var u=i==null?void 0:i[Number(s)];if(u)switch(r){case"horizontal":return{x:u.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:u.coordinate}}}},eN=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;return r==="hover"?i=e.itemInteraction.hover.dataKey:i=e.itemInteraction.click.dataKey,i==null&&n!=null?[e.tooltipItemPayloads[0]]:e.tooltipItemPayloads.filter(s=>{var o;return((o=s.settings)===null||o===void 0?void 0:o.dataKey)===i})},fo=e=>e.options.tooltipPayloadSearcher,Ma=e=>e.tooltip;function Ay(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oy(e){for(var t=1;t{if(!(t==null||s==null)){var{chartData:l,computedData:c,dataStartIndex:d,dataEndIndex:u}=r,f=[];return e.reduce((p,m)=>{var x,{dataDefinedOnItem:g,settings:v}=m,b=UI(g,l),j=Array.isArray(b)?Tw(b,d,u):b,y=(x=v==null?void 0:v.dataKey)!==null&&x!==void 0?x:n,w=v==null?void 0:v.nameKey,S;if(n&&Array.isArray(j)&&!Array.isArray(j[0])&&o==="axis"?S=Tj(j,n,i):S=s(j,t,c,w),Array.isArray(S))S.forEach(_=>{var C=Oy(Oy({},v),{},{name:_.name,unit:_.unit,color:void 0,fill:void 0});p.push(f0({tooltipEntrySettings:C,dataKey:_.dataKey,payload:_.payload,value:et(_.payload,_.dataKey),name:_.name}))});else{var N;p.push(f0({tooltipEntrySettings:v,dataKey:y,payload:S,value:et(S,y),name:(N=et(S,w))!==null&&N!==void 0?N:v==null?void 0:v.name}))}return p},f)}},Ym=$([Ue,de,fS,Cm,We],IS),qI=$([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),HI=$([We,Ea],pS),po=$([qI,Ue,HI],hS,{memoizeOptions:{resultEqualityCheck:Au}}),KI=$([po],e=>e.filter(Im)),VI=$([po],xS,{memoizeOptions:{resultEqualityCheck:Au}}),Ia=$([VI,Kn],yS),YI=$([KI,Kn,Ue],cS),Zm=$([Ia,Ue,po],vS),rN=$([Ue],Rm),ZI=$([Ue],e=>e.allowDataOverflow),nN=$([rN,ZI],W2),GI=$([po],e=>e.filter(Im)),XI=$([YI,GI,Nu],wS),JI=$([XI,Kn,We,nN],SS),QI=$([po],gS),e8=$([Ia,Ue,QI,Bm,We],PS,{memoizeOptions:{resultEqualityCheck:Cu}}),t8=$([_S,We,Ea],Da),r8=$([t8,We],OS),n8=$([CS,We,Ea],Da),i8=$([n8,We],ES),a8=$([AS,We,Ea],Da),s8=$([a8,We],DS),o8=$([r8,s8,i8],hc),l8=$([Ue,rN,nN,JI,e8,o8,de,We],TS),iN=$([Ue,de,Ia,Zm,Nu,We,l8],MS),c8=$([iN,Ue,Ym],$S),u8=$([Ue,iN,c8,We],LS),aN=e=>{var t=We(e),r=Ea(e),n=!1;return uo(e,t,r,n)},sN=$([Ue,aN],ku),oN=$([Ue,Ym,u8,sN],Wm),d8=$([de,Zm,Ue,We],WS),f8=$([de,Zm,Ue,We],US),p8=(e,t,r,n,i,s,o,l)=>{if(t){var{type:c}=t,d=Mr(e,l);if(n){var u=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/u:0;return f=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?Jt(i[0]-i[1])*2*f:f,d&&o?o.map((p,m)=>({coordinate:n(p)+f,value:p,index:m,offset:f})):n.domain().map((p,m)=>({coordinate:n(p)+f,value:s?s[p]:p,index:m,offset:f}))}}},hn=$([de,Ue,Ym,oN,aN,d8,f8,We],p8),Gm=$([HS,KS,_I],(e,t,r)=>VS(r.shared,e,t)),lN=e=>e.tooltip.settings.trigger,Xm=e=>e.tooltip.settings.defaultIndex,Iu=$([Ma,Gm,lN,Xm],JS),qs=$([Iu,Ia],Vm),cN=$([hn,qs],YS),h8=$([Iu],e=>{if(e)return e.dataKey}),uN=$([Ma,Gm,lN,Xm],eN),m8=$([cn,un,de,rt,hn,Xm,uN,fo],QS),g8=$([Iu,m8],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),x8=$([Iu],e=>e.active),y8=$([uN,qs,Kn,jS,cN,fo,Gm],tN),v8=$([y8],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function Ey(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Dy(e){for(var t=1;tG(Ue),N8=()=>{var e=S8(),t=G(hn),r=G(oN);return ga(!e||!r?void 0:Dy(Dy({},e),{},{scale:r}),t)};function Ty(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ti(e){for(var t=1;t{var i=t.find(s=>s&&s.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:i.coordinate}}return{x:0,y:0}},A8=(e,t,r,n)=>{var i=t.find(d=>d&&d.index===r);if(i){if(e==="centric"){var s=i.coordinate,{radius:o}=n;return Ti(Ti(Ti({},n),Je(n.cx,n.cy,o,s)),{},{angle:s,radius:o})}var l=i.coordinate,{angle:c}=n;return Ti(Ti(Ti({},n),Je(n.cx,n.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function O8(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var dN=(e,t,r,n,i)=>{var s,o=-1,l=(s=t==null?void 0:t.length)!==null&&s!==void 0?s:0;if(l<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c0?r[c-1].coordinate:r[l-1].coordinate,u=r[c].coordinate,f=c>=l-1?r[0].coordinate:r[c+1].coordinate,p=void 0;if(Jt(u-d)!==Jt(f-u)){var m=[];if(Jt(f-u)===Jt(i[1]-i[0])){p=f;var x=u+i[1]-i[0];m[0]=Math.min(x,(x+d)/2),m[1]=Math.max(x,(x+d)/2)}else{p=d;var g=f+i[1]-i[0];m[0]=Math.min(u,(g+u)/2),m[1]=Math.max(u,(g+u)/2)}var v=[Math.min(u,(p+u)/2),Math.max(u,(p+u)/2)];if(e>v[0]&&e<=v[1]||e>=m[0]&&e<=m[1]){({index:o}=r[c]);break}}else{var b=Math.min(d,f),j=Math.max(d,f);if(e>(b+u)/2&&e<=(j+u)/2){({index:o}=r[c]);break}}}else if(t){for(var y=0;y0&&y(t[y].coordinate+t[y-1].coordinate)/2&&e<=(t[y].coordinate+t[y+1].coordinate)/2||y===l-1&&e>(t[y].coordinate+t[y-1].coordinate)/2){({index:o}=t[y]);break}}return o},fN=()=>G(Cm),Jm=(e,t)=>t,pN=(e,t,r)=>r,Qm=(e,t,r,n)=>n,E8=$(hn,e=>tu(e,t=>t.coordinate)),eg=$([Ma,Jm,pN,Qm],JS),hN=$([eg,Ia],Vm),D8=(e,t,r)=>{if(t!=null){var n=Ma(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},mN=$([Ma,Jm,pN,Qm],eN),mc=$([cn,un,de,rt,hn,Qm,mN,fo],QS),T8=$([eg,mc],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),gN=$([hn,hN],YS),M8=$([mN,hN,Kn,jS,gN,fo,Jm],tN),I8=$([eg],e=>({isActive:e.active,activeIndex:e.index})),$8=(e,t,r,n,i,s,o)=>{if(!(!e||!r||!n||!i)&&O8(e,o)){var l=IE(e,t),c=dN(l,s,i,r,n),d=C8(t,i,c,e);return{activeIndex:String(c),activeCoordinate:d}}},L8=(e,t,r,n,i,s,o)=>{if(!(!e||!n||!i||!s||!r)){var l=P3(e,r);if(l){var c=$E(l,t),d=dN(c,o,s,n,i),u=A8(t,s,d,l);return{activeIndex:String(d),activeCoordinate:u}}}},z8=(e,t,r,n,i,s,o,l)=>{if(!(!e||!t||!n||!i||!s))return t==="horizontal"||t==="vertical"?$8(e,t,n,i,s,o,l):L8(e,t,r,n,i,s,o)},R8=$(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElementId:n.elementId}}),B8=$(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(lt)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:PM}});function My(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Iy(e){for(var t=1;tIy(Iy({},e),{},{[t]:{elementId:void 0,panoramaElementId:void 0,consumers:0}}),q8)},K8=new Set(Object.values(lt));function V8(e){return K8.has(e)}var xN=At({name:"zIndex",initialState:H8,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,elementId:void 0,panoramaElementId:void 0}},prepare:Le()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!V8(r)&&delete e.zIndexMap[r])},prepare:Le()},registerZIndexPortalId:{reducer:(e,t)=>{var{zIndex:r,elementId:n,isPanorama:i}=t.payload;e.zIndexMap[r]?i?e.zIndexMap[r].panoramaElementId=n:e.zIndexMap[r].elementId=n:e.zIndexMap[r]={consumers:0,elementId:i?void 0:n,panoramaElementId:i?n:void 0}},prepare:Le()},unregisterZIndexPortalId:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElementId=void 0:e.zIndexMap[r].elementId=void 0)},prepare:Le()}}}),{registerZIndexPortal:Y8,unregisterZIndexPortal:Z8,registerZIndexPortalId:G8,unregisterZIndexPortalId:X8}=xN.actions,J8=xN.reducer;function Ir(e){var{zIndex:t,children:r}=e,n=u5(),i=n&&t!==void 0&&t!==0,s=pt(),o=Ye();h.useLayoutEffect(()=>i?(o(Y8({zIndex:t})),()=>{o(Z8({zIndex:t}))}):_a,[o,t,i]);var l=G(d=>R8(d,t,s));if(!i)return r;if(!l)return null;var c=document.getElementById(l);return c?Sh.createPortal(r,c):null}function mp(){return mp=Object.assign?Object.assign.bind():function(e){for(var t=1;th.useContext(yN),vN={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function s(c,d,u,f,p){if(typeof u!="function")throw new TypeError("The listener must be a function");var m=new i(u,f||c,p),x=r?r+d:d;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],m]:c._events[x].push(m):(c._events[x]=m,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new n:delete c._events[d]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,f;if(this._eventsCount===0)return d;for(f in u=this._events)t.call(u,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=r?r+d:d,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var p=0,m=f.length,x=new Array(m);p{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),c$=jN.reducer,{createEventEmitter:u$}=jN.actions;function d$(e){return e.tooltip.syncInteraction}var f$={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},wN=At({name:"chartData",initialState:f$,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:zy,setDataStartEndIndexes:p$,setComputedData:I7}=wN.actions,h$=wN.reducer,m$=["x","y"];function Ry(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mi(e){for(var t=1;tc.rootProps.className);h.useEffect(()=>{if(e==null)return _a;var c=(d,u,f)=>{if(t!==f&&e===d){if(n==="index"){var p;if(o&&u!==null&&u!==void 0&&(p=u.payload)!==null&&p!==void 0&&p.coordinate&&u.payload.sourceViewBox){var m=u.payload.coordinate,{x,y:g}=m,v=v$(m,m$),{x:b,y:j,width:y,height:w}=u.payload.sourceViewBox,S=Mi(Mi({},v),{},{x:o.x+(y?(x-b)/y:0)*o.width,y:o.y+(w?(g-j)/w:0)*o.height});r(Mi(Mi({},u),{},{payload:Mi(Mi({},u.payload),{},{coordinate:S})}))}else r(u);return}if(i!=null){var N;if(typeof n=="function"){var _={activeTooltipIndex:u.payload.index==null?void 0:Number(u.payload.index),isTooltipActive:u.payload.active,activeIndex:u.payload.index==null?void 0:Number(u.payload.index),activeLabel:u.payload.label,activeDataKey:u.payload.dataKey,activeCoordinate:u.payload.coordinate},C=n(i,_);N=i[C]}else n==="value"&&(N=i.find(P=>String(P.value)===u.payload.label));var{coordinate:D}=u.payload;if(N==null||u.payload.active===!1||D==null||o==null){r(pp({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0}));return}var{x:M,y:I}=D,A=Math.min(M,o.x+o.width),R=Math.min(I,o.y+o.height),q={x:s==="horizontal"?N.coordinate:A,y:s==="horizontal"?R:N.coordinate},Y=pp({active:u.payload.active,coordinate:q,dataKey:u.payload.dataKey,index:String(N.index),label:u.payload.label,sourceViewBox:u.payload.sourceViewBox});r(Y)}}};return Hs.on(gp,c),()=>{Hs.off(gp,c)}},[l,r,t,e,n,i,s,o])}function w$(){var e=G(Am),t=G(Om),r=Ye();h.useEffect(()=>{if(e==null)return _a;var n=(i,s,o)=>{t!==o&&e===i&&r(p$(s))};return Hs.on(Ly,n),()=>{Hs.off(Ly,n)}},[r,t,e])}function S$(){var e=Ye();h.useEffect(()=>{e(u$())},[e]),j$(),w$()}function N$(e,t,r,n,i,s){var o=G(m=>D8(m,e,t)),l=G(Om),c=G(Am),d=G(nS),u=G(d$),f=u==null?void 0:u.active,p=fu();h.useEffect(()=>{if(!f&&c!=null&&l!=null){var m=pp({active:s,coordinate:r,dataKey:o,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:p});Hs.emit(gp,c,m,l)}},[f,r,o,i,n,l,c,d,s,p])}function By(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fy(e){for(var t=1;t{_(EI({shared:j,trigger:y,axisId:N,active:i,defaultIndex:C}))},[_,j,y,N,i,C]);var D=fu(),M=Zw(),I=PI(j),{activeIndex:A,isActive:R}=(t=G(J=>I8(J,I,y,C)))!==null&&t!==void 0?t:{},q=G(J=>M8(J,I,y,C)),Y=G(J=>gN(J,I,y,C)),P=G(J=>T8(J,I,y,C)),T=q,O=a$(),k=(r=i??R)!==null&&r!==void 0?r:!1,[L,F]=kO([T,k]),H=I==="axis"?Y:void 0;N$(I,y,P,H,A,k);var ee=S??O;if(ee==null||D==null||I==null)return null;var re=T??Wy;k||(re=Wy),d&&re.length&&(re=lO(re.filter(J=>J.value!=null&&(J.hide!==!0||n.includeHidden)),p,C$));var Me=re.length>0,E=h.createElement(P5,{allowEscapeViewBox:s,animationDuration:o,animationEasing:l,isAnimationActive:u,active:k,coordinate:P,hasPayload:Me,offset:f,position:m,reverseDirection:x,useTranslate3d:g,viewBox:D,wrapperStyle:v,lastBoundingBox:L,innerRef:F,hasPortalFromProps:!!S},A$(c,Fy(Fy({},n),{},{payload:re,label:H,active:k,activeIndex:A,coordinate:P,accessibilityLayer:M})));return h.createElement(h.Fragment,null,Sh.createPortal(E,ee),k&&h.createElement(i$,{cursor:b,tooltipEventType:I,coordinate:P,payload:re,index:A}))}function E$(e,t,r){return(t=D$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D$(e){var t=T$(e,"string");return typeof t=="symbol"?t:t+""}function T$(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class M${constructor(t){E$(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function qy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function I$(e){for(var t=1;t{try{var r=document.getElementById(Ky);r||(r=document.createElement("span"),r.setAttribute("id",Ky),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,B$,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},ps=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ci.isSsr)return{width:0,height:0};if(!SN.enableCache)return Vy(t,r);var n=F$(t,r),i=Hy.get(n);if(i)return i;var s=Vy(t,r);return Hy.set(n,s),s},Yy=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Zy=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,W$=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,U$=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,NN={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},q$=Object.keys(NN),Zi="NaN";function H$(e,t){return e*NN[t]}class wt{static parse(t){var r,[,n,i]=(r=U$.exec(t))!==null&&r!==void 0?r:[];return new wt(parseFloat(n),i??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,yr(t)&&(this.unit=""),r!==""&&!W$.test(r)&&(this.num=NaN,this.unit=""),q$.includes(r)&&(this.num=H$(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new wt(NaN,""):new wt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new wt(NaN,""):new wt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new wt(NaN,""):new wt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new wt(NaN,""):new wt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return yr(this.num)}}function kN(e){if(e.includes(Zi))return Zi;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,i,s]=(r=Yy.exec(t))!==null&&r!==void 0?r:[],o=wt.parse(n??""),l=wt.parse(s??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Zi;t=t.replace(Yy,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,u,f,p]=(d=Zy.exec(t))!==null&&d!==void 0?d:[],m=wt.parse(u??""),x=wt.parse(p??""),g=f==="+"?m.add(x):m.subtract(x);if(g.isNaN())return Zi;t=t.replace(Zy,g.toString())}return t}var Gy=/\(([^()]*)\)/;function K$(e){for(var t=e,r;(r=Gy.exec(t))!=null;){var[,n]=r;t=t.replace(Gy,kN(n))}return t}function V$(e){var t=e.replace(/\s+/g,"");return t=K$(t),t=kN(t),t}function Y$(e){try{return V$(e)}catch{return Zi}}function _d(e){var t=Y$(e.slice(5,-1));return t===Zi?"":t}var Z$=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],G$=["dx","dy","angle","className","breakAll"];function xp(){return xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:r,style:n}=e;try{var i=[];Re(t)||(r?i=t.toString().split(""):i=t.toString().split(PN));var s=i.map(l=>({word:l,width:ps(l,n).width})),o=r?0:ps(" ",n).width;return{wordsWithComputedWidth:s,spaceWidth:o}}catch{return null}};function J$(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var CN=(e,t,r,n)=>e.reduce((i,s)=>{var{word:o,width:l}=s,c=i[i.length-1];if(c&&l!=null&&(t==null||n||c.width+l+re.reduce((t,r)=>t.width>r.width?t:r),Q$="…",Jy=(e,t,r,n,i,s,o,l)=>{var c=e.slice(0,t),d=_N({breakAll:r,style:n,children:c+Q$});if(!d)return[!1,[]];var u=CN(d.wordsWithComputedWidth,s,o,l),f=u.length>i||AN(u).width>Number(s);return[f,u]},eL=(e,t,r,n,i)=>{var{maxLines:s,children:o,style:l,breakAll:c}=e,d=Z(s),u=String(o),f=CN(t,n,r,i);if(!d||i)return f;var p=f.length>s||AN(f).width>Number(n);if(!p)return f;for(var m=0,x=u.length-1,g=0,v;m<=x&&g<=u.length-1;){var b=Math.floor((m+x)/2),j=b-1,[y,w]=Jy(u,j,c,l,s,n,r,i),[S]=Jy(u,b,c,l,s,n,r,i);if(!y&&!S&&(m=b+1),y&&S&&(x=b-1),!y&&S){v=w;break}g++}return v||f},Qy=e=>{var t=Re(e)?[]:e.toString().split(PN);return[{words:t,width:void 0}]},tL=e=>{var{width:t,scaleToFit:r,children:n,style:i,breakAll:s,maxLines:o}=e;if((t||r)&&!Ci.isSsr){var l,c,d=_N({breakAll:s,children:n,style:i});if(d){var{wordsWithComputedWidth:u,spaceWidth:f}=d;l=u,c=f}else return Qy(n);return eL({breakAll:s,children:n,maxLines:o,style:i},l,c,t,!!r)}return Qy(n)},ON="#808080",rL={breakAll:!1,capHeight:"0.71em",fill:ON,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},tg=h.forwardRef((e,t)=>{var r=ft(e,rL),{x:n,y:i,lineHeight:s,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:u}=r,f=Xy(r,Z$),p=h.useMemo(()=>tL({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:m,dy:x,angle:g,className:v,breakAll:b}=f,j=Xy(f,G$);if(!Or(n)||!Or(i)||p.length===0)return null;var y=Number(n)+(Z(m)?m:0),w=Number(i)+(Z(x)?x:0);if(!Pe(y)||!Pe(w))return null;var S;switch(u){case"start":S=_d("calc(".concat(o,")"));break;case"middle":S=_d("calc(".concat((p.length-1)/2," * -").concat(s," + (").concat(o," / 2))"));break;default:S=_d("calc(".concat(p.length-1," * -").concat(s,")"));break}var N=[];if(c){var _=p[0].width,{width:C}=f;N.push("scale(".concat(Z(C)&&Z(_)?C/_:1,")"))}return g&&N.push("rotate(".concat(g,", ").concat(y,", ").concat(w,")")),N.length&&(j.transform=N.join(" ")),h.createElement("text",xp({},ut(j),{ref:t,x:y,y:w,className:ue("recharts-text",v),textAnchor:d,fill:l.includes("url")?ON:l}),p.map((D,M)=>{var I=D.words.join(b?"":" ");return h.createElement("tspan",{x:y,dy:M===0?S:s,key:"".concat(I,"-").concat(M)},I)}))});tg.displayName="Text";var nL=["labelRef"];function iL(e,t){if(e==null)return{};var r,n,i=aL(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n{var{x:t,y:r,upperWidth:n,lowerWidth:i,width:s,height:o,children:l}=e,c=h.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:s,height:o}),[t,r,n,i,s,o]);return h.createElement(EN.Provider,{value:c},l)},DN=()=>{var e=h.useContext(EN),t=fu();return e||qw(t)},uL=h.createContext(null),dL=()=>{var e=h.useContext(uL),t=G(lS);return e||t},fL=e=>{var{value:t,formatter:r}=e,n=Re(e.children)?t:e.children;return typeof r=="function"?r(n):n},rg=e=>e!=null&&typeof e=="function",pL=(e,t)=>{var r=Jt(t-e),n=Math.min(Math.abs(t-e),360);return r*n},hL=(e,t,r,n,i)=>{var{offset:s,className:o}=e,{cx:l,cy:c,innerRadius:d,outerRadius:u,startAngle:f,endAngle:p,clockWise:m}=i,x=(d+u)/2,g=pL(f,p),v=g>=0?1:-1,b,j;switch(t){case"insideStart":b=f+v*s,j=m;break;case"insideEnd":b=p-v*s,j=!m;break;case"end":b=p+v*s,j=m;break;default:throw new Error("Unsupported position ".concat(t))}j=g<=0?j:!j;var y=Je(l,c,x,b),w=Je(l,c,x,b+(j?1:-1)*359),S="M".concat(y.x,",").concat(y.y,` - A`).concat(x,",").concat(x,",0,1,").concat(j?0:1,`, - `).concat(w.x,",").concat(w.y),N=Re(e.id)?Ms("recharts-radial-line-"):e.id;return h.createElement("text",Rr({},n,{dominantBaseline:"central",className:ue("recharts-radial-bar-label",o)}),h.createElement("defs",null,h.createElement("path",{id:N,d:S})),h.createElement("textPath",{xlinkHref:"#".concat(N)},r))},mL=(e,t,r)=>{var{cx:n,cy:i,innerRadius:s,outerRadius:o,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(r==="outside"){var{x:u,y:f}=Je(n,i,o+t,d);return{x:u,y:f,textAnchor:u>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var p=(s+o)/2,{x:m,y:x}=Je(n,i,p,d);return{x:m,y:x,textAnchor:"middle",verticalAnchor:"middle"}},yp=e=>"cx"in e&&Z(e.cx),gL=(e,t)=>{var{parentViewBox:r,offset:n,position:i}=e,s;r!=null&&!yp(r)&&(s=r);var{x:o,y:l,upperWidth:c,lowerWidth:d,height:u}=t,f=o,p=o+(c-d)/2,m=(f+p)/2,x=(c+d)/2,g=f+c/2,v=u>=0?1:-1,b=v*n,j=v>0?"end":"start",y=v>0?"start":"end",w=c>=0?1:-1,S=w*n,N=w>0?"end":"start",_=w>0?"start":"end";if(i==="top"){var C={x:f+c/2,y:l-b,textAnchor:"middle",verticalAnchor:j};return _e(_e({},C),s?{height:Math.max(l-s.y,0),width:c}:{})}if(i==="bottom"){var D={x:p+d/2,y:l+u+b,textAnchor:"middle",verticalAnchor:y};return _e(_e({},D),s?{height:Math.max(s.y+s.height-(l+u),0),width:d}:{})}if(i==="left"){var M={x:m-S,y:l+u/2,textAnchor:N,verticalAnchor:"middle"};return _e(_e({},M),s?{width:Math.max(M.x-s.x,0),height:u}:{})}if(i==="right"){var I={x:m+x+S,y:l+u/2,textAnchor:_,verticalAnchor:"middle"};return _e(_e({},I),s?{width:Math.max(s.x+s.width-I.x,0),height:u}:{})}var A=s?{width:x,height:u}:{};return i==="insideLeft"?_e({x:m+S,y:l+u/2,textAnchor:_,verticalAnchor:"middle"},A):i==="insideRight"?_e({x:m+x-S,y:l+u/2,textAnchor:N,verticalAnchor:"middle"},A):i==="insideTop"?_e({x:f+c/2,y:l+b,textAnchor:"middle",verticalAnchor:y},A):i==="insideBottom"?_e({x:p+d/2,y:l+u-b,textAnchor:"middle",verticalAnchor:j},A):i==="insideTopLeft"?_e({x:f+S,y:l+b,textAnchor:_,verticalAnchor:y},A):i==="insideTopRight"?_e({x:f+c-S,y:l+b,textAnchor:N,verticalAnchor:y},A):i==="insideBottomLeft"?_e({x:p+S,y:l+u-b,textAnchor:_,verticalAnchor:j},A):i==="insideBottomRight"?_e({x:p+d-S,y:l+u-b,textAnchor:N,verticalAnchor:j},A):i&&typeof i=="object"&&(Z(i.x)||en(i.x))&&(Z(i.y)||en(i.y))?_e({x:o+Rn(i.x,x),y:l+Rn(i.y,u),textAnchor:"end",verticalAnchor:"end"},A):_e({x:g,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},A)},xL={offset:5,zIndex:lt.label};function vn(e){var t=ft(e,xL),{viewBox:r,position:n,value:i,children:s,content:o,className:l="",textBreakAll:c,labelRef:d}=t,u=dL(),f=DN(),p=n==="center"?f:u??f,m,x,g;if(r==null?m=p:yp(r)?m=r:m=qw(r),!m||Re(i)&&Re(s)&&!h.isValidElement(o)&&typeof o!="function")return null;var v=_e(_e({},t),{},{viewBox:m});if(h.isValidElement(o)){var{labelRef:b}=v,j=iL(v,nL);return h.cloneElement(o,j)}if(typeof o=="function"){if(x=h.createElement(o,v),h.isValidElement(x))return x}else x=fL(t);var y=ut(t);if(yp(m)){if(n==="insideStart"||n==="insideEnd"||n==="end")return hL(t,n,x,y,m);g=mL(m,t.offset,t.position)}else g=gL(t,m);return h.createElement(Ir,{zIndex:t.zIndex},h.createElement(tg,Rr({ref:d,className:ue("recharts-label",l)},y,g,{textAnchor:J$(y.textAnchor)?y.textAnchor:g.textAnchor,breakAll:c}),x))}vn.displayName="Label";var yL=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?h.createElement(vn,Rr({key:"label-implicit"},n)):Or(e)?h.createElement(vn,Rr({key:"label-implicit",value:e},n)):h.isValidElement(e)?e.type===vn?h.cloneElement(e,_e({key:"label-implicit"},n)):h.createElement(vn,Rr({key:"label-implicit",content:e},n)):rg(e)?h.createElement(vn,Rr({key:"label-implicit",content:e},n)):e&&typeof e=="object"?h.createElement(vn,Rr({},e,{key:"label-implicit"},n)):null};function vL(e){var{label:t,labelRef:r}=e,n=DN();return yL(t,n,r)||null}var TN={},MN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(MN);var IN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(IN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MN,r=IN,n=eu;function i(s){if(n.isArrayLike(s))return t.last(r.toArray(s))}e.last=i})(TN);var bL=TN.last;const jL=Tr(bL);var wL=["valueAccessor"],SL=["dataKey","clockWise","id","textBreakAll","zIndex"];function gc(){return gc=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?jL(e.value):e.value,$N=h.createContext(void 0),LN=$N.Provider,zN=h.createContext(void 0);zN.Provider;function PL(){return h.useContext($N)}function _L(){return h.useContext(zN)}function ul(e){var{valueAccessor:t=kL}=e,r=tv(e,wL),{dataKey:n,clockWise:i,id:s,textBreakAll:o,zIndex:l}=r,c=tv(r,SL),d=PL(),u=_L(),f=d||u;return!f||!f.length?null:h.createElement(Ir,{zIndex:l??lt.label},h.createElement(ir,{className:"recharts-label-list"},f.map((p,m)=>{var x,g=Re(n)?t(p,m):et(p&&p.payload,n),v=Re(s)?{}:{id:"".concat(s,"-").concat(m)};return h.createElement(vn,gc({key:"label-".concat(m)},ut(p),c,v,{fill:(x=r.fill)!==null&&x!==void 0?x:p.fill,parentViewBox:p.parentViewBox,value:g,textBreakAll:o,viewBox:p.viewBox,index:m,zIndex:0}))})))}ul.displayName="LabelList";function RN(e){var{label:t}=e;return t?t===!0?h.createElement(ul,{key:"labelList-implicit"}):h.isValidElement(t)||rg(t)?h.createElement(ul,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(ul,gc({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function vp(){return vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:r,r:n,className:i}=e,s=ue("recharts-dot",i);return Z(t)&&Z(r)&&Z(n)?h.createElement("circle",vp({},nr(e),zh(e),{className:s,cx:t,cy:r,r:n})):null},CL={radiusAxis:{},angleAxis:{}},FN=At({name:"polarAxis",initialState:CL,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:$7,removeRadiusAxis:L7,addAngleAxis:z7,removeAngleAxis:R7}=FN.actions,AL=FN.reducer,ng=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,WN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var i;if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!((i=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&i.writable)?!1:r.toString()===`[object ${s}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(WN);var OL=WN.isPlainObject;const EL=Tr(OL);function rv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nv(e){for(var t=1;t{var s=r-n,o;return o="M ".concat(e,",").concat(t),o+="L ".concat(e+r,",").concat(t),o+="L ".concat(e+r-s/2,",").concat(t+i),o+="L ".concat(e+r-s/2-n,",").concat(t+i),o+="L ".concat(e,",").concat(t," Z"),o},IL={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$L=e=>{var t=ft(e,IL),{x:r,y:n,upperWidth:i,lowerWidth:s,height:o,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:f}=t,p=h.useRef(null),[m,x]=h.useState(-1),g=h.useRef(i),v=h.useRef(s),b=h.useRef(o),j=h.useRef(r),y=h.useRef(n),w=mu(e,"trapezoid-");if(h.useEffect(()=>{if(p.current&&p.current.getTotalLength)try{var q=p.current.getTotalLength();q&&x(q)}catch{}},[]),r!==+r||n!==+n||i!==+i||s!==+s||o!==+o||i===0&&s===0||o===0)return null;var S=ue("recharts-trapezoid",l);if(!f)return h.createElement("g",null,h.createElement("path",xc({},ut(t),{className:S,d:iv(r,n,i,s,o)})));var N=g.current,_=v.current,C=b.current,D=j.current,M=y.current,I="0px ".concat(m===-1?1:m,"px"),A="".concat(m,"px 0px"),R=Gw(["strokeDasharray"],d,c);return h.createElement(hu,{animationId:w,key:w,canBegin:m>0,duration:d,easing:c,isActive:f,begin:u},q=>{var Y=Ee(N,i,q),P=Ee(_,s,q),T=Ee(C,o,q),O=Ee(D,r,q),k=Ee(M,n,q);p.current&&(g.current=Y,v.current=P,b.current=T,j.current=O,y.current=k);var L=q>0?{transition:R,strokeDasharray:A}:{strokeDasharray:I};return h.createElement("path",xc({},ut(t),{className:S,d:iv(O,k,Y,P,T),ref:p,style:nv(nv({},L),t.style)}))})},LL=["option","shapeType","propTransformer","activeClassName","isActive"];function zL(e,t){if(e==null)return{};var r,n,i=RL(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n{if(!i){var s=t(r);return n(AI(s)),()=>{n(OI(s))}}},[t,r,n,i]),null}function qN(e){var{legendPayload:t}=e,r=Ye(),n=pt();return h.useLayoutEffect(()=>n?_a:(r(f5(t)),()=>{r(p5(t))}),[r,n,t]),null}var Cd,VL=()=>{var[e]=h.useState(()=>Ms("uid-"));return e},YL=(Cd=$v.useId)!==null&&Cd!==void 0?Cd:VL;function HN(e,t){var r=YL();return t||(e?"".concat(e,"-").concat(r):r)}var ZL=h.createContext(void 0),KN=e=>{var{id:t,type:r,children:n}=e,i=HN("recharts-".concat(r),t);return h.createElement(ZL.Provider,{value:i},n(i))},GL={cartesianItems:[],polarItems:[]},VN=At({name:"graphicalItems",initialState:GL,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Le()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,i=Kr(e).cartesianItems.indexOf(r);i>-1&&(e.cartesianItems[i]=n)},prepare:Le()},removeCartesianGraphicalItem:{reducer(e,t){var r=Kr(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:Le()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Le()},removePolarGraphicalItem:{reducer(e,t){var r=Kr(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:Le()}}}),{addCartesianGraphicalItem:XL,replaceCartesianGraphicalItem:JL,removeCartesianGraphicalItem:QL,addPolarGraphicalItem:B7,removePolarGraphicalItem:F7}=VN.actions,ez=VN.reducer;function YN(e){var t=Ye(),r=h.useRef(null);return h.useLayoutEffect(()=>{r.current===null?t(XL(e)):r.current!==e&&t(JL({prev:r.current,next:e})),r.current=e},[t,e]),h.useLayoutEffect(()=>()=>{r.current&&(t(QL(r.current)),r.current=null)},[t]),null}var tz=["points"];function ov(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ad(e){for(var t=1;t{var v,b,j=Ad(Ad(Ad({r:3},o),f),{},{index:g,cx:(v=x.x)!==null&&v!==void 0?v:void 0,cy:(b=x.y)!==null&&b!==void 0?b:void 0,dataKey:s,value:x.value,payload:x.payload,points:t});return h.createElement(oz,{key:"dot-".concat(g),option:r,dotProps:j,className:i})}),m={};return l&&c!=null&&(m.clipPath="url(#clipPath-".concat(u?"":"dots-").concat(c,")")),h.createElement(Ir,{zIndex:d},h.createElement(ir,vc({className:n},m),p))}function lv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cv(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),bz=$([vz,cn,un],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),$u=()=>G(bz),jz=()=>G(v8);function uv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Od(e){for(var t=1;t{var{point:t,childIndex:r,mainColor:n,activeDot:i,dataKey:s}=e;if(i===!1||t.x==null||t.y==null)return null;var o={index:r,dataKey:s,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},l=Od(Od(Od({},o),Kc(i)),zh(i)),c;return h.isValidElement(i)?c=h.cloneElement(i,l):typeof i=="function"?c=i(l):c=h.createElement(BN,l),h.createElement(ir,{className:"recharts-active-dot"},c)};function bp(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:i,zIndex:s=lt.activeDot}=e,o=G(qs),l=jz();if(t==null||l==null)return null;var c=t.find(d=>l.includes(d.payload));return Re(c)?null:h.createElement(Ir,{zIndex:s},h.createElement(kz,{point:c,childIndex:Number(o),mainColor:r,dataKey:i,activeDot:n}))}var Pz={},XN=At({name:"errorBars",initialState:Pz,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:i}=t.payload;e[r]&&(e[r]=e[r].map(s=>s.dataKey===n.dataKey&&s.direction===n.direction?i:s))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(i=>i.dataKey!==n.dataKey||i.direction!==n.direction))}}}),{addErrorBar:q7,replaceErrorBar:H7,removeErrorBar:K7}=XN.actions,_z=XN.reducer,Cz=["children"];function Az(e,t){if(e==null)return{};var r,n,i=Oz(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n({x:0,y:0,value:0}),errorBarOffset:0},Dz=h.createContext(Ez);function Tz(e){var{children:t}=e,r=Az(e,Cz);return h.createElement(Dz.Provider,{value:r},t)}function ig(e,t){var r,n,i=G(d=>fn(d,e)),s=G(d=>pn(d,t)),o=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:Tt.allowDataOverflow,l=(n=s==null?void 0:s.allowDataOverflow)!==null&&n!==void 0?n:Mt.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function JN(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,i=$u(),{needClipX:s,needClipY:o,needClip:l}=ig(t,r);if(!l||!i)return null;var{x:c,y:d,width:u,height:f}=i;return h.createElement("clipPath",{id:"clipPath-".concat(n)},h.createElement("rect",{x:s?c:c-u/2,y:o?d:d-f/2,width:s?u:u*2,height:o?f:f*2}))}var Mz=e=>{var{chartData:t}=e,r=Ye(),n=pt();return h.useEffect(()=>n?()=>{}:(r(zy(t)),()=>{r(zy(void 0))}),[t,r,n]),null},dv={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},QN=At({name:"brush",initialState:dv,reducers:{setBrushSettings(e,t){return t.payload==null?dv:t.payload}}}),{setBrushSettings:V7}=QN.actions,Iz=QN.reducer;function $z(e,t,r){return(t=Lz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lz(e){var t=zz(e,"string");return typeof t=="symbol"?t:t+""}function zz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class ag{static create(t){return new ag(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:r,position:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(n)switch(n){case"start":return this.scale(t);case"middle":{var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+i}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(t)+s}default:return this.scale(t)}if(r){var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+o}return this.scale(t)}}isInRange(t){var r=this.range(),n=r[0],i=r[r.length-1];return n<=i?t>=n&&t<=i:t>=i&&t<=n}}$z(ag,"EPS",1e-4);function Rz(e){return(e%180+180)%180}var Bz=function(t){var{width:r,height:n}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=Rz(i),o=s*Math.PI/180,l=Math.atan(n/r),c=o>l&&o{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Kr(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Kr(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Kr(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:Y7,removeDot:Z7,addArea:G7,removeArea:X7,addLine:J7,removeLine:Q7}=ek.actions,Wz=ek.reducer,Uz=h.createContext(void 0),qz=e=>{var{children:t}=e,[r]=h.useState("".concat(Ms("recharts"),"-clip")),n=$u();if(n==null)return null;var{x:i,y:s,width:o,height:l}=n;return h.createElement(Uz.Provider,{value:r},h.createElement("defs",null,h.createElement("clipPath",{id:r},h.createElement("rect",{x:i,y:s,height:l,width:o}))),t)};function ba(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function tk(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;ne*i)return!1;var s=r();return e*(t-e*s/2-n)>=0&&e*(t+e*s/2-i)<=0}function Vz(e,t){return tk(e,t+1)}function Yz(e,t,r,n,i){for(var s=(n||[]).slice(),{start:o,end:l}=t,c=0,d=1,u=o,f=function(){var x=n==null?void 0:n[c];if(x===void 0)return{v:tk(n,d)};var g=c,v,b=()=>(v===void 0&&(v=r(x,g)),v),j=x.coordinate,y=c===0||bc(e,j,b,u,l);y||(c=0,u=o,d+=1),y&&(u=j+e*(b()/2+i),c+=d)},p;d<=s.length;)if(p=f(),p)return p.v;return[]}function fv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function at(e){for(var t=1;t(x===void 0&&(x=r(m,p)),x);if(p===o-1){var v=e*(m.coordinate+e*g()/2-c);s[p]=m=at(at({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate})}else s[p]=m=at(at({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var b=bc(e,m.tickCoord,g,l,c);b&&(c=m.tickCoord-e*(g()/2+i),s[p]=at(at({},m),{},{isShow:!0}))}},u=o-1;u>=0;u--)d(u);return s}function Qz(e,t,r,n,i,s){var o=(n||[]).slice(),l=o.length,{start:c,end:d}=t;if(s){var u=n[l-1],f=r(u,l-1),p=e*(u.coordinate+e*f/2-d);if(o[l-1]=u=at(at({},u),{},{tickCoord:p>0?u.coordinate-p*e:u.coordinate}),u.tickCoord!=null){var m=bc(e,u.tickCoord,()=>f,c,d);m&&(d=u.tickCoord-e*(f/2+i),o[l-1]=at(at({},u),{},{isShow:!0}))}}for(var x=s?l-1:l,g=function(j){var y=o[j],w,S=()=>(w===void 0&&(w=r(y,j)),w);if(j===0){var N=e*(y.coordinate-e*S()/2-c);o[j]=y=at(at({},y),{},{tickCoord:N<0?y.coordinate-N*e:y.coordinate})}else o[j]=y=at(at({},y),{},{tickCoord:y.coordinate});if(y.tickCoord!=null){var _=bc(e,y.tickCoord,S,c,d);_&&(c=y.tickCoord+e*(S()/2+i),o[j]=at(at({},y),{},{isShow:!0}))}},v=0;v{var S=typeof d=="function"?d(y.value,w):y.value;return x==="width"?Hz(ps(S,{fontSize:t,letterSpacing:r}),g,f):ps(S,{fontSize:t,letterSpacing:r})[x]},b=i.length>=2?Jt(i[1].coordinate-i[0].coordinate):1,j=Kz(s,b,x);return c==="equidistantPreserveStart"?Yz(b,j,v,i,o):(c==="preserveStart"||c==="preserveStartEnd"?m=Qz(b,j,v,i,o,c==="preserveStartEnd"):m=Jz(b,j,v,i,o),m.filter(y=>y.isShow))}var eR=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:i=0,tickMargin:s=0}=e,o=0;if(t){Array.from(t).forEach(u=>{if(u){var f=u.getBoundingClientRect();f.width>o&&(o=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=i+s,d=o+c+l+(r?n:0);return Math.round(d)}return 0},tR=["axisLine","width","height","className","hide","ticks","axisType"],rR=["viewBox"],nR=["viewBox"];function jp(e,t){if(e==null)return{};var r,n,i=iR(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n{var{ticks:r=[],tick:n,tickLine:i,stroke:s,tickFormatter:o,unit:l,padding:c,tickTextProps:d,orientation:u,mirror:f,x:p,y:m,width:x,height:g,tickSize:v,tickMargin:b,fontSize:j,letterSpacing:y,getTicksConfig:w,events:S,axisType:N}=e,_=sg(Oe(Oe({},w),{},{ticks:r}),j,y),C=uR(u,f),D=dR(u,f),M=nr(w),I=Kc(n),A={};typeof i=="object"&&(A=i);var R=Oe(Oe({},M),{},{fill:"none"},A),q=_.map(T=>Oe({entry:T},cR(T,p,m,x,g,u,v,f,b))),Y=q.map(T=>{var{entry:O,line:k}=T;return h.createElement(ir,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(O.value,"-").concat(O.coordinate,"-").concat(O.tickCoord)},i&&h.createElement("line",Si({},R,k,{className:ue("recharts-cartesian-axis-tick-line",Qc(i,"className"))})))}),P=q.map((T,O)=>{var{entry:k,tick:L}=T,F=Oe(Oe(Oe(Oe({textAnchor:C,verticalAnchor:D},M),{},{stroke:"none",fill:s},I),L),{},{index:O,payload:k,visibleTicksCount:_.length,tickFormatter:o,padding:c},d);return h.createElement(ir,Si({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},rO(S,k,O)),n&&h.createElement(fR,{option:n,tickProps:F,value:"".concat(typeof o=="function"?o(k.value,O):k.value).concat(l||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(N,"-ticks")},P.length>0&&h.createElement(Ir,{zIndex:lt.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(N,"-tick-labels"),ref:t},P)),Y.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(N,"-tick-lines")},Y))}),hR=h.forwardRef((e,t)=>{var{axisLine:r,width:n,height:i,className:s,hide:o,ticks:l,axisType:c}=e,d=jp(e,tR),[u,f]=h.useState(""),[p,m]=h.useState(""),x=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return eR({ticks:x.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var g=h.useCallback(v=>{if(v){var b=v.getElementsByClassName("recharts-cartesian-axis-tick-value");x.current=b;var j=b[0];if(j){var y=window.getComputedStyle(j),w=y.fontSize,S=y.letterSpacing;(w!==u||S!==p)&&(f(w),m(S))}}},[u,p]);return o||n!=null&&n<=0||i!=null&&i<=0?null:h.createElement(Ir,{zIndex:e.zIndex},h.createElement(ir,{className:ue("recharts-cartesian-axis",s)},h.createElement(lR,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:nr(e)}),h.createElement(pR,{ref:g,axisType:c,events:d,fontSize:u,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y}),h.createElement(cL,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(vL,{label:e.label,labelRef:e.labelRef}),e.children)))}),mR=h.memo(hR,(e,t)=>{var{viewBox:r}=e,n=jp(e,rR),{viewBox:i}=t,s=jp(t,nR);return ba(r,i)&&ba(n,s)}),lg=h.forwardRef((e,t)=>{var r=ft(e,og);return h.createElement(mR,Si({},r,{ref:t}))});lg.displayName="CartesianAxis";var gR=["x1","y1","x2","y2","key"],xR=["offset"],yR=["xAxisId","yAxisId"],vR=["xAxisId","yAxisId"];function hv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:i,width:s,height:o,ry:l}=e;return h.createElement("rect",{x:n,y:i,ry:l,width:s,height:o,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function rk(e){var{option:t,lineItemProps:r}=e,n;if(h.isValidElement(t))n=h.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var i,{x1:s,y1:o,x2:l,y2:c,key:d}=r,u=jc(r,gR),f=(i=nr(u))!==null&&i!==void 0?i:{},{offset:p}=f,m=jc(f,xR);n=h.createElement("line",ai({},m,{x1:s,y1:o,x2:l,y2:c,fill:"none",key:d}))}return n}function kR(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:i}=e;if(!n||!i||!i.length)return null;var{xAxisId:s,yAxisId:o}=e,l=jc(e,yR),c=i.map((d,u)=>{var f=ot(ot({},l),{},{x1:t,y1:d,x2:t+r,y2:d,key:"line-".concat(u),index:u});return h.createElement(rk,{key:"line-".concat(u),option:n,lineItemProps:f})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function PR(e){var{y:t,height:r,vertical:n=!0,verticalPoints:i}=e;if(!n||!i||!i.length)return null;var{xAxisId:s,yAxisId:o}=e,l=jc(e,vR),c=i.map((d,u)=>{var f=ot(ot({},l),{},{x1:d,y1:t,x2:d,y2:t+r,key:"line-".concat(u),index:u});return h.createElement(rk,{option:n,lineItemProps:f,key:"line-".concat(u)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function _R(e){var{horizontalFill:t,fillOpacity:r,x:n,y:i,width:s,height:o,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var d=l.map(f=>Math.round(f+i-i)).sort((f,p)=>f-p);i!==d[0]&&d.unshift(0);var u=d.map((f,p)=>{var m=!d[p+1],x=m?i+o-f:d[p+1]-f;if(x<=0)return null;var g=p%t.length;return h.createElement("rect",{key:"react-".concat(p),y:f,x:n,height:x,width:s,stroke:"none",fill:t[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function CR(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:i,y:s,width:o,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var d=c.map(f=>Math.round(f+i-i)).sort((f,p)=>f-p);i!==d[0]&&d.unshift(0);var u=d.map((f,p)=>{var m=!d[p+1],x=m?i+o-f:d[p+1]-f;if(x<=0)return null;var g=p%r.length;return h.createElement("rect",{key:"react-".concat(p),x:f,y:s,width:x,height:l,stroke:"none",fill:r[g],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var AR=(e,t)=>{var{xAxis:r,width:n,height:i,offset:s}=e;return Mw(sg(ot(ot(ot({},og),r),{},{ticks:Iw(r),viewBox:{x:0,y:0,width:n,height:i}})),s.left,s.left+s.width,t)},OR=(e,t)=>{var{yAxis:r,width:n,height:i,offset:s}=e;return Mw(sg(ot(ot(ot({},og),r),{},{ticks:Iw(r),viewBox:{x:0,y:0,width:n,height:i}})),s.top,s.top+s.height,t)},ER={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:lt.grid};function wp(e){var t=Kw(),r=Vw(),n=Hw(),i=ot(ot({},ft(e,ER)),{},{x:Z(e.x)?e.x:n.left,y:Z(e.y)?e.y:n.top,width:Z(e.width)?e.width:n.width,height:Z(e.height)?e.height:n.height}),{xAxisId:s,yAxisId:o,x:l,y:c,width:d,height:u,syncWithTicks:f,horizontalValues:p,verticalValues:m}=i,x=pt(),g=G(D=>_y(D,"xAxis",s,x)),v=G(D=>_y(D,"yAxis",o,x));if(!Er(d)||!Er(u)||!Z(l)||!Z(c))return null;var b=i.verticalCoordinatesGenerator||AR,j=i.horizontalCoordinatesGenerator||OR,{horizontalPoints:y,verticalPoints:w}=i;if((!y||!y.length)&&typeof j=="function"){var S=p&&p.length,N=j({yAxis:v?ot(ot({},v),{},{ticks:S?p:v.ticks}):void 0,width:t??d,height:r??u,offset:n},S?!0:f);Xl(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof N,"]")),Array.isArray(N)&&(y=N)}if((!w||!w.length)&&typeof b=="function"){var _=m&&m.length,C=b({xAxis:g?ot(ot({},g),{},{ticks:_?m:g.ticks}):void 0,width:t??d,height:r??u,offset:n},_?!0:f);Xl(Array.isArray(C),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof C,"]")),Array.isArray(C)&&(w=C)}return h.createElement(Ir,{zIndex:i.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(NR,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),h.createElement(_R,ai({},i,{horizontalPoints:y})),h.createElement(CR,ai({},i,{verticalPoints:w})),h.createElement(kR,ai({},i,{offset:n,horizontalPoints:y,xAxis:g,yAxis:v})),h.createElement(PR,ai({},i,{offset:n,verticalPoints:w,xAxis:g,yAxis:v}))))}wp.displayName="CartesianGrid";var nk=(e,t,r,n)=>Mu(e,"xAxis",t,n),ik=(e,t,r,n)=>Tu(e,"xAxis",t,n),ak=(e,t,r,n)=>Mu(e,"yAxis",r,n),sk=(e,t,r,n)=>Tu(e,"yAxis",r,n),DR=$([de,nk,ak,ik,sk],(e,t,r,n,i)=>Mr(e,"xAxis")?ga(t,n,!1):ga(r,i,!1)),TR=(e,t,r,n,i)=>i;function MR(e){return e.type==="line"}var IR=$([Lm,TR],(e,t)=>e.filter(MR).find(r=>r.id===t)),$R=$([de,nk,ak,ik,sk,IR,DR,wu],(e,t,r,n,i,s,o,l)=>{var{chartData:c,dataStartIndex:d,dataEndIndex:u}=l;if(!(s==null||t==null||r==null||n==null||i==null||n.length===0||i.length===0||o==null)){var{dataKey:f,data:p}=s,m;if(p!=null&&p.length>0?m=p:m=c==null?void 0:c.slice(d,u+1),m!=null)return r9({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataKey:f,bandSize:o,displayedData:m})}});function ok(e){var t=Kc(e),r=3,n=2;if(t!=null){var{r:i,strokeWidth:s}=t,o=Number(i),l=Number(s);return(Number.isNaN(o)||o<0)&&(o=r),(Number.isNaN(l)||l<0)&&(l=n),{r:o,strokeWidth:l}}return{r,strokeWidth:n}}var LR=["id"],zR=["type","layout","connectNulls","needClip","shape"],RR=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Ks(){return Ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:r,stroke:n,legendType:i,hide:s}=e;return[{inactive:s,dataKey:t,type:i,color:n,value:ou(r,t),payload:e}]};function HR(e){var{dataKey:t,data:r,stroke:n,strokeWidth:i,fill:s,name:o,hide:l,unit:c}=e;return{dataDefinedOnItem:r,positions:void 0,settings:{stroke:n,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:ou(o,t),hide:l,type:e.tooltipType,color:e.stroke,unit:c}}}var lk=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function KR(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],i=0;i{var n=r.reduce((f,p)=>f+p);if(!n)return lk(t,e);for(var i=Math.floor(e/n),s=e%n,o=t-e,l=[],c=0,d=0;cs){l=[...r.slice(0,c),s-d];break}var u=l.length%2===0?[0,o]:[o];return[...KR(r,i),...l,...u].map(f=>"".concat(f,"px")).join(", ")};function YR(e){var{clipPathId:t,points:r,props:n}=e,{dot:i,dataKey:s,needClip:o}=n,{id:l}=n,c=cg(n,LR),d=nr(c);return h.createElement(ZN,{points:r,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:s,baseProps:d,needClip:o,clipPathId:t})}function ZR(e){var{showLabels:t,children:r,points:n}=e,i=h.useMemo(()=>n==null?void 0:n.map(s=>{var o,l,c={x:(o=s.x)!==null&&o!==void 0?o:0,y:(l=s.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return wr(wr({},c),{},{value:s.value,payload:s.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return h.createElement(LN,{value:t?i:void 0},r)}function gv(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:i,props:s}=e,{type:o,layout:l,connectNulls:c,needClip:d,shape:u}=s,f=cg(s,zR),p=wr(wr({},ut(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(t,")"):void 0,points:n,type:o,layout:l,connectNulls:c,strokeDasharray:i??s.strokeDasharray});return h.createElement(h.Fragment,null,(n==null?void 0:n.length)>1&&h.createElement(KL,Ks({shapeType:"curve",option:u},p,{pathRef:r})),h.createElement(YR,{points:n,clipPathId:t,props:s}))}function GR(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function XR(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:i,longestAnimatedLengthRef:s}=e,{points:o,strokeDasharray:l,isAnimationActive:c,animationBegin:d,animationDuration:u,animationEasing:f,animateNewValues:p,width:m,height:x,onAnimationEnd:g,onAnimationStart:v}=r,b=i.current,j=mu(r,"recharts-line-"),[y,w]=h.useState(!1),S=!y,N=h.useCallback(()=>{typeof g=="function"&&g(),w(!1)},[g]),_=h.useCallback(()=>{typeof v=="function"&&v(),w(!0)},[v]),C=GR(n.current),D=s.current;return h.createElement(ZR,{points:o,showLabels:S},r.children,h.createElement(hu,{animationId:j,begin:d,duration:u,isActive:c,easing:f,onAnimationEnd:N,onAnimationStart:_,key:j},M=>{var I=Ee(D,C+D,M),A=Math.min(I,C),R;if(c)if(l){var q="".concat(l).split(/[,\s]+/gim).map(T=>parseFloat(T));R=VR(A,C,q)}else R=lk(C,A);else R=l==null?void 0:String(l);if(b){var Y=b.length/o.length,P=M===1?o:o.map((T,O)=>{var k=Math.floor(O*Y);if(b[k]){var L=b[k];return wr(wr({},T),{},{x:Ee(L.x,T.x,M),y:Ee(L.y,T.y,M)})}return p?wr(wr({},T),{},{x:Ee(m*2,T.x,M),y:Ee(x/2,T.y,M)}):wr(wr({},T),{},{x:T.x,y:T.y})});return i.current=P,h.createElement(gv,{props:r,points:P,clipPathId:t,pathRef:n,strokeDasharray:R})}return M>0&&C>0&&(i.current=o,s.current=A),h.createElement(gv,{props:r,points:o,clipPathId:t,pathRef:n,strokeDasharray:R})}),h.createElement(RN,{label:r.label}))}function JR(e){var{clipPathId:t,props:r}=e,n=h.useRef(null),i=h.useRef(0),s=h.useRef(null);return h.createElement(XR,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:i,pathRef:s})}var QR=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:et(e.payload,t)}};class e9 extends h.Component{render(){var{hide:t,dot:r,points:n,className:i,xAxisId:s,yAxisId:o,top:l,left:c,width:d,height:u,id:f,needClip:p,zIndex:m}=this.props;if(t)return null;var x=ue("recharts-line",i),g=f,{r:v,strokeWidth:b}=ok(r),j=ng(r),y=v*2+b;return h.createElement(Ir,{zIndex:m},h.createElement(ir,{className:x},p&&h.createElement("defs",null,h.createElement(JN,{clipPathId:g,xAxisId:s,yAxisId:o}),!j&&h.createElement("clipPath",{id:"clipPath-dots-".concat(g)},h.createElement("rect",{x:c-y/2,y:l-y/2,width:d+y,height:u+y}))),h.createElement(Tz,{xAxisId:s,yAxisId:o,data:n,dataPointFormatter:QR,errorBarOffset:0},h.createElement(JR,{props:this.props,clipPathId:g}))),h.createElement(bp,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey}))}}var ck={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:!Ci.isSsr,label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:lt.line};function t9(e){var t=ft(e,ck),{activeDot:r,animateNewValues:n,animationBegin:i,animationDuration:s,animationEasing:o,connectNulls:l,dot:c,hide:d,isAnimationActive:u,label:f,legendType:p,xAxisId:m,yAxisId:x,id:g}=t,v=cg(t,RR),{needClip:b}=ig(m,x),j=$u(),y=ro(),w=pt(),S=G(M=>$R(M,m,x,w,g));if(y!=="horizontal"&&y!=="vertical"||S==null||j==null)return null;var{height:N,width:_,x:C,y:D}=j;return h.createElement(e9,Ks({},v,{id:g,connectNulls:l,dot:c,activeDot:r,animateNewValues:n,animationBegin:i,animationDuration:s,animationEasing:o,isAnimationActive:u,hide:d,label:f,legendType:p,xAxisId:m,yAxisId:x,points:S,layout:y,height:N,width:_,left:C,top:D,needClip:b}))}function r9(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:s,dataKey:o,bandSize:l,displayedData:c}=e;return c.map((d,u)=>{var f=et(d,o);if(t==="horizontal"){var p=Gl({axis:r,ticks:i,bandSize:l,entry:d,index:u}),m=Re(f)?null:n.scale(f);return{x:p,y:m,value:f,payload:d}}var x=Re(f)?null:r.scale(f),g=Gl({axis:n,ticks:s,bandSize:l,entry:d,index:u});return x==null||g==null?null:{x,y:g,value:f,payload:d}}).filter(Boolean)}function n9(e){var t=ft(e,ck),r=pt();return h.createElement(KN,{id:t.id,type:"line"},n=>h.createElement(h.Fragment,null,h.createElement(qN,{legendPayload:qR(t)}),h.createElement(UN,{fn:HR,args:t}),h.createElement(YN,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),h.createElement(t9,Ks({},t,{id:n}))))}var uk=h.memo(n9);uk.displayName="Line";var dk=(e,t,r,n)=>Mu(e,"xAxis",t,n),fk=(e,t,r,n)=>Tu(e,"xAxis",t,n),pk=(e,t,r,n)=>Mu(e,"yAxis",r,n),hk=(e,t,r,n)=>Tu(e,"yAxis",r,n),i9=$([de,dk,pk,fk,hk],(e,t,r,n,i)=>Mr(e,"xAxis")?ga(t,n,!1):ga(r,i,!1)),a9=(e,t,r,n,i)=>i,mk=$([Lm,a9],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),s9=(e,t,r,n,i)=>{var s,o=mk(e,t,r,n,i);if(o!=null){var l=de(e),c=Mr(l,"xAxis"),d;if(c?d=fp(e,"yAxis",r,n):d=fp(e,"xAxis",t,n),d!=null){var{stackId:u}=o,f=Mm(o);if(!(u==null||f==null)){var p=(s=d[u])===null||s===void 0?void 0:s.stackedData;return p==null?void 0:p.find(m=>m.key===f)}}}},o9=$([de,dk,pk,fk,hk,s9,wu,i9,mk,bM],(e,t,r,n,i,s,o,l,c,d)=>{var{chartData:u,dataStartIndex:f,dataEndIndex:p}=o;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||i==null||n.length===0||i.length===0||l==null)){var{data:m}=c,x;if(m&&m.length>0?x=m:x=u==null?void 0:u.slice(f,p+1),x!=null)return P9({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:s,displayedData:x,chartBaseValue:d,bandSize:l})}}),l9=["id"],c9=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function fi(){return fi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:r,stroke:n,fill:i,legendType:s,hide:o}=e;return[{inactive:o,dataKey:t,type:s,color:wc(n,i),value:ou(r,t),payload:e}]};function m9(e){var{dataKey:t,data:r,stroke:n,strokeWidth:i,fill:s,name:o,hide:l,unit:c}=e;return{dataDefinedOnItem:r,positions:void 0,settings:{stroke:n,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:ou(o,t),hide:l,type:e.tooltipType,color:wc(n,s),unit:c}}}function g9(e){var{clipPathId:t,points:r,props:n}=e,{needClip:i,dot:s,dataKey:o}=n,l=nr(n);return h.createElement(ZN,{points:r,dot:s,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:l,needClip:i,clipPathId:t})}function x9(e){var{showLabels:t,children:r,points:n}=e,i=n.map(s=>{var o,l,c={x:(o=s.x)!==null&&o!==void 0?o:0,y:(l=s.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Gi(Gi({},c),{},{value:s.value,payload:s.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return h.createElement(LN,{value:t?i:void 0},r)}function yv(e){var{points:t,baseLine:r,needClip:n,clipPathId:i,props:s}=e,{layout:o,type:l,stroke:c,connectNulls:d,isRange:u}=s,{id:f}=s,p=gk(s,l9),m=nr(p),x=ut(p);return h.createElement(h.Fragment,null,(t==null?void 0:t.length)>1&&h.createElement(ir,{clipPath:n?"url(#clipPath-".concat(i,")"):void 0},h.createElement(fs,fi({},x,{id:f,points:t,connectNulls:d,type:l,baseLine:r,layout:o,stroke:"none",className:"recharts-area-area"})),c!=="none"&&h.createElement(fs,fi({},m,{className:"recharts-area-curve",layout:o,type:l,connectNulls:d,fill:"none",points:t})),c!=="none"&&u&&h.createElement(fs,fi({},m,{className:"recharts-area-curve",layout:o,type:l,connectNulls:d,fill:"none",points:r}))),h.createElement(g9,{points:t,props:p,clipPathId:i}))}function y9(e){var{alpha:t,baseLine:r,points:n,strokeWidth:i}=e,s=n[0].y,o=n[n.length-1].y;if(!Pe(s)||!Pe(o))return null;var l=t*Math.abs(s-o),c=Math.max(...n.map(d=>d.x||0));return Z(r)?c=Math.max(r,c):r&&Array.isArray(r)&&r.length&&(c=Math.max(...r.map(d=>d.x||0),c)),Z(c)?h.createElement("rect",{x:0,y:sd.y||0));return Z(r)?c=Math.max(r,c):r&&Array.isArray(r)&&r.length&&(c=Math.max(...r.map(d=>d.y||0),c)),Z(c)?h.createElement("rect",{x:s{typeof m=="function"&&m(),v(!1)},[m]),y=h.useCallback(()=>{typeof p=="function"&&p(),v(!0)},[p]),w=i.current,S=s.current;return h.createElement(x9,{showLabels:b,points:o},n.children,h.createElement(hu,{animationId:x,begin:d,duration:u,isActive:c,easing:f,onAnimationEnd:j,onAnimationStart:y,key:x},N=>{if(w){var _=w.length/o.length,C=N===1?o:o.map((M,I)=>{var A=Math.floor(I*_);if(w[A]){var R=w[A];return Gi(Gi({},M),{},{x:Ee(R.x,M.x,N),y:Ee(R.y,M.y,N)})}return M}),D;return Z(l)?D=Ee(S,l,N):Re(l)||yr(l)?D=Ee(S,0,N):D=l.map((M,I)=>{var A=Math.floor(I*_);if(Array.isArray(S)&&S[A]){var R=S[A];return Gi(Gi({},M),{},{x:Ee(R.x,M.x,N),y:Ee(R.y,M.y,N)})}return M}),N>0&&(i.current=C,s.current=D),h.createElement(yv,{points:C,baseLine:D,needClip:t,clipPathId:r,props:n})}return N>0&&(i.current=o,s.current=l),h.createElement(ir,null,c&&h.createElement("defs",null,h.createElement("clipPath",{id:"animationClipPath-".concat(r)},h.createElement(b9,{alpha:N,points:o,baseLine:l,layout:n.layout,strokeWidth:n.strokeWidth}))),h.createElement(ir,{clipPath:"url(#animationClipPath-".concat(r,")")},h.createElement(yv,{points:o,baseLine:l,needClip:t,clipPathId:r,props:n})))}),h.createElement(RN,{label:n.label}))}function w9(e){var{needClip:t,clipPathId:r,props:n}=e,i=h.useRef(null),s=h.useRef();return h.createElement(j9,{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:s})}class S9 extends h.PureComponent{render(){var{hide:t,dot:r,points:n,className:i,top:s,left:o,needClip:l,xAxisId:c,yAxisId:d,width:u,height:f,id:p,baseLine:m,zIndex:x}=this.props;if(t)return null;var g=ue("recharts-area",i),v=p,{r:b,strokeWidth:j}=ok(r),y=ng(r),w=b*2+j;return h.createElement(Ir,{zIndex:x},h.createElement(ir,{className:g},l&&h.createElement("defs",null,h.createElement(JN,{clipPathId:v,xAxisId:c,yAxisId:d}),!y&&h.createElement("clipPath",{id:"clipPath-dots-".concat(v)},h.createElement("rect",{x:o-w/2,y:s-w/2,width:u+w,height:f+w}))),h.createElement(w9,{needClip:l,clipPathId:v,props:this.props})),h.createElement(bp,{points:n,mainColor:wc(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot}),this.props.isRange&&Array.isArray(m)&&h.createElement(bp,{points:m,mainColor:wc(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot}))}}var xk={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:!Ci.isSsr,legendType:"line",stroke:"#3182bd",xAxisId:0,yAxisId:0,zIndex:lt.area};function N9(e){var t,r=ft(e,xk),{activeDot:n,animationBegin:i,animationDuration:s,animationEasing:o,connectNulls:l,dot:c,fill:d,fillOpacity:u,hide:f,isAnimationActive:p,legendType:m,stroke:x,xAxisId:g,yAxisId:v}=r,b=gk(r,c9),j=ro(),y=fN(),{needClip:w}=ig(g,v),S=pt(),{points:N,isRange:_,baseLine:C}=(t=G(q=>o9(q,g,v,S,e.id)))!==null&&t!==void 0?t:{},D=$u();if(j!=="horizontal"&&j!=="vertical"||D==null||y!=="AreaChart"&&y!=="ComposedChart")return null;var{height:M,width:I,x:A,y:R}=D;return!N||!N.length?null:h.createElement(S9,fi({},b,{activeDot:n,animationBegin:i,animationDuration:s,animationEasing:o,baseLine:C,connectNulls:l,dot:c,fill:d,fillOpacity:u,height:M,hide:f,layout:j,isAnimationActive:p,isRange:_,legendType:m,needClip:w,points:N,stroke:x,width:I,left:A,top:R,xAxisId:g,yAxisId:v}))}var k9=(e,t,r,n,i)=>{var s=r??t;if(Z(s))return s;var o=e==="horizontal"?i:n,l=o.scale.domain();if(o.type==="number"){var c=Math.max(l[0],l[1]),d=Math.min(l[0],l[1]);return s==="dataMin"?d:s==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]};function P9(e){var{areaSettings:{connectNulls:t,baseValue:r,dataKey:n},stackedData:i,layout:s,chartBaseValue:o,xAxis:l,yAxis:c,displayedData:d,dataStartIndex:u,xAxisTicks:f,yAxisTicks:p,bandSize:m}=e,x=i&&i.length,g=k9(s,o,r,l,c),v=s==="horizontal",b=!1,j=d.map((w,S)=>{var N;x?N=i[u+S]:(N=et(w,n),Array.isArray(N)?b=!0:N=[g,N]);var _=N[1]==null||x&&!t&&et(w,n)==null;return v?{x:Gl({axis:l,ticks:f,bandSize:m,entry:w,index:S}),y:_?null:c.scale(N[1]),value:N,payload:w}:{x:_?null:l.scale(N[1]),y:Gl({axis:c,ticks:p,bandSize:m,entry:w,index:S}),value:N,payload:w}}),y;return x||b?y=j.map(w=>{var S=Array.isArray(w.value)?w.value[0]:null;return v?{x:w.x,y:S!=null&&w.y!=null?c.scale(S):null,payload:w.payload}:{x:S!=null?l.scale(S):null,y:w.y,payload:w.payload}}):y=v?c.scale(g):l.scale(g),{points:j,baseLine:y,isRange:b}}function _9(e){var t=ft(e,xk),r=pt();return h.createElement(KN,{id:t.id,type:"area"},n=>h.createElement(h.Fragment,null,h.createElement(qN,{legendPayload:h9(t)}),h.createElement(UN,{fn:m9,args:t}),h.createElement(YN,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:EE(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),h.createElement(N9,fi({},t,{id:n}))))}var yk=h.memo(_9);yk.displayName="Area";var C9=["dangerouslySetInnerHTML","ticks"],A9=["id"],O9=["domain"],E9=["domain"];function Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t(t(pz(e)),()=>{t(hz(e))}),[e,t]),null}var M9=e=>{var{xAxisId:t,className:r}=e,n=G(Lw),i=pt(),s="xAxis",o=G(v=>Ta(v,s,t,i)),l=G(v=>qS(v,s,t,i)),c=G(v=>fI(v,t)),d=G(v=>yI(v,t)),u=G(v=>uS(v,t));if(c==null||d==null||u==null)return null;var{dangerouslySetInnerHTML:f,ticks:p}=e,m=Sc(e,C9),{id:x}=u,g=Sc(u,A9);return h.createElement(lg,Sp({},m,g,{scale:o,x:d.x,y:d.y,width:c.width,height:c.height,className:ue("recharts-".concat(s," ").concat(s),r),viewBox:n,ticks:l,axisType:s}))},I9={allowDataOverflow:Tt.allowDataOverflow,allowDecimals:Tt.allowDecimals,allowDuplicatedCategory:Tt.allowDuplicatedCategory,height:Tt.height,hide:!1,mirror:Tt.mirror,orientation:Tt.orientation,padding:Tt.padding,reversed:Tt.reversed,scale:Tt.scale,tickCount:Tt.tickCount,type:Tt.type,xAxisId:0},$9=e=>{var t,r,n,i,s,o=ft(e,I9);return h.createElement(h.Fragment,null,h.createElement(T9,{interval:(t=o.interval)!==null&&t!==void 0?t:"preserveEnd",id:o.xAxisId,scale:o.scale,type:o.type,padding:o.padding,allowDataOverflow:o.allowDataOverflow,domain:o.domain,dataKey:o.dataKey,allowDuplicatedCategory:o.allowDuplicatedCategory,allowDecimals:o.allowDecimals,tickCount:o.tickCount,includeHidden:(r=o.includeHidden)!==null&&r!==void 0?r:!1,reversed:o.reversed,ticks:o.ticks,height:o.height,orientation:o.orientation,mirror:o.mirror,hide:o.hide,unit:o.unit,name:o.name,angle:(n=o.angle)!==null&&n!==void 0?n:0,minTickGap:(i=o.minTickGap)!==null&&i!==void 0?i:5,tick:(s=o.tick)!==null&&s!==void 0?s:!0,tickFormatter:o.tickFormatter}),h.createElement(M9,o))},L9=(e,t)=>{var{domain:r}=e,n=Sc(e,O9),{domain:i}=t,s=Sc(t,E9);return ba(n,s)?Array.isArray(r)&&r.length===2&&Array.isArray(i)&&i.length===2?r[0]===i[0]&&r[1]===i[1]:ba({domain:r},{domain:i}):!1},Np=h.memo($9,L9);Np.displayName="XAxis";var z9=["dangerouslySetInnerHTML","ticks"],R9=["id"],B9=["domain"],F9=["domain"];function kp(){return kp=Object.assign?Object.assign.bind():function(e){for(var t=1;t(t(mz(e)),()=>{t(gz(e))}),[e,t]),null}var q9=e=>{var{yAxisId:t,className:r,width:n,label:i}=e,s=h.useRef(null),o=h.useRef(null),l=G(Lw),c=pt(),d=Ye(),u="yAxis",f=G(S=>Ta(S,u,t,c)),p=G(S=>jI(S,t)),m=G(S=>bI(S,t)),x=G(S=>qS(S,u,t,c)),g=G(S=>dS(S,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!p||rg(i)||h.isValidElement(i)||g==null)){var S=s.current;if(S){var N=S.getCalculatedWidth();Math.round(p.width)!==Math.round(N)&&d(xz({id:t,width:N}))}}},[x,p,d,i,t,n,g]),p==null||m==null||g==null)return null;var{dangerouslySetInnerHTML:v,ticks:b}=e,j=Nc(e,z9),{id:y}=g,w=Nc(g,R9);return h.createElement(lg,kp({},j,w,{ref:s,labelRef:o,scale:f,x:m.x,y:m.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:p.width,height:p.height,className:ue("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:x,axisType:u}))},H9={allowDataOverflow:Mt.allowDataOverflow,allowDecimals:Mt.allowDecimals,allowDuplicatedCategory:Mt.allowDuplicatedCategory,hide:!1,mirror:Mt.mirror,orientation:Mt.orientation,padding:Mt.padding,reversed:Mt.reversed,scale:Mt.scale,tickCount:Mt.tickCount,type:Mt.type,width:Mt.width,yAxisId:0},K9=e=>{var t,r,n,i,s,o=ft(e,H9);return h.createElement(h.Fragment,null,h.createElement(U9,{interval:(t=o.interval)!==null&&t!==void 0?t:"preserveEnd",id:o.yAxisId,scale:o.scale,type:o.type,domain:o.domain,allowDataOverflow:o.allowDataOverflow,dataKey:o.dataKey,allowDuplicatedCategory:o.allowDuplicatedCategory,allowDecimals:o.allowDecimals,tickCount:o.tickCount,padding:o.padding,includeHidden:(r=o.includeHidden)!==null&&r!==void 0?r:!1,reversed:o.reversed,ticks:o.ticks,width:o.width,orientation:o.orientation,mirror:o.mirror,hide:o.hide,unit:o.unit,name:o.name,angle:(n=o.angle)!==null&&n!==void 0?n:0,minTickGap:(i=o.minTickGap)!==null&&i!==void 0?i:5,tick:(s=o.tick)!==null&&s!==void 0?s:!0,tickFormatter:o.tickFormatter}),h.createElement(q9,o))},V9=(e,t)=>{var{domain:r}=e,n=Nc(e,B9),{domain:i}=t,s=Nc(t,F9);return ba(n,s)?Array.isArray(r)&&r.length===2&&Array.isArray(i)&&i.length===2?r[0]===i[0]&&r[1]===i[1]:ba({domain:r},{domain:i}):!1},Pp=h.memo(K9,V9);Pp.displayName="YAxis";var Y9={};/** - * @license React - * use-sync-external-store-with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ho=h;function Z9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var G9=typeof Object.is=="function"?Object.is:Z9,X9=ho.useSyncExternalStore,J9=ho.useRef,Q9=ho.useEffect,eB=ho.useMemo,tB=ho.useDebugValue;Y9.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var s=J9(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=eB(function(){function c(m){if(!d){if(d=!0,u=m,m=n(m),i!==void 0&&o.hasValue){var x=o.value;if(i(x,m))return f=x}return f=m}if(x=f,G9(u,m))return x;var g=n(m);return i!==void 0&&i(x,g)?(u=m,x):(u=m,f=g)}var d=!1,u,f,p=r===void 0?null:r;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,r,n,i]);var l=X9(e,s[0],s[1]);return Q9(function(){o.hasValue=!0,o.value=l},[l]),tB(l),l};function rB(e){e()}function nB(){let e=null,t=null;return{clear(){e=null,t=null},notify(){rB(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var vv={notify(){},get:()=>[]};function iB(e,t){let r,n=vv,i=0,s=!1;function o(g){u();const v=n.subscribe(g);let b=!1;return()=>{b||(b=!0,v(),f())}}function l(){n.notify()}function c(){x.onStateChange&&x.onStateChange()}function d(){return s}function u(){i++,r||(r=e.subscribe(c),n=nB())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=vv)}function p(){s||(s=!0,u())}function m(){s&&(s=!1,f())}const x={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:p,tryUnsubscribe:m,getListeners:()=>n};return x}var aB=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sB=aB(),oB=()=>typeof navigator<"u"&&navigator.product==="ReactNative",lB=oB(),cB=()=>sB||lB?h.useLayoutEffect:h.useEffect,uB=cB(),Ed=Symbol.for("react-redux-context"),Dd=typeof globalThis<"u"?globalThis:{};function dB(){if(!h.createContext)return{};const e=Dd[Ed]??(Dd[Ed]=new Map);let t=e.get(h.createContext);return t||(t=h.createContext(null),e.set(h.createContext,t)),t}var fB=dB();function pB(e){const{children:t,context:r,serverState:n,store:i}=e,s=h.useMemo(()=>{const c=iB(i);return{store:i,subscription:c,getServerState:n?()=>n:void 0}},[i,n]),o=h.useMemo(()=>i.getState(),[i]);uB(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,o]);const l=r||fB;return h.createElement(l.Provider,{value:s},t)}var hB=pB,mB=(e,t)=>t,ug=$([mB,de,lS,We,sN,hn,E8,rt],z8),dg=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},vk=ar("mouseClick"),bk=eo();bk.startListening({actionCreator:vk,effect:(e,t)=>{var r=e.payload,n=ug(t.getState(),dg(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(TI({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var _p=ar("mouseMove"),jk=eo();jk.startListening({actionCreator:_p,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=Km(n,n.tooltip.settings.shared),s=ug(n,dg(r));i==="axis"&&((s==null?void 0:s.activeIndex)!=null?t.dispatch(XS({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate})):t.dispatch(GS()))}});var bv={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0},wk=At({name:"rootProps",initialState:bv,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:bv.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue}}}),gB=wk.reducer,{updateOptions:xB}=wk.actions,Sk=At({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:eF}=Sk.actions,yB=Sk.reducer,Nk=ar("keyDown"),kk=ar("focus"),fg=eo();fg.startListening({actionCreator:Nk,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,s=e.payload;if(!(s!=="ArrowRight"&&s!=="ArrowLeft"&&s!=="Enter")){var o=Number(Vm(i,Ia(r))),l=hn(r);if(s==="Enter"){var c=mc(r,"axis","hover",String(i.index));t.dispatch(hp({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:c}));return}var d=kI(r),u=d==="left-to-right"?1:-1,f=s==="ArrowRight"?1:-1,p=o+f*u;if(!(l==null||p>=l.length||p<0)){var m=mc(r,"axis","hover",String(p));t.dispatch(hp({active:!0,activeIndex:p.toString(),activeDataKey:void 0,activeCoordinate:m}))}}}}});fg.startListening({actionCreator:kk,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var s="0",o=mc(r,"axis","hover",String(s));t.dispatch(hp({activeDataKey:void 0,active:!0,activeIndex:s,activeCoordinate:o}))}}}});var Vt=ar("externalEvent"),Pk=eo();Pk.startListening({actionCreator:Vt,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:g8(r),activeDataKey:h8(r),activeIndex:qs(r),activeLabel:cN(r),activeTooltipIndex:qs(r),isTooltipActive:x8(r)};e.payload.handler(n,e.payload.reactEvent)}}});var vB=$([Ma],e=>e.tooltipItemPayloads),bB=$([vB,fo,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(l=>l.settings.dataKey===n);if(i!=null){var{positions:s}=i;if(s!=null){var o=t(s,r);return o}}}),_k=ar("touchMove"),Ck=eo();Ck.startListening({actionCreator:_k,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),i=Km(n,n.tooltip.settings.shared);if(i==="axis"){var s=ug(n,dg({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));(s==null?void 0:s.activeIndex)!=null&&t.dispatch(XS({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate}))}else if(i==="item"){var o,l=r.touches[0];if(document.elementFromPoint==null)return;var c=document.elementFromPoint(l.clientX,l.clientY);if(!c||!c.getAttribute)return;var d=c.getAttribute(zE),u=(o=c.getAttribute(RE))!==null&&o!==void 0?o:void 0,f=bB(t.getState(),d,u);t.dispatch(DI({activeDataKey:u,activeIndex:d,activeCoordinate:f}))}}}});var jB=lw({brush:Iz,cartesianAxis:yz,chartData:h$,errorBars:_z,graphicalItems:ez,layout:jE,legend:h5,options:c$,polarAxis:AL,polarOptions:yB,referenceElements:Wz,rootProps:gB,tooltip:MI,zIndex:J8}),wB=function(t){return KO({reducer:jB,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([bk.middleware,jk.middleware,fg.middleware,Pk.middleware,Ck.middleware]),enhancers:r=>{var n=r;return typeof r=="function"&&(n=r()),n.concat(bw({type:"raf"}))},devTools:Ci.devToolsEnabled})};function SB(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=pt(),s=h.useRef(null);if(i)return r;s.current==null&&(s.current=wB(t));var o=Yh;return h.createElement(hB,{context:o,store:s.current},r)}function NB(e){var{layout:t,margin:r}=e,n=Ye(),i=pt();return h.useEffect(()=>{i||(n(yE(t)),n(xE(r)))},[n,i,t,r]),null}function kB(e){var t=Ye();return h.useEffect(()=>{t(xB(e))},[t,e]),null}function jv(e){var{zIndex:t,isPanorama:r}=e,n=r?"recharts-zindex-panorama-":"recharts-zindex-",i=HN("".concat(n).concat(t)),s=Ye();return h.useLayoutEffect(()=>(s(G8({zIndex:t,elementId:i,isPanorama:r})),()=>{s(X8({zIndex:t,isPanorama:r}))}),[s,t,i,r]),h.createElement("g",{id:i})}function wv(e){var{children:t,isPanorama:r}=e,n=G(B8);if(!n||n.length===0)return t;var i=n.filter(o=>o<0),s=n.filter(o=>o>0);return h.createElement(h.Fragment,null,i.map(o=>h.createElement(jv,{key:o,zIndex:o,isPanorama:r})),t,s.map(o=>h.createElement(jv,{key:o,zIndex:o,isPanorama:r})))}var PB=["children"];function _B(e,t){if(e==null)return{};var r,n,i=CB(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n{var r=Kw(),n=Vw(),i=Zw();if(!Er(r)||!Er(n))return null;var{children:s,otherAttributes:o,title:l,desc:c}=e,d,u;return o!=null&&(typeof o.tabIndex=="number"?d=o.tabIndex:d=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0),h.createElement(pj,kc({},o,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:AB,ref:t}),s)}),EB=e=>{var{children:t}=e,r=G(du);if(!r)return null;var{width:n,height:i,y:s,x:o}=r;return h.createElement(pj,{width:n,height:i,x:o,y:s},t)},Sv=h.forwardRef((e,t)=>{var{children:r}=e,n=_B(e,PB),i=pt();return i?h.createElement(EB,null,h.createElement(wv,{isPanorama:!0},r)):h.createElement(OB,kc({ref:t},n),h.createElement(wv,{isPanorama:!1},r))});function DB(){var e=Ye(),[t,r]=h.useState(null),n=G(LE);return h.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),s=i.width/t.offsetWidth;Pe(s)&&s!==n&&e(bE(s))}},[t,e,n]),r}function Nv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function TB(e){for(var t=1;t(S$(),null);function Pc(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var zB=h.forwardRef((e,t)=>{var r,n,i=h.useRef(null),[s,o]=h.useState({containerWidth:Pc((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Pc((n=e.style)===null||n===void 0?void 0:n.height)}),l=h.useCallback((d,u)=>{o(f=>{var p=Math.round(d),m=Math.round(u);return f.containerWidth===p&&f.containerHeight===m?f:{containerWidth:p,containerHeight:m}})},[]),c=h.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null&&typeof ResizeObserver<"u"){var{width:u,height:f}=d.getBoundingClientRect();l(u,f);var p=x=>{var{width:g,height:v}=x[0].contentRect;l(g,v)},m=new ResizeObserver(p);m.observe(d),i.current=m}},[t,l]);return h.useEffect(()=>()=>{var d=i.current;d!=null&&d.disconnect()},[l]),h.createElement(h.Fragment,null,h.createElement(pu,{width:s.containerWidth,height:s.containerHeight}),h.createElement("div",Ni({ref:c},e)))}),RB=h.forwardRef((e,t)=>{var{width:r,height:n}=e,[i,s]=h.useState({containerWidth:Pc(r),containerHeight:Pc(n)}),o=h.useCallback((c,d)=>{s(u=>{var f=Math.round(c),p=Math.round(d);return u.containerWidth===f&&u.containerHeight===p?u:{containerWidth:f,containerHeight:p}})},[]),l=h.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:u}=c.getBoundingClientRect();o(d,u)}},[t,o]);return h.createElement(h.Fragment,null,h.createElement(pu,{width:i.containerWidth,height:i.containerHeight}),h.createElement("div",Ni({ref:l},e)))}),BB=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return h.createElement(h.Fragment,null,h.createElement(pu,{width:r,height:n}),h.createElement("div",Ni({ref:t},e)))}),FB=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return en(r)||en(n)?h.createElement(RB,Ni({},e,{ref:t})):h.createElement(BB,Ni({},e,{ref:t}))});function WB(e){return e===!0?zB:FB}var UB=h.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:s,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,onMouseMove:f,onMouseUp:p,onTouchEnd:m,onTouchMove:x,onTouchStart:g,style:v,width:b,responsive:j,dispatchTouchEvents:y=!0}=e,w=h.useRef(null),S=Ye(),[N,_]=h.useState(null),[C,D]=h.useState(null),M=DB(),I=rm(),A=(I==null?void 0:I.width)>0?I.width:b,R=(I==null?void 0:I.height)>0?I.height:i,q=h.useCallback(B=>{M(B),typeof t=="function"&&t(B),_(B),D(B),B!=null&&(w.current=B)},[M,t,_,D]),Y=h.useCallback(B=>{S(vk(B)),S(Vt({handler:s,reactEvent:B}))},[S,s]),P=h.useCallback(B=>{S(_p(B)),S(Vt({handler:d,reactEvent:B}))},[S,d]),T=h.useCallback(B=>{S(GS()),S(Vt({handler:u,reactEvent:B}))},[S,u]),O=h.useCallback(B=>{S(_p(B)),S(Vt({handler:f,reactEvent:B}))},[S,f]),k=h.useCallback(()=>{S(kk())},[S]),L=h.useCallback(B=>{S(Nk(B.key))},[S]),F=h.useCallback(B=>{S(Vt({handler:o,reactEvent:B}))},[S,o]),H=h.useCallback(B=>{S(Vt({handler:l,reactEvent:B}))},[S,l]),ee=h.useCallback(B=>{S(Vt({handler:c,reactEvent:B}))},[S,c]),re=h.useCallback(B=>{S(Vt({handler:p,reactEvent:B}))},[S,p]),Me=h.useCallback(B=>{S(Vt({handler:g,reactEvent:B}))},[S,g]),E=h.useCallback(B=>{y&&S(_k(B)),S(Vt({handler:x,reactEvent:B}))},[S,y,x]),J=h.useCallback(B=>{S(Vt({handler:m,reactEvent:B}))},[S,m]),Ot=WB(j);return h.createElement(yN.Provider,{value:N},h.createElement(l4.Provider,{value:C},h.createElement(Ot,{width:A??(v==null?void 0:v.width),height:R??(v==null?void 0:v.height),className:ue("recharts-wrapper",n),style:TB({position:"relative",cursor:"default",width:A,height:R},v),onClick:Y,onContextMenu:F,onDoubleClick:H,onFocus:k,onKeyDown:L,onMouseDown:ee,onMouseEnter:P,onMouseLeave:T,onMouseMove:O,onMouseUp:re,onTouchEnd:J,onTouchMove:E,onTouchStart:Me,ref:q},h.createElement(LB,null),r)))}),qB=["width","height","responsive","children","className","style","compact","title","desc"];function HB(e,t){if(e==null)return{};var r,n,i=KB(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n{var{width:r,height:n,responsive:i,children:s,className:o,style:l,compact:c,title:d,desc:u}=e,f=HB(e,qB),p=nr(f);return c?h.createElement(h.Fragment,null,h.createElement(pu,{width:r,height:n}),h.createElement(Sv,{otherAttributes:p,title:d,desc:u},s)):h.createElement(UB,{className:o,style:l,width:r,height:n,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},h.createElement(Sv,{otherAttributes:p,title:d,desc:u,ref:t},h.createElement(qz,null,s)))});function Cp(){return Cp=Object.assign?Object.assign.bind():function(e){for(var t=1;th.createElement(Ak,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:GB,tooltipPayloadSearcher:bN,categoricalChartProps:e,ref:t})),JB=["axis"],QB=h.forwardRef((e,t)=>h.createElement(Ak,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:JB,tooltipPayloadSearcher:bN,categoricalChartProps:e,ref:t}));function e7(){var v,b,j,y,w,S,N,_,C,D,M,I,A,R,q,Y,P,T,O,k,L;const[e,t]=h.useState(null),[r,n]=h.useState(null),[i,s]=h.useState(!0),[o,l]=h.useState(0),[c,d]=h.useState(!1);h.useEffect(()=>{f(),u()},[]);const u=async()=>{try{const H=(await z.getChangeStats()).pending_count;l(H);const ee=localStorage.getItem("dismissedPendingChangesCount"),re=ee&&parseInt(ee)>=H;d(H>0&&!re)}catch(F){console.error("Failed to load change stats:",F),d(!1)}},f=async()=>{try{const F=await z.getDutchieAZDashboard();t({products:{total:F.productCount,in_stock:F.productCount,with_images:0},stores:{total:F.dispensaryCount,active:F.dispensaryCount},brands:{total:F.brandCount},campaigns:{active:0,total:0},clicks:{clicks_24h:F.snapshotCount24h},failedJobs:F.failedJobCount,lastCrawlTime:F.lastCrawlTime});try{const H=await z.getDashboardActivity();n(H)}catch{n(null)}}catch(F){console.error("Failed to load dashboard:",F)}finally{s(!1)}},p=()=>{localStorage.setItem("dismissedPendingChangesCount",o.toString()),d(!1)};if(i)return a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx(Xt,{className:"w-8 h-8 animate-spin text-gray-400"})})});const m=Math.round(((v=e==null?void 0:e.products)==null?void 0:v.with_images)/((b=e==null?void 0:e.products)==null?void 0:b.total)*100)||0;Math.round(((j=e==null?void 0:e.stores)==null?void 0:j.active)/((y=e==null?void 0:e.stores)==null?void 0:y.total)*100);const x=[{date:"Mon",products:120},{date:"Tue",products:145},{date:"Wed",products:132},{date:"Thu",products:178},{date:"Fri",products:195},{date:"Sat",products:210},{date:"Sun",products:((w=e==null?void 0:e.products)==null?void 0:w.total)||225}],g=[{time:"00:00",scrapes:5},{time:"04:00",scrapes:12},{time:"08:00",scrapes:18},{time:"12:00",scrapes:25},{time:"16:00",scrapes:30},{time:"20:00",scrapes:22},{time:"24:00",scrapes:((S=r==null?void 0:r.recent_scrapes)==null?void 0:S.length)||15}];return a.jsxs(X,{children:[c&&a.jsx("div",{className:"mb-6 bg-amber-50 border-l-4 border-amber-500 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[a.jsx(lj,{className:"w-5 h-5 text-amber-600 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-sm font-semibold text-amber-900",children:[o," pending change",o!==1?"s":""," require review"]}),a.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:"Proposed changes to dispensary data are waiting for approval"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{className:"btn btn-sm bg-amber-600 hover:bg-amber-700 text-white border-none",children:"Review Changes"}),a.jsx("button",{onClick:p,className:"btn btn-sm btn-ghost text-amber-900 hover:bg-amber-100","aria-label":"Dismiss notification",children:a.jsx(Dh,{className:"w-4 h-4"})})]})]})}),a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"Dashboard"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Monitor your dispensary data aggregation"})]}),a.jsxs("button",{onClick:f,className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors text-sm font-medium text-gray-700",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Refresh"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(xt,{className:"w-5 h-5 text-blue-600"})}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600",children:[a.jsx(Qr,{className:"w-3 h-3"}),a.jsx("span",{children:"12.5%"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Products"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((_=(N=e==null?void 0:e.products)==null?void 0:N.total)==null?void 0:_.toLocaleString())||0}),a.jsxs("p",{className:"text-xs text-gray-500",children:[((C=e==null?void 0:e.products)==null?void 0:C.in_stock)||0," in stock"]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-emerald-50 rounded-lg",children:a.jsx(Ll,{className:"w-5 h-5 text-emerald-600"})}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600",children:[a.jsx(Qr,{className:"w-3 h-3"}),a.jsx("span",{children:"8.2%"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Dispensaries"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((D=e==null?void 0:e.stores)==null?void 0:D.total)||0}),a.jsxs("p",{className:"text-xs text-gray-500",children:[((M=e==null?void 0:e.stores)==null?void 0:M.active)||0," active (crawlable)"]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(sj,{className:"w-5 h-5 text-purple-600"})}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600",children:[a.jsx(W6,{className:"w-3 h-3"}),a.jsx("span",{children:"3.1%"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Active Campaigns"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((I=e==null?void 0:e.campaigns)==null?void 0:I.active)||0}),a.jsxs("p",{className:"text-xs text-gray-500",children:[((A=e==null?void 0:e.campaigns)==null?void 0:A.total)||0," total campaigns"]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-amber-50 rounded-lg",children:a.jsx(p6,{className:"w-5 h-5 text-amber-600"})}),a.jsxs("span",{className:"text-xs font-medium text-gray-600",children:[m,"%"]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Images Downloaded"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((q=(R=e==null?void 0:e.products)==null?void 0:R.with_images)==null?void 0:q.toLocaleString())||0}),a.jsx("div",{className:"mt-3",children:a.jsx("div",{className:"w-full bg-gray-100 rounded-full h-1.5",children:a.jsx("div",{className:"bg-amber-500 h-1.5 rounded-full transition-all",style:{width:`${m}%`}})})})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-cyan-50 rounded-lg",children:a.jsx(na,{className:"w-5 h-5 text-cyan-600"})}),a.jsx(xr,{className:"w-4 h-4 text-gray-400"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Snapshots (24h)"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((P=(Y=e==null?void 0:e.clicks)==null?void 0:Y.clicks_24h)==null?void 0:P.toLocaleString())||0}),a.jsx("p",{className:"text-xs text-gray-500",children:"Product snapshots created"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-indigo-50 rounded-lg",children:a.jsx(Cr,{className:"w-5 h-5 text-indigo-600"})}),a.jsx(na,{className:"w-4 h-4 text-gray-400"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Brands"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((T=e==null?void 0:e.brands)==null?void 0:T.total)||((O=e==null?void 0:e.products)==null?void 0:O.unique_brands)||0}),a.jsx("p",{className:"text-xs text-gray-500",children:"Unique brands tracked"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Product Growth"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Weekly product count trend"})]}),a.jsx(g0,{width:"100%",height:200,children:a.jsxs(QB,{data:x,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"productGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#3b82f6",stopOpacity:.1}),a.jsx("stop",{offset:"95%",stopColor:"#3b82f6",stopOpacity:0})]})}),a.jsx(wp,{strokeDasharray:"3 3",stroke:"#f1f5f9"}),a.jsx(Np,{dataKey:"date",tick:{fill:"#94a3b8",fontSize:12},axisLine:{stroke:"#e2e8f0"}}),a.jsx(Pp,{tick:{fill:"#94a3b8",fontSize:12},axisLine:{stroke:"#e2e8f0"}}),a.jsx(Uy,{contentStyle:{backgroundColor:"#ffffff",border:"1px solid #e2e8f0",borderRadius:"8px",fontSize:"12px"}}),a.jsx(yk,{type:"monotone",dataKey:"products",stroke:"#3b82f6",strokeWidth:2,fill:"url(#productGradient)"})]})})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Scrape Activity"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Scrapes over the last 24 hours"})]}),a.jsx(g0,{width:"100%",height:200,children:a.jsxs(XB,{data:g,children:[a.jsx(wp,{strokeDasharray:"3 3",stroke:"#f1f5f9"}),a.jsx(Np,{dataKey:"time",tick:{fill:"#94a3b8",fontSize:12},axisLine:{stroke:"#e2e8f0"}}),a.jsx(Pp,{tick:{fill:"#94a3b8",fontSize:12},axisLine:{stroke:"#e2e8f0"}}),a.jsx(Uy,{contentStyle:{backgroundColor:"#ffffff",border:"1px solid #e2e8f0",borderRadius:"8px",fontSize:"12px"}}),a.jsx(uk,{type:"monotone",dataKey:"scrapes",stroke:"#10b981",strokeWidth:2,dot:{fill:"#10b981",r:4}})]})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200",children:[a.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Recent Scrapes"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Latest data collection activities"})]}),a.jsx("div",{className:"divide-y divide-gray-100",children:((k=r==null?void 0:r.recent_scrapes)==null?void 0:k.length)>0?r.recent_scrapes.slice(0,5).map((F,H)=>a.jsx("div",{className:"px-6 py-4 hover:bg-gray-50 transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:F.name}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:new Date(F.last_scraped_at).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})]}),a.jsx("div",{className:"ml-4 flex-shrink-0",children:a.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-50 text-blue-700",children:[F.product_count," products"]})})]})},H)):a.jsxs("div",{className:"px-6 py-12 text-center",children:[a.jsx(na,{className:"w-8 h-8 text-gray-300 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No recent scrapes"})]})})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200",children:[a.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Recent Products"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Newly added to inventory"})]}),a.jsx("div",{className:"divide-y divide-gray-100",children:((L=r==null?void 0:r.recent_products)==null?void 0:L.length)>0?r.recent_products.slice(0,5).map((F,H)=>a.jsx("div",{className:"px-6 py-4 hover:bg-gray-50 transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:F.name}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:F.store_name})]}),F.price&&a.jsx("div",{className:"ml-4 flex-shrink-0",children:a.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-emerald-50 text-emerald-700",children:["$",F.price]})})]})},H)):a.jsxs("div",{className:"px-6 py-12 text-center",children:[a.jsx(xt,{className:"w-8 h-8 text-gray-300 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No recent products"})]})})]})]})]})]})}function t7(){const[e,t]=lA(),r=dt(),[n,i]=h.useState([]),[s,o]=h.useState([]),[l,c]=h.useState([]),[d,u]=h.useState(!1),[f,p]=h.useState(""),[m,x]=h.useState(""),[g,v]=h.useState(""),[b,j]=h.useState(""),[y,w]=h.useState(0),[S,N]=h.useState(0),_=50;h.useEffect(()=>{const k=e.get("store");k&&x(k),D()},[]),h.useEffect(()=>{m&&(M(),C())},[f,m,g,b,S]);const C=async()=>{try{const k=await z.getCategoryTree(parseInt(m));c(k.categories||[])}catch(k){console.error("Failed to load categories:",k)}},D=async()=>{try{const k=await z.getStores();o(k.stores)}catch(k){console.error("Failed to load stores:",k)}},M=async()=>{u(!0);try{const k={limit:_,offset:S,store_id:m};f&&(k.search=f),g&&(k.category_id=g),b&&(k.in_stock=b);const L=await z.getProducts(k);i(L.products),w(L.total)}catch(k){console.error("Failed to load products:",k)}finally{u(!1)}},I=k=>{p(k),N(0)},A=k=>{x(k),v(""),N(0),p(""),t(k?{store:k}:{})},R=k=>{v(k),N(0)},q=(k,L=0)=>k.map(F=>a.jsxs("div",{style:{marginLeft:`${L*20}px`},children:[a.jsxs("button",{onClick:()=>R(F.id.toString()),style:{width:"100%",textAlign:"left",padding:"10px 15px",background:g===F.id.toString()?"#667eea":"transparent",color:g===F.id.toString()?"white":"#333",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:L===0?"600":"400",fontSize:L===0?"15px":"14px",marginBottom:"4px",transition:"all 0.2s"},onMouseEnter:H=>{g!==F.id.toString()&&(H.currentTarget.style.background="#f5f5f5")},onMouseLeave:H=>{g!==F.id.toString()&&(H.currentTarget.style.background="transparent")},children:[F.name," (",F.product_count||0,")"]}),F.children&&F.children.length>0&&q(F.children,L+1)]},F.id)),Y=l.find(k=>k.id.toString()===g),P=()=>{S+_{S>0&&N(Math.max(0,S-_))},O=s.find(k=>k.id.toString()===m);return a.jsx(X,{children:a.jsxs("div",{children:[a.jsx("h1",{style:{fontSize:"32px",marginBottom:"30px"},children:"Products"}),a.jsxs("div",{style:{background:"white",padding:"30px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"30px"},children:[a.jsx("label",{style:{display:"block",marginBottom:"15px",fontSize:"18px",fontWeight:"600",color:"#333"},children:"Select a Store to View Products:"}),a.jsxs("select",{value:m,onChange:k=>A(k.target.value),style:{width:"100%",padding:"15px",border:"2px solid #667eea",borderRadius:"8px",fontSize:"16px",fontWeight:"500",cursor:"pointer",background:"white"},children:[a.jsx("option",{value:"",children:"-- Select a Store --"}),s.map(k=>a.jsx("option",{value:k.id,children:k.name},k.id))]})]}),m?a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{background:"#667eea",color:"white",padding:"20px",borderRadius:"8px",marginBottom:"20px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{children:[a.jsx("h2",{style:{margin:0,fontSize:"24px"},children:O==null?void 0:O.name}),Y&&a.jsx("div",{style:{marginTop:"8px",fontSize:"14px",opacity:.9},children:Y.name})]}),a.jsxs("div",{style:{fontSize:"18px",fontWeight:"bold"},children:[y," Products"]})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"280px 1fr",gap:"20px"},children:[a.jsx("div",{children:a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",position:"sticky",top:"20px"},children:[a.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",fontWeight:"600",color:"#333"},children:"Categories"}),a.jsxs("button",{onClick:()=>R(""),style:{width:"100%",textAlign:"left",padding:"10px 15px",background:g===""?"#667eea":"transparent",color:g===""?"white":"#333",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600",fontSize:"15px",marginBottom:"12px"},children:["All Products (",y,")"]}),a.jsx("div",{style:{borderTop:"1px solid #eee",marginBottom:"12px"}}),q(l)]})}),a.jsxs("div",{children:[a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"20px",display:"flex",gap:"15px",flexWrap:"wrap"},children:[a.jsx("input",{type:"text",placeholder:"Search products...",value:f,onChange:k=>I(k.target.value),style:{flex:"1",minWidth:"200px",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"}}),a.jsxs("select",{value:b,onChange:k=>{j(k.target.value),N(0)},style:{padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"",children:"All Products"}),a.jsx("option",{value:"true",children:"In Stock"}),a.jsx("option",{value:"false",children:"Out of Stock"})]})]}),d?a.jsx("div",{style:{textAlign:"center",padding:"40px"},children:"Loading..."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"20px",marginBottom:"20px"},children:n.map(k=>a.jsx(r7,{product:k,onViewDetails:()=>r(`/products/${k.id}`)},k.id))}),n.length===0&&a.jsx("div",{style:{background:"white",padding:"40px",borderRadius:"8px",textAlign:"center",color:"#999"},children:"No products found"}),y>_&&a.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"15px",marginTop:"30px"},children:[a.jsx("button",{onClick:T,disabled:S===0,style:{padding:"10px 20px",background:S===0?"#ddd":"#667eea",color:S===0?"#999":"white",border:"none",borderRadius:"6px",cursor:S===0?"not-allowed":"pointer"},children:"Previous"}),a.jsxs("span",{children:["Showing ",S+1," - ",Math.min(S+_,y)," of ",y]}),a.jsx("button",{onClick:P,disabled:S+_>=y,style:{padding:"10px 20px",background:S+_>=y?"#ddd":"#667eea",color:S+_>=y?"#999":"white",border:"none",borderRadius:"6px",cursor:S+_>=y?"not-allowed":"pointer"},children:"Next"})]})]})]})]})]}):a.jsxs("div",{style:{background:"white",padding:"60px 40px",borderRadius:"8px",textAlign:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"48px",marginBottom:"20px"},children:"🏪"}),a.jsx("div",{style:{fontSize:"18px",color:"#666"},children:"Please select a store from the dropdown above to view products"})]})]})})}function r7({product:e,onViewDetails:t}){const r=n=>{if(!n)return"Never";const i=new Date(n),o=new Date().getTime()-i.getTime(),l=Math.floor(o/(1e3*60*60*24));return l===0?"Today":l===1?"Yesterday":l<7?`${l} days ago`:i.toLocaleDateString()};return a.jsxs("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden",transition:"transform 0.2s"},onMouseEnter:n=>n.currentTarget.style.transform="translateY(-4px)",onMouseLeave:n=>n.currentTarget.style.transform="translateY(0)",children:[e.image_url_full?a.jsx("img",{src:e.image_url_full,alt:e.name,style:{width:"100%",height:"200px",objectFit:"cover",background:"#f5f5f5"},onError:n=>{n.currentTarget.src='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23ddd" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" text-anchor="middle" dy=".3em" fill="%23999"%3ENo Image%3C/text%3E%3C/svg%3E'}}):a.jsx("div",{style:{width:"100%",height:"200px",background:"#f5f5f5",display:"flex",alignItems:"center",justifyContent:"center",color:"#999"},children:"No Image"}),a.jsxs("div",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"500",marginBottom:"8px",fontSize:"14px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[a.jsx("div",{style:{fontWeight:"bold",color:"#667eea"},children:e.price?`$${e.price}`:"N/A"}),a.jsx("div",{style:{padding:"4px 8px",borderRadius:"4px",fontSize:"12px",background:e.in_stock?"#d4edda":"#f8d7da",color:e.in_stock?"#155724":"#721c24"},children:e.in_stock?"In Stock":"Out of Stock"})]}),a.jsxs("div",{style:{fontSize:"11px",color:"#888",marginBottom:"12px",borderTop:"1px solid #eee",paddingTop:"8px"},children:["Last Updated: ",r(e.last_seen_at)]}),a.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.dutchie_url&&a.jsx("a",{href:e.dutchie_url,target:"_blank",rel:"noopener noreferrer",style:{flex:1,padding:"8px 12px",background:"#f0f0f0",color:"#333",textDecoration:"none",borderRadius:"6px",fontSize:"12px",fontWeight:"500",textAlign:"center",border:"1px solid #ddd"},onClick:n=>n.stopPropagation(),children:"Dutchie"}),a.jsx("button",{onClick:n=>{n.stopPropagation(),t()},style:{flex:1,padding:"8px 12px",background:"#667eea",color:"white",border:"none",borderRadius:"6px",fontSize:"12px",fontWeight:"500",cursor:"pointer"},children:"Details"})]})]})]})}function n7(){const{id:e}=Pa(),t=dt(),[r,n]=h.useState(null),[i,s]=h.useState(!0),[o,l]=h.useState(null);h.useEffect(()=>{c()},[e]);const c=async()=>{if(e){s(!0),l(null);try{const p=await z.getProduct(parseInt(e));n(p.product)}catch(p){l(p.message||"Failed to load product")}finally{s(!1)}}};if(i)return a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin"})})});if(o||!r)return a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx(xt,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Product not found"}),a.jsx("p",{className:"text-gray-500 mb-4",children:o}),a.jsx("button",{onClick:()=>t(-1),className:"text-blue-600 hover:text-blue-700",children:"← Go back"})]})});const d=r.metadata||{},f=r.image_url_full?r.image_url_full:r.medium_path?`http://localhost:9020/dutchie/${r.medium_path}`:r.thumbnail_path?`http://localhost:9020/dutchie/${r.thumbnail_path}`:null;return a.jsx(X,{children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("button",{onClick:()=>t(-1),className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 mb-6",children:[a.jsx(Ah,{className:"w-4 h-4"}),"Back"]}),a.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-6",children:[a.jsx("div",{className:"aspect-square bg-gray-50 rounded-lg overflow-hidden",children:f?a.jsx("img",{src:f,alt:r.name,className:"w-full h-full object-contain"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400",children:a.jsx(xt,{className:"w-24 h-24"})})}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.in_stock?a.jsx("span",{className:"px-2 py-1 bg-green-100 text-green-700 text-xs font-medium rounded",children:"In Stock"}):a.jsx("span",{className:"px-2 py-1 bg-red-100 text-red-700 text-xs font-medium rounded",children:"Out of Stock"}),r.strain_type&&a.jsx("span",{className:"px-2 py-1 bg-purple-100 text-purple-700 text-xs font-medium rounded capitalize",children:r.strain_type})]}),a.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:r.name}),r.brand&&a.jsx("p",{className:"text-lg text-gray-600 font-medium",children:r.brand}),a.jsxs("div",{className:"flex items-center gap-4 mt-2 text-sm text-gray-500",children:[r.store_name&&a.jsx("span",{children:r.store_name}),r.category_name&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"•"}),a.jsx("span",{children:r.category_name})]})]})]}),r.price!==null&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsxs("div",{className:"text-3xl font-bold text-blue-600",children:["$",parseFloat(r.price).toFixed(2)]}),r.weight&&a.jsx("div",{className:"text-sm text-gray-500 mt-1",children:r.weight})]}),(r.thc_percentage||r.cbd_percentage)&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Cannabinoid Content"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.thc_percentage!==null&&a.jsxs("div",{className:"bg-green-50 rounded-lg p-3",children:[a.jsx("div",{className:"text-xs text-gray-500 uppercase",children:"THC"}),a.jsxs("div",{className:"text-xl font-bold text-green-600",children:[r.thc_percentage,"%"]})]}),r.cbd_percentage!==null&&a.jsxs("div",{className:"bg-blue-50 rounded-lg p-3",children:[a.jsx("div",{className:"text-xs text-gray-500 uppercase",children:"CBD"}),a.jsxs("div",{className:"text-xl font-bold text-blue-600",children:[r.cbd_percentage,"%"]})]})]})]}),r.description&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Description"}),a.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:r.description})]}),d.terpenes&&d.terpenes.length>0&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Terpenes"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:d.terpenes.map(p=>a.jsx("span",{className:"px-2 py-1 bg-amber-100 text-amber-700 text-xs font-medium rounded",children:p},p))})]}),d.effects&&d.effects.length>0&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Effects"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:d.effects.map(p=>a.jsx("span",{className:"px-2 py-1 bg-indigo-100 text-indigo-700 text-xs font-medium rounded",children:p},p))})]}),d.flavors&&d.flavors.length>0&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Flavors"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:d.flavors.map(p=>a.jsx("span",{className:"px-2 py-1 bg-pink-100 text-pink-700 text-xs font-medium rounded",children:p},p))})]}),d.lineage&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Lineage"}),a.jsx("p",{className:"text-gray-600 text-sm",children:d.lineage})]}),r.dutchie_url&&a.jsx("div",{className:"border-t border-gray-100 pt-4",children:a.jsxs("a",{href:r.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 hover:text-blue-700",children:["View on Dutchie",a.jsx(Jr,{className:"w-4 h-4"})]})}),r.last_seen_at&&a.jsxs("div",{className:"text-xs text-gray-400 pt-4 border-t border-gray-100",children:["Last updated: ",new Date(r.last_seen_at).toLocaleString()]})]})]})})]})})}function i7(){const[e,t]=h.useState([]),[r,n]=h.useState(!0),[i,s]=h.useState(new Set),[o,l]=h.useState(new Set),c=dt();h.useEffect(()=>{d()},[]);const d=async()=>{n(!0);try{const b=await z.getStores();t(b.stores)}catch(b){console.error("Failed to load stores:",b)}finally{n(!1)}},u=b=>{const j=b.match(/(?:^|-)(al|ak|az|ar|ca|co|ct|de|fl|ga|hi|id|il|in|ia|ks|ky|la|me|md|ma|mi|mn|ms|mo|mt|ne|nv|nh|nj|nm|ny|nc|nd|oh|ok|or|pa|ri|sc|sd|tn|tx|ut|vt|va|wa|wv|wi|wy)-/i),y={peoria:"AZ"};let w=j?j[1].toUpperCase():null;if(!w){for(const[S,N]of Object.entries(y))if(b.toLowerCase().includes(S)){w=N;break}}return w||"UNKNOWN"},f=b=>{const j=u(b.slug).toLowerCase(),y=b.name.match(/^([^-]+)/),w=y?y[1].trim().toLowerCase().replace(/\s+/g,"-"):"other";return`/stores/${j}/${w}/${b.slug}`},p=e.reduce((b,j)=>{const y=j.name.match(/^([^-]+)/),w=y?y[1].trim():"Other",S=u(j.slug),_={AZ:"Arizona",FL:"Florida",PA:"Pennsylvania",NJ:"New Jersey",MA:"Massachusetts",IL:"Illinois",NY:"New York",MD:"Maryland",MI:"Michigan",OH:"Ohio",CT:"Connecticut",ME:"Maine",MO:"Missouri",NV:"Nevada",OR:"Oregon",UT:"Utah"}[S]||S;return b[w]||(b[w]={}),b[w][_]||(b[w][_]=[]),b[w][_].push(j),b},{}),m=async(b,j,y)=>{y.stopPropagation();try{await z.updateStore(b,{scrape_enabled:!j}),t(e.map(w=>w.id===b?{...w,scrape_enabled:!j}:w))}catch(w){console.error("Failed to update scraping status:",w)}},x=b=>b?new Date(b).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Never",g=b=>{const j=new Set(i);j.has(b)?j.delete(b):j.add(b),s(j)},v=(b,j)=>{const y=`${b}-${j}`,w=new Set(o);w.has(y)?w.delete(y):w.add(y),l(w)};return r?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin"})})}):a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(Ll,{className:"w-6 h-6 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"Stores"}),a.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[e.length," total stores"]})]})]})}),a.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Store Name"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"View Online"}),a.jsx("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Categories"}),a.jsx("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Products"}),a.jsx("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Scraping"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Last Scraped"})]})}),a.jsx("tbody",{children:Object.entries(p).map(([b,j])=>{const y=Object.values(j).flat().length,w=y===1,S=i.has(b);if(w){const C=Object.values(j).flat()[0];return a.jsxs("tr",{className:"border-b border-gray-100 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>c(f(C)),title:"Click to view store",children:[a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[C.logo_url?a.jsx("img",{src:C.logo_url,alt:`${C.name} logo`,className:"w-8 h-8 object-contain flex-shrink-0",onError:D=>{D.target.style.display="none"}}):null,a.jsxs("div",{children:[a.jsx("div",{className:"font-semibold text-gray-900",children:C.name}),a.jsx("div",{className:"text-xs text-gray-500",children:C.slug})]})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-blue-50 text-blue-700 rounded",children:"Dutchie"})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("a",{href:C.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700",onClick:D=>D.stopPropagation(),children:[a.jsx("span",{children:"View Online"}),a.jsx(Jr,{className:"w-3 h-3"})]})}),a.jsx("td",{className:"px-6 py-4 text-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx(Cr,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:C.category_count||0})]})}),a.jsx("td",{className:"px-6 py-4 text-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx(xt,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:C.product_count||0})]})}),a.jsx("td",{className:"px-6 py-4 text-center",onClick:D=>D.stopPropagation(),children:a.jsx("button",{onClick:D=>m(C.id,C.scrape_enabled,D),className:"inline-flex items-center gap-1 text-sm font-medium transition-colors",children:C.scrape_enabled?a.jsxs(a.Fragment,{children:[a.jsx(zx,{className:"w-5 h-5 text-green-600"}),a.jsx("span",{className:"text-green-600",children:"On"})]}):a.jsxs(a.Fragment,{children:[a.jsx(Lx,{className:"w-5 h-5 text-gray-400"}),a.jsx("span",{className:"text-gray-500",children:"Off"})]})})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(xr,{className:"w-4 h-4 text-gray-400"}),x(C.last_scraped_at)]})})]},C.id)}const N=Object.values(j).flat()[0],_=N==null?void 0:N.logo_url;return a.jsxs(hs.Fragment,{children:[a.jsx("tr",{className:"bg-gray-100 border-b border-gray-200 cursor-pointer hover:bg-gray-150 transition-colors",onClick:()=>g(b),children:a.jsx("td",{colSpan:7,className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Df,{className:`w-5 h-5 text-gray-600 transition-transform ${S?"rotate-90":""}`}),_&&a.jsx("img",{src:_,alt:`${b} logo`,className:"w-8 h-8 object-contain flex-shrink-0",onError:C=>{C.target.style.display="none"}}),a.jsx("span",{className:"text-base font-semibold text-gray-900",children:b}),a.jsxs("span",{className:"text-sm text-gray-500",children:["(",y," stores)"]})]})})}),S&&Object.entries(j).map(([C,D])=>{const M=`${b}-${C}`,I=o.has(M);return a.jsxs(hs.Fragment,{children:[a.jsx("tr",{className:"bg-gray-50 border-b border-gray-100 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>v(b,C),children:a.jsx("td",{colSpan:7,className:"px-6 py-3 pl-12",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Df,{className:`w-4 h-4 text-gray-500 transition-transform ${I?"rotate-90":""}`}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:C}),a.jsxs("span",{className:"text-xs text-gray-500",children:["(",D.length," locations)"]})]})})}),I&&D.map(A=>a.jsxs("tr",{className:"border-b border-gray-100 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>c(f(A)),title:"Click to view store",children:[a.jsx("td",{className:"px-6 py-4 pl-16",children:a.jsxs("div",{children:[a.jsx("div",{className:"font-semibold text-gray-900",children:A.name}),a.jsx("div",{className:"text-xs text-gray-500",children:A.slug})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-blue-50 text-blue-700 rounded",children:"Dutchie"})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("a",{href:A.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700",onClick:R=>R.stopPropagation(),children:[a.jsx("span",{children:"View Online"}),a.jsx(Jr,{className:"w-3 h-3"})]})}),a.jsx("td",{className:"px-6 py-4 text-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx(Cr,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:A.category_count||0})]})}),a.jsx("td",{className:"px-6 py-4 text-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx(xt,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:A.product_count||0})]})}),a.jsx("td",{className:"px-6 py-4 text-center",onClick:R=>R.stopPropagation(),children:a.jsx("button",{onClick:R=>m(A.id,A.scrape_enabled,R),className:"inline-flex items-center gap-1 text-sm font-medium transition-colors",children:A.scrape_enabled?a.jsxs(a.Fragment,{children:[a.jsx(zx,{className:"w-5 h-5 text-green-600"}),a.jsx("span",{className:"text-green-600",children:"On"})]}):a.jsxs(a.Fragment,{children:[a.jsx(Lx,{className:"w-5 h-5 text-gray-400"}),a.jsx("span",{className:"text-gray-500",children:"Off"})]})})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(xr,{className:"w-4 h-4 text-gray-400"}),x(A.last_scraped_at)]})})]},A.id))]},`state-${M}`)})]},`chain-${b}`)})})]})})}),e.length===0&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[a.jsx(Ll,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No stores found"}),a.jsx("p",{className:"text-gray-500",children:"Start by adding stores to your database"})]})]})})}function a7(){const e=dt(),[t,r]=h.useState([]),[n,i]=h.useState(!0),[s,o]=h.useState(""),[l,c]=h.useState(""),[d,u]=h.useState(null),[f,p]=h.useState({});h.useEffect(()=>{m()},[]);const m=async()=>{i(!0);try{const y=await z.getDispensaries();r(y.dispensaries)}catch(y){console.error("Failed to load dispensaries:",y)}finally{i(!1)}},x=y=>{u(y),p({dba_name:y.dba_name||"",website:y.website||"",phone:y.phone||"",google_rating:y.google_rating||"",google_review_count:y.google_review_count||""})},g=async()=>{if(d)try{await z.updateDispensary(d.id,f),await m(),u(null),p({})}catch(y){console.error("Failed to update dispensary:",y),alert("Failed to update dispensary")}},v=()=>{u(null),p({})},b=t.filter(y=>{const w=s.toLowerCase(),S=!s||y.name.toLowerCase().includes(w)||y.company_name&&y.company_name.toLowerCase().includes(w)||y.dba_name&&y.dba_name.toLowerCase().includes(w),N=!l||y.city===l;return S&&N}),j=Array.from(new Set(t.map(y=>y.city).filter(Boolean))).sort();return a.jsxs(X,{children:[a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Dispensaries"}),a.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:["AZDHS official dispensary directory (",t.length," total)"]})]}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Search"}),a.jsxs("div",{className:"relative",children:[a.jsx(E6,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),placeholder:"Search by name or company...",className:"w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Filter by City"}),a.jsxs("select",{value:l,onChange:y=>c(y.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"",children:"All Cities"}),j.map(y=>a.jsx("option",{value:y,children:y},y))]})]})]})}),n?a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading dispensaries..."})]}):a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Name"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Company"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Address"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"City"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Phone"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Email"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Website"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-200",children:b.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-sm text-gray-500",children:"No dispensaries found"})}):b.map(y=>a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(zn,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-sm font-medium text-gray-900",children:y.dba_name||y.name}),y.dba_name&&y.google_rating&&a.jsxs("span",{className:"text-xs text-gray-500",children:["⭐ ",y.google_rating," (",y.google_review_count," reviews)"]})]})]})}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:"text-sm text-gray-600",children:y.company_name||"-"})}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-start gap-1",children:[a.jsx(yi,{className:"w-3 h-3 text-gray-400 flex-shrink-0 mt-0.5"}),a.jsx("span",{className:"text-sm text-gray-600",children:y.address||"-"})]})}),a.jsxs("td",{className:"px-4 py-3",children:[a.jsx("span",{className:"text-sm text-gray-600",children:y.city||"-"}),y.zip&&a.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["(",y.zip,")"]})]}),a.jsx("td",{className:"px-4 py-3",children:y.phone?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Eh,{className:"w-3 h-3 text-gray-400"}),a.jsx("span",{className:"text-sm text-gray-600",children:y.phone.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")})]}):a.jsx("span",{className:"text-sm text-gray-400",children:"-"})}),a.jsx("td",{className:"px-4 py-3",children:y.email?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ij,{className:"w-3 h-3 text-gray-400"}),a.jsx("a",{href:`mailto:${y.email}`,className:"text-sm text-blue-600 hover:text-blue-800",children:y.email})]}):a.jsx("span",{className:"text-sm text-gray-400",children:"-"})}),a.jsx("td",{className:"px-4 py-3",children:y.website?a.jsxs("a",{href:y.website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800",children:[a.jsx(Jr,{className:"w-3 h-3"}),a.jsx("span",{children:"Visit Site"})]}):a.jsx("span",{className:"text-sm text-gray-400",children:"-"})}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>x(y),className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 rounded-lg transition-colors",title:"Edit",children:a.jsx(aj,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>{const w=y.city.toLowerCase().replace(/\s+/g,"-");e(`/dispensaries/${y.state}/${w}/${y.slug}`)},className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium text-blue-600 hover:text-blue-800 hover:bg-blue-50 rounded-lg transition-colors",title:"View",children:a.jsx(o6,{className:"w-4 h-4"})})]})})]},y.id))})]})}),a.jsx("div",{className:"bg-gray-50 px-4 py-3 border-t border-gray-200",children:a.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",b.length," of ",t.length," dispensaries"]})})]})]}),d&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[a.jsxs("h2",{className:"text-xl font-bold text-gray-900",children:["Edit Dispensary: ",d.name]}),a.jsx("button",{onClick:v,className:"text-gray-400 hover:text-gray-600",children:a.jsx(Dh,{className:"w-6 h-6"})})]}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"DBA Name (Display Name)"}),a.jsx("input",{type:"text",value:f.dba_name,onChange:y=>p({...f,dba_name:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"e.g., Green Med Wellness"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Website"}),a.jsx("input",{type:"url",value:f.website,onChange:y=>p({...f,website:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"https://example.com"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone Number"}),a.jsx("input",{type:"tel",value:f.phone,onChange:y=>p({...f,phone:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"5551234567"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Google Rating"}),a.jsx("input",{type:"number",step:"0.1",min:"0",max:"5",value:f.google_rating,onChange:y=>p({...f,google_rating:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"4.5"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Review Count"}),a.jsx("input",{type:"number",min:"0",value:f.google_review_count,onChange:y=>p({...f,google_review_count:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"123"})]})]}),a.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg space-y-2",children:[a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"font-medium text-gray-700",children:"AZDHS Name:"})," ",a.jsx("span",{className:"text-gray-600",children:d.name})]}),a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"font-medium text-gray-700",children:"Address:"})," ",a.jsxs("span",{className:"text-gray-600",children:[d.address,", ",d.city,", ",d.state," ",d.zip]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-gray-200",children:[a.jsx("button",{onClick:v,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),a.jsxs("button",{onClick:g,className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:[a.jsx(A6,{className:"w-4 h-4"}),"Save Changes"]})]})]})})]})}function s7(){const{state:e,city:t,slug:r}=Pa(),n=dt(),[i,s]=h.useState(null),[o,l]=h.useState([]),[c,d]=h.useState([]),[u,f]=h.useState([]),[p,m]=h.useState(!0),[x,g]=h.useState("products"),[v,b]=h.useState(!1),[j,y]=h.useState(!1),[w,S]=h.useState(""),[N,_]=h.useState(1),[C]=h.useState(25),D=T=>{if(!T)return"Never";const O=new Date(T),L=new Date().getTime()-O.getTime(),F=Math.floor(L/(1e3*60)),H=Math.floor(L/(1e3*60*60)),ee=Math.floor(L/(1e3*60*60*24));return F<1?"Just now":F<60?`${F}m ago`:H<24?`${H}h ago`:ee===1?"Yesterday":ee<7?`${ee} days ago`:O.toLocaleDateString()};h.useEffect(()=>{M()},[r]);const M=async()=>{m(!0);try{const[T,O,k,L]=await Promise.all([z.getDispensary(r),z.getDispensaryProducts(r).catch(()=>({products:[]})),z.getDispensaryBrands(r).catch(()=>({brands:[]})),z.getDispensarySpecials(r).catch(()=>({specials:[]}))]);s(T),l(O.products),d(k.brands),f(L.specials)}catch(T){console.error("Failed to load dispensary:",T)}finally{m(!1)}},I=async T=>{b(!1),y(!0);try{const O=await fetch(`/api/dispensaries/${r}/scrape`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")}`},body:JSON.stringify({type:T})});if(!O.ok)throw new Error("Failed to trigger scraping");const k=await O.json();alert(`${T.charAt(0).toUpperCase()+T.slice(1)} update started! ${k.message||""}`)}catch(O){console.error("Failed to trigger scraping:",O),alert("Failed to start update. Please try again.")}finally{y(!1)}},A=o.filter(T=>{var k,L,F,H,ee;if(!w)return!0;const O=w.toLowerCase();return((k=T.name)==null?void 0:k.toLowerCase().includes(O))||((L=T.brand)==null?void 0:L.toLowerCase().includes(O))||((F=T.variant)==null?void 0:F.toLowerCase().includes(O))||((H=T.description)==null?void 0:H.toLowerCase().includes(O))||((ee=T.strain_type)==null?void 0:ee.toLowerCase().includes(O))}),R=Math.ceil(A.length/C),q=(N-1)*C,Y=q+C,P=A.slice(q,Y);return h.useEffect(()=>{_(1)},[w]),p?a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading dispensary..."})]})}):i?a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("button",{onClick:()=>n("/dispensaries"),className:"flex items-center gap-2 text-sm text-gray-600 hover:text-gray-900",children:[a.jsx(Ah,{className:"w-4 h-4"}),"Back to Dispensaries"]}),a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>b(!v),disabled:j,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx(Xt,{className:`w-4 h-4 ${j?"animate-spin":""}`}),j?"Updating...":"Update",!j&&a.jsx(nj,{className:"w-4 h-4"})]}),v&&!j&&a.jsxs("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 z-10",children:[a.jsx("button",{onClick:()=>I("products"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-t-lg",children:"Products"}),a.jsx("button",{onClick:()=>I("brands"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Brands"}),a.jsx("button",{onClick:()=>I("specials"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Specials"}),a.jsx("button",{onClick:()=>I("all"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-b-lg border-t border-gray-200",children:"All"})]})]})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"p-3 bg-blue-50 rounded-lg",children:a.jsx(zn,{className:"w-8 h-8 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:i.dba_name||i.name}),i.company_name&&a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:i.company_name})]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 bg-gray-50 px-4 py-2 rounded-lg",children:[a.jsx(Oh,{className:"w-4 h-4"}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Last Crawl Date:"}),a.jsx("span",{className:"ml-2",children:i.last_menu_scrape?new Date(i.last_menu_scrape).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Never"})]})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-4",children:[i.address&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(yi,{className:"w-4 h-4"}),a.jsxs("span",{children:[i.address,", ",i.city,", ",i.state," ",i.zip]})]}),i.phone&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(Eh,{className:"w-4 h-4"}),a.jsx("span",{children:i.phone.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(Jr,{className:"w-4 h-4"}),i.website?a.jsx("a",{href:i.website,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800",children:"Website"}):a.jsx("span",{children:"Website N/A"})]}),i.email&&a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(ij,{className:"w-4 h-4 text-gray-400"}),a.jsx("a",{href:`mailto:${i.email}`,className:"text-blue-600 hover:text-blue-800",children:i.email})]}),i.azdhs_url&&a.jsxs("a",{href:i.azdhs_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800",children:[a.jsx(Jr,{className:"w-4 h-4"}),a.jsx("span",{children:"AZDHS Profile"})]}),a.jsxs(Y1,{to:"/schedule",className:"flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800",children:[a.jsx(xr,{className:"w-4 h-4"}),a.jsx("span",{children:"View Schedule"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[a.jsx("button",{onClick:()=>{g("products"),S("")},className:"bg-white rounded-lg border border-gray-200 p-6 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(xt,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Total Products"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:o.length})]})]})}),a.jsx("button",{onClick:()=>g("brands"),className:"bg-white rounded-lg border border-gray-200 p-6 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(Cr,{className:"w-5 h-5 text-purple-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Brands"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:c.length})]})]})}),a.jsx("button",{onClick:()=>g("specials"),className:"bg-white rounded-lg border border-gray-200 p-6 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(Qr,{className:"w-5 h-5 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Active Specials"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:u.length})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-orange-50 rounded-lg",children:a.jsx(i6,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Avg Price"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:o.length>0?`$${(o.reduce((T,O)=>T+(O.sale_price||O.regular_price||0),0)/o.length).toFixed(2)}`:"-"})]})]})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[a.jsx("div",{className:"border-b border-gray-200",children:a.jsxs("div",{className:"flex gap-4 px-6",children:[a.jsxs("button",{onClick:()=>g("products"),className:`py-4 px-2 text-sm font-medium border-b-2 ${x==="products"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Products (",o.length,")"]}),a.jsxs("button",{onClick:()=>g("brands"),className:`py-4 px-2 text-sm font-medium border-b-2 ${x==="brands"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Brands (",c.length,")"]}),a.jsxs("button",{onClick:()=>g("specials"),className:`py-4 px-2 text-sm font-medium border-b-2 ${x==="specials"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Specials (",u.length,")"]})]})}),a.jsxs("div",{className:"p-6",children:[x==="products"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No products available"}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("input",{type:"text",placeholder:"Search products by name, brand, variant, description, or strain type...",value:w,onChange:T=>S(T.target.value),className:"input input-bordered input-sm flex-1"}),w&&a.jsx("button",{onClick:()=>S(""),className:"btn btn-sm btn-ghost",children:"Clear"}),a.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",q+1,"-",Math.min(Y,A.length)," of ",A.length," products"]})]}),a.jsx("div",{className:"overflow-x-auto -mx-6 px-6",children:a.jsxs("table",{className:"table table-xs table-zebra table-pin-rows w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Image"}),a.jsx("th",{children:"Product Name"}),a.jsx("th",{children:"Brand"}),a.jsx("th",{children:"Variant"}),a.jsx("th",{children:"Description"}),a.jsx("th",{className:"text-right",children:"Price"}),a.jsx("th",{className:"text-center",children:"THC %"}),a.jsx("th",{className:"text-center",children:"CBD %"}),a.jsx("th",{className:"text-center",children:"Strain Type"}),a.jsx("th",{className:"text-center",children:"In Stock"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{children:"Actions"})]})}),a.jsx("tbody",{children:P.map(T=>a.jsxs("tr",{children:[a.jsx("td",{className:"whitespace-nowrap",children:T.image_url?a.jsx("img",{src:T.image_url,alt:T.name,className:"w-12 h-12 object-cover rounded",onError:O=>O.currentTarget.style.display="none"}):"-"}),a.jsx("td",{className:"font-medium max-w-[150px]",children:a.jsx("div",{className:"line-clamp-2",title:T.name,children:T.name})}),a.jsx("td",{className:"max-w-[120px]",children:a.jsx("div",{className:"line-clamp-2",title:T.brand||"-",children:T.brand||"-"})}),a.jsx("td",{className:"max-w-[100px]",children:a.jsx("div",{className:"line-clamp-2",title:T.variant||"-",children:T.variant||"-"})}),a.jsx("td",{className:"w-[120px]",children:a.jsx("span",{title:T.description,children:T.description?T.description.length>15?T.description.substring(0,15)+"...":T.description:"-"})}),a.jsx("td",{className:"text-right font-semibold whitespace-nowrap",children:T.sale_price?a.jsxs("div",{className:"flex flex-col items-end",children:[a.jsxs("span",{className:"text-error",children:["$",T.sale_price]}),a.jsxs("span",{className:"text-gray-400 line-through text-xs",children:["$",T.regular_price]})]}):T.regular_price?`$${T.regular_price}`:"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:T.thc_percentage?a.jsxs("span",{className:"badge badge-success badge-sm",children:[T.thc_percentage,"%"]}):"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:T.cbd_percentage?a.jsxs("span",{className:"badge badge-info badge-sm",children:[T.cbd_percentage,"%"]}):"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:T.strain_type?a.jsx("span",{className:"badge badge-ghost badge-sm",children:T.strain_type}):"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:T.in_stock?a.jsx("span",{className:"badge badge-success badge-sm",children:"Yes"}):T.in_stock===!1?a.jsx("span",{className:"badge badge-error badge-sm",children:"No"}):"-"}),a.jsx("td",{className:"whitespace-nowrap text-xs text-gray-500",children:T.updated_at?D(T.updated_at):"-"}),a.jsx("td",{children:a.jsxs("div",{className:"flex gap-1",children:[T.dutchie_url&&a.jsx("a",{href:T.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"btn btn-xs btn-outline",children:"Dutchie"}),a.jsx("button",{onClick:()=>n(`/products/${T.id}`),className:"btn btn-xs btn-primary",children:"Details"})]})})]},T.id))})]})}),R>1&&a.jsxs("div",{className:"flex justify-center items-center gap-2 mt-4",children:[a.jsx("button",{onClick:()=>_(T=>Math.max(1,T-1)),disabled:N===1,className:"btn btn-sm btn-outline",children:"Previous"}),a.jsx("div",{className:"flex gap-1",children:Array.from({length:R},(T,O)=>O+1).map(T=>{const O=T===1||T===R||T>=N-1&&T<=N+1;return T===2&&N>3||T===R-1&&N_(T),className:`btn btn-sm ${N===T?"btn-primary":"btn-outline"}`,children:T},T):null})}),a.jsx("button",{onClick:()=>_(T=>Math.min(R,T+1)),disabled:N===R,className:"btn btn-sm btn-outline",children:"Next"})]})]})}),x==="brands"&&a.jsx("div",{className:"space-y-4",children:c.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No brands available"}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:c.map(T=>a.jsxs("button",{onClick:()=>{g("products"),S(T.brand)},className:"border border-gray-200 rounded-lg p-4 text-center hover:border-blue-300 hover:shadow-md transition-all cursor-pointer",children:[a.jsx("p",{className:"font-medium text-gray-900 line-clamp-2",children:T.brand}),a.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:[T.product_count," product",T.product_count!==1?"s":""]})]},T.brand))})}),x==="specials"&&a.jsx("div",{className:"space-y-4",children:u.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No active specials"}):a.jsx("div",{className:"space-y-3",children:u.map(T=>a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[a.jsx("h4",{className:"font-medium text-gray-900",children:T.name}),T.description&&a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:T.description}),a.jsxs("div",{className:"flex items-center gap-4 mt-2 text-sm text-gray-500",children:[a.jsxs("span",{children:[new Date(T.start_date).toLocaleDateString()," -"," ",T.end_date?new Date(T.end_date).toLocaleDateString():"Ongoing"]}),a.jsxs("span",{children:[T.product_count," products"]})]})]},T.id))})})]})]})]})}):a.jsx(X,{children:a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-600",children:"Dispensary not found"})})})}function o7(){var M,I;const{slug:e}=Pa(),t=dt(),[r,n]=h.useState(null),[i,s]=h.useState([]),[o,l]=h.useState([]),[c,d]=h.useState([]),[u,f]=h.useState(!0),[p,m]=h.useState(null),[x,g]=h.useState(""),[v,b]=h.useState("products"),[j,y]=h.useState("name");h.useEffect(()=>{w()},[e]),h.useEffect(()=>{r&&S()},[p,x,j,r]);const w=async()=>{f(!0);try{const R=(await z.getStores()).stores.find(T=>T.slug===e);if(!R)throw new Error("Store not found");const[q,Y,P]=await Promise.all([z.getStore(R.id),z.getCategories(R.id),z.getStoreBrands(R.id)]);n(q),l(Y.categories||[]),d(P.brands||[])}catch(A){console.error("Failed to load store data:",A)}finally{f(!1)}},S=async()=>{if(r)try{const A={store_id:r.id,limit:1e3};p&&(A.category_id=p),x&&(A.brand=x);let q=(await z.getProducts(A)).products||[];q.sort((Y,P)=>{switch(j){case"name":return(Y.name||"").localeCompare(P.name||"");case"price_asc":return(Y.price||0)-(P.price||0);case"price_desc":return(P.price||0)-(Y.price||0);case"thc":return(P.thc_percentage||0)-(Y.thc_percentage||0);default:return 0}}),s(q)}catch(A){console.error("Failed to load products:",A)}},N=A=>A.image_url_full?A.image_url_full:A.medium_path?`http://localhost:9020/dutchie/${A.medium_path}`:A.thumbnail_path?`http://localhost:9020/dutchie/${A.thumbnail_path}`:"https://via.placeholder.com/300x300?text=No+Image",_=A=>A?new Date(A).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Never",C=A=>{switch(A==null?void 0:A.toLowerCase()){case"dutchie":return"bg-green-100 text-green-700";case"jane":return"bg-purple-100 text-purple-700";case"treez":return"bg-blue-100 text-blue-700";case"weedmaps":return"bg-orange-100 text-orange-700";case"leafly":return"bg-emerald-100 text-emerald-700";default:return"bg-gray-100 text-gray-700"}},D=A=>{switch(A){case"completed":return a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-green-100 text-green-700 rounded-full flex items-center gap-1",children:[a.jsx(_r,{className:"w-3 h-3"})," Completed"]});case"running":return a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-blue-100 text-blue-700 rounded-full flex items-center gap-1",children:[a.jsx(Xt,{className:"w-3 h-3 animate-spin"})," Running"]});case"failed":return a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-red-100 text-red-700 rounded-full flex items-center gap-1",children:[a.jsx(Hr,{className:"w-3 h-3"})," Failed"]});case"pending":return a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-yellow-100 text-yellow-700 rounded-full flex items-center gap-1",children:[a.jsx(xr,{className:"w-3 h-3"})," Pending"]});default:return a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-gray-100 text-gray-700 rounded-full",children:A})}};return u?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin"})})}):r?a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-start justify-between mb-6",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("button",{onClick:()=>t("/stores"),className:"text-gray-600 hover:text-gray-900 mt-1",children:"← Back"}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:r.name}),a.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded ${C(r.provider)}`,children:r.provider||"Unknown"})]}),a.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["Store ID: ",r.id]})]})]}),a.jsxs("a",{href:r.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700",children:["View Menu ",a.jsx(Jr,{className:"w-4 h-4"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4 mb-6",children:[a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 text-xs mb-1",children:[a.jsx(xt,{className:"w-4 h-4"}),"Products"]}),a.jsx("p",{className:"text-xl font-semibold text-gray-900",children:r.product_count||0})]}),a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 text-xs mb-1",children:[a.jsx(Cr,{className:"w-4 h-4"}),"Categories"]}),a.jsx("p",{className:"text-xl font-semibold text-gray-900",children:r.category_count||0})]}),a.jsxs("div",{className:"p-4 bg-green-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-green-600 text-xs mb-1",children:[a.jsx(_r,{className:"w-4 h-4"}),"In Stock"]}),a.jsx("p",{className:"text-xl font-semibold text-green-700",children:r.in_stock_count||0})]}),a.jsxs("div",{className:"p-4 bg-red-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-red-600 text-xs mb-1",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Out of Stock"]}),a.jsx("p",{className:"text-xl font-semibold text-red-700",children:r.out_of_stock_count||0})]}),a.jsxs("div",{className:`p-4 rounded-lg ${r.is_stale?"bg-yellow-50":"bg-blue-50"}`,children:[a.jsxs("div",{className:`flex items-center gap-2 text-xs mb-1 ${r.is_stale?"text-yellow-600":"text-blue-600"}`,children:[a.jsx(xr,{className:"w-4 h-4"}),"Freshness"]}),a.jsx("p",{className:`text-sm font-semibold ${r.is_stale?"text-yellow-700":"text-blue-700"}`,children:r.freshness||"Never scraped"})]}),a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 text-xs mb-1",children:[a.jsx(Oh,{className:"w-4 h-4"}),"Next Crawl"]}),a.jsx("p",{className:"text-sm font-semibold text-gray-700",children:(M=r.schedule)!=null&&M.next_run_at?_(r.schedule.next_run_at):"Not scheduled"})]})]}),r.linked_dispensary&&a.jsxs("div",{className:"p-4 bg-indigo-50 rounded-lg mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-indigo-600 text-xs mb-2",children:[a.jsx(KA,{className:"w-4 h-4"}),"Linked Dispensary"]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-indigo-900",children:r.linked_dispensary.name}),a.jsxs("p",{className:"text-sm text-indigo-700 flex items-center gap-1",children:[a.jsx(yi,{className:"w-3 h-3"}),r.linked_dispensary.city,", ",r.linked_dispensary.state,r.linked_dispensary.address&&` - ${r.linked_dispensary.address}`]})]}),a.jsx("button",{onClick:()=>t(`/dispensaries/${r.linked_dispensary.slug}`),className:"text-sm text-indigo-600 hover:text-indigo-700 font-medium",children:"View Dispensary →"})]})]}),a.jsxs("div",{className:"flex gap-2 border-b border-gray-200",children:[a.jsx("button",{onClick:()=>b("products"),className:`px-4 py-2 border-b-2 transition-colors ${v==="products"?"border-blue-600 text-blue-600 font-medium":"border-transparent text-gray-600 hover:text-gray-900"}`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xt,{className:"w-4 h-4"}),"Products (",i.length,")"]})}),a.jsx("button",{onClick:()=>b("brands"),className:`px-4 py-2 border-b-2 transition-colors ${v==="brands"?"border-blue-600 text-blue-600 font-medium":"border-transparent text-gray-600 hover:text-gray-900"}`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cr,{className:"w-4 h-4"}),"Brands (",c.length,")"]})}),a.jsx("button",{onClick:()=>b("specials"),className:`px-4 py-2 border-b-2 transition-colors ${v==="specials"?"border-blue-600 text-blue-600 font-medium":"border-transparent text-gray-600 hover:text-gray-900"}`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Rx,{className:"w-4 h-4"}),"Specials"]})}),a.jsx("button",{onClick:()=>b("crawl-history"),className:`px-4 py-2 border-b-2 transition-colors ${v==="crawl-history"?"border-blue-600 text-blue-600 font-medium":"border-transparent text-gray-600 hover:text-gray-900"}`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(na,{className:"w-4 h-4"}),"Crawl History (",((I=r.recent_jobs)==null?void 0:I.length)||0,")"]})})]})]}),v==="crawl-history"&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[a.jsxs("div",{className:"p-4 border-b border-gray-200",children:[a.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Recent Crawl Jobs"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Last 10 crawl jobs for this store"})]}),r.recent_jobs&&r.recent_jobs.length>0?a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Status"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Type"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Started"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Completed"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"Found"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"New"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"Updated"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"In Stock"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"Out of Stock"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Error"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-100",children:r.recent_jobs.map(A=>a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-4 py-3",children:D(A.status)}),a.jsx("td",{className:"px-4 py-3 text-sm text-gray-700",children:A.job_type||"-"}),a.jsx("td",{className:"px-4 py-3 text-sm text-gray-700",children:_(A.started_at)}),a.jsx("td",{className:"px-4 py-3 text-sm text-gray-700",children:_(A.completed_at)}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-gray-900",children:A.products_found??"-"}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-green-600",children:A.products_new??"-"}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-blue-600",children:A.products_updated??"-"}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-green-600",children:A.in_stock_count??"-"}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-red-600",children:A.out_of_stock_count??"-"}),a.jsx("td",{className:"px-4 py-3 text-sm text-red-600 max-w-xs truncate",title:A.error_message||"",children:A.error_message||"-"})]},A.id))})]})}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx(na,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-500",children:"No crawl history available"})]})]}),v==="products"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:a.jsxs("div",{className:"flex flex-wrap gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-[200px]",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Category"}),a.jsxs("select",{value:p||"",onChange:A=>m(A.target.value?parseInt(A.target.value):null),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"",children:"All Categories"}),o.map(A=>a.jsxs("option",{value:A.id,children:[A.name," (",i.filter(R=>R.category_id===A.id).length,")"]},A.id))]})]}),a.jsxs("div",{className:"flex-1 min-w-[200px]",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Brand"}),a.jsxs("select",{value:x,onChange:A=>g(A.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"",children:"All Brands"}),c.map(A=>a.jsx("option",{value:A,children:A},A))]})]}),a.jsxs("div",{className:"flex-1 min-w-[200px]",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Sort By"}),a.jsxs("select",{value:j,onChange:A=>y(A.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"name",children:"Name (A-Z)"}),a.jsx("option",{value:"price_asc",children:"Price (Low to High)"}),a.jsx("option",{value:"price_desc",children:"Price (High to Low)"}),a.jsx("option",{value:"thc",children:"THC % (High to Low)"})]})]})]})}),i.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:i.map(A=>a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden hover:shadow-lg transition-shadow",children:[a.jsxs("div",{className:"aspect-square bg-gray-50 relative",children:[a.jsx("img",{src:N(A),alt:A.name,className:"w-full h-full object-cover"}),A.in_stock?a.jsx("span",{className:"absolute top-2 right-2 px-2 py-1 bg-green-500 text-white text-xs font-medium rounded",children:"In Stock"}):a.jsx("span",{className:"absolute top-2 right-2 px-2 py-1 bg-red-500 text-white text-xs font-medium rounded",children:"Out of Stock"})]}),a.jsxs("div",{className:"p-3 space-y-2",children:[a.jsx("h3",{className:"font-semibold text-sm text-gray-900 line-clamp-2",children:A.name}),A.brand&&a.jsx("p",{className:"text-xs text-gray-600 font-medium",children:A.brand}),A.category_name&&a.jsx("p",{className:"text-xs text-gray-500",children:A.category_name}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t border-gray-100",children:[A.price!==null&&a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Price:"}),a.jsxs("span",{className:"ml-1 font-semibold text-blue-600",children:["$",parseFloat(A.price).toFixed(2)]})]}),A.weight&&a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Weight:"}),a.jsx("span",{className:"ml-1 font-medium",children:A.weight})]}),A.thc_percentage!==null&&a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"THC:"}),a.jsxs("span",{className:"ml-1 font-medium text-green-600",children:[A.thc_percentage,"%"]})]}),A.cbd_percentage!==null&&a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"CBD:"}),a.jsxs("span",{className:"ml-1 font-medium text-blue-600",children:[A.cbd_percentage,"%"]})]}),A.strain_type&&a.jsxs("div",{className:"text-xs col-span-2",children:[a.jsx("span",{className:"text-gray-500",children:"Type:"}),a.jsx("span",{className:"ml-1 font-medium capitalize",children:A.strain_type})]})]}),A.description&&a.jsx("p",{className:"text-xs text-gray-600 line-clamp-2 pt-2 border-t border-gray-100",children:A.description}),A.last_seen_at&&a.jsxs("p",{className:"text-xs text-gray-400 pt-2 border-t border-gray-100",children:["Updated: ",new Date(A.last_seen_at).toLocaleDateString()]}),a.jsxs("div",{className:"flex gap-2 mt-3 pt-3 border-t border-gray-100",children:[A.dutchie_url&&a.jsx("a",{href:A.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"flex-1 px-3 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-lg hover:bg-gray-200 transition-colors text-center border border-gray-200",children:"Dutchie"}),a.jsx("button",{onClick:()=>t(`/products/${A.id}`),className:"flex-1 px-3 py-2 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 transition-colors",children:"Details"})]})]})]},A.id))}):a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[a.jsx(xt,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No products found"}),a.jsx("p",{className:"text-gray-500",children:"Try adjusting your filters"})]})]}),v==="brands"&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:["All Brands (",c.length,")"]}),c.length>0?a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3",children:c.map(A=>{const R=i.filter(q=>q.brand===A);return a.jsxs("div",{className:"p-4 border border-gray-200 rounded-lg hover:border-blue-500 hover:bg-blue-50 transition-all cursor-pointer",onClick:()=>{b("products"),g(A)},children:[a.jsx("p",{className:"font-medium text-gray-900 text-sm",children:A}),a.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[R.length," products"]})]},A)})}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Cr,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-500",children:"No brands found"})]})]}),v==="specials"&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Daily Specials"}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Rx,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-500",children:"No specials available"})]})]})]})}):a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Store not found"}),a.jsx("button",{onClick:()=>t("/stores"),className:"text-blue-600 hover:text-blue-700",children:"← Back to stores"})]})})}function l7(){const{state:e,storeName:t,slug:r}=Pa(),n=dt(),[i,s]=h.useState(null),[o,l]=h.useState([]),[c,d]=h.useState(!0);h.useEffect(()=>{u()},[r]);const u=async()=>{d(!0);try{const p=(await z.getStores()).stores.find(x=>x.slug===r);if(!p)throw new Error("Store not found");s(p);const m=await z.getStoreBrands(p.id);l(m.brands)}catch(f){console.error("Failed to load brands:",f)}finally{d(!1)}};return c?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("span",{className:"loading loading-spinner loading-lg"})})}):i?a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>n(`/stores/${e}/${t}/${r}`),className:"btn btn-ghost btn-sm",children:"← Back to Store"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h1",{className:"text-3xl font-bold",children:[i.name," - Brands"]}),a.jsxs("div",{className:"flex gap-3 mt-2",children:[a.jsx("a",{href:`${i.dutchie_url}/brands`,target:"_blank",rel:"noopener noreferrer",className:"link link-primary text-sm",children:"View Live Brands Page"}),a.jsx("span",{className:"text-sm text-gray-500",children:"•"}),a.jsxs("span",{className:"text-sm text-gray-500",children:[o.length," ",o.length===1?"Brand":"Brands"]})]})]})]}),o.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:o.map((f,p)=>a.jsx("div",{className:"card bg-base-100 shadow-md hover:shadow-lg transition-shadow",children:a.jsx("div",{className:"card-body p-6",children:a.jsx("h3",{className:"text-lg font-semibold text-center",children:f})})},p))}):a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body text-center py-12",children:[a.jsx("p",{className:"text-gray-500",children:"No brands found for this store"}),a.jsx("p",{className:"text-sm text-gray-400 mt-2",children:"Brands are automatically extracted from products"})]})})]})}):a.jsx(X,{children:a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-500",children:"Store not found"})})})}function c7(){const{state:e,storeName:t,slug:r}=Pa(),n=dt(),[i,s]=h.useState(null),[o,l]=h.useState([]),[c,d]=h.useState(new Date().toISOString().split("T")[0]),[u,f]=h.useState(!0);h.useEffect(()=>{p()},[r,c]);const p=async()=>{f(!0);try{const x=(await z.getStores()).stores.find(v=>v.slug===r);if(!x)throw new Error("Store not found");s(x);const g=await z.getStoreSpecials(x.id,c);l(g.specials)}catch(m){console.error("Failed to load specials:",m)}finally{f(!1)}};return u?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("span",{className:"loading loading-spinner loading-lg"})})}):i?a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>n(`/stores/${e}/${t}/${r}`),className:"btn btn-ghost btn-sm",children:"← Back to Store"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h1",{className:"text-3xl font-bold",children:[i.name," - Specials"]}),a.jsxs("div",{className:"flex gap-3 mt-2",children:[a.jsx("a",{href:`${i.dutchie_url}/specials`,target:"_blank",rel:"noopener noreferrer",className:"link link-primary text-sm",children:"View Live Specials Page"}),a.jsx("span",{className:"text-sm text-gray-500",children:"•"}),a.jsxs("span",{className:"text-sm text-gray-500",children:[o.length," ",o.length===1?"Special":"Specials"]})]})]})]}),a.jsx("div",{className:"card bg-base-100 shadow-md",children:a.jsx("div",{className:"card-body p-4",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("label",{className:"font-semibold",children:"Select Date:"}),a.jsx("input",{type:"date",value:c,onChange:m=>d(m.target.value),className:"input input-bordered input-sm"})]})})}),o.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:o.map((m,x)=>a.jsx("div",{className:"card bg-base-100 shadow-xl hover:shadow-2xl transition-shadow",children:a.jsxs("div",{className:"card-body",children:[a.jsx("h3",{className:"card-title text-lg",children:m.name}),m.description&&a.jsx("p",{className:"text-sm text-gray-600",children:m.description}),a.jsxs("div",{className:"space-y-2 mt-2",children:[m.original_price&&a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm opacity-60",children:"Original Price:"}),a.jsxs("span",{className:"line-through text-gray-500",children:["$",parseFloat(m.original_price).toFixed(2)]})]}),m.special_price&&a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm opacity-60",children:"Special Price:"}),a.jsxs("span",{className:"text-lg font-bold text-success",children:["$",parseFloat(m.special_price).toFixed(2)]})]}),m.discount_percentage&&a.jsxs("div",{className:"badge badge-success badge-lg",children:[m.discount_percentage,"% OFF"]}),m.discount_amount&&a.jsxs("div",{className:"badge badge-info badge-lg",children:["Save $",parseFloat(m.discount_amount).toFixed(2)]})]})]})},x))}):a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body text-center py-12",children:[a.jsxs("p",{className:"text-gray-500",children:["No specials found for ",c]}),a.jsx("p",{className:"text-sm text-gray-400 mt-2",children:"Try selecting a different date"})]})})]})}):a.jsx(X,{children:a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-500",children:"Store not found"})})})}function u7(){const[e,t]=h.useState([]),[r,n]=h.useState(null),[i,s]=h.useState([]),[o,l]=h.useState(!0);h.useEffect(()=>{c()},[]),h.useEffect(()=>{r&&d()},[r]);const c=async()=>{try{const f=await z.getStores();t(f.stores),f.stores.length>0&&n(f.stores[0].id)}catch(f){console.error("Failed to load stores:",f)}finally{l(!1)}},d=async()=>{if(r)try{const f=await z.getCategoryTree(r);s(f.tree)}catch(f){console.error("Failed to load categories:",f)}};if(o)return a.jsx(X,{children:a.jsx("div",{children:"Loading..."})});const u=e.find(f=>f.id===r);return a.jsx(X,{children:a.jsxs("div",{children:[a.jsx("h1",{style:{fontSize:"32px",marginBottom:"30px"},children:"Categories"}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"30px"},children:[a.jsx("label",{style:{display:"block",marginBottom:"10px",fontWeight:"600"},children:"Select Store:"}),a.jsx("select",{value:r||"",onChange:f=>n(parseInt(f.target.value)),style:{width:"100%",padding:"12px",border:"2px solid #667eea",borderRadius:"6px",fontSize:"16px",cursor:"pointer"},children:e.map(f=>a.jsxs("option",{value:f.id,children:[f.name," (",f.category_count||0," categories)"]},f.id))})]}),u&&a.jsxs("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsxs("h2",{style:{marginBottom:"20px",fontSize:"24px"},children:[u.name," - Categories"]}),i.length===0?a.jsx("div",{style:{color:"#999",textAlign:"center",padding:"40px"},children:'No categories found. Run "Discover Categories" from the Stores page.'}):a.jsx("div",{children:i.map(f=>a.jsx(Ok,{category:f},f.id))})]})]})})}function Ok({category:e,level:t=0}){return a.jsxs("div",{style:{marginLeft:t*30+"px",marginBottom:"10px"},children:[a.jsxs("div",{style:{padding:"12px 15px",background:t===0?"#f0f0ff":"#f8f9fa",borderRadius:"6px",borderLeft:`4px solid ${t===0?"#667eea":"#999"}`,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{children:[a.jsxs("strong",{style:{fontSize:t===0?"16px":"14px"},children:[t>0&&"└── ",e.name]}),a.jsxs("span",{style:{marginLeft:"10px",color:"#666",fontSize:"12px"},children:["(",e.product_count||0," products)"]})]}),a.jsx("div",{style:{fontSize:"12px",color:"#999"},children:a.jsx("code",{children:e.path})})]}),e.children&&e.children.length>0&&a.jsx("div",{style:{marginTop:"5px"},children:e.children.map(r=>a.jsx(Ok,{category:r,level:t+1},r.id))})]})}function Vn({message:e,type:t,onClose:r,duration:n=4e3}){h.useEffect(()=>{const s=setTimeout(r,n);return()=>clearTimeout(s)},[n,r]);const i={success:"#10b981",error:"#ef4444",info:"#3b82f6"};return a.jsxs("div",{style:{position:"fixed",top:"20px",right:"20px",background:i[t],color:"white",padding:"16px 24px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:9999,maxWidth:"400px",animation:"slideIn 0.3s ease-out",fontSize:"14px",fontWeight:"500"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[a.jsx("div",{style:{flex:1,whiteSpace:"pre-wrap"},children:e}),a.jsx("button",{onClick:r,style:{background:"transparent",border:"none",color:"white",cursor:"pointer",fontSize:"18px",padding:"0 4px",opacity:.8},children:"×"})]}),a.jsx("style",{children:` - @keyframes slideIn { - from { - transform: translateX(100%); - opacity: 0; - } - to { - transform: translateX(0); - opacity: 1; - } - } - `})]})}function d7(){const[e,t]=h.useState([]),[r,n]=h.useState(!0),[i,s]=h.useState(!1),[o,l]=h.useState(null);h.useEffect(()=>{c()},[]);const c=async()=>{n(!0);try{const u=await z.getCampaigns();t(u.campaigns)}catch(u){console.error("Failed to load campaigns:",u)}finally{n(!1)}},d=async(u,f)=>{if(confirm(`Are you sure you want to delete campaign "${f}"?`))try{await z.deleteCampaign(u),c()}catch(p){l({message:"Failed to delete campaign: "+p.message,type:"error"})}};return r?a.jsx(X,{children:a.jsx("div",{children:"Loading..."})}):a.jsxs(X,{children:[o&&a.jsx(Vn,{message:o.message,type:o.type,onClose:()=>l(null)}),a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Campaigns"}),a.jsx("button",{onClick:()=>s(!0),style:{padding:"12px 24px",background:"#667eea",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"14px",fontWeight:"500"},children:"+ Create Campaign"})]}),i&&a.jsx(f7,{onClose:()=>s(!1),onSuccess:()=>{s(!1),c()}}),a.jsx("div",{style:{display:"grid",gap:"20px"},children:e.map(u=>a.jsx("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsxs("h3",{style:{marginBottom:"10px",fontSize:"20px"},children:[u.name,a.jsx("span",{style:{marginLeft:"10px",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",background:u.active?"#d4edda":"#f8d7da",color:u.active?"#155724":"#721c24"},children:u.active?"Active":"Inactive"})]}),a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"5px"},children:[a.jsx("strong",{children:"Slug:"})," ",u.slug]}),u.description&&a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"5px"},children:[a.jsx("strong",{children:"Description:"})," ",u.description]}),a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"5px"},children:[a.jsx("strong",{children:"Display Style:"})," ",u.display_style]}),a.jsxs("div",{style:{fontSize:"14px",color:"#666"},children:[a.jsx("strong",{children:"Products:"})," ",u.product_count||0]})]}),a.jsx("div",{style:{display:"flex",gap:"10px"},children:a.jsx("button",{onClick:()=>d(u.id,u.name),style:{padding:"8px 16px",background:"#e74c3c",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"14px"},children:"Delete"})})]})},u.id))}),e.length===0&&!i&&a.jsx("div",{style:{background:"white",padding:"40px",borderRadius:"8px",textAlign:"center",color:"#999"},children:"No campaigns found"})]})]})}function f7({onClose:e,onSuccess:t}){const[r,n]=h.useState(""),[i,s]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState("grid"),[u,f]=h.useState(!0),[p,m]=h.useState(!1),[x,g]=h.useState(null),v=async b=>{b.preventDefault(),m(!0);try{await z.createCampaign({name:r,slug:i,description:o,display_style:c,active:u}),t()}catch(j){g({message:"Failed to create campaign: "+j.message,type:"error"})}finally{m(!1)}};return a.jsxs("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"20px"},children:[x&&a.jsx(Vn,{message:x.message,type:x.type,onClose:()=>g(null)}),a.jsx("h3",{style:{marginBottom:"20px"},children:"Create New Campaign"}),a.jsxs("form",{onSubmit:v,children:[a.jsxs("div",{style:{display:"grid",gap:"15px"},children:[a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"5px",fontWeight:"500"},children:"Name *"}),a.jsx("input",{type:"text",value:r,onChange:b=>n(b.target.value),required:!0,style:{width:"100%",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"}})]}),a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"5px",fontWeight:"500"},children:"Slug *"}),a.jsx("input",{type:"text",value:i,onChange:b=>s(b.target.value),required:!0,placeholder:"e.g., summer-sale",style:{width:"100%",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"}})]}),a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"5px",fontWeight:"500"},children:"Description"}),a.jsx("textarea",{value:o,onChange:b=>l(b.target.value),rows:3,style:{width:"100%",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"}})]}),a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"5px",fontWeight:"500"},children:"Display Style"}),a.jsxs("select",{value:c,onChange:b=>d(b.target.value),style:{width:"100%",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"grid",children:"Grid"}),a.jsx("option",{value:"list",children:"List"}),a.jsx("option",{value:"carousel",children:"Carousel"})]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[a.jsx("input",{type:"checkbox",id:"active",checked:u,onChange:b=>f(b.target.checked)}),a.jsx("label",{htmlFor:"active",children:"Active"})]})]}),a.jsxs("div",{style:{display:"flex",gap:"10px",marginTop:"20px"},children:[a.jsx("button",{type:"submit",disabled:p,style:{padding:"10px 20px",background:p?"#999":"#667eea",color:"white",border:"none",borderRadius:"6px",cursor:p?"not-allowed":"pointer",fontSize:"14px"},children:p?"Creating...":"Create Campaign"}),a.jsx("button",{type:"button",onClick:e,style:{padding:"10px 20px",background:"#ddd",color:"#333",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"14px"},children:"Cancel"})]})]})]})}function p7(){var l,c,d,u;const[e,t]=h.useState(null),[r,n]=h.useState(!0),[i,s]=h.useState(30);h.useEffect(()=>{o()},[i]);const o=async()=>{n(!0);try{const f=await z.getAnalyticsOverview(i);t(f)}catch(f){console.error("Failed to load analytics:",f)}finally{n(!1)}};return r?a.jsx(X,{children:a.jsx("div",{children:"Loading..."})}):a.jsx(X,{children:a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Analytics"}),a.jsxs("select",{value:i,onChange:f=>s(parseInt(f.target.value)),style:{padding:"10px 15px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px"},children:[a.jsx("option",{value:7,children:"Last 7 days"}),a.jsx("option",{value:30,children:"Last 30 days"}),a.jsx("option",{value:90,children:"Last 90 days"}),a.jsx("option",{value:365,children:"Last year"})]})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(250px, 1fr))",gap:"20px",marginBottom:"30px"},children:[a.jsx(kv,{title:"Total Clicks",value:((l=e==null?void 0:e.overview)==null?void 0:l.total_clicks)||0,icon:"👆",color:"#3498db"}),a.jsx(kv,{title:"Unique Products Clicked",value:((c=e==null?void 0:e.overview)==null?void 0:c.unique_products)||0,icon:"📦",color:"#2ecc71"})]}),a.jsxs("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"30px"},children:[a.jsx("h3",{style:{marginBottom:"20px"},children:"Clicks Over Time"}),((d=e==null?void 0:e.clicks_by_day)==null?void 0:d.length)>0?a.jsx("div",{style:{overflowX:"auto"},children:a.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"8px",minWidth:"600px",height:"200px"},children:e.clicks_by_day.slice().reverse().map((f,p)=>{const m=Math.max(...e.clicks_by_day.map(g=>g.clicks)),x=f.clicks/m*180;return a.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:[a.jsx("div",{style:{width:"100%",height:`${x}px`,background:"#667eea",borderRadius:"4px 4px 0 0",position:"relative",minHeight:"2px"},title:`${f.clicks} clicks`,children:a.jsx("div",{style:{position:"absolute",top:"-25px",left:"50%",transform:"translateX(-50%)",fontSize:"12px",fontWeight:"bold"},children:f.clicks})}),a.jsx("div",{style:{fontSize:"10px",marginTop:"5px",color:"#666",transform:"rotate(-45deg)",transformOrigin:"left",whiteSpace:"nowrap"},children:new Date(f.date).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},p)})})}):a.jsx("div",{style:{color:"#999",textAlign:"center",padding:"40px"},children:"No click data for this period"})]}),a.jsxs("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("h3",{style:{marginBottom:"20px"},children:"Top Products"}),((u=e==null?void 0:e.top_products)==null?void 0:u.length)>0?a.jsx("div",{children:e.top_products.map((f,p)=>a.jsxs("div",{style:{padding:"15px 0",borderBottom:p{u()},[]);const u=async()=>{n(!0);try{const x=await z.getSettings();t(x.settings)}catch(x){console.error("Failed to load settings:",x)}finally{n(!1)}},f=(x,g)=>{l(v=>({...v,[x]:g}))},p=async()=>{s(!0);try{const x=Object.entries(o).map(([g,v])=>({key:g,value:v}));await z.updateSettings(x),l({}),u(),d({message:"Settings saved successfully!",type:"success"})}catch(x){d({message:"Failed to save settings: "+x.message,type:"error"})}finally{s(!1)}},m=Object.keys(o).length>0;return r?a.jsx(X,{children:a.jsx("div",{children:"Loading..."})}):a.jsxs(X,{children:[c&&a.jsx(Vn,{message:c.message,type:c.type,onClose:()=>d(null)}),a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Settings"}),m&&a.jsx("button",{onClick:p,disabled:i,style:{padding:"12px 24px",background:i?"#999":"#2ecc71",color:"white",border:"none",borderRadius:"6px",cursor:i?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500"},children:i?"Saving...":"Save Changes"})]}),a.jsx("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:a.jsx("div",{style:{display:"grid",gap:"25px"},children:e.map(x=>{const g=o[x.key]!==void 0?o[x.key]:x.value;return a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500",fontSize:"16px"},children:m7(x.key)}),x.description&&a.jsx("div",{style:{fontSize:"13px",color:"#666",marginBottom:"8px"},children:x.description}),a.jsx("input",{type:"text",value:g,onChange:v=>f(x.key,v.target.value),style:{width:"100%",maxWidth:"500px",padding:"10px",border:o[x.key]!==void 0?"2px solid #667eea":"1px solid #ddd",borderRadius:"6px",fontSize:"14px"}}),a.jsxs("div",{style:{fontSize:"12px",color:"#999",marginTop:"5px"},children:["Last updated: ",new Date(x.updated_at).toLocaleString()]})]},x.key)})})}),m&&a.jsx("div",{style:{marginTop:"20px",padding:"15px",background:"#fff3cd",border:"1px solid #ffc107",borderRadius:"6px",color:"#856404"},children:'⚠️ You have unsaved changes. Click "Save Changes" to apply them.'})]})]})}function m7(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function g7(){const[e,t]=h.useState([]),[r,n]=h.useState(!0),[i,s]=h.useState(!1),[o,l]=h.useState({}),[c,d]=h.useState(null),[u,f]=h.useState(null);h.useEffect(()=>{p(),m()},[]),h.useEffect(()=>{if(!(c!=null&&c.id))return;if(c.status==="completed"||c.status==="cancelled"||c.status==="failed"){p();return}const _=setInterval(async()=>{try{const C=await z.getProxyTestJob(c.id);d(C.job),(C.job.status==="completed"||C.job.status==="cancelled"||C.job.status==="failed")&&(clearInterval(_),p())}catch(C){console.error("Failed to poll job status:",C)}},2e3);return()=>clearInterval(_)},[c==null?void 0:c.id]);const p=async()=>{n(!0);try{const N=await z.getProxies();t(N.proxies)}catch(N){console.error("Failed to load proxies:",N)}finally{n(!1)}},m=async()=>{try{const N=await z.getActiveProxyTestJob();N.job&&d(N.job)}catch{console.log("No active job found")}},x=async N=>{l(_=>({..._,[N]:!0}));try{await z.testProxy(N),p()}catch(_){f({message:"Test failed: "+_.message,type:"error"})}finally{l(_=>({..._,[N]:!1}))}},g=async N=>{l(_=>({..._,[N]:!0})),z.testProxy(N).then(()=>{p(),l(_=>({..._,[N]:!1}))}).catch(()=>{l(_=>({..._,[N]:!1}))})},v=async()=>{try{const N=await z.testAllProxies();f({message:"Proxy testing job started",type:"success"}),d({id:N.jobId,status:"pending",tested_proxies:0,total_proxies:e.length,passed_proxies:0,failed_proxies:0})}catch(N){f({message:"Failed to start testing: "+N.message,type:"error"})}},b=async()=>{if(c!=null&&c.id)try{await z.cancelProxyTestJob(c.id),f({message:"Job cancelled",type:"info"})}catch(N){f({message:"Failed to cancel job: "+N.message,type:"error"})}},j=async()=>{try{await z.updateProxyLocations(),f({message:"Location update job started",type:"success"})}catch(N){f({message:"Failed to start location update: "+N.message,type:"error"})}},y=async N=>{if(confirm("Delete this proxy?"))try{await z.deleteProxy(N),p()}catch(_){f({message:"Failed to delete proxy: "+_.message,type:"error"})}};if(r)return a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin"})})});const w={total:e.length,passed:e.filter(N=>N.active).length,failed:e.filter(N=>!N.active).length},S=w.total>0?Math.round(w.passed/w.total*100):0;return a.jsxs(X,{children:[u&&a.jsx(Vn,{message:u.message,type:u.type,onClose:()=>f(null)}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(ol,{className:"w-6 h-6 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"Proxies"}),a.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[w.total," total • ",w.passed," active • ",w.failed," inactive"]})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("button",{onClick:v,disabled:!!c&&c.status!=="completed"&&c.status!=="cancelled"&&c.status!=="failed",className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-50 text-blue-700 rounded-lg hover:bg-blue-100 transition-colors text-sm font-medium disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Test All"]}),a.jsxs("button",{onClick:j,className:"inline-flex items-center gap-2 px-4 py-2 bg-purple-50 text-purple-700 rounded-lg hover:bg-purple-100 transition-colors text-sm font-medium",children:[a.jsx(yi,{className:"w-4 h-4"}),"Update Locations"]}),a.jsxs("button",{onClick:()=>s(!0),className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors text-sm font-medium",children:[a.jsx($l,{className:"w-4 h-4"}),"Add Proxy"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(ol,{className:"w-5 h-5 text-blue-600"})}),a.jsx("div",{className:"flex items-center gap-1 text-xs text-gray-500",children:a.jsxs("span",{children:[S,"% pass rate"]})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Proxies"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:w.total})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(_r,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600",children:[a.jsx(Qr,{className:"w-3 h-3"}),a.jsxs("span",{children:[Math.round(w.passed/w.total*100)||0,"%"]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Active"}),a.jsx("p",{className:"text-3xl font-semibold text-green-600",children:w.passed}),a.jsx("p",{className:"text-xs text-gray-500",children:"Passing health checks"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-red-50 rounded-lg",children:a.jsx(Hr,{className:"w-5 h-5 text-red-600"})}),a.jsx("div",{className:"flex items-center gap-1 text-xs text-red-600",children:a.jsxs("span",{children:[Math.round(w.failed/w.total*100)||0,"%"]})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Inactive"}),a.jsx("p",{className:"text-3xl font-semibold text-red-600",children:w.failed}),a.jsx("p",{className:"text-xs text-gray-500",children:"Failed health checks"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(Qr,{className:"w-5 h-5 text-purple-600"})})}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Success Rate"}),a.jsxs("p",{className:"text-3xl font-semibold text-gray-900",children:[S,"%"]}),a.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 mt-3",children:a.jsx("div",{className:"bg-green-600 h-2 rounded-full transition-all",style:{width:`${S}%`}})})]})]})]}),c&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(Xt,{className:`w-5 h-5 text-blue-600 ${c.status==="running"?"animate-spin":""}`})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-gray-900",children:"Proxy Testing Job"}),a.jsx("p",{className:"text-sm text-gray-500",children:c.status.charAt(0).toUpperCase()+c.status.slice(1)})]})]}),a.jsxs("div",{className:"flex gap-2",children:[c.status==="running"&&a.jsx("button",{onClick:b,className:"px-3 py-1.5 bg-red-50 text-red-700 rounded-lg hover:bg-red-100 transition-colors text-sm font-medium",children:"Cancel"}),(c.status==="completed"||c.status==="cancelled"||c.status==="failed")&&a.jsx("button",{onClick:()=>d(null),className:"px-3 py-1.5 text-gray-600 hover:bg-gray-50 rounded-lg transition-colors text-sm font-medium",children:"Dismiss"})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:["Progress: ",c.tested_proxies||0," / ",c.total_proxies||0," proxies tested"]}),a.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:a.jsx("div",{className:`h-2 rounded-full transition-all ${c.status==="completed"?"bg-green-600":c.status==="cancelled"||c.status==="failed"?"bg-red-600":"bg-blue-600"}`,style:{width:`${(c.tested_proxies||0)/(c.total_proxies||100)*100}%`}})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Passed:"}),a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-green-50 text-green-700 rounded",children:c.passed_proxies||0})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Failed:"}),a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-red-50 text-red-700 rounded",children:c.failed_proxies||0})]})]}),c.error&&a.jsxs("div",{className:"mt-4 p-3 bg-red-50 border border-red-200 rounded-lg flex items-start gap-2",children:[a.jsx(ha,{className:"w-5 h-5 text-red-600 flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-red-900",children:"Error"}),a.jsx("p",{className:"text-sm text-red-700",children:c.error})]})]})]}),i&&a.jsx(x7,{onClose:()=>s(!1),onSuccess:()=>{s(!1),p()}}),a.jsx("div",{className:"space-y-3",children:e.map(N=>a.jsx("div",{className:"bg-white rounded-xl border border-gray-200 p-4 hover:shadow-lg transition-shadow",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsxs("h3",{className:"font-semibold text-gray-900",children:[N.protocol,"://",N.host,":",N.port]}),a.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded ${N.active?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:N.active?"Active":"Inactive"}),N.is_anonymous&&a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-blue-50 text-blue-700 rounded",children:"Anonymous"}),(N.city||N.state||N.country)&&a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-purple-50 text-purple-700 rounded flex items-center gap-1",children:[a.jsx(yi,{className:"w-3 h-3"}),N.city&&`${N.city}/`,N.state&&`${N.state.substring(0,2).toUpperCase()} `,N.country]})]}),a.jsx("div",{className:"text-sm text-gray-600",children:N.last_tested_at?a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(xr,{className:"w-4 h-4 text-gray-400"}),a.jsxs("span",{children:["Last tested: ",new Date(N.last_tested_at).toLocaleString()]})]}),N.test_result==="success"?a.jsxs("span",{className:"flex items-center gap-1 text-green-600",children:[a.jsx(_r,{className:"w-4 h-4"}),"Success (",N.response_time_ms,"ms)"]}):a.jsxs("span",{className:"flex items-center gap-1 text-red-600",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Failed"]})]}):"Not tested yet"})]}),a.jsxs("div",{className:"flex gap-2",children:[N.active?a.jsx("button",{onClick:()=>x(N.id),disabled:o[N.id],className:"inline-flex items-center gap-1 px-3 py-1.5 bg-blue-50 text-blue-700 rounded-lg hover:bg-blue-100 transition-colors text-sm font-medium disabled:opacity-50",children:o[N.id]?a.jsx("div",{className:"w-4 h-4 border-2 border-blue-700 border-t-transparent rounded-full animate-spin"}):a.jsxs(a.Fragment,{children:[a.jsx(Xt,{className:"w-4 h-4"}),"Test"]})}):a.jsx("button",{onClick:()=>g(N.id),disabled:o[N.id],className:"inline-flex items-center gap-1 px-3 py-1.5 bg-yellow-50 text-yellow-700 rounded-lg hover:bg-yellow-100 transition-colors text-sm font-medium disabled:opacity-50",children:o[N.id]?a.jsx("div",{className:"w-4 h-4 border-2 border-yellow-700 border-t-transparent rounded-full animate-spin"}):a.jsxs(a.Fragment,{children:[a.jsx(Xt,{className:"w-4 h-4"}),"Retest"]})}),a.jsxs("button",{onClick:()=>y(N.id),className:"inline-flex items-center gap-1 px-3 py-1.5 bg-red-50 text-red-700 rounded-lg hover:bg-red-100 transition-colors text-sm font-medium",children:[a.jsx(oj,{className:"w-4 h-4"}),"Delete"]})]})]})},N.id))}),e.length===0&&!i&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[a.jsx(ol,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"No proxies configured"}),a.jsx("p",{className:"text-gray-500 mb-6",children:"Add your first proxy to get started with scraping"}),a.jsxs("button",{onClick:()=>s(!0),className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium",children:[a.jsx($l,{className:"w-4 h-4"}),"Add Proxy"]})]})]})]})}function x7({onClose:e,onSuccess:t}){const[r,n]=h.useState("single"),[i,s]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState("http"),[u,f]=h.useState(""),[p,m]=h.useState(""),[x,g]=h.useState(""),[v,b]=h.useState(!1),[j,y]=h.useState(null),w=C=>{if(C=C.trim(),!C||C.startsWith("#"))return null;let D;return D=C.match(/^(https?|socks5):\/\/([^:]+):([^@]+)@([^:]+):(\d+)$/),D?{protocol:D[1],username:D[2],password:D[3],host:D[4],port:parseInt(D[5])}:(D=C.match(/^(https?|socks5):\/\/([^:]+):(\d+)$/),D?{protocol:D[1],host:D[2],port:parseInt(D[3])}:(D=C.match(/^([^:]+):(\d+):([^:]+):(.+)$/),D?{protocol:"http",host:D[1],port:parseInt(D[2]),username:D[3],password:D[4]}:(D=C.match(/^([^:]+):(\d+)$/),D?{protocol:"http",host:D[1],port:parseInt(D[2])}:null)))},S=async()=>{const D=x.split(` -`).map(M=>w(M)).filter(M=>M!==null);if(D.length===0){y({message:"No valid proxies found. Please check the format.",type:"error"});return}b(!0);try{const M=await z.addProxiesBulk(D),I=`Import complete! - -Added: ${M.added} -Duplicates: ${M.duplicates||0} -Failed: ${M.failed} - -Proxies are inactive by default. Use "Test All Proxies" to verify and activate them.`;y({message:I,type:"success"}),t()}catch(M){y({message:"Failed to import proxies: "+M.message,type:"error"})}finally{b(!1)}},N=async C=>{var I;const D=(I=C.target.files)==null?void 0:I[0];if(!D)return;const M=await D.text();g(M)},_=async C=>{if(C.preventDefault(),r==="bulk"){await S();return}b(!0);try{await z.addProxy({host:i,port:parseInt(o),protocol:c,username:u||void 0,password:p||void 0}),t()}catch(D){y({message:"Failed to add proxy: "+D.message,type:"error"})}finally{b(!1)}};return a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200",children:[j&&a.jsx(Vn,{message:j.message,type:j.type,onClose:()=>y(null)}),a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Proxies"}),a.jsxs("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[a.jsx("button",{type:"button",onClick:()=>n("single"),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${r==="single"?"bg-white text-gray-900 shadow-sm":"text-gray-600 hover:text-gray-900"}`,children:"Single"}),a.jsx("button",{type:"button",onClick:()=>n("bulk"),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${r==="bulk"?"bg-white text-gray-900 shadow-sm":"text-gray-600 hover:text-gray-900"}`,children:"Bulk Import"})]})]}),a.jsxs("form",{onSubmit:_,children:[r==="single"?a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Host *"}),a.jsx("input",{type:"text",value:i,onChange:C=>s(C.target.value),required:!0,placeholder:"proxy.example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Port *"}),a.jsx("input",{type:"number",value:o,onChange:C=>l(C.target.value),required:!0,placeholder:"8080",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Protocol *"}),a.jsxs("select",{value:c,onChange:C=>d(C.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"http",children:"HTTP"}),a.jsx("option",{value:"https",children:"HTTPS"}),a.jsx("option",{value:"socks5",children:"SOCKS5"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Username"}),a.jsx("input",{type:"text",value:u,onChange:C=>f(C.target.value),placeholder:"Optional",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Password"}),a.jsx("input",{type:"password",value:p,onChange:C=>m(C.target.value),placeholder:"Optional",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Upload File"}),a.jsxs("label",{className:"flex items-center justify-center w-full px-4 py-6 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer hover:border-blue-500 hover:bg-blue-50 transition-colors",children:[a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx(K6,{className:"w-8 h-8 text-gray-400 mb-2"}),a.jsx("span",{className:"text-sm text-gray-600",children:"Click to upload or drag and drop"}),a.jsx("span",{className:"text-xs text-gray-500 mt-1",children:".txt or .list files"})]}),a.jsx("input",{type:"file",accept:".txt,.list",onChange:N,className:"hidden"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Or Paste Proxies (one per line)"}),a.jsx("textarea",{value:x,onChange:C=>g(C.target.value),placeholder:`Supported formats: -host:port -protocol://host:port -host:port:username:password -protocol://username:password@host:port - -Example: -192.168.1.1:8080 -http://proxy.example.com:3128 -10.0.0.1:8080:user:pass -socks5://user:pass@proxy.example.com:1080`,rows:12,className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 font-mono text-sm"})]}),a.jsxs("div",{className:"p-3 bg-blue-50 border border-blue-200 rounded-lg flex items-start gap-2",children:[a.jsx(ha,{className:"w-5 h-5 text-blue-600 flex-shrink-0 mt-0.5"}),a.jsx("span",{className:"text-sm text-blue-900",children:"Lines starting with # are treated as comments and ignored."})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-6 border-t border-gray-200",children:[a.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 text-gray-700 hover:bg-gray-50 rounded-lg transition-colors font-medium",children:"Cancel"}),a.jsx("button",{type:"submit",disabled:v,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium disabled:opacity-50 disabled:cursor-not-allowed",children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),a.jsx("span",{children:"Processing..."})]}):a.jsxs(a.Fragment,{children:[a.jsx($l,{className:"w-4 h-4"}),r==="bulk"?"Import Proxies":"Add Proxy"]})})]})]})]})]})}function y7(){const[e,t]=h.useState([]),[r,n]=h.useState(!0),[i,s]=h.useState(!0),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(200),[p,m]=h.useState(null),x=h.useRef(null);h.useEffect(()=>{g()},[o,c,u]),h.useEffect(()=>{if(!i)return;const S=setInterval(()=>{g()},2e3);return()=>clearInterval(S)},[i,o,c,u]);const g=async()=>{try{const S=await z.getLogs(u,o,c);t(S.logs)}catch(S){console.error("Failed to load logs:",S)}finally{n(!1)}},v=async()=>{if(confirm("Are you sure you want to clear all logs?"))try{await z.clearLogs(),t([]),m({message:"Logs cleared successfully",type:"success"})}catch(S){m({message:"Failed to clear logs: "+S.message,type:"error"})}},b=()=>{var S;(S=x.current)==null||S.scrollIntoView({behavior:"smooth"})},j=S=>{switch(S){case"error":return"#dc3545";case"warn":return"#ffc107";case"info":return"#17a2b8";case"debug":return"#6c757d";default:return"#333"}},y=S=>{switch(S){case"error":return"#f8d7da";case"warn":return"#fff3cd";case"info":return"#d1ecf1";case"debug":return"#e2e3e5";default:return"#f8f9fa"}},w=S=>{switch(S){case"scraper":return"🔍";case"images":return"📸";case"categories":return"📂";case"system":return"⚙️";case"api":return"🌐";default:return"📝"}};return r?a.jsx(X,{children:a.jsx("div",{children:"Loading logs..."})}):a.jsxs(X,{children:[p&&a.jsx(Vn,{message:p.message,type:p.type,onClose:()=>m(null)}),a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"System Logs"}),a.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[a.jsx("input",{type:"checkbox",checked:i,onChange:S=>s(S.target.checked)}),"Auto-refresh (2s)"]}),a.jsx("button",{onClick:b,style:{padding:"8px 16px",background:"#6c757d",color:"white",border:"none",borderRadius:"6px",cursor:"pointer"},children:"⬇️ Scroll to Bottom"}),a.jsx("button",{onClick:v,style:{padding:"8px 16px",background:"#dc3545",color:"white",border:"none",borderRadius:"6px",cursor:"pointer"},children:"🗑️ Clear Logs"})]})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"20px",display:"flex",gap:"15px",flexWrap:"wrap"},children:[a.jsxs("select",{value:o,onChange:S=>l(S.target.value),style:{padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"",children:"All Levels"}),a.jsx("option",{value:"info",children:"Info"}),a.jsx("option",{value:"warn",children:"Warning"}),a.jsx("option",{value:"error",children:"Error"}),a.jsx("option",{value:"debug",children:"Debug"})]}),a.jsxs("select",{value:c,onChange:S=>d(S.target.value),style:{padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"",children:"All Categories"}),a.jsx("option",{value:"scraper",children:"🔍 Scraper"}),a.jsx("option",{value:"images",children:"📸 Images"}),a.jsx("option",{value:"categories",children:"📂 Categories"}),a.jsx("option",{value:"system",children:"⚙️ System"}),a.jsx("option",{value:"api",children:"🌐 API"})]}),a.jsxs("select",{value:u,onChange:S=>f(parseInt(S.target.value)),style:{padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"50",children:"Last 50"}),a.jsx("option",{value:"100",children:"Last 100"}),a.jsx("option",{value:"200",children:"Last 200"}),a.jsx("option",{value:"500",children:"Last 500"}),a.jsx("option",{value:"1000",children:"Last 1000"})]}),a.jsx("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"10px"},children:a.jsxs("span",{style:{fontSize:"14px",color:"#666"},children:["Showing ",e.length," logs"]})})]}),a.jsxs("div",{style:{background:"#1e1e1e",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",maxHeight:"70vh",overflowY:"auto",fontFamily:"monospace",fontSize:"13px"},children:[e.length===0?a.jsx("div",{style:{color:"#999",textAlign:"center",padding:"40px"},children:"No logs to display"}):e.map((S,N)=>a.jsxs("div",{style:{padding:"8px 12px",marginBottom:"4px",borderRadius:"4px",background:y(S.level),borderLeft:`4px solid ${j(S.level)}`,display:"flex",gap:"10px",alignItems:"flex-start"},children:[a.jsx("span",{style:{color:"#666",fontSize:"11px",whiteSpace:"nowrap"},children:new Date(S.timestamp).toLocaleTimeString()}),a.jsx("span",{style:{fontSize:"14px"},children:w(S.category)}),a.jsx("span",{style:{padding:"2px 6px",borderRadius:"3px",fontSize:"10px",fontWeight:"bold",background:j(S.level),color:"white",textTransform:"uppercase"},children:S.level}),a.jsx("span",{style:{padding:"2px 6px",borderRadius:"3px",fontSize:"10px",background:"#e2e3e5",color:"#333"},children:S.category}),a.jsx("span",{style:{flex:1,color:"#333",wordBreak:"break-word"},children:S.message})]},N)),a.jsx("div",{ref:x})]})]})]})}function v7(){const[e,t]=h.useState([]),[r,n]=h.useState([]),[i,s]=h.useState(null),[o,l]=h.useState([]),[c,d]=h.useState([]),[u,f]=h.useState([]),[p,m]=h.useState(!0),[x,g]=h.useState(!0),[v,b]=h.useState("az-live"),[j,y]=h.useState(null),[w,S]=h.useState(""),[N,_]=h.useState(null),[C,D]=h.useState({scheduledJobs:[],crawlJobs:[],inMemoryScrapers:[],totalActive:0}),[M,I]=h.useState({jobLogs:[],crawlJobs:[]}),[A,R]=h.useState([]),q=async P=>{try{if(P==="az-live"){const[T,O,k,L]=await Promise.all([z.getAZMonitorSummary().catch(()=>null),z.getAZMonitorActiveJobs().catch(()=>({scheduledJobs:[],crawlJobs:[],inMemoryScrapers:[],totalActive:0})),z.getAZMonitorRecentJobs(30).catch(()=>({jobLogs:[],crawlJobs:[]})),z.getAZMonitorErrors({limit:10,hours:24}).catch(()=>({errors:[]}))]);_(T),D(O),I(k),R((L==null?void 0:L.errors)||[])}else if(P==="jobs"){const[T,O,k,L]=await Promise.all([z.getJobStats(),z.getActiveJobs(),z.getWorkerStats(),z.getRecentJobs({limit:50})]);s(T),l(O.jobs||[]),d(k.workers||[]),f(L.jobs||[])}else if(P==="scrapers"){const[T,O]=await Promise.all([z.getActiveScrapers(),z.getScraperHistory()]);t(T.scrapers||[]),n(O.history||[])}}catch(T){console.error("Failed to load scraper data:",T)}finally{m(!1)}};h.useEffect(()=>{q(v)},[v]),h.useEffect(()=>{if(x){const P=setInterval(()=>q(v),3e3);return()=>clearInterval(P)}},[x,v]);const Y=P=>{const T=Math.floor(P/1e3),O=Math.floor(T/60),k=Math.floor(O/60);return k>0?`${k}h ${O%60}m ${T%60}s`:O>0?`${O}m ${T%60}s`:`${T}s`};return a.jsx(X,{children:a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Scraper Monitor"}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:x,onChange:P=>g(P.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),a.jsx("span",{children:"Auto-refresh (3s)"})]})]}),a.jsxs("div",{style:{marginBottom:"30px",display:"flex",gap:"10px",borderBottom:"2px solid #eee"},children:[a.jsxs("button",{onClick:()=>b("az-live"),style:{padding:"12px 24px",background:v==="az-live"?"white":"transparent",border:"none",borderBottom:v==="az-live"?"3px solid #10b981":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:v==="az-live"?"600":"400",color:v==="az-live"?"#10b981":"#666",marginBottom:"-2px"},children:["AZ Live ",C.totalActive>0&&a.jsx("span",{style:{marginLeft:"8px",padding:"2px 8px",background:"#10b981",color:"white",borderRadius:"10px",fontSize:"12px"},children:C.totalActive})]}),a.jsx("button",{onClick:()=>b("jobs"),style:{padding:"12px 24px",background:v==="jobs"?"white":"transparent",border:"none",borderBottom:v==="jobs"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:v==="jobs"?"600":"400",color:v==="jobs"?"#2563eb":"#666",marginBottom:"-2px"},children:"Dispensary Jobs"}),a.jsx("button",{onClick:()=>b("scrapers"),style:{padding:"12px 24px",background:v==="scrapers"?"white":"transparent",border:"none",borderBottom:v==="scrapers"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:v==="scrapers"?"600":"400",color:v==="scrapers"?"#2563eb":"#666",marginBottom:"-2px"},children:"Crawl History"})]}),v==="az-live"&&a.jsxs(a.Fragment,{children:[N&&a.jsx("div",{style:{marginBottom:"30px"},children:a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:"15px"},children:[a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Running Jobs"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:C.totalActive>0?"#10b981":"#666"},children:C.totalActive})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Successful (24h)"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#10b981"},children:(N.successful_jobs_24h||0)+(N.successful_crawls_24h||0)})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Failed (24h)"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:(N.failed_jobs_24h||0)+(N.failed_crawls_24h||0)>0?"#ef4444":"#666"},children:(N.failed_jobs_24h||0)+(N.failed_crawls_24h||0)})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Products (24h)"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#8b5cf6"},children:N.products_found_24h||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Snapshots (24h)"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#06b6d4"},children:N.snapshots_created_24h||0})]})]})}),a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px",display:"flex",alignItems:"center",gap:"10px"},children:["Active Jobs",C.totalActive>0&&a.jsxs("span",{style:{padding:"4px 12px",background:"#d1fae5",color:"#065f46",borderRadius:"12px",fontSize:"14px",fontWeight:"600"},children:[C.totalActive," running"]})]}),C.totalActive===0?a.jsxs("div",{style:{background:"white",padding:"60px 40px",borderRadius:"8px",textAlign:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"48px",marginBottom:"20px"},children:"😴"}),a.jsx("div",{style:{fontSize:"18px",color:"#666"},children:"No jobs currently running"})]}):a.jsxs("div",{style:{display:"grid",gap:"15px"},children:[C.scheduledJobs.map(P=>a.jsx("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:"4px solid #10b981"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"},children:P.job_name}),a.jsx("div",{style:{fontSize:"14px",color:"#666",marginBottom:"12px"},children:P.job_description||"Scheduled job"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(120px, 1fr))",gap:"12px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Processed"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600"},children:P.items_processed||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Succeeded"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#10b981"},children:P.items_succeeded||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Failed"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:P.items_failed>0?"#ef4444":"#666"},children:P.items_failed||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Duration"}),a.jsxs("div",{style:{fontSize:"16px",fontWeight:"600"},children:[Math.floor((P.duration_seconds||0)/60),"m ",Math.floor((P.duration_seconds||0)%60),"s"]})]})]})]}),a.jsx("div",{style:{padding:"6px 12px",borderRadius:"4px",fontSize:"13px",fontWeight:"600",background:"#d1fae5",color:"#065f46"},children:"RUNNING"})]})},`sched-${P.id}`)),C.crawlJobs.length>0&&a.jsxs("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden",marginTop:"15px"},children:[a.jsx("div",{style:{padding:"15px 20px",borderBottom:"2px solid #eee",background:"#f8f8f8"},children:a.jsxs("h3",{style:{margin:0,fontSize:"16px",fontWeight:"600"},children:["Active Crawler Sessions (",C.crawlJobs.length,")"]})}),a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsx("th",{style:{padding:"12px 15px",textAlign:"left",fontWeight:"600",fontSize:"13px",color:"#666"},children:"Store"}),a.jsx("th",{style:{padding:"12px 15px",textAlign:"left",fontWeight:"600",fontSize:"13px",color:"#666"},children:"Worker"}),a.jsx("th",{style:{padding:"12px 15px",textAlign:"center",fontWeight:"600",fontSize:"13px",color:"#666"},children:"Page"}),a.jsx("th",{style:{padding:"12px 15px",textAlign:"right",fontWeight:"600",fontSize:"13px",color:"#666"},children:"Products"}),a.jsx("th",{style:{padding:"12px 15px",textAlign:"right",fontWeight:"600",fontSize:"13px",color:"#666"},children:"Snapshots"}),a.jsx("th",{style:{padding:"12px 15px",textAlign:"right",fontWeight:"600",fontSize:"13px",color:"#666"},children:"Duration"}),a.jsx("th",{style:{padding:"12px 15px",textAlign:"center",fontWeight:"600",fontSize:"13px",color:"#666"},children:"Status"})]})}),a.jsx("tbody",{children:C.crawlJobs.map(P=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"12px 15px"},children:[a.jsx("div",{style:{fontWeight:"600",marginBottom:"2px"},children:P.dispensary_name||"Unknown"}),a.jsxs("div",{style:{fontSize:"12px",color:"#999"},children:[P.city," | ID: ",P.dispensary_id]})]}),a.jsxs("td",{style:{padding:"12px 15px",fontSize:"13px"},children:[a.jsx("div",{style:{fontFamily:"monospace",fontSize:"11px",color:"#666"},children:P.worker_id?P.worker_id.substring(0,8):"-"}),P.worker_hostname&&a.jsx("div",{style:{fontSize:"11px",color:"#999"},children:P.worker_hostname})]}),a.jsx("td",{style:{padding:"12px 15px",textAlign:"center",fontSize:"13px"},children:P.current_page&&P.total_pages?a.jsxs("span",{children:[P.current_page,"/",P.total_pages]}):"-"}),a.jsx("td",{style:{padding:"12px 15px",textAlign:"right",fontWeight:"600",color:"#8b5cf6"},children:P.products_found||0}),a.jsx("td",{style:{padding:"12px 15px",textAlign:"right",fontWeight:"600",color:"#06b6d4"},children:P.snapshots_created||0}),a.jsxs("td",{style:{padding:"12px 15px",textAlign:"right",fontSize:"13px"},children:[Math.floor((P.duration_seconds||0)/60),"m ",Math.floor((P.duration_seconds||0)%60),"s"]}),a.jsx("td",{style:{padding:"12px 15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"11px",fontWeight:"600",background:P.last_heartbeat_at&&Date.now()-new Date(P.last_heartbeat_at).getTime()>6e4?"#fef3c7":"#dbeafe",color:P.last_heartbeat_at&&Date.now()-new Date(P.last_heartbeat_at).getTime()>6e4?"#92400e":"#1e40af"},children:P.last_heartbeat_at&&Date.now()-new Date(P.last_heartbeat_at).getTime()>6e4?"STALE":"CRAWLING"})})]},`crawl-${P.id}`))})]})]})]})]}),(N==null?void 0:N.nextRuns)&&N.nextRuns.length>0&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsx("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:"Next Scheduled Runs"}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Job"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Next Run"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Last Status"})]})}),a.jsx("tbody",{children:N.nextRuns.map(P=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:P.job_name}),a.jsx("div",{style:{fontSize:"13px",color:"#666"},children:P.description})]}),a.jsx("td",{style:{padding:"15px"},children:a.jsx("div",{style:{fontWeight:"600",color:"#2563eb"},children:P.next_run_at?new Date(P.next_run_at).toLocaleString():"-"})}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",background:P.last_status==="success"?"#d1fae5":P.last_status==="error"?"#fee2e2":"#fef3c7",color:P.last_status==="success"?"#065f46":P.last_status==="error"?"#991b1b":"#92400e"},children:P.last_status||"never"})})]},P.id))})]})})]}),A.length>0&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsx("h2",{style:{fontSize:"24px",marginBottom:"20px",color:"#ef4444"},children:"Recent Errors (24h)"}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:A.map((P,T)=>a.jsxs("div",{style:{padding:"15px",borderBottom:Ta.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:P.job_name}),a.jsxs("div",{style:{fontSize:"12px",color:"#999"},children:["Log #",P.id]})]}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",background:P.status==="success"?"#d1fae5":P.status==="running"?"#dbeafe":P.status==="error"?"#fee2e2":"#fef3c7",color:P.status==="success"?"#065f46":P.status==="running"?"#1e40af":P.status==="error"?"#991b1b":"#92400e"},children:P.status})}),a.jsxs("td",{style:{padding:"15px",textAlign:"right"},children:[a.jsx("span",{style:{color:"#10b981"},children:P.items_succeeded||0})," / ",a.jsx("span",{children:P.items_processed||0})]}),a.jsx("td",{style:{padding:"15px",textAlign:"right"},children:P.duration_ms?`${Math.floor(P.duration_ms/6e4)}m ${Math.floor(P.duration_ms%6e4/1e3)}s`:"-"}),a.jsx("td",{style:{padding:"15px",color:"#666"},children:P.completed_at?new Date(P.completed_at).toLocaleString():"-"})]},`log-${P.id}`))})]})})]})]}),v==="jobs"&&a.jsxs(a.Fragment,{children:[i&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsx("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:"Job Statistics"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"15px"},children:[a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Pending"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#f59e0b"},children:i.pending||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"In Progress"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#3b82f6"},children:i.in_progress||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Completed"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#10b981"},children:i.completed||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Failed"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#ef4444"},children:i.failed||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Products Found"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#8b5cf6"},children:i.total_products_found||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Products Saved"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#06b6d4"},children:i.total_products_saved||0})]})]})]}),c.length>0&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Active Workers (",c.length,")"]}),a.jsx("div",{style:{display:"grid",gap:"15px"},children:c.map(P=>a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:"4px solid #10b981"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"12px"},children:["Worker: ",P.worker_id]}),a.jsx("div",{style:{padding:"6px 12px",borderRadius:"4px",fontSize:"13px",fontWeight:"600",background:"#d1fae5",color:"#065f46"},children:"ACTIVE"})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"12px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Active Jobs"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600"},children:P.active_jobs})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Products Found"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#8b5cf6"},children:P.total_products_found||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Products Saved"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#10b981"},children:P.total_products_saved||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Running Since"}),a.jsx("div",{style:{fontSize:"14px"},children:new Date(P.earliest_start).toLocaleTimeString()})]})]})]},P.worker_id))})]}),a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Active Jobs (",o.length,")"]}),o.length===0?a.jsxs("div",{style:{background:"white",padding:"60px 40px",borderRadius:"8px",textAlign:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"48px",marginBottom:"20px"},children:"😴"}),a.jsx("div",{style:{fontSize:"18px",color:"#666"},children:"No jobs currently running"})]}):a.jsx("div",{style:{display:"grid",gap:"15px"},children:o.map(P=>a.jsx("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:"4px solid #3b82f6"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"},children:P.dispensary_name||P.brand_name}),a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"12px"},children:[P.job_type||"crawl"," | Job #",P.id]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"12px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Products Found"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#8b5cf6"},children:P.products_found||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Products Saved"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#10b981"},children:P.products_saved||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Duration"}),a.jsxs("div",{style:{fontSize:"16px",fontWeight:"600"},children:[Math.floor(P.duration_seconds/60),"m ",Math.floor(P.duration_seconds%60),"s"]})]})]})]}),a.jsx("div",{style:{padding:"6px 12px",borderRadius:"4px",fontSize:"13px",fontWeight:"600",background:"#dbeafe",color:"#1e40af"},children:"IN PROGRESS"})]})},P.id))})]}),a.jsxs("div",{children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Recent Jobs (",u.length,")"]}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Dispensary"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Type"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Found"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Saved"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Duration"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Completed"})]})}),a.jsx("tbody",{children:u.map(P=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsx("td",{style:{padding:"15px"},children:P.dispensary_name||P.brand_name}),a.jsx("td",{style:{padding:"15px",fontSize:"14px",color:"#666"},children:P.job_type||"-"}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",background:P.status==="completed"?"#d1fae5":P.status==="in_progress"?"#dbeafe":P.status==="failed"?"#fee2e2":"#fef3c7",color:P.status==="completed"?"#065f46":P.status==="in_progress"?"#1e40af":P.status==="failed"?"#991b1b":"#92400e"},children:P.status})}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:P.products_found||0}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600",color:"#10b981"},children:P.products_saved||0}),a.jsx("td",{style:{padding:"15px",textAlign:"right"},children:P.duration_seconds?`${Math.floor(P.duration_seconds/60)}m ${Math.floor(P.duration_seconds%60)}s`:"-"}),a.jsx("td",{style:{padding:"15px",color:"#666"},children:P.completed_at?new Date(P.completed_at).toLocaleString():"-"})]},P.id))})]})})]})]}),v==="scrapers"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Active Scrapers (",e.length,")"]}),e.length===0?a.jsxs("div",{style:{background:"white",padding:"60px 40px",borderRadius:"8px",textAlign:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"48px",marginBottom:"20px"},children:"🛌"}),a.jsx("div",{style:{fontSize:"18px",color:"#666"},children:"No scrapers currently running"})]}):a.jsx("div",{style:{display:"grid",gap:"15px"},children:e.map(P=>a.jsx("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:`4px solid ${P.status==="running"?P.isStale?"#ff9800":"#2ecc71":P.status==="error"?"#e74c3c":"#95a5a6"}`},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsxs("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"},children:[P.storeName," - ",P.categoryName]}),a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"12px"},children:["ID: ",P.id]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"12px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Requests"}),a.jsxs("div",{style:{fontSize:"16px",fontWeight:"600"},children:[P.stats.requestsSuccess," / ",P.stats.requestsTotal]})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Items Saved"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#2ecc71"},children:P.stats.itemsSaved})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Items Dropped"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#e74c3c"},children:P.stats.itemsDropped})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Errors"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:P.stats.errorsCount>0?"#ff9800":"#999"},children:P.stats.errorsCount})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Duration"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600"},children:Y(P.duration)})]})]}),P.currentActivity&&a.jsxs("div",{style:{marginTop:"12px",padding:"8px 12px",background:"#f8f8f8",borderRadius:"4px",fontSize:"14px",color:"#666"},children:["📍 ",P.currentActivity]}),P.isStale&&a.jsx("div",{style:{marginTop:"12px",padding:"8px 12px",background:"#fff3cd",borderRadius:"4px",fontSize:"14px",color:"#856404"},children:"⚠️ No update in over 1 minute - scraper may be stuck"})]}),a.jsx("div",{style:{padding:"6px 12px",borderRadius:"4px",fontSize:"13px",fontWeight:"600",background:P.status==="running"?"#d4edda":P.status==="error"?"#f8d7da":"#e7e7e7",color:P.status==="running"?"#155724":P.status==="error"?"#721c24":"#666"},children:P.status.toUpperCase()})]})},P.id))})]}),a.jsxs("div",{children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Recent Scrapes (",r.length,")"]}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Dispensary"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Found"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"New"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Updated"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Products"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Last Crawled"})]})}),a.jsx("tbody",{children:r.map((P,T)=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsx("td",{style:{padding:"15px"},children:P.dispensary_name||P.store_name}),a.jsx("td",{style:{padding:"15px"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",background:P.status==="completed"?"#d1fae5":P.status==="failed"?"#fee2e2":"#fef3c7",color:P.status==="completed"?"#065f46":P.status==="failed"?"#991b1b":"#92400e"},children:P.status||"-"})}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:P.products_found||"-"}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600",color:"#059669"},children:P.products_new||0}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600",color:"#2563eb"},children:P.products_updated||0}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:P.product_count}),a.jsx("td",{style:{padding:"15px",color:"#666"},children:P.last_scraped_at?new Date(P.last_scraped_at).toLocaleString():"-"})]},T))})]})})]})]})]})})}function b7(){var Me;const[e,t]=h.useState([]),[r,n]=h.useState([]),[i,s]=h.useState([]),[o,l]=h.useState(!0),[c,d]=h.useState(!0),[u,f]=h.useState("dispensaries"),[p,m]=h.useState(null),[x,g]=h.useState(null),[v,b]=h.useState(null),[j,y]=h.useState(null),[w,S]=h.useState(!1),[N,_]=h.useState("all"),[C,D]=h.useState(""),[M,I]=h.useState("");h.useEffect(()=>{const E=setTimeout(()=>{D(M)},300);return()=>clearTimeout(E)},[M]),h.useEffect(()=>{if(A(),c){const E=setInterval(A,5e3);return()=>clearInterval(E)}},[c,N,C]);const A=async()=>{try{const E={};N==="AZ"&&(E.state="AZ"),C.trim()&&(E.search=C.trim());const[J,Ot,B]=await Promise.all([z.getGlobalSchedule(),z.getDispensarySchedules(Object.keys(E).length>0?E:void 0),z.getDispensaryCrawlJobs(100)]);t(J.schedules||[]),n(Ot.dispensaries||[]),s(B.jobs||[])}catch(E){console.error("Failed to load schedule data:",E)}finally{l(!1)}},R=async E=>{m(E);try{await z.triggerDispensaryCrawl(E),await A()}catch(J){console.error("Failed to trigger crawl:",J)}finally{m(null)}},q=async()=>{if(confirm("This will create crawl jobs for ALL active stores. Continue?"))try{const E=await z.triggerAllCrawls();alert(`Created ${E.jobs_created} crawl jobs`),await A()}catch(E){console.error("Failed to trigger all crawls:",E)}},Y=async E=>{try{await z.cancelCrawlJob(E),await A()}catch(J){console.error("Failed to cancel job:",J)}},P=async E=>{g(E);try{const J=await z.resolvePlatformId(E);J.success?alert(J.message):alert(`Failed: ${J.error||J.message}`),await A()}catch(J){console.error("Failed to resolve platform ID:",J),alert(`Error: ${J.message}`)}finally{g(null)}},T=async E=>{b(E);try{const J=await z.refreshDetection(E);alert(`Detected: ${J.menu_type}${J.platform_dispensary_id?`, Platform ID: ${J.platform_dispensary_id}`:""}`),await A()}catch(J){console.error("Failed to refresh detection:",J),alert(`Error: ${J.message}`)}finally{b(null)}},O=async(E,J)=>{y(E);try{await z.toggleDispensarySchedule(E,!J),await A()}catch(Ot){console.error("Failed to toggle schedule:",Ot),alert(`Error: ${Ot.message}`)}finally{y(null)}},k=async(E,J)=>{try{await z.updateGlobalSchedule(E,J),await A()}catch(Ot){console.error("Failed to update global schedule:",Ot)}},L=E=>{if(!E)return"Never";const J=new Date(E),B=new Date().getTime()-J.getTime(),te=Math.floor(B/6e4),ne=Math.floor(te/60),U=Math.floor(ne/24);return te<1?"Just now":te<60?`${te}m ago`:ne<24?`${ne}h ago`:`${U}d ago`},F=E=>{const J=new Date(E),Ot=new Date,B=J.getTime()-Ot.getTime();if(B<0)return"Overdue";const te=Math.floor(B/6e4),ne=Math.floor(te/60);return te<60?`${te}m`:`${ne}h ${te%60}m`},H=E=>{switch(E){case"completed":case"success":return{bg:"#d1fae5",color:"#065f46"};case"running":return{bg:"#dbeafe",color:"#1e40af"};case"failed":case"error":return{bg:"#fee2e2",color:"#991b1b"};case"cancelled":return{bg:"#f3f4f6",color:"#374151"};case"pending":return{bg:"#fef3c7",color:"#92400e"};case"sandbox_only":return{bg:"#e0e7ff",color:"#3730a3"};case"detection_only":return{bg:"#fce7f3",color:"#9d174d"};default:return{bg:"#f3f4f6",color:"#374151"}}},ee=e.find(E=>E.schedule_type==="global_interval"),re=e.find(E=>E.schedule_type==="daily_special");return a.jsx(X,{children:a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Crawler Schedule"}),a.jsxs("div",{style:{display:"flex",gap:"15px",alignItems:"center"},children:[a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:c,onChange:E=>d(E.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),a.jsx("span",{children:"Auto-refresh (5s)"})]}),a.jsx("button",{onClick:q,style:{padding:"10px 20px",background:"#2563eb",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600"},children:"Crawl All Stores"})]})]}),a.jsxs("div",{style:{marginBottom:"30px",display:"flex",gap:"10px",borderBottom:"2px solid #eee"},children:[a.jsxs("button",{onClick:()=>f("dispensaries"),style:{padding:"12px 24px",background:u==="dispensaries"?"white":"transparent",border:"none",borderBottom:u==="dispensaries"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:u==="dispensaries"?"600":"400",color:u==="dispensaries"?"#2563eb":"#666",marginBottom:"-2px"},children:["Dispensary Schedules (",r.length,")"]}),a.jsxs("button",{onClick:()=>f("jobs"),style:{padding:"12px 24px",background:u==="jobs"?"white":"transparent",border:"none",borderBottom:u==="jobs"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:u==="jobs"?"600":"400",color:u==="jobs"?"#2563eb":"#666",marginBottom:"-2px"},children:["Job Queue (",i.filter(E=>E.status==="pending"||E.status==="running").length,")"]}),a.jsx("button",{onClick:()=>f("global"),style:{padding:"12px 24px",background:u==="global"?"white":"transparent",border:"none",borderBottom:u==="global"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:u==="global"?"600":"400",color:u==="global"?"#2563eb":"#666",marginBottom:"-2px"},children:"Global Settings"})]}),u==="global"&&a.jsxs("div",{style:{display:"grid",gap:"20px"},children:[a.jsxs("div",{style:{background:"white",padding:"24px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start",marginBottom:"20px"},children:[a.jsxs("div",{children:[a.jsx("h2",{style:{fontSize:"20px",margin:0,marginBottom:"8px"},children:"Interval Crawl Schedule"}),a.jsx("p",{style:{color:"#666",margin:0},children:"Crawl all stores periodically"})]}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("span",{style:{color:"#666"},children:"Enabled"}),a.jsx("input",{type:"checkbox",checked:(ee==null?void 0:ee.enabled)??!0,onChange:E=>k("global_interval",{enabled:E.target.checked}),style:{width:"20px",height:"20px",cursor:"pointer"}})]})]}),a.jsx("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[a.jsx("span",{children:"Crawl every"}),a.jsxs("select",{value:(ee==null?void 0:ee.interval_hours)??4,onChange:E=>k("global_interval",{interval_hours:parseInt(E.target.value)}),style:{padding:"8px 12px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"16px"},children:[a.jsx("option",{value:1,children:"1 hour"}),a.jsx("option",{value:2,children:"2 hours"}),a.jsx("option",{value:4,children:"4 hours"}),a.jsx("option",{value:6,children:"6 hours"}),a.jsx("option",{value:8,children:"8 hours"}),a.jsx("option",{value:12,children:"12 hours"}),a.jsx("option",{value:24,children:"24 hours"})]})]})})]}),a.jsxs("div",{style:{background:"white",padding:"24px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start",marginBottom:"20px"},children:[a.jsxs("div",{children:[a.jsx("h2",{style:{fontSize:"20px",margin:0,marginBottom:"8px"},children:"Daily Special Crawl"}),a.jsx("p",{style:{color:"#666",margin:0},children:"Crawl stores at local midnight to capture daily specials"})]}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("span",{style:{color:"#666"},children:"Enabled"}),a.jsx("input",{type:"checkbox",checked:(re==null?void 0:re.enabled)??!0,onChange:E=>k("daily_special",{enabled:E.target.checked}),style:{width:"20px",height:"20px",cursor:"pointer"}})]})]}),a.jsx("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[a.jsx("span",{children:"Run at"}),a.jsx("input",{type:"time",value:((Me=re==null?void 0:re.run_time)==null?void 0:Me.slice(0,5))??"00:01",onChange:E=>k("daily_special",{run_time:E.target.value}),style:{padding:"8px 12px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"16px"}}),a.jsx("span",{style:{color:"#666"},children:"(store local time)"})]})})]})]}),u==="dispensaries"&&a.jsxs("div",{children:[a.jsxs("div",{style:{marginBottom:"15px",display:"flex",gap:"20px",alignItems:"center",flexWrap:"wrap"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.jsx("span",{style:{fontWeight:"500",color:"#374151"},children:"State:"}),a.jsxs("div",{style:{display:"flex",borderRadius:"6px",overflow:"hidden",border:"1px solid #d1d5db"},children:[a.jsx("button",{onClick:()=>_("all"),style:{padding:"6px 14px",background:N==="all"?"#2563eb":"white",color:N==="all"?"white":"#374151",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:"500"},children:"All"}),a.jsx("button",{onClick:()=>_("AZ"),style:{padding:"6px 14px",background:N==="AZ"?"#2563eb":"white",color:N==="AZ"?"white":"#374151",border:"none",borderLeft:"1px solid #d1d5db",cursor:"pointer",fontSize:"14px",fontWeight:"500"},children:"AZ Only"})]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.jsx("span",{style:{fontWeight:"500",color:"#374151"},children:"Search:"}),a.jsx("input",{type:"text",placeholder:"Store name or slug...",value:M,onChange:E=>I(E.target.value),style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid #d1d5db",fontSize:"14px",width:"200px"}}),M&&a.jsx("button",{onClick:()=>{I(""),D("")},style:{padding:"4px 8px",background:"#f3f4f6",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",fontSize:"12px"},children:"Clear"})]}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:w,onChange:E=>S(E.target.checked),style:{width:"16px",height:"16px",cursor:"pointer"}}),a.jsx("span",{children:"Dutchie only"})]}),a.jsxs("span",{style:{color:"#666",fontSize:"14px",marginLeft:"auto"},children:["Showing ",(w?r.filter(E=>E.menu_type==="dutchie"):r).length," dispensaries"]})]}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"auto"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",minWidth:"1200px"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"12px",textAlign:"left",fontWeight:"600"},children:"Dispensary"}),a.jsx("th",{style:{padding:"12px",textAlign:"center",fontWeight:"600"},children:"Menu Type"}),a.jsx("th",{style:{padding:"12px",textAlign:"center",fontWeight:"600"},children:"Platform ID"}),a.jsx("th",{style:{padding:"12px",textAlign:"center",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"12px",textAlign:"left",fontWeight:"600"},children:"Last Run"}),a.jsx("th",{style:{padding:"12px",textAlign:"left",fontWeight:"600"},children:"Next Run"}),a.jsx("th",{style:{padding:"12px",textAlign:"left",fontWeight:"600"},children:"Last Result"}),a.jsx("th",{style:{padding:"12px",textAlign:"center",fontWeight:"600",minWidth:"220px"},children:"Actions"})]})}),a.jsx("tbody",{children:(w?r.filter(E=>E.menu_type==="dutchie"):r).map(E=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"12px"},children:[a.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:E.state&&E.city&&(E.dispensary_slug||E.slug)?a.jsx(Y1,{to:`/dispensaries/${E.state}/${E.city.toLowerCase().replace(/\s+/g,"-")}/${E.dispensary_slug||E.slug}`,style:{fontWeight:"600",color:"#2563eb",textDecoration:"none"},children:E.dispensary_name}):a.jsx("span",{style:{fontWeight:"600"},children:E.dispensary_name})}),a.jsx("div",{style:{fontSize:"12px",color:"#666"},children:E.city?`${E.city}, ${E.state}`:E.state})]}),a.jsx("td",{style:{padding:"12px",textAlign:"center"},children:E.menu_type?a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"11px",fontWeight:"600",background:E.menu_type==="dutchie"?"#d1fae5":"#e0e7ff",color:E.menu_type==="dutchie"?"#065f46":"#3730a3"},children:E.menu_type}):a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"11px",fontWeight:"600",background:"#f3f4f6",color:"#666"},children:"unknown"})}),a.jsx("td",{style:{padding:"12px",textAlign:"center"},children:E.platform_dispensary_id?a.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontSize:"10px",fontFamily:"monospace",background:"#d1fae5",color:"#065f46"},title:E.platform_dispensary_id,children:E.platform_dispensary_id.length>12?`${E.platform_dispensary_id.slice(0,6)}...${E.platform_dispensary_id.slice(-4)}`:E.platform_dispensary_id}):a.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontSize:"10px",background:"#fee2e2",color:"#991b1b"},children:"missing"})}),a.jsx("td",{style:{padding:"12px",textAlign:"center"},children:a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"11px",fontWeight:"600",background:E.can_crawl?"#d1fae5":E.is_active!==!1?"#fef3c7":"#fee2e2",color:E.can_crawl?"#065f46":E.is_active!==!1?"#92400e":"#991b1b"},children:E.can_crawl?"Ready":E.is_active!==!1?"Not Ready":"Disabled"}),E.schedule_status_reason&&E.schedule_status_reason!=="ready"&&a.jsx("span",{style:{fontSize:"10px",color:"#666",maxWidth:"100px",textAlign:"center"},children:E.schedule_status_reason}),E.interval_minutes&&a.jsxs("span",{style:{fontSize:"10px",color:"#999"},children:["Every ",Math.round(E.interval_minutes/60),"h"]})]})}),a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{children:L(E.last_run_at)}),E.last_run_at&&a.jsx("div",{style:{fontSize:"12px",color:"#999"},children:new Date(E.last_run_at).toLocaleString()})]}),a.jsx("td",{style:{padding:"15px"},children:a.jsx("div",{style:{fontWeight:"600",color:"#2563eb"},children:E.next_run_at?F(E.next_run_at):"Not scheduled"})}),a.jsx("td",{style:{padding:"15px"},children:E.last_status||E.latest_job_status?a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px"},children:[a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",...H(E.last_status||E.latest_job_status||"pending")},children:E.last_status||E.latest_job_status}),E.last_error&&a.jsx("button",{onClick:()=>alert(E.last_error),style:{padding:"2px 6px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"10px"},children:"Error"})]}),E.last_summary?a.jsx("div",{style:{fontSize:"12px",color:"#666",maxWidth:"250px"},children:E.last_summary}):E.latest_products_found!==null?a.jsxs("div",{style:{fontSize:"12px",color:"#666"},children:[E.latest_products_found," products"]}):null]}):a.jsx("span",{style:{color:"#999",fontSize:"13px"},children:"No runs yet"})}),a.jsx("td",{style:{padding:"12px",textAlign:"center"},children:a.jsxs("div",{style:{display:"flex",gap:"6px",justifyContent:"center",flexWrap:"wrap"},children:[a.jsx("button",{onClick:()=>T(E.dispensary_id),disabled:v===E.dispensary_id,style:{padding:"4px 8px",background:v===E.dispensary_id?"#94a3b8":"#f3f4f6",color:"#374151",border:"1px solid #d1d5db",borderRadius:"4px",cursor:v===E.dispensary_id?"wait":"pointer",fontSize:"11px"},title:"Re-detect menu type and resolve platform ID",children:v===E.dispensary_id?"...":"Refresh"}),E.menu_type==="dutchie"&&!E.platform_dispensary_id&&a.jsx("button",{onClick:()=>P(E.dispensary_id),disabled:x===E.dispensary_id,style:{padding:"4px 8px",background:x===E.dispensary_id?"#94a3b8":"#fef3c7",color:"#92400e",border:"1px solid #fcd34d",borderRadius:"4px",cursor:x===E.dispensary_id?"wait":"pointer",fontSize:"11px"},title:"Resolve platform dispensary ID via GraphQL",children:x===E.dispensary_id?"...":"Resolve ID"}),a.jsx("button",{onClick:()=>R(E.dispensary_id),disabled:p===E.dispensary_id||!E.can_crawl,style:{padding:"4px 8px",background:p===E.dispensary_id?"#94a3b8":E.can_crawl?"#2563eb":"#e5e7eb",color:E.can_crawl?"white":"#9ca3af",border:"none",borderRadius:"4px",cursor:p===E.dispensary_id||!E.can_crawl?"not-allowed":"pointer",fontSize:"11px"},title:E.can_crawl?"Trigger immediate crawl":`Cannot crawl: ${E.schedule_status_reason}`,children:p===E.dispensary_id?"...":"Run"}),a.jsx("button",{onClick:()=>O(E.dispensary_id,E.is_active),disabled:j===E.dispensary_id,style:{padding:"4px 8px",background:j===E.dispensary_id?"#94a3b8":E.is_active?"#fee2e2":"#d1fae5",color:E.is_active?"#991b1b":"#065f46",border:"none",borderRadius:"4px",cursor:j===E.dispensary_id?"wait":"pointer",fontSize:"11px"},title:E.is_active?"Disable scheduled crawling":"Enable scheduled crawling",children:j===E.dispensary_id?"...":E.is_active?"Disable":"Enable"})]})})]},E.dispensary_id))})]})})]}),u==="jobs"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{marginBottom:"30px"},children:a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"15px"},children:[a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Pending"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#f59e0b"},children:i.filter(E=>E.status==="pending").length})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Running"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#3b82f6"},children:i.filter(E=>E.status==="running").length})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Completed"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#10b981"},children:i.filter(E=>E.status==="completed").length})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Failed"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#ef4444"},children:i.filter(E=>E.status==="failed").length})]})]})}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Dispensary"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Type"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Trigger"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Products"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Started"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Completed"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Actions"})]})}),a.jsx("tbody",{children:i.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:8,style:{padding:"40px",textAlign:"center",color:"#666"},children:"No crawl jobs found"})}):i.map(E=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:E.dispensary_name}),a.jsxs("div",{style:{fontSize:"12px",color:"#999"},children:["Job #",E.id]})]}),a.jsx("td",{style:{padding:"15px",textAlign:"center",fontSize:"13px"},children:E.job_type}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"3px 8px",borderRadius:"4px",fontSize:"12px",background:E.trigger_type==="manual"?"#e0e7ff":E.trigger_type==="daily_special"?"#fce7f3":"#f3f4f6",color:E.trigger_type==="manual"?"#3730a3":E.trigger_type==="daily_special"?"#9d174d":"#374151"},children:E.trigger_type})}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",...H(E.status)},children:E.status})}),a.jsx("td",{style:{padding:"15px",textAlign:"right"},children:E.products_found!==null?a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600"},children:E.products_found}),E.products_new!==null&&E.products_updated!==null&&a.jsxs("div",{style:{fontSize:"12px",color:"#666"},children:["+",E.products_new," / ~",E.products_updated]})]}):"-"}),a.jsx("td",{style:{padding:"15px",fontSize:"13px"},children:E.started_at?new Date(E.started_at).toLocaleString():"-"}),a.jsx("td",{style:{padding:"15px",fontSize:"13px"},children:E.completed_at?new Date(E.completed_at).toLocaleString():"-"}),a.jsxs("td",{style:{padding:"15px",textAlign:"center"},children:[E.status==="pending"&&a.jsx("button",{onClick:()=>Y(E.id),style:{padding:"4px 10px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px"},children:"Cancel"}),E.error_message&&a.jsx("button",{onClick:()=>alert(E.error_message),style:{padding:"4px 10px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px"},children:"View Error"})]})]},E.id))})]})})]})]})})}function j7(){const[e,t]=h.useState([]),[r,n]=h.useState(null),[i,s]=h.useState(3),[o,l]=h.useState("rotate-desktop"),[c,d]=h.useState(!1),[u,f]=h.useState(!1),[p,m]=h.useState(null),[x,g]=h.useState(!0),[v,b]=h.useState(null),[j,y]=h.useState(!1),[w,S]=h.useState(null),[N,_]=h.useState(!1);h.useEffect(()=>{A(),C()},[]);const C=h.useCallback(async()=>{y(!0);try{const P=await fetch("/api/stale-processes/status");if(P.ok){const T=await P.json();b(T)}}catch(P){console.error("Failed to load stale processes:",P)}finally{y(!1)}},[]),D=async P=>{S(P);try{const O=await(await fetch(`/api/stale-processes/kill/${P}`,{method:"POST"})).json();O.success?(m({message:`Process ${P} killed`,type:"success"}),C()):m({message:O.error||"Failed to kill process",type:"error"})}catch(T){m({message:"Failed to kill process: "+T.message,type:"error"})}finally{S(null)}},M=async P=>{try{const O=await(await fetch("/api/stale-processes/kill-pattern",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pattern:P})})).json();O.success?(m({message:`Killed ${O.killed.length} processes matching "${P}"`,type:"success"}),C()):m({message:O.error||"Failed to kill processes",type:"error"})}catch(T){m({message:"Failed to kill processes: "+T.message,type:"error"})}},I=async(P=!1)=>{_(!0);try{const O=await(await fetch("/api/stale-processes/clean-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dryRun:P})})).json();if(O.success){const k=P?`Would kill ${O.totalKilled} processes`:`Killed ${O.totalKilled} processes`;m({message:k,type:"success"}),P||C()}else m({message:O.error||"Failed to clean processes",type:"error"})}catch(T){m({message:"Failed to clean processes: "+T.message,type:"error"})}finally{_(!1)}},A=async()=>{g(!0);try{const T=(await z.getDispensaries()).dispensaries.filter(O=>O.menu_url&&O.scrape_enabled);t(T),T.length>0&&n(T[0].id)}catch(P){console.error("Failed to load dispensaries:",P)}finally{g(!1)}},R=async()=>{if(!(!r||c)){d(!0);try{await z.triggerDispensaryCrawl(r),m({message:"Crawl started for dispensary! Check the Scraper Monitor for progress.",type:"success"})}catch(P){m({message:"Failed to start crawl: "+P.message,type:"error"})}finally{d(!1)}}},q=async()=>{if(!(!r||u)){f(!0);try{m({message:"Image download feature coming soon!",type:"info"})}catch(P){m({message:"Failed to start image download: "+P.message,type:"error"})}finally{f(!1)}}},Y=e.find(P=>P.id===r);return x?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("span",{className:"loading loading-spinner loading-lg"})})}):a.jsxs(X,{children:[p&&a.jsx(Vn,{message:p.message,type:p.type,onClose:()=>m(null)}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold",children:"Scraper Tools"}),a.jsx("p",{className:"text-gray-500 mt-2",children:"Manage crawling operations for dispensaries"})]}),a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body",children:[a.jsx("h2",{className:"card-title",children:"Select Dispensary"}),a.jsx("select",{className:"select select-bordered w-full max-w-md",value:r||"",onChange:P=>n(parseInt(P.target.value)),children:e.map(P=>a.jsxs("option",{value:P.id,children:[P.dba_name||P.name," - ",P.city,", ",P.state]},P.id))}),Y&&a.jsx("div",{className:"mt-4 p-4 bg-base-200 rounded-lg",children:a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500",children:"Status"}),a.jsx("div",{className:"font-semibold",children:Y.scrape_enabled?a.jsx("span",{className:"badge badge-success",children:"Enabled"}):a.jsx("span",{className:"badge badge-error",children:"Disabled"})})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500",children:"Provider"}),a.jsx("div",{className:"font-semibold",children:Y.provider_type||"Unknown"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500",children:"Products"}),a.jsx("div",{className:"font-semibold",children:Y.product_count||0})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500",children:"Last Crawled"}),a.jsx("div",{className:"font-semibold",children:Y.last_crawl_at?new Date(Y.last_crawl_at).toLocaleDateString():"Never"})]})]})})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body",children:[a.jsx("h2",{className:"card-title",children:"Crawl Dispensary"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Start crawling products from the selected dispensary menu"}),a.jsx("div",{className:"card-actions justify-end mt-4",children:a.jsx("button",{onClick:R,disabled:!r||c,className:`btn btn-primary ${c?"loading":""}`,children:c?"Starting...":"Start Crawl"})})]})}),a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body",children:[a.jsx("h2",{className:"card-title",children:"Download Images"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Download missing product images for the selected dispensary"}),a.jsx("div",{className:"card-actions justify-end mt-auto",children:a.jsx("button",{onClick:q,disabled:!r||u,className:`btn btn-secondary ${u?"loading":""}`,children:u?"Downloading...":"Download Missing Images"})})]})})]}),a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"card-title",children:"Stale Process Monitor"}),a.jsx("div",{className:"flex gap-2",children:a.jsx("button",{onClick:()=>C(),disabled:j,className:"btn btn-sm btn-ghost",children:j?a.jsx("span",{className:"loading loading-spinner loading-xs"}):a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})})]}),a.jsx("p",{className:"text-sm text-gray-500",children:"Monitor and clean up stale background processes from Claude Code sessions"}),j&&!v?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsx("span",{className:"loading loading-spinner loading-lg"})}):v?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"stats shadow mt-4",children:a.jsxs("div",{className:"stat",children:[a.jsx("div",{className:"stat-title",children:"Total Processes"}),a.jsx("div",{className:`stat-value ${v.total>0?"text-warning":"text-success"}`,children:v.total}),a.jsxs("div",{className:"stat-desc",children:[v.patterns.length," patterns monitored"]})]})}),Object.entries(v.summary).length>0&&a.jsxs("div",{className:"mt-4",children:[a.jsx("h3",{className:"font-semibold text-sm mb-2",children:"Processes by Pattern"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(v.summary).map(([P,T])=>a.jsxs("div",{className:"badge badge-lg badge-warning gap-2",children:[a.jsx("span",{children:P}),a.jsx("span",{className:"badge badge-sm",children:T}),a.jsx("button",{onClick:()=>M(P),className:"btn btn-xs btn-ghost btn-circle",title:`Kill all "${P}" processes`,children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},P))})]}),v.processes.length>0&&a.jsx("div",{className:"mt-4 overflow-x-auto",children:a.jsxs("table",{className:"table table-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"PID"}),a.jsx("th",{children:"User"}),a.jsx("th",{children:"CPU"}),a.jsx("th",{children:"Mem"}),a.jsx("th",{children:"Elapsed"}),a.jsx("th",{children:"Command"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:v.processes.map(P=>a.jsxs("tr",{className:"hover",children:[a.jsx("td",{className:"font-mono",children:P.pid}),a.jsx("td",{children:P.user}),a.jsxs("td",{children:[P.cpu,"%"]}),a.jsxs("td",{children:[P.mem,"%"]}),a.jsx("td",{className:"font-mono",children:P.elapsed}),a.jsx("td",{className:"max-w-xs truncate",title:P.command,children:P.command}),a.jsx("td",{children:a.jsx("button",{onClick:()=>D(P.pid),disabled:w===P.pid,className:"btn btn-xs btn-error",children:w===P.pid?a.jsx("span",{className:"loading loading-spinner loading-xs"}):"Kill"})})]},P.pid))})]})}),a.jsxs("div",{className:"card-actions justify-end mt-4",children:[a.jsx("button",{onClick:()=>I(!0),disabled:N||v.total===0,className:"btn btn-sm btn-outline",children:"Dry Run"}),a.jsx("button",{onClick:()=>I(!1),disabled:N||v.total===0,className:`btn btn-sm btn-error ${N?"loading":""}`,children:N?"Cleaning...":"Clean All"})]})]}):a.jsx("div",{className:"alert alert-error mt-4",children:a.jsx("span",{children:"Failed to load stale processes"})})]})}),a.jsxs("div",{className:"alert alert-info",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:"stroke-current shrink-0 w-6 h-6",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),a.jsxs("span",{children:["After starting scraper operations, check the"," ",a.jsx("a",{href:"/scraper-monitor",className:"link",children:"Scraper Monitor"})," for real-time progress and ",a.jsx("a",{href:"/logs",className:"link",children:"Logs"})," for detailed output."]})]})]})]})}function w7(){const[e,t]=h.useState([]),[r,n]=h.useState(null),[i,s]=h.useState(!0),[o,l]=h.useState("pending"),[c,d]=h.useState(null);h.useEffect(()=>{u()},[o]);const u=async()=>{s(!0);try{const[g,v]=await Promise.all([z.getChanges(o==="all"?void 0:o),z.getChangeStats()]);t(g.changes),n(v)}catch(g){console.error("Failed to load changes:",g)}finally{s(!1)}},f=async g=>{d(g);try{(await z.approveChange(g)).requires_recrawl&&alert("Change approved! This dispensary requires a menu recrawl."),await u()}catch(v){console.error("Failed to approve change:",v),alert("Failed to approve change. Please try again.")}finally{d(null)}},p=async g=>{const v=prompt("Enter rejection reason (optional):");d(g);try{await z.rejectChange(g,v||void 0),await u()}catch(b){console.error("Failed to reject change:",b),alert("Failed to reject change. Please try again.")}finally{d(null)}},m=g=>({dba_name:"DBA Name",website:"Website",phone:"Phone",email:"Email",google_rating:"Google Rating",google_review_count:"Google Review Count",menu_url:"Menu URL"})[g]||g,x=g=>({high:"bg-green-100 text-green-800",medium:"bg-yellow-100 text-yellow-800",low:"bg-red-100 text-red-800"})[g]||"bg-gray-100 text-gray-800";return i?a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading changes..."})]})}):a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Change Approval"}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Review and approve proposed changes to dispensary data"})]}),a.jsxs("button",{onClick:u,className:"flex items-center gap-2 px-4 py-2 text-sm border border-gray-300 rounded-lg hover:bg-gray-50",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Refresh"]})]}),r&&a.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-yellow-50 rounded-lg",children:a.jsx(xr,{className:"w-5 h-5 text-yellow-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Pending"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.pending_count})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-orange-50 rounded-lg",children:a.jsx(lj,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Needs Recrawl"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.pending_recrawl_count})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(_r,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Approved"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.approved_count})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-red-50 rounded-lg",children:a.jsx(Hr,{className:"w-5 h-5 text-red-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Rejected"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.rejected_count})]})]})})]}),a.jsx("div",{className:"flex gap-2",children:["all","pending","approved","rejected"].map(g=>a.jsx("button",{onClick:()=>l(g),className:`px-4 py-2 text-sm font-medium rounded-lg ${o===g?"bg-blue-600 text-white":"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50"}`,children:g.charAt(0).toUpperCase()+g.slice(1)},g))}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200",children:e.length===0?a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-600",children:"No changes found"})}):a.jsx("div",{className:"divide-y divide-gray-200",children:e.map(g=>a.jsx("div",{className:"p-6",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:g.dispensary_name}),a.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded ${x(g.confidence_score)}`,children:g.confidence_score||"N/A"}),g.requires_recrawl&&a.jsx("span",{className:"px-2 py-1 text-xs font-medium rounded bg-orange-100 text-orange-800",children:"Requires Recrawl"})]}),a.jsxs("p",{className:"text-sm text-gray-600 mb-3",children:[g.city,", ",g.state," • Source: ",g.source]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-medium text-gray-500",children:"Field"}),a.jsx("p",{className:"text-sm text-gray-900",children:m(g.field_name)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-medium text-gray-500",children:"Old Value"}),a.jsx("p",{className:"text-sm text-gray-900",children:g.old_value||a.jsx("em",{className:"text-gray-400",children:"None"})})]}),a.jsxs("div",{className:"col-span-2",children:[a.jsx("label",{className:"text-xs font-medium text-gray-500",children:"New Value"}),a.jsx("p",{className:"text-sm font-medium text-blue-600",children:g.new_value})]}),g.change_notes&&a.jsxs("div",{className:"col-span-2",children:[a.jsx("label",{className:"text-xs font-medium text-gray-500",children:"Notes"}),a.jsx("p",{className:"text-sm text-gray-700",children:g.change_notes})]})]}),a.jsxs("p",{className:"text-xs text-gray-500",children:["Created ",new Date(g.created_at).toLocaleString()]}),g.status==="rejected"&&g.rejection_reason&&a.jsxs("div",{className:"mt-2 p-3 bg-red-50 rounded border border-red-200",children:[a.jsx("p",{className:"text-xs font-medium text-red-800",children:"Rejection Reason:"}),a.jsx("p",{className:"text-sm text-red-700",children:g.rejection_reason})]})]}),a.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[g.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>f(g.id),disabled:c===g.id,className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-lg hover:bg-green-700 disabled:opacity-50",children:[a.jsx(_r,{className:"w-4 h-4"}),"Approve"]}),a.jsxs("button",{onClick:()=>p(g.id),disabled:c===g.id,className:"flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-lg hover:bg-red-700 disabled:opacity-50",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Reject"]})]}),g.status==="approved"&&a.jsxs("span",{className:"flex items-center gap-2 px-4 py-2 bg-green-100 text-green-800 text-sm font-medium rounded-lg",children:[a.jsx(_r,{className:"w-4 h-4"}),"Approved"]}),g.status==="rejected"&&a.jsxs("span",{className:"flex items-center gap-2 px-4 py-2 bg-red-100 text-red-800 text-sm font-medium rounded-lg",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Rejected"]}),a.jsx("a",{href:`/dispensaries/${g.dispensary_slug}`,target:"_blank",rel:"noopener noreferrer",className:"p-2 text-gray-400 hover:text-gray-600",children:a.jsx(Jr,{className:"w-4 h-4"})})]})]})},g.id))})})]})})}function S7(){const[e,t]=h.useState([]),[r,n]=h.useState([]),[i,s]=h.useState(!0),[o,l]=h.useState(!1),[c,d]=h.useState({user_name:"",store_id:"",allowed_ips:"",allowed_domains:""}),[u,f]=h.useState(null);h.useEffect(()=>{m(),p()},[]);const p=async()=>{try{const y=await z.getApiPermissionDispensaries();n(y.dispensaries)}catch(y){console.error("Failed to load dispensaries:",y)}},m=async()=>{s(!0);try{const y=await z.getApiPermissions();t(y.permissions)}catch(y){f({message:"Failed to load API permissions: "+y.message,type:"error"})}finally{s(!1)}},x=async y=>{if(y.preventDefault(),!c.user_name.trim()){f({message:"User name is required",type:"error"});return}if(!c.store_id){f({message:"Store is required",type:"error"});return}try{const w=await z.createApiPermission({...c,store_id:parseInt(c.store_id)});f({message:w.message,type:"success"}),d({user_name:"",store_id:"",allowed_ips:"",allowed_domains:""}),l(!1),m()}catch(w){f({message:"Failed to create permission: "+w.message,type:"error"})}},g=async y=>{try{await z.toggleApiPermission(y),f({message:"Permission status updated",type:"success"}),m()}catch(w){f({message:"Failed to toggle permission: "+w.message,type:"error"})}},v=async y=>{if(confirm("Are you sure you want to delete this API permission?"))try{await z.deleteApiPermission(y),f({message:"Permission deleted successfully",type:"success"}),m()}catch(w){f({message:"Failed to delete permission: "+w.message,type:"error"})}},b=y=>{navigator.clipboard.writeText(y),f({message:"API key copied to clipboard!",type:"success"})},j=y=>{if(!y)return"Never";const w=new Date(y);return w.toLocaleDateString()+" "+w.toLocaleTimeString()};return i?a.jsx(X,{children:a.jsx("div",{className:"p-6",children:a.jsx("div",{className:"text-center text-gray-600",children:"Loading API permissions..."})})}):a.jsx(X,{children:a.jsxs("div",{className:"p-6",children:[u&&a.jsx(Vn,{message:u.message,type:u.type,onClose:()=>f(null)}),a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"API Permissions"}),a.jsx("button",{onClick:()=>l(!o),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:o?"Cancel":"Add New Permission"})]}),a.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:[a.jsx("h3",{className:"font-semibold text-blue-900 mb-2",children:"How it works:"}),a.jsx("p",{className:"text-blue-800 text-sm",children:"Users with valid permissions can access your API without entering tokens. Access is automatically validated based on their IP address and/or domain name."})]}),o&&a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[a.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Add New API User"}),a.jsxs("form",{onSubmit:x,children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"User/Client Name *"}),a.jsx("input",{type:"text",value:c.user_name,onChange:y=>d({...c,user_name:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"e.g., My Website",required:!0}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"A friendly name to identify this API user"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Store *"}),a.jsxs("select",{value:c.store_id,onChange:y=>d({...c,store_id:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:!0,children:[a.jsx("option",{value:"",children:"Select a store..."}),r.map(y=>a.jsx("option",{value:y.id,children:y.name},y.id))]}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"The store this API token can access"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Allowed IP Addresses"}),a.jsx("textarea",{value:c.allowed_ips,onChange:y=>d({...c,allowed_ips:y.target.value}),rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",placeholder:`192.168.1.1 -10.0.0.0/8 -2001:db8::/32`}),a.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:["One IP address or CIDR range per line. Leave empty to allow any IP.",a.jsx("br",{}),"Supports IPv4, IPv6, and CIDR notation (e.g., 192.168.0.0/24)"]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Allowed Domains"}),a.jsx("textarea",{value:c.allowed_domains,onChange:y=>d({...c,allowed_domains:y.target.value}),rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",placeholder:`example.com -*.example.com -subdomain.example.com`}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"One domain per line. Wildcards supported (e.g., *.example.com). Leave empty to allow any domain."})]}),a.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Create API Permission"})]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow-md overflow-hidden",children:[a.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:a.jsx("h2",{className:"text-xl font-semibold",children:"Active API Users"})}),e.length===0?a.jsx("div",{className:"p-6 text-center text-gray-600",children:"No API permissions configured yet. Add your first user above."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"User Name"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Store"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"API Key"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Allowed IPs"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Allowed Domains"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Last Used"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:e.map(y=>a.jsxs("tr",{children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"font-medium text-gray-900",children:y.user_name})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"text-sm text-gray-900",children:y.store_name||a.jsx("span",{className:"text-gray-400 italic",children:"No store"})})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("code",{className:"text-xs bg-gray-100 px-2 py-1 rounded",children:[y.api_key.substring(0,16),"..."]}),a.jsx("button",{onClick:()=>b(y.api_key),className:"text-blue-600 hover:text-blue-800 text-sm",children:"Copy"})]})}),a.jsx("td",{className:"px-6 py-4",children:y.allowed_ips?a.jsxs("div",{className:"text-sm text-gray-600",children:[y.allowed_ips.split(` -`).slice(0,2).join(", "),y.allowed_ips.split(` -`).length>2&&a.jsxs("span",{className:"text-gray-400",children:[" +",y.allowed_ips.split(` -`).length-2," more"]})]}):a.jsx("span",{className:"text-gray-400 italic",children:"Any IP"})}),a.jsx("td",{className:"px-6 py-4",children:y.allowed_domains?a.jsxs("div",{className:"text-sm text-gray-600",children:[y.allowed_domains.split(` -`).slice(0,2).join(", "),y.allowed_domains.split(` -`).length>2&&a.jsxs("span",{className:"text-gray-400",children:[" +",y.allowed_domains.split(` -`).length-2," more"]})]}):a.jsx("span",{className:"text-gray-400 italic",children:"Any domain"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:y.is_active?a.jsx("span",{className:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800",children:"Active"}):a.jsx("span",{className:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800",children:"Disabled"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600",children:j(y.last_used_at)}),a.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm space-x-2",children:[a.jsx("button",{onClick:()=>g(y.id),className:"text-blue-600 hover:text-blue-800",children:y.is_active?"Disable":"Enable"}),a.jsx("button",{onClick:()=>v(y.id),className:"text-red-600 hover:text-red-800",children:"Delete"})]})]},y.id))})]})})]})]})})}function N7(){const[e,t]=h.useState([]),[r,n]=h.useState([]),[i,s]=h.useState(null),[o,l]=h.useState(null),[c,d]=h.useState(!0),[u,f]=h.useState(!0),[p,m]=h.useState("schedules"),[x,g]=h.useState(null),[v,b]=h.useState(!1),[j,y]=h.useState(!1),[w,S]=h.useState(null);h.useEffect(()=>{if(N(),u){const k=setInterval(N,1e4);return()=>clearInterval(k)}},[u]);const N=async()=>{try{const[k,L,F,H]=await Promise.all([z.getDutchieAZSchedules(),z.getDutchieAZRunLogs({limit:50}),z.getDutchieAZSchedulerStatus(),z.getDetectionStats().catch(()=>null)]);t(k.schedules||[]),n(L.logs||[]),s(F),l(H)}catch(k){console.error("Failed to load schedule data:",k)}finally{d(!1)}},_=async()=>{try{i!=null&&i.running?await z.stopDutchieAZScheduler():await z.startDutchieAZScheduler(),await N()}catch(k){console.error("Failed to toggle scheduler:",k)}},C=async()=>{try{await z.initDutchieAZSchedules(),await N()}catch(k){console.error("Failed to initialize schedules:",k)}},D=async k=>{try{await z.triggerDutchieAZSchedule(k),await N()}catch(L){console.error("Failed to trigger schedule:",L)}},M=async k=>{try{await z.updateDutchieAZSchedule(k.id,{enabled:!k.enabled}),await N()}catch(L){console.error("Failed to toggle schedule:",L)}},I=async(k,L)=>{try{const F={description:L.description??void 0,enabled:L.enabled,baseIntervalMinutes:L.baseIntervalMinutes,jitterMinutes:L.jitterMinutes,jobConfig:L.jobConfig??void 0};await z.updateDutchieAZSchedule(k,F),g(null),await N()}catch(F){console.error("Failed to update schedule:",F)}},A=async()=>{if(confirm("Run menu detection on all dispensaries with unknown/missing menu_type?")){y(!0),S(null);try{const k=await z.detectAllDispensaries({state:"AZ",onlyUnknown:!0});S(k),await N()}catch(k){console.error("Failed to run bulk detection:",k)}finally{y(!1)}}},R=async()=>{if(confirm("Resolve platform IDs for all Dutchie dispensaries missing them?")){y(!0),S(null);try{const k=await z.detectAllDispensaries({state:"AZ",onlyMissingPlatformId:!0,onlyUnknown:!1});S(k),await N()}catch(k){console.error("Failed to resolve platform IDs:",k)}finally{y(!1)}}},q=k=>{if(!k)return"Never";const L=new Date(k),H=new Date().getTime()-L.getTime(),ee=Math.floor(H/6e4),re=Math.floor(ee/60),Me=Math.floor(re/24);return ee<1?"Just now":ee<60?`${ee}m ago`:re<24?`${re}h ago`:`${Me}d ago`},Y=k=>{if(!k)return"Not scheduled";const L=new Date(k),F=new Date,H=L.getTime()-F.getTime();if(H<0)return"Overdue";const ee=Math.floor(H/6e4),re=Math.floor(ee/60);return ee<60?`${ee}m`:`${re}h ${ee%60}m`},P=k=>{if(!k)return"-";if(k<1e3)return`${k}ms`;const L=Math.floor(k/1e3),F=Math.floor(L/60);return F<1?`${L}s`:`${F}m ${L%60}s`},T=(k,L)=>{const F=Math.floor(k/60),H=k%60,ee=Math.floor(L/60),re=L%60;let Me=F>0?`${F}h`:"";H>0&&(Me+=`${H}m`);let E=ee>0?`${ee}h`:"";return re>0&&(E+=`${re}m`),`${Me} +/- ${E}`},O=k=>{switch(k){case"success":return{bg:"#d1fae5",color:"#065f46"};case"running":return{bg:"#dbeafe",color:"#1e40af"};case"error":return{bg:"#fee2e2",color:"#991b1b"};case"partial":return{bg:"#fef3c7",color:"#92400e"};default:return{bg:"#f3f4f6",color:"#374151"}}};return a.jsx(X,{children:a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsxs("div",{children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Dutchie AZ Schedule"}),a.jsx("p",{style:{color:"#666",margin:"8px 0 0 0"},children:"Jittered scheduling for Arizona Dutchie product crawls"})]}),a.jsx("div",{style:{display:"flex",gap:"15px",alignItems:"center"},children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:u,onChange:k=>f(k.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),a.jsx("span",{children:"Auto-refresh (10s)"})]})})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"30px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"20px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"14px",color:"#666",marginBottom:"4px"},children:"Scheduler Status"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.jsx("span",{style:{width:"12px",height:"12px",borderRadius:"50%",background:i!=null&&i.running?"#10b981":"#ef4444",display:"inline-block"}}),a.jsx("span",{style:{fontWeight:"600",fontSize:"18px"},children:i!=null&&i.running?"Running":"Stopped"})]})]}),a.jsxs("div",{style:{borderLeft:"1px solid #eee",paddingLeft:"20px"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#666",marginBottom:"4px"},children:"Poll Interval"}),a.jsx("div",{style:{fontWeight:"600"},children:i?`${i.pollIntervalMs/1e3}s`:"-"})]}),a.jsxs("div",{style:{borderLeft:"1px solid #eee",paddingLeft:"20px"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#666",marginBottom:"4px"},children:"Active Schedules"}),a.jsxs("div",{style:{fontWeight:"600"},children:[e.filter(k=>k.enabled).length," / ",e.length]})]})]}),a.jsxs("div",{style:{display:"flex",gap:"10px"},children:[a.jsx("button",{onClick:_,style:{padding:"10px 20px",background:i!=null&&i.running?"#ef4444":"#10b981",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600"},children:i!=null&&i.running?"Stop Scheduler":"Start Scheduler"}),e.length===0&&a.jsx("button",{onClick:C,style:{padding:"10px 20px",background:"#2563eb",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600"},children:"Initialize Default Schedules"})]})]}),a.jsxs("div",{style:{marginBottom:"30px",display:"flex",gap:"10px",borderBottom:"2px solid #eee"},children:[a.jsxs("button",{onClick:()=>m("schedules"),style:{padding:"12px 24px",background:p==="schedules"?"white":"transparent",border:"none",borderBottom:p==="schedules"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:p==="schedules"?"600":"400",color:p==="schedules"?"#2563eb":"#666",marginBottom:"-2px"},children:["Schedule Configs (",e.length,")"]}),a.jsxs("button",{onClick:()=>m("logs"),style:{padding:"12px 24px",background:p==="logs"?"white":"transparent",border:"none",borderBottom:p==="logs"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:p==="logs"?"600":"400",color:p==="logs"?"#2563eb":"#666",marginBottom:"-2px"},children:["Run Logs (",r.length,")"]}),a.jsxs("button",{onClick:()=>m("detection"),style:{padding:"12px 24px",background:p==="detection"?"white":"transparent",border:"none",borderBottom:p==="detection"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:p==="detection"?"600":"400",color:p==="detection"?"#2563eb":"#666",marginBottom:"-2px"},children:["Menu Detection ",o!=null&&o.needsDetection?`(${o.needsDetection} pending)`:""]})]}),p==="schedules"&&a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:e.length===0?a.jsx("div",{style:{padding:"40px",textAlign:"center",color:"#666"},children:'No schedules configured. Click "Initialize Default Schedules" to create the default crawl schedule.'}):a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Job Name"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Enabled"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Interval (Jitter)"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Last Run"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Next Run"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Last Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Actions"})]})}),a.jsx("tbody",{children:e.map(k=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:k.jobName}),k.description&&a.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"4px"},children:k.description}),k.jobConfig&&a.jsxs("div",{style:{fontSize:"11px",color:"#999",marginTop:"4px"},children:["Config: ",JSON.stringify(k.jobConfig)]})]}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("button",{onClick:()=>M(k),style:{padding:"4px 12px",borderRadius:"12px",border:"none",cursor:"pointer",fontWeight:"600",fontSize:"12px",background:k.enabled?"#d1fae5":"#fee2e2",color:k.enabled?"#065f46":"#991b1b"},children:k.enabled?"ON":"OFF"})}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("div",{style:{fontWeight:"600"},children:T(k.baseIntervalMinutes,k.jitterMinutes)})}),a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{children:q(k.lastRunAt)}),k.lastDurationMs&&a.jsxs("div",{style:{fontSize:"12px",color:"#666"},children:["Duration: ",P(k.lastDurationMs)]})]}),a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600",color:"#2563eb"},children:Y(k.nextRunAt)}),k.nextRunAt&&a.jsx("div",{style:{fontSize:"12px",color:"#999"},children:new Date(k.nextRunAt).toLocaleString()})]}),a.jsx("td",{style:{padding:"15px"},children:k.lastStatus?a.jsxs("div",{children:[a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",...O(k.lastStatus)},children:k.lastStatus}),k.lastErrorMessage&&a.jsx("button",{onClick:()=>alert(k.lastErrorMessage),style:{marginLeft:"8px",padding:"2px 6px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"10px"},children:"Error"})]}):a.jsx("span",{style:{color:"#999"},children:"Never run"})}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"center"},children:[a.jsx("button",{onClick:()=>D(k.id),disabled:k.lastStatus==="running",style:{padding:"6px 12px",background:k.lastStatus==="running"?"#94a3b8":"#2563eb",color:"white",border:"none",borderRadius:"4px",cursor:k.lastStatus==="running"?"not-allowed":"pointer",fontSize:"13px"},children:"Run Now"}),a.jsx("button",{onClick:()=>g(k),style:{padding:"6px 12px",background:"#f3f4f6",color:"#374151",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Edit"})]})})]},k.id))})]})}),p==="logs"&&a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:r.length===0?a.jsx("div",{style:{padding:"40px",textAlign:"center",color:"#666"},children:"No run logs yet. Logs will appear here after jobs execute."}):a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Job"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Started"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Duration"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Processed"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Succeeded"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Failed"})]})}),a.jsx("tbody",{children:r.map(k=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:k.job_name}),a.jsxs("div",{style:{fontSize:"12px",color:"#999"},children:["Run #",k.id]})]}),a.jsxs("td",{style:{padding:"15px",textAlign:"center"},children:[a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",...O(k.status)},children:k.status}),k.error_message&&a.jsx("button",{onClick:()=>alert(k.error_message),style:{marginLeft:"8px",padding:"2px 6px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"10px"},children:"Error"})]}),a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{children:k.started_at?new Date(k.started_at).toLocaleString():"-"}),a.jsx("div",{style:{fontSize:"12px",color:"#999"},children:q(k.started_at)})]}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:P(k.duration_ms)}),a.jsx("td",{style:{padding:"15px",textAlign:"right"},children:k.items_processed??"-"}),a.jsx("td",{style:{padding:"15px",textAlign:"right",color:"#10b981"},children:k.items_succeeded??"-"}),a.jsx("td",{style:{padding:"15px",textAlign:"right",color:k.items_failed?"#ef4444":"inherit"},children:k.items_failed??"-"})]},k.id))})]})}),p==="detection"&&a.jsxs("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",padding:"30px"},children:[o&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsx("h3",{style:{margin:"0 0 20px 0"},children:"Detection Statistics"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"20px"},children:[a.jsxs("div",{style:{padding:"20px",background:"#f8f8f8",borderRadius:"8px",textAlign:"center"},children:[a.jsx("div",{style:{fontSize:"32px",fontWeight:"700",color:"#2563eb"},children:o.totalDispensaries}),a.jsx("div",{style:{color:"#666",marginTop:"4px"},children:"Total Dispensaries"})]}),a.jsxs("div",{style:{padding:"20px",background:"#f8f8f8",borderRadius:"8px",textAlign:"center"},children:[a.jsx("div",{style:{fontSize:"32px",fontWeight:"700",color:"#10b981"},children:o.withMenuType}),a.jsx("div",{style:{color:"#666",marginTop:"4px"},children:"With Menu Type"})]}),a.jsxs("div",{style:{padding:"20px",background:"#f8f8f8",borderRadius:"8px",textAlign:"center"},children:[a.jsx("div",{style:{fontSize:"32px",fontWeight:"700",color:"#10b981"},children:o.withPlatformId}),a.jsx("div",{style:{color:"#666",marginTop:"4px"},children:"With Platform ID"})]}),a.jsxs("div",{style:{padding:"20px",background:"#fef3c7",borderRadius:"8px",textAlign:"center"},children:[a.jsx("div",{style:{fontSize:"32px",fontWeight:"700",color:"#92400e"},children:o.needsDetection}),a.jsx("div",{style:{color:"#666",marginTop:"4px"},children:"Needs Detection"})]})]}),Object.keys(o.byProvider).length>0&&a.jsxs("div",{style:{marginTop:"20px"},children:[a.jsx("h4",{style:{margin:"0 0 10px 0"},children:"By Provider"}),a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px"},children:Object.entries(o.byProvider).map(([k,L])=>a.jsxs("span",{style:{padding:"6px 14px",background:k==="dutchie"?"#dbeafe":"#f3f4f6",borderRadius:"16px",fontSize:"14px",fontWeight:"600"},children:[k,": ",L]},k))})]})]}),a.jsxs("div",{style:{marginBottom:"30px",display:"flex",gap:"15px",flexWrap:"wrap"},children:[a.jsx("button",{onClick:A,disabled:j||!(o!=null&&o.needsDetection),style:{padding:"12px 24px",background:j?"#94a3b8":"#2563eb",color:"white",border:"none",borderRadius:"6px",cursor:j?"not-allowed":"pointer",fontWeight:"600",fontSize:"14px"},children:j?"Detecting...":"Detect All Unknown"}),a.jsx("button",{onClick:R,disabled:j,style:{padding:"12px 24px",background:j?"#94a3b8":"#10b981",color:"white",border:"none",borderRadius:"6px",cursor:j?"not-allowed":"pointer",fontWeight:"600",fontSize:"14px"},children:j?"Resolving...":"Resolve Missing Platform IDs"})]}),w&&a.jsxs("div",{style:{marginBottom:"30px",padding:"20px",background:"#f8f8f8",borderRadius:"8px"},children:[a.jsx("h4",{style:{margin:"0 0 15px 0"},children:"Detection Results"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"15px",marginBottom:"15px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600",fontSize:"24px"},children:w.totalProcessed}),a.jsx("div",{style:{color:"#666",fontSize:"13px"},children:"Processed"})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600",fontSize:"24px",color:"#10b981"},children:w.totalSucceeded}),a.jsx("div",{style:{color:"#666",fontSize:"13px"},children:"Succeeded"})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600",fontSize:"24px",color:"#ef4444"},children:w.totalFailed}),a.jsx("div",{style:{color:"#666",fontSize:"13px"},children:"Failed"})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600",fontSize:"24px",color:"#666"},children:w.totalSkipped}),a.jsx("div",{style:{color:"#666",fontSize:"13px"},children:"Skipped"})]})]}),w.errors&&w.errors.length>0&&a.jsxs("div",{style:{marginTop:"15px"},children:[a.jsx("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#991b1b"},children:"Errors:"}),a.jsxs("div",{style:{maxHeight:"150px",overflow:"auto",background:"#fee2e2",padding:"10px",borderRadius:"4px",fontSize:"12px"},children:[w.errors.slice(0,10).map((k,L)=>a.jsx("div",{style:{marginBottom:"4px"},children:k},L)),w.errors.length>10&&a.jsxs("div",{style:{fontStyle:"italic",marginTop:"8px"},children:["...and ",w.errors.length-10," more"]})]})]})]}),a.jsxs("div",{style:{padding:"20px",background:"#f0f9ff",borderRadius:"8px",fontSize:"14px"},children:[a.jsx("h4",{style:{margin:"0 0 10px 0",color:"#1e40af"},children:"About Menu Detection"}),a.jsxs("ul",{style:{margin:0,paddingLeft:"20px",color:"#1e40af"},children:[a.jsxs("li",{style:{marginBottom:"8px"},children:[a.jsx("strong",{children:"Detect All Unknown:"})," Scans dispensaries with no menu_type set and detects the provider (dutchie, treez, jane, etc.) from their menu_url."]}),a.jsxs("li",{style:{marginBottom:"8px"},children:[a.jsx("strong",{children:"Resolve Missing Platform IDs:"}),' For dispensaries already detected as "dutchie", extracts the cName from menu_url and resolves the platform_dispensary_id via GraphQL.']}),a.jsxs("li",{children:[a.jsx("strong",{children:"Automatic scheduling:"}),' A "Menu Detection" job runs daily (24h +/- 1h jitter) to detect new dispensaries.']})]})]})]}),x&&a.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:a.jsxs("div",{style:{background:"white",padding:"30px",borderRadius:"12px",width:"500px",maxWidth:"90vw"},children:[a.jsxs("h2",{style:{margin:"0 0 20px 0"},children:["Edit Schedule: ",x.jobName]}),a.jsxs("div",{style:{marginBottom:"20px"},children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"600"},children:"Description"}),a.jsx("input",{type:"text",value:x.description||"",onChange:k=>g({...x,description:k.target.value}),style:{width:"100%",padding:"10px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"14px"}})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px",marginBottom:"20px"},children:[a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"600"},children:"Base Interval (minutes)"}),a.jsx("input",{type:"number",value:x.baseIntervalMinutes,onChange:k=>g({...x,baseIntervalMinutes:parseInt(k.target.value)||240}),style:{width:"100%",padding:"10px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"14px"}}),a.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"4px"},children:["= ",Math.floor(x.baseIntervalMinutes/60),"h ",x.baseIntervalMinutes%60,"m"]})]}),a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"600"},children:"Jitter (minutes)"}),a.jsx("input",{type:"number",value:x.jitterMinutes,onChange:k=>g({...x,jitterMinutes:parseInt(k.target.value)||30}),style:{width:"100%",padding:"10px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"14px"}}),a.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"4px"},children:["+/- ",x.jitterMinutes,"m random offset"]})]})]}),a.jsxs("div",{style:{fontSize:"13px",color:"#666",marginBottom:"20px",padding:"15px",background:"#f8f8f8",borderRadius:"6px"},children:[a.jsx("strong",{children:"Effective range:"})," ",Math.floor((x.baseIntervalMinutes-x.jitterMinutes)/60),"h ",(x.baseIntervalMinutes-x.jitterMinutes)%60,"m"," to ",Math.floor((x.baseIntervalMinutes+x.jitterMinutes)/60),"h ",(x.baseIntervalMinutes+x.jitterMinutes)%60,"m"]}),a.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[a.jsx("button",{onClick:()=>g(null),style:{padding:"10px 20px",background:"#f3f4f6",color:"#374151",border:"none",borderRadius:"6px",cursor:"pointer"},children:"Cancel"}),a.jsx("button",{onClick:()=>I(x.id,{description:x.description,baseIntervalMinutes:x.baseIntervalMinutes,jitterMinutes:x.jitterMinutes}),style:{padding:"10px 20px",background:"#2563eb",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600"},children:"Save Changes"})]})]})})]})})}function k7(){const e=dt(),[t,r]=h.useState([]),[n,i]=h.useState(0),[s,o]=h.useState(!0),[l,c]=h.useState(null);h.useEffect(()=>{d()},[]);const d=async()=>{o(!0);try{const[u,f]=await Promise.all([z.getDutchieAZStores({limit:200}),z.getDutchieAZDashboard()]);r(u.stores),i(u.total),c(f)}catch(u){console.error("Failed to load data:",u)}finally{o(!1)}};return s?a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading stores..."})]})}):a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Dutchie AZ Stores"}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Arizona dispensaries using the Dutchie platform - data from the new pipeline"})]}),a.jsxs("button",{onClick:d,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Refresh"]})]}),l&&a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(zn,{className:"w-5 h-5 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Dispensaries"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:l.dispensaryCount})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(xt,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Total Products"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:l.productCount.toLocaleString()})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(_r,{className:"w-5 h-5 text-purple-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Brands"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:l.brandCount})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-orange-50 rounded-lg",children:a.jsx(Hr,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Failed Jobs (24h)"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:l.failedJobCount})]})]})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[a.jsx("div",{className:"p-4 border-b border-gray-200",children:a.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:["All Stores (",n,")"]})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"table table-zebra w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Name"}),a.jsx("th",{children:"City"}),a.jsx("th",{children:"Menu Type"}),a.jsx("th",{children:"Platform ID"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Actions"})]})}),a.jsx("tbody",{children:t.map(u=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(zn,{className:"w-4 h-4 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:u.dba_name||u.name}),u.company_name&&u.company_name!==u.name&&a.jsx("p",{className:"text-xs text-gray-500",children:u.company_name})]})]})}),a.jsx("td",{children:a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(yi,{className:"w-4 h-4"}),u.city,", ",u.state]})}),a.jsx("td",{children:u.menu_type?a.jsx("span",{className:`badge badge-sm ${u.menu_type==="dutchie"?"badge-success":u.menu_type==="jane"?"badge-info":u.menu_type==="joint"?"badge-primary":u.menu_type==="treez"?"badge-secondary":u.menu_type==="leafly"?"badge-accent":"badge-ghost"}`,children:u.menu_type}):a.jsx("span",{className:"badge badge-ghost badge-sm",children:"unknown"})}),a.jsx("td",{children:u.platform_dispensary_id?a.jsx("span",{className:"text-xs font-mono text-gray-600",children:u.platform_dispensary_id}):a.jsx("span",{className:"badge badge-warning badge-sm",children:"Not Resolved"})}),a.jsx("td",{children:u.platform_dispensary_id?a.jsx("span",{className:"badge badge-success badge-sm",children:"Ready"}):a.jsx("span",{className:"badge badge-warning badge-sm",children:"Pending"})}),a.jsx("td",{children:a.jsx("button",{onClick:()=>e(`/az/stores/${u.id}`),className:"btn btn-sm btn-primary",disabled:!u.platform_dispensary_id,children:"View Products"})})]},u.id))})]})})]})]})})}function P7(){const{id:e}=Pa(),t=dt(),[r,n]=h.useState(null),[i,s]=h.useState([]),[o,l]=h.useState(!0),[c,d]=h.useState(!1),[u,f]=h.useState("products"),[p,m]=h.useState(!1),[x,g]=h.useState(!1),[v,b]=h.useState(""),[j,y]=h.useState(1),[w,S]=h.useState(0),[N]=h.useState(25),[_,C]=h.useState(""),D=O=>{if(!O)return"Never";const k=new Date(O),F=new Date().getTime()-k.getTime(),H=Math.floor(F/(1e3*60)),ee=Math.floor(F/(1e3*60*60)),re=Math.floor(F/(1e3*60*60*24));return H<1?"Just now":H<60?`${H}m ago`:ee<24?`${ee}h ago`:re===1?"Yesterday":re<7?`${re} days ago`:k.toLocaleDateString()};h.useEffect(()=>{e&&M()},[e]),h.useEffect(()=>{e&&u==="products"&&I()},[e,j,v,_,u]),h.useEffect(()=>{y(1)},[v,_]);const M=async()=>{l(!0);try{const O=await z.getDutchieAZStoreSummary(parseInt(e,10));n(O)}catch(O){console.error("Failed to load store summary:",O)}finally{l(!1)}},I=async()=>{if(e){d(!0);try{const O=await z.getDutchieAZStoreProducts(parseInt(e,10),{search:v||void 0,stockStatus:_||void 0,limit:N,offset:(j-1)*N});s(O.products),S(O.total)}catch(O){console.error("Failed to load products:",O)}finally{d(!1)}}},A=async()=>{m(!1),g(!0);try{await z.triggerDutchieAZCrawl(parseInt(e,10)),alert("Crawl started! Refresh the page in a few minutes to see updated data.")}catch(O){console.error("Failed to trigger crawl:",O),alert("Failed to start crawl. Please try again.")}finally{g(!1)}},R=Math.ceil(w/N);if(o)return a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading store..."})]})});if(!r)return a.jsx(X,{children:a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-600",children:"Store not found"})})});const{dispensary:q,brands:Y,categories:P,lastCrawl:T}=r;return a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("button",{onClick:()=>t("/az"),className:"flex items-center gap-2 text-sm text-gray-600 hover:text-gray-900",children:[a.jsx(Ah,{className:"w-4 h-4"}),"Back to AZ Stores"]}),a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>m(!p),disabled:x,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx(Xt,{className:`w-4 h-4 ${x?"animate-spin":""}`}),x?"Crawling...":"Crawl Now",!x&&a.jsx(nj,{className:"w-4 h-4"})]}),p&&!x&&a.jsx("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 z-10",children:a.jsx("button",{onClick:A,className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg",children:"Start Full Crawl"})})]})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"p-3 bg-blue-50 rounded-lg",children:a.jsx(zn,{className:"w-8 h-8 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:q.dba_name||q.name}),q.company_name&&a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:q.company_name}),a.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Platform ID: ",q.platform_dispensary_id||"Not resolved"]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 bg-gray-50 px-4 py-2 rounded-lg",children:[a.jsx(xr,{className:"w-4 h-4"}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Last Crawl:"}),a.jsx("span",{className:"ml-2",children:T!=null&&T.completed_at?new Date(T.completed_at).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Never"}),(T==null?void 0:T.status)&&a.jsx("span",{className:`ml-2 px-2 py-0.5 rounded text-xs ${T.status==="completed"?"bg-green-100 text-green-800":T.status==="failed"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:T.status})]})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-4",children:[q.address&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(yi,{className:"w-4 h-4"}),a.jsxs("span",{children:[q.address,", ",q.city,", ",q.state," ",q.zip]})]}),q.phone&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(Eh,{className:"w-4 h-4"}),a.jsx("span",{children:q.phone})]}),q.website&&a.jsxs("a",{href:q.website,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800",children:[a.jsx(Jr,{className:"w-4 h-4"}),"Website"]})]})]}),a.jsxs("div",{className:"grid grid-cols-5 gap-4",children:[a.jsx("button",{onClick:()=>{f("products"),C(""),b("")},className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${u==="products"&&!_?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(xt,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Total Products"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.totalProducts})]})]})}),a.jsx("button",{onClick:()=>{f("products"),C("in_stock"),b("")},className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${_==="in_stock"?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-emerald-50 rounded-lg",children:a.jsx(_r,{className:"w-5 h-5 text-emerald-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"In Stock"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.inStockCount})]})]})}),a.jsx("button",{onClick:()=>{f("products"),C("out_of_stock"),b("")},className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${_==="out_of_stock"?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-red-50 rounded-lg",children:a.jsx(Hr,{className:"w-5 h-5 text-red-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Out of Stock"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.outOfStockCount})]})]})}),a.jsx("button",{onClick:()=>f("brands"),className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${u==="brands"?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(Cr,{className:"w-5 h-5 text-purple-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Brands"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.brandCount})]})]})}),a.jsx("button",{onClick:()=>f("categories"),className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${u==="categories"?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-orange-50 rounded-lg",children:a.jsx(ha,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Categories"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.categoryCount})]})]})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[a.jsx("div",{className:"border-b border-gray-200",children:a.jsxs("div",{className:"flex gap-4 px-6",children:[a.jsxs("button",{onClick:()=>{f("products"),C("")},className:`py-4 px-2 text-sm font-medium border-b-2 ${u==="products"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Products (",r.totalProducts,")"]}),a.jsxs("button",{onClick:()=>f("brands"),className:`py-4 px-2 text-sm font-medium border-b-2 ${u==="brands"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Brands (",r.brandCount,")"]}),a.jsxs("button",{onClick:()=>f("categories"),className:`py-4 px-2 text-sm font-medium border-b-2 ${u==="categories"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Categories (",r.categoryCount,")"]})]})}),a.jsxs("div",{className:"p-6",children:[u==="products"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("input",{type:"text",placeholder:"Search products by name or brand...",value:v,onChange:O=>b(O.target.value),className:"input input-bordered input-sm flex-1"}),a.jsxs("select",{value:_,onChange:O=>C(O.target.value),className:"select select-bordered select-sm",children:[a.jsx("option",{value:"",children:"All Stock"}),a.jsx("option",{value:"in_stock",children:"In Stock"}),a.jsx("option",{value:"out_of_stock",children:"Out of Stock"}),a.jsx("option",{value:"unknown",children:"Unknown"})]}),(v||_)&&a.jsx("button",{onClick:()=>{b(""),C("")},className:"btn btn-sm btn-ghost",children:"Clear"}),a.jsxs("div",{className:"text-sm text-gray-600",children:[w," products"]})]}),c?a.jsxs("div",{className:"text-center py-8",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-6 w-6 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading products..."})]}):i.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No products found"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"overflow-x-auto -mx-6 px-6",children:a.jsxs("table",{className:"table table-xs table-zebra table-pin-rows w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Image"}),a.jsx("th",{children:"Product Name"}),a.jsx("th",{children:"Brand"}),a.jsx("th",{children:"Type"}),a.jsx("th",{className:"text-right",children:"Price"}),a.jsx("th",{className:"text-center",children:"THC %"}),a.jsx("th",{className:"text-center",children:"Stock"}),a.jsx("th",{className:"text-center",children:"Qty"}),a.jsx("th",{children:"Last Updated"})]})}),a.jsx("tbody",{children:i.map(O=>a.jsxs("tr",{children:[a.jsx("td",{className:"whitespace-nowrap",children:O.image_url?a.jsx("img",{src:O.image_url,alt:O.name,className:"w-12 h-12 object-cover rounded",onError:k=>k.currentTarget.style.display="none"}):"-"}),a.jsx("td",{className:"font-medium max-w-[200px]",children:a.jsx("div",{className:"line-clamp-2",title:O.name,children:O.name})}),a.jsx("td",{className:"max-w-[120px]",children:a.jsx("div",{className:"line-clamp-2",title:O.brand||"-",children:O.brand||"-"})}),a.jsxs("td",{className:"whitespace-nowrap",children:[a.jsx("span",{className:"badge badge-ghost badge-sm",children:O.type||"-"}),O.subcategory&&a.jsx("span",{className:"badge badge-ghost badge-sm ml-1",children:O.subcategory})]}),a.jsx("td",{className:"text-right font-semibold whitespace-nowrap",children:O.sale_price?a.jsxs("div",{className:"flex flex-col items-end",children:[a.jsxs("span",{className:"text-error",children:["$",O.sale_price]}),a.jsxs("span",{className:"text-gray-400 line-through text-xs",children:["$",O.regular_price]})]}):O.regular_price?`$${O.regular_price}`:"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:O.thc_percentage?a.jsxs("span",{className:"badge badge-success badge-sm",children:[O.thc_percentage,"%"]}):"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:O.stock_status==="in_stock"?a.jsx("span",{className:"badge badge-success badge-sm",children:"In Stock"}):O.stock_status==="out_of_stock"?a.jsx("span",{className:"badge badge-error badge-sm",children:"Out"}):a.jsx("span",{className:"badge badge-warning badge-sm",children:"Unknown"})}),a.jsx("td",{className:"text-center whitespace-nowrap",children:O.total_quantity!=null?O.total_quantity:"-"}),a.jsx("td",{className:"whitespace-nowrap text-xs text-gray-500",children:O.updated_at?D(O.updated_at):"-"})]},O.id))})]})}),R>1&&a.jsxs("div",{className:"flex justify-center items-center gap-2 mt-4",children:[a.jsx("button",{onClick:()=>y(O=>Math.max(1,O-1)),disabled:j===1,className:"btn btn-sm btn-outline",children:"Previous"}),a.jsx("div",{className:"flex gap-1",children:Array.from({length:Math.min(5,R)},(O,k)=>{let L;return R<=5||j<=3?L=k+1:j>=R-2?L=R-4+k:L=j-2+k,a.jsx("button",{onClick:()=>y(L),className:`btn btn-sm ${j===L?"btn-primary":"btn-outline"}`,children:L},L)})}),a.jsx("button",{onClick:()=>y(O=>Math.min(R,O+1)),disabled:j===R,className:"btn btn-sm btn-outline",children:"Next"})]})]})]}),u==="brands"&&a.jsx("div",{className:"space-y-4",children:Y.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No brands found"}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:Y.map(O=>a.jsxs("button",{onClick:()=>{f("products"),b(O.brand_name),C("")},className:"border border-gray-200 rounded-lg p-4 text-center hover:border-blue-300 hover:shadow-md transition-all cursor-pointer",children:[a.jsx("p",{className:"font-medium text-gray-900 line-clamp-2",children:O.brand_name}),a.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:[O.product_count," product",O.product_count!==1?"s":""]})]},O.brand_name))})}),u==="categories"&&a.jsx("div",{className:"space-y-4",children:P.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No categories found"}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:P.map((O,k)=>a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 text-center",children:[a.jsx("p",{className:"font-medium text-gray-900",children:O.type}),O.subcategory&&a.jsx("p",{className:"text-sm text-gray-600",children:O.subcategory}),a.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[O.product_count," product",O.product_count!==1?"s":""]})]},k))})})]})]})]})})}function _7(){const e=dt(),[t,r]=h.useState(null),[n,i]=h.useState([]),[s,o]=h.useState([]),[l,c]=h.useState([]),[d,u]=h.useState(!0),[f,p]=h.useState("overview");h.useEffect(()=>{m()},[]);const m=async()=>{u(!0);try{const[g,v,b,j]=await Promise.all([z.getDutchieAZDashboard(),z.getDutchieAZStores({limit:200}),z.getDutchieAZBrands?z.getDutchieAZBrands({limit:100}):Promise.resolve({brands:[]}),z.getDutchieAZCategories?z.getDutchieAZCategories():Promise.resolve({categories:[]})]);r(g),i(v.stores||[]),o(b.brands||[]),c(j.categories||[])}catch(g){console.error("Failed to load analytics data:",g)}finally{u(!1)}},x=g=>{if(!g)return"Never";const v=new Date(g),j=new Date().getTime()-v.getTime(),y=Math.floor(j/(1e3*60*60)),w=Math.floor(j/(1e3*60*60*24));return y<1?"Just now":y<24?`${y}h ago`:w===1?"Yesterday":w<7?`${w} days ago`:v.toLocaleDateString()};return d?a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading analytics..."})]})}):a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Wholesale & Inventory Analytics"}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Arizona Dutchie dispensaries data overview"})]}),a.jsxs("button",{onClick:m,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Refresh"]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4",children:[a.jsx(Ii,{title:"Dispensaries",value:(t==null?void 0:t.dispensaryCount)||0,icon:a.jsx(zn,{className:"w-5 h-5 text-blue-600"}),color:"blue"}),a.jsx(Ii,{title:"Total Products",value:(t==null?void 0:t.productCount)||0,icon:a.jsx(xt,{className:"w-5 h-5 text-green-600"}),color:"green"}),a.jsx(Ii,{title:"Brands",value:(t==null?void 0:t.brandCount)||0,icon:a.jsx(Cr,{className:"w-5 h-5 text-purple-600"}),color:"purple"}),a.jsx(Ii,{title:"Categories",value:(t==null?void 0:t.categoryCount)||0,icon:a.jsx($x,{className:"w-5 h-5 text-orange-600"}),color:"orange"}),a.jsx(Ii,{title:"Snapshots (24h)",value:(t==null?void 0:t.snapshotCount24h)||0,icon:a.jsx(Qr,{className:"w-5 h-5 text-cyan-600"}),color:"cyan"}),a.jsx(Ii,{title:"Failed Jobs (24h)",value:(t==null?void 0:t.failedJobCount)||0,icon:a.jsx(ha,{className:"w-5 h-5 text-red-600"}),color:"red"}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-600 mb-1",children:[a.jsx(xr,{className:"w-4 h-4"}),a.jsx("span",{className:"text-xs",children:"Last Crawl"})]}),a.jsx("p",{className:"text-sm font-semibold text-gray-900",children:x((t==null?void 0:t.lastCrawlTime)||null)})]})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[a.jsx("div",{className:"border-b border-gray-200",children:a.jsxs("div",{className:"flex gap-4 px-6",children:[a.jsx(Yo,{active:f==="overview",onClick:()=>p("overview"),icon:a.jsx(rj,{className:"w-4 h-4"}),label:"Overview"}),a.jsx(Yo,{active:f==="stores",onClick:()=>p("stores"),icon:a.jsx(zn,{className:"w-4 h-4"}),label:`Stores (${n.length})`}),a.jsx(Yo,{active:f==="brands",onClick:()=>p("brands"),icon:a.jsx(Cr,{className:"w-4 h-4"}),label:`Brands (${s.length})`}),a.jsx(Yo,{active:f==="categories",onClick:()=>p("categories"),icon:a.jsx($x,{className:"w-4 h-4"}),label:`Categories (${l.length})`})]})}),a.jsxs("div",{className:"p-6",children:[f==="overview"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Top Stores by Products"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.slice(0,6).map(g=>a.jsxs("button",{onClick:()=>e(`/az/stores/${g.id}`),className:"flex items-center justify-between p-4 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors text-left",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:g.dba_name||g.name}),a.jsxs("p",{className:"text-sm text-gray-600",children:[g.city,", ",g.state]}),a.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Last crawl: ",x(g.last_crawl_at||null)]})]}),a.jsx(Df,{className:"w-5 h-5 text-gray-400"})]},g.id))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Top Brands"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:s.slice(0,12).map(g=>a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg text-center",children:[a.jsx("p",{className:"font-medium text-gray-900 text-sm line-clamp-2",children:g.brand_name}),a.jsx("p",{className:"text-lg font-bold text-purple-600 mt-1",children:g.product_count}),a.jsx("p",{className:"text-xs text-gray-500",children:"products"})]},g.brand_name))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Product Categories"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:l.slice(0,12).map((g,v)=>a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg text-center",children:[a.jsx("p",{className:"font-medium text-gray-900",children:g.type}),g.subcategory&&a.jsx("p",{className:"text-xs text-gray-600",children:g.subcategory}),a.jsx("p",{className:"text-lg font-bold text-orange-600 mt-1",children:g.product_count}),a.jsx("p",{className:"text-xs text-gray-500",children:"products"})]},v))})]})]}),f==="stores"&&a.jsx("div",{className:"space-y-4",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"table table-sm w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Store Name"}),a.jsx("th",{children:"City"}),a.jsx("th",{className:"text-center",children:"Platform ID"}),a.jsx("th",{className:"text-center",children:"Last Crawl"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.map(g=>a.jsxs("tr",{className:"hover",children:[a.jsx("td",{className:"font-medium",children:g.dba_name||g.name}),a.jsxs("td",{children:[g.city,", ",g.state]}),a.jsx("td",{className:"text-center",children:g.platform_dispensary_id?a.jsx("span",{className:"badge badge-success badge-sm",children:"Resolved"}):a.jsx("span",{className:"badge badge-warning badge-sm",children:"Pending"})}),a.jsx("td",{className:"text-center text-sm text-gray-600",children:x(g.last_crawl_at||null)}),a.jsx("td",{children:a.jsx("button",{onClick:()=>e(`/az/stores/${g.id}`),className:"btn btn-xs btn-ghost",children:"View"})})]},g.id))})]})})}),f==="brands"&&a.jsx("div",{className:"space-y-4",children:s.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No brands found. Run a crawl to populate brand data."}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:s.map(g=>a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 text-center hover:border-purple-300 hover:shadow-md transition-all",children:[a.jsx("p",{className:"font-medium text-gray-900 text-sm line-clamp-2 h-10",children:g.brand_name}),a.jsxs("div",{className:"mt-2 space-y-1",children:[a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Products:"}),a.jsx("span",{className:"font-semibold",children:g.product_count})]}),a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Stores:"}),a.jsx("span",{className:"font-semibold",children:g.dispensary_count})]})]})]},g.brand_name))})}),f==="categories"&&a.jsx("div",{className:"space-y-4",children:l.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No categories found. Run a crawl to populate category data."}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:l.map((g,v)=>a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:border-orange-300 hover:shadow-md transition-all",children:[a.jsx("p",{className:"font-medium text-gray-900",children:g.type}),g.subcategory&&a.jsx("p",{className:"text-sm text-gray-600",children:g.subcategory}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[a.jsxs("div",{className:"bg-gray-50 rounded p-2 text-center",children:[a.jsx("p",{className:"font-bold text-lg text-orange-600",children:g.product_count}),a.jsx("p",{className:"text-gray-500",children:"products"})]}),a.jsxs("div",{className:"bg-gray-50 rounded p-2 text-center",children:[a.jsx("p",{className:"font-bold text-lg text-blue-600",children:g.brand_count}),a.jsx("p",{className:"text-gray-500",children:"brands"})]})]}),g.avg_thc!=null&&a.jsxs("p",{className:"text-xs text-gray-500 mt-2 text-center",children:["Avg THC: ",g.avg_thc.toFixed(1),"%"]})]},v))})})]})]})]})})}function Ii({title:e,value:t,icon:r,color:n}){const i={blue:"bg-blue-50",green:"bg-green-50",purple:"bg-purple-50",orange:"bg-orange-50",cyan:"bg-cyan-50",red:"bg-red-50"};return a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`p-2 ${i[n]||"bg-gray-50"} rounded-lg`,children:r}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-600",children:e}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:t.toLocaleString()})]})]})})}function Yo({active:e,onClick:t,icon:r,label:n}){return a.jsxs("button",{onClick:t,className:`flex items-center gap-2 py-4 px-2 text-sm font-medium border-b-2 transition-colors ${e?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:[r,n]})}function C7(){const{user:e}=Hc(),[t,r]=h.useState([]),[n,i]=h.useState(!0),[s,o]=h.useState(null),[l,c]=h.useState(!1),[d,u]=h.useState(null),[f,p]=h.useState({email:"",password:"",role:"viewer"}),[m,x]=h.useState(null),[g,v]=h.useState(!1),b=async()=>{try{i(!0);const D=await z.getUsers();r(D.users),o(null)}catch(D){o(D.message||"Failed to fetch users")}finally{i(!1)}};h.useEffect(()=>{b()},[]);const j=async()=>{if(!f.email||!f.password){x("Email and password are required");return}try{v(!0),x(null),await z.createUser(f),c(!1),p({email:"",password:"",role:"viewer"}),b()}catch(D){x(D.message||"Failed to create user")}finally{v(!1)}},y=async()=>{if(!d)return;const D={};if(f.email&&f.email!==d.email&&(D.email=f.email),f.password&&(D.password=f.password),f.role&&f.role!==d.role&&(D.role=f.role),Object.keys(D).length===0){u(null);return}try{v(!0),x(null),await z.updateUser(d.id,D),u(null),p({email:"",password:"",role:"viewer"}),b()}catch(M){x(M.message||"Failed to update user")}finally{v(!1)}},w=async D=>{if(confirm(`Are you sure you want to delete ${D.email}?`))try{await z.deleteUser(D.id),b()}catch(M){alert(M.message||"Failed to delete user")}},S=D=>{u(D),p({email:D.email,password:"",role:D.role}),x(null)},N=()=>{c(!1),u(null),p({email:"",password:"",role:"viewer"}),x(null)},_=D=>{switch(D){case"superadmin":return"bg-purple-100 text-purple-800";case"admin":return"bg-blue-100 text-blue-800";case"analyst":return"bg-green-100 text-green-800";case"viewer":return"bg-gray-100 text-gray-700";default:return"bg-gray-100 text-gray-700"}},C=D=>!((e==null?void 0:e.id)===D.id||D.role==="superadmin"&&(e==null?void 0:e.role)!=="superadmin");return a.jsxs(X,{children:[a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(cj,{className:"w-8 h-8 text-blue-600"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"User Management"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Manage system users and their roles"})]})]}),a.jsxs("button",{onClick:()=>{c(!0),x(null)},className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[a.jsx($l,{className:"w-4 h-4"}),"Add User"]})]}),s&&a.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 flex items-center gap-3",children:[a.jsx(ha,{className:"w-5 h-5 text-red-500"}),a.jsx("p",{className:"text-red-700",children:s})]}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:n?a.jsxs("div",{className:"p-8 text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto"}),a.jsx("p",{className:"mt-2 text-gray-500",children:"Loading users..."})]}):t.length===0?a.jsx("div",{className:"p-8 text-center text-gray-500",children:"No users found"}):a.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Email"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Role"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Created"}),a.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:t.map(D=>a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"flex-shrink-0 h-8 w-8 rounded-full bg-gray-200 flex items-center justify-center",children:a.jsx("span",{className:"text-sm font-medium text-gray-600",children:D.email.charAt(0).toUpperCase()})}),a.jsxs("div",{className:"ml-3",children:[a.jsx("p",{className:"text-sm font-medium text-gray-900",children:D.email}),(e==null?void 0:e.id)===D.id&&a.jsx("p",{className:"text-xs text-gray-500",children:"(you)"})]})]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${_(D.role)}`,children:D.role})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:new Date(D.created_at).toLocaleDateString()}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:C(D)?a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:()=>S(D),className:"p-1.5 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors",title:"Edit user",children:a.jsx(aj,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>w(D),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors",title:"Delete user",children:a.jsx(oj,{className:"w-4 h-4"})})]}):a.jsx("span",{className:"text-xs text-gray-400",children:"—"})})]},D.id))})]})}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-3",children:"Role Permissions"}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${_("superadmin")}`,children:"superadmin"}),a.jsx("p",{className:"mt-1 text-gray-500",children:"Full system access"})]}),a.jsxs("div",{children:[a.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${_("admin")}`,children:"admin"}),a.jsx("p",{className:"mt-1 text-gray-500",children:"Manage users & settings"})]}),a.jsxs("div",{children:[a.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${_("analyst")}`,children:"analyst"}),a.jsx("p",{className:"mt-1 text-gray-500",children:"View & analyze data"})]}),a.jsxs("div",{children:[a.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${_("viewer")}`,children:"viewer"}),a.jsx("p",{className:"mt-1 text-gray-500",children:"Read-only access"})]})]})]})]}),(l||d)&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-md mx-4",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[a.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:d?"Edit User":"Create New User"}),a.jsx("button",{onClick:N,className:"p-1 text-gray-400 hover:text-gray-600 rounded",children:a.jsx(Dh,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"px-6 py-4 space-y-4",children:[m&&a.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 flex items-center gap-2",children:[a.jsx(ha,{className:"w-4 h-4 text-red-500"}),a.jsx("p",{className:"text-sm text-red-700",children:m})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),a.jsx("input",{type:"email",value:f.email,onChange:D=>p({...f,email:D.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"user@example.com"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Password ",d&&a.jsx("span",{className:"text-gray-400 font-normal",children:"(leave blank to keep current)"})]}),a.jsx("input",{type:"password",value:f.password,onChange:D=>p({...f,password:D.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:d?"••••••••":"Enter password"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Role"}),a.jsxs("select",{value:f.role,onChange:D=>p({...f,role:D.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"viewer",children:"Viewer"}),a.jsx("option",{value:"analyst",children:"Analyst"}),a.jsx("option",{value:"admin",children:"Admin"}),(e==null?void 0:e.role)==="superadmin"&&a.jsx("option",{value:"superadmin",children:"Superadmin"})]})]})]}),a.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-gray-200 bg-gray-50",children:[a.jsx("button",{onClick:N,className:"px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors",disabled:g,children:"Cancel"}),a.jsx("button",{onClick:d?y:j,disabled:g,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50",children:g?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),"Saving..."]}):a.jsxs(a.Fragment,{children:[a.jsx(GA,{className:"w-4 h-4"}),d?"Update":"Create"]})})]})]})})]})}function ge({children:e}){const{isAuthenticated:t,checkAuth:r}=Hc();return h.useEffect(()=>{r()},[]),t?a.jsx(a.Fragment,{children:e}):a.jsx(Cf,{to:"/login",replace:!0})}function A7(){return a.jsx(iA,{children:a.jsxs(GC,{children:[a.jsx(oe,{path:"/login",element:a.jsx(J6,{})}),a.jsx(oe,{path:"/",element:a.jsx(Cf,{to:"/login",replace:!0})}),a.jsx(oe,{path:"/dashboard",element:a.jsx(ge,{children:a.jsx(e7,{})})}),a.jsx(oe,{path:"/products",element:a.jsx(ge,{children:a.jsx(t7,{})})}),a.jsx(oe,{path:"/products/:id",element:a.jsx(ge,{children:a.jsx(n7,{})})}),a.jsx(oe,{path:"/stores",element:a.jsx(ge,{children:a.jsx(i7,{})})}),a.jsx(oe,{path:"/dispensaries",element:a.jsx(ge,{children:a.jsx(a7,{})})}),a.jsx(oe,{path:"/dispensaries/:state/:city/:slug",element:a.jsx(ge,{children:a.jsx(s7,{})})}),a.jsx(oe,{path:"/stores/:state/:storeName/:slug/brands",element:a.jsx(ge,{children:a.jsx(l7,{})})}),a.jsx(oe,{path:"/stores/:state/:storeName/:slug/specials",element:a.jsx(ge,{children:a.jsx(c7,{})})}),a.jsx(oe,{path:"/stores/:state/:storeName/:slug",element:a.jsx(ge,{children:a.jsx(o7,{})})}),a.jsx(oe,{path:"/categories",element:a.jsx(ge,{children:a.jsx(u7,{})})}),a.jsx(oe,{path:"/campaigns",element:a.jsx(ge,{children:a.jsx(d7,{})})}),a.jsx(oe,{path:"/analytics",element:a.jsx(ge,{children:a.jsx(p7,{})})}),a.jsx(oe,{path:"/settings",element:a.jsx(ge,{children:a.jsx(h7,{})})}),a.jsx(oe,{path:"/changes",element:a.jsx(ge,{children:a.jsx(w7,{})})}),a.jsx(oe,{path:"/proxies",element:a.jsx(ge,{children:a.jsx(g7,{})})}),a.jsx(oe,{path:"/logs",element:a.jsx(ge,{children:a.jsx(y7,{})})}),a.jsx(oe,{path:"/scraper-tools",element:a.jsx(ge,{children:a.jsx(j7,{})})}),a.jsx(oe,{path:"/scraper-monitor",element:a.jsx(ge,{children:a.jsx(v7,{})})}),a.jsx(oe,{path:"/scraper-schedule",element:a.jsx(ge,{children:a.jsx(b7,{})})}),a.jsx(oe,{path:"/az-schedule",element:a.jsx(ge,{children:a.jsx(N7,{})})}),a.jsx(oe,{path:"/az",element:a.jsx(ge,{children:a.jsx(k7,{})})}),a.jsx(oe,{path:"/az/stores/:id",element:a.jsx(ge,{children:a.jsx(P7,{})})}),a.jsx(oe,{path:"/api-permissions",element:a.jsx(ge,{children:a.jsx(S7,{})})}),a.jsx(oe,{path:"/wholesale-analytics",element:a.jsx(ge,{children:a.jsx(_7,{})})}),a.jsx(oe,{path:"/users",element:a.jsx(ge,{children:a.jsx(C7,{})})}),a.jsx(oe,{path:"*",element:a.jsx(Cf,{to:"/dashboard",replace:!0})})]})})}Td.createRoot(document.getElementById("root")).render(a.jsx(hs.StrictMode,{children:a.jsx(A7,{})})); diff --git a/cannaiq/dist/index.html b/cannaiq/dist/index.html index 76714a96..8602d1d1 100644 --- a/cannaiq/dist/index.html +++ b/cannaiq/dist/index.html @@ -7,8 +7,8 @@ CannaIQ - Cannabis Menu Intelligence Platform - - + +