diff --git a/.circleci/config.yml b/.circleci/config.yml index 0d778d5f279..06ceebcc5b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -839,6 +839,52 @@ jobs: paths: - guardrails_coverage.xml - guardrails_coverage + + google_generate_content_endpoint_testing: + docker: + - image: cimg/python:3.11 + auth: + username: ${DOCKERHUB_USERNAME} + password: ${DOCKERHUB_PASSWORD} + working_directory: ~/project + + steps: + - checkout + - setup_google_dns + - run: + name: Install Dependencies + command: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + pip install "pytest==7.3.1" + pip install "pytest-retry==1.6.3" + pip install "pytest-cov==5.0.0" + pip install "pytest-asyncio==0.21.1" + pip install "respx==0.22.0" + pip install "pydantic==2.10.2" + # Run pytest and generate JUnit XML report + - run: + name: Run tests + command: | + pwd + ls + python -m pytest -vv tests/unified_google_tests --cov=litellm --cov-report=xml -x -s -v --junitxml=test-results/junit.xml --durations=5 + no_output_timeout: 120m + - run: + name: Rename the coverage files + command: | + mv coverage.xml google_generate_content_endpoint_coverage.xml + mv .coverage google_generate_content_endpoint_coverage + + # Store test results + - store_test_results: + path: test-results + - persist_to_workspace: + root: . + paths: + - google_generate_content_endpoint_coverage.xml + - google_generate_content_endpoint_coverage + llm_responses_api_testing: docker: - image: cimg/python:3.11 @@ -925,6 +971,7 @@ jobs: command: | pwd ls + prisma generate python -m pytest -vv tests/enterprise --cov=litellm --cov-report=xml -x -s -v --junitxml=test-results/junit-enterprise.xml --durations=10 -n 8 no_output_timeout: 120m - run: @@ -1333,7 +1380,6 @@ jobs: - run: python ./tests/code_coverage_tests/recursive_detector.py - run: python ./tests/code_coverage_tests/test_router_strategy_async.py - run: python ./tests/code_coverage_tests/litellm_logging_code_coverage.py - - run: python ./tests/code_coverage_tests/bedrock_pricing.py - run: python ./tests/documentation_tests/test_env_keys.py - run: python ./tests/documentation_tests/test_router_settings.py - run: python ./tests/documentation_tests/test_api_docs.py @@ -1342,6 +1388,7 @@ jobs: - run: python ./tests/documentation_tests/test_circular_imports.py - run: python ./tests/code_coverage_tests/prevent_key_leaks_in_exceptions.py - run: python ./tests/code_coverage_tests/check_unsafe_enterprise_import.py + - run: python ./tests/code_coverage_tests/ban_copy_deepcopy_kwargs.py - run: helm lint ./deploy/charts/litellm-helm db_migration_disable_update_check: @@ -1475,6 +1522,25 @@ jobs: pip install "asyncio==3.4.3" pip install "PyGithub==1.59.1" pip install "openai==1.81.0" + - run: + name: Install dockerize + command: | + wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz + sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz + rm dockerize-linux-amd64-v0.6.1.tar.gz + - run: + name: Start PostgreSQL Database + command: | + docker run -d \ + --name postgres-db \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=circle_test \ + -p 5432:5432 \ + postgres:14 + - run: + name: Wait for PostgreSQL to be ready + command: dockerize -wait tcp://localhost:5432 -timeout 1m - run: name: Install Grype command: | @@ -1485,13 +1551,13 @@ jobs: # Build and scan Dockerfile.database echo "Building and scanning Dockerfile.database..." docker build -t litellm-database:latest -f ./docker/Dockerfile.database . - grype litellm-database:latest --fail-on high + grype litellm-database:latest --fail-on critical # Build and scan main Dockerfile echo "Building and scanning main Dockerfile..." docker build -t litellm:latest . - grype litellm:latest --fail-on high + grype litellm:latest --fail-on critical - run: name: Build Docker image command: docker build -t my-app:latest -f ./docker/Dockerfile.database . @@ -1500,7 +1566,7 @@ jobs: command: | docker run -d \ -p 4000:4000 \ - -e DATABASE_URL=$PROXY_DATABASE_URL \ + -e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/circle_test \ -e USE_PRISMA_MIGRATE=True \ -e AZURE_API_KEY=$AZURE_API_KEY \ -e REDIS_HOST=$REDIS_HOST \ @@ -1525,6 +1591,7 @@ jobs: -e LANGFUSE_PROJECT2_PUBLIC=$LANGFUSE_PROJECT2_PUBLIC \ -e LANGFUSE_PROJECT1_SECRET=$LANGFUSE_PROJECT1_SECRET \ -e LANGFUSE_PROJECT2_SECRET=$LANGFUSE_PROJECT2_SECRET \ + --add-host host.docker.internal:host-gateway \ --name my-app \ -v $(pwd)/proxy_server_config.yaml:/app/config.yaml \ my-app:latest \ @@ -1532,13 +1599,10 @@ jobs: --port 4000 \ --detailed_debug \ - run: - name: Install curl and dockerize + name: Install curl command: | sudo apt-get update sudo apt-get install -y curl - sudo wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz - sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz - sudo rm dockerize-linux-amd64-v0.6.1.tar.gz - run: name: Start outputting logs command: docker logs -f my-app @@ -1616,6 +1680,25 @@ jobs: pip install "PyGithub==1.59.1" pip install "openai==1.81.0" # Run pytest and generate JUnit XML report + - run: + name: Install dockerize + command: | + wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz + sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz + rm dockerize-linux-amd64-v0.6.1.tar.gz + - run: + name: Start PostgreSQL Database + command: | + docker run -d \ + --name postgres-db \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=circle_test \ + -p 5432:5432 \ + postgres:14 + - run: + name: Wait for PostgreSQL to be ready + command: dockerize -wait tcp://localhost:5432 -timeout 1m - run: name: Build Docker image command: docker build -t my-app:latest -f ./docker/Dockerfile.database . @@ -1624,7 +1707,7 @@ jobs: command: | docker run -d \ -p 4000:4000 \ - -e DATABASE_URL=$PROXY_DATABASE_URL \ + -e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/circle_test \ -e AZURE_API_KEY=$AZURE_BATCHES_API_KEY \ -e AZURE_API_BASE=$AZURE_BATCHES_API_BASE \ -e AZURE_API_VERSION="2024-05-01-preview" \ @@ -1650,6 +1733,7 @@ jobs: -e LANGFUSE_PROJECT2_PUBLIC=$LANGFUSE_PROJECT2_PUBLIC \ -e LANGFUSE_PROJECT1_SECRET=$LANGFUSE_PROJECT1_SECRET \ -e LANGFUSE_PROJECT2_SECRET=$LANGFUSE_PROJECT2_SECRET \ + --add-host host.docker.internal:host-gateway \ --name my-app \ -v $(pwd)/litellm/proxy/example_config_yaml/oai_misc_config.yaml:/app/config.yaml \ my-app:latest \ @@ -1657,13 +1741,10 @@ jobs: --port 4000 \ --detailed_debug \ - run: - name: Install curl and dockerize + name: Install curl command: | sudo apt-get update sudo apt-get install -y curl - sudo wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz - sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz - sudo rm dockerize-linux-amd64-v0.6.1.tar.gz - run: name: Start outputting logs command: docker logs -f my-app @@ -1738,6 +1819,25 @@ jobs: pip install "asyncio==3.4.3" pip install "PyGithub==1.59.1" pip install "openai==1.81.0" + - run: + name: Install dockerize + command: | + wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz + sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz + rm dockerize-linux-amd64-v0.6.1.tar.gz + - run: + name: Start PostgreSQL Database + command: | + docker run -d \ + --name postgres-db \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=circle_test \ + -p 5432:5432 \ + postgres:14 + - run: + name: Wait for PostgreSQL to be ready + command: dockerize -wait tcp://localhost:5432 -timeout 1m - run: name: Build Docker image command: docker build -t my-app:latest -f ./docker/Dockerfile.database . @@ -1748,7 +1848,7 @@ jobs: command: | docker run -d \ -p 4000:4000 \ - -e DATABASE_URL=$PROXY_DATABASE_URL \ + -e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/circle_test \ -e REDIS_HOST=$REDIS_HOST \ -e REDIS_PASSWORD=$REDIS_PASSWORD \ -e REDIS_PORT=$REDIS_PORT \ @@ -1768,6 +1868,7 @@ jobs: -e APORIA_API_KEY_1=$APORIA_API_KEY_1 \ -e COHERE_API_KEY=$COHERE_API_KEY \ -e GCS_FLUSH_INTERVAL="1" \ + --add-host host.docker.internal:host-gateway \ --name my-app \ -v $(pwd)/litellm/proxy/example_config_yaml/otel_test_config.yaml:/app/config.yaml \ -v $(pwd)/litellm/proxy/example_config_yaml/custom_guardrail.py:/app/custom_guardrail.py \ @@ -1812,13 +1913,14 @@ jobs: command: | docker run -d \ -p 4000:4000 \ - -e DATABASE_URL=$PROXY_DATABASE_URL \ + -e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/circle_test \ -e REDIS_HOST=$REDIS_HOST \ -e REDIS_PASSWORD=$REDIS_PASSWORD \ -e REDIS_PORT=$REDIS_PORT \ -e LITELLM_MASTER_KEY="sk-1234" \ -e OPENAI_API_KEY=$OPENAI_API_KEY \ -e LITELLM_LICENSE="bad-license" \ + --add-host host.docker.internal:host-gateway \ --name my-app-3 \ -v $(pwd)/litellm/proxy/example_config_yaml/enterprise_config.yaml:/app/config.yaml \ my-app:latest \ @@ -1876,6 +1978,25 @@ jobs: pip install aiohttp python -m pip install --upgrade pip python -m pip install -r requirements.txt + - run: + name: Install dockerize + command: | + wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz + sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz + rm dockerize-linux-amd64-v0.6.1.tar.gz + - run: + name: Start PostgreSQL Database + command: | + docker run -d \ + --name postgres-db \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=circle_test \ + -p 5432:5432 \ + postgres:14 + - run: + name: Wait for PostgreSQL to be ready + command: dockerize -wait tcp://localhost:5432 -timeout 1m - run: name: Build Docker image command: docker build -t my-app:latest -f ./docker/Dockerfile.database . @@ -1886,7 +2007,7 @@ jobs: command: | docker run -d \ -p 4000:4000 \ - -e DATABASE_URL=$PROXY_DATABASE_URL \ + -e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/circle_test \ -e REDIS_HOST=$REDIS_HOST \ -e REDIS_PASSWORD=$REDIS_PASSWORD \ -e REDIS_PORT=$REDIS_PORT \ @@ -1899,6 +2020,7 @@ jobs: -e DD_API_KEY=$DD_API_KEY \ -e DD_SITE=$DD_SITE \ -e AWS_REGION_NAME=$AWS_REGION_NAME \ + --add-host host.docker.internal:host-gateway \ --name my-app \ -v $(pwd)/litellm/proxy/example_config_yaml/spend_tracking_config.yaml:/app/config.yaml \ my-app:latest \ @@ -1906,13 +2028,10 @@ jobs: --port 4000 \ --detailed_debug \ - run: - name: Install curl and dockerize + name: Install curl command: | sudo apt-get update sudo apt-get install -y curl - sudo wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz - sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz - sudo rm dockerize-linux-amd64-v0.6.1.tar.gz - run: name: Start outputting logs command: docker logs -f my-app @@ -1971,6 +2090,25 @@ jobs: pip install "pytest-retry==1.6.3" pip install "pytest-mock==3.12.0" pip install "pytest-asyncio==0.21.1" + - run: + name: Install dockerize + command: | + wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz + sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz + rm dockerize-linux-amd64-v0.6.1.tar.gz + - run: + name: Start PostgreSQL Database + command: | + docker run -d \ + --name postgres-db \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=circle_test \ + -p 5432:5432 \ + postgres:14 + - run: + name: Wait for PostgreSQL to be ready + command: dockerize -wait tcp://localhost:5432 -timeout 1m - run: name: Build Docker image command: docker build -t my-app:latest -f ./docker/Dockerfile.database . @@ -1981,7 +2119,7 @@ jobs: command: | docker run -d \ -p 4000:4000 \ - -e DATABASE_URL=$PROXY_DATABASE_URL \ + -e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/circle_test \ -e REDIS_HOST=$REDIS_HOST \ -e REDIS_PASSWORD=$REDIS_PASSWORD \ -e REDIS_PORT=$REDIS_PORT \ @@ -1990,6 +2128,7 @@ jobs: -e USE_DDTRACE=True \ -e DD_API_KEY=$DD_API_KEY \ -e DD_SITE=$DD_SITE \ + --add-host host.docker.internal:host-gateway \ --name my-app \ -v $(pwd)/litellm/proxy/example_config_yaml/multi_instance_simple_config.yaml:/app/config.yaml \ my-app:latest \ @@ -2001,7 +2140,7 @@ jobs: command: | docker run -d \ -p 4001:4001 \ - -e DATABASE_URL=$PROXY_DATABASE_URL \ + -e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/circle_test \ -e REDIS_HOST=$REDIS_HOST \ -e REDIS_PASSWORD=$REDIS_PASSWORD \ -e REDIS_PORT=$REDIS_PORT \ @@ -2010,6 +2149,7 @@ jobs: -e USE_DDTRACE=True \ -e DD_API_KEY=$DD_API_KEY \ -e DD_SITE=$DD_SITE \ + --add-host host.docker.internal:host-gateway \ --name my-app-2 \ -v $(pwd)/litellm/proxy/example_config_yaml/multi_instance_simple_config.yaml:/app/config.yaml \ my-app:latest \ @@ -2281,6 +2421,25 @@ jobs: pip install "langchain_mcp_adapters==0.0.5" pip install "langchain_openai==0.2.1" pip install "langgraph==0.3.18" + - run: + name: Install dockerize + command: | + wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz + sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz + rm dockerize-linux-amd64-v0.6.1.tar.gz + - run: + name: Start PostgreSQL Database + command: | + docker run -d \ + --name postgres-db \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=circle_test \ + -p 5432:5432 \ + postgres:14 + - run: + name: Wait for PostgreSQL to be ready + command: dockerize -wait tcp://localhost:5432 -timeout 1m # Run pytest and generate JUnit XML report - run: name: Build Docker image @@ -2290,7 +2449,7 @@ jobs: command: | docker run -d \ -p 4000:4000 \ - -e DATABASE_URL=$PROXY_DATABASE_URL \ + -e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/circle_test \ -e LITELLM_MASTER_KEY="sk-1234" \ -e OPENAI_API_KEY=$OPENAI_API_KEY \ -e GEMINI_API_KEY=$GEMINI_API_KEY \ @@ -2300,6 +2459,7 @@ jobs: -e DD_API_KEY=$DD_API_KEY \ -e DD_SITE=$DD_SITE \ -e LITELLM_LICENSE=$LITELLM_LICENSE \ + --add-host host.docker.internal:host-gateway \ --name my-app \ -v $(pwd)/litellm/proxy/example_config_yaml/pass_through_config.yaml:/app/config.yaml \ -v $(pwd)/litellm/proxy/example_config_yaml/custom_auth_basic.py:/app/custom_auth_basic.py \ @@ -2307,14 +2467,6 @@ jobs: --config /app/config.yaml \ --port 4000 \ --detailed_debug \ - - run: - name: Install curl and dockerize - command: | - sudo apt-get update - sudo apt-get install -y curl - sudo wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz - sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz - sudo rm dockerize-linux-amd64-v0.6.1.tar.gz - run: name: Start outputting logs command: docker logs -f my-app @@ -2383,6 +2535,7 @@ jobs: ls python -m pytest -vv tests/pass_through_tests/ -x --junitxml=test-results/junit.xml --durations=5 no_output_timeout: 120m + # Store test results - store_test_results: path: test-results @@ -2429,16 +2582,6 @@ jobs: command: | cp model_prices_and_context_window.json litellm/model_prices_and_context_window_backup.json - - run: - name: Check if litellm dir, tests dir, or pyproject.toml was modified - command: | - if [ -n "$(git diff --name-only $CIRCLE_SHA1^..$CIRCLE_SHA1 | grep -E 'pyproject\.toml|litellm/|tests/')" ]; then - echo "litellm, tests, or pyproject.toml updated" - else - echo "No changes to litellm, tests, or pyproject.toml. Skipping PyPI publish." - circleci step halt - fi - - run: name: Checkout code command: git checkout $CIRCLE_SHA1 @@ -2740,6 +2883,25 @@ jobs: steps: - checkout - setup_google_dns + - run: + name: Install dockerize + command: | + wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz + sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz + rm dockerize-linux-amd64-v0.6.1.tar.gz + - run: + name: Start PostgreSQL Database + command: | + docker run -d \ + --name postgres-db \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_DB=circle_test \ + -p 5432:5432 \ + postgres:14 + - run: + name: Wait for PostgreSQL to be ready + command: dockerize -wait tcp://localhost:5432 -timeout 1m - run: name: Build Docker image command: | @@ -2759,7 +2921,6 @@ jobs: name: Check for expected error command: | if grep -q "Error: P1001: Can't reach database server at" docker_output.log && \ - grep -q "prisma.engine.errors.NotConnectedError: Not connected to the query engine" docker_output.log && \ grep -q "ERROR: Application startup failed. Exiting." docker_output.log; then echo "Expected error found. Test passed." else @@ -2904,6 +3065,12 @@ workflows: only: - main - /litellm_.*/ + - google_generate_content_endpoint_testing: + filters: + branches: + only: + - main + - /litellm_.*/ - llm_responses_api_testing: filters: branches: @@ -2950,6 +3117,7 @@ workflows: requires: - llm_translation_testing - mcp_testing + - google_generate_content_endpoint_testing - guardrails_testing - llm_responses_api_testing - litellm_mapped_tests @@ -3009,6 +3177,7 @@ workflows: - test_bad_database_url - llm_translation_testing - mcp_testing + - google_generate_content_endpoint_testing - llm_responses_api_testing - litellm_mapped_tests - batches_testing diff --git a/deploy/charts/litellm-helm/README.md b/deploy/charts/litellm-helm/README.md index 31bda3f7d79..cef2b8d162d 100644 --- a/deploy/charts/litellm-helm/README.md +++ b/deploy/charts/litellm-helm/README.md @@ -110,6 +110,22 @@ data: Source: [GitHub Gist from troyharvey](https://gist.github.com/troyharvey/4506472732157221e04c6b15e3b3f094) +### Migration Job Settings + +The migration job supports both ArgoCD and Helm hooks to ensure database migrations run at the appropriate time during deployments. + +| Name | Description | Value | +| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | +| `migrationJob.enabled` | Enable or disable the schema migration Job | `true` | +| `migrationJob.backoffLimit` | Backoff limit for Job restarts | `4` | +| `migrationJob.ttlSecondsAfterFinished` | TTL for completed migration jobs | `120` | +| `migrationJob.annotations` | Additional annotations for the migration job pod | `{}` | +| `migrationJob.extraContainers` | Additional containers to run alongside the migration job | `[]` | +| `migrationJob.hooks.argocd.enabled` | Enable ArgoCD hooks for the migration job (uses PreSync hook with BeforeHookCreation delete policy) | `true` | +| `migrationJob.hooks.helm.enabled` | Enable Helm hooks for the migration job (uses pre-install,pre-upgrade hooks with before-hook-creation delete policy) | `false` | +| `migrationJob.hooks.helm.weight` | Helm hook execution order (lower weights executed first). Optional - defaults to "1" if not specified. | N/A | + + ## Accessing the Admin UI When browsing to the URL published per the settings in `ingress.*`, you will be prompted for **Admin Configuration**. The **Proxy Endpoint** is the internal diff --git a/deploy/charts/litellm-helm/templates/deployment.yaml b/deploy/charts/litellm-helm/templates/deployment.yaml index 4781bb5a553..71412b8052b 100644 --- a/deploy/charts/litellm-helm/templates/deployment.yaml +++ b/deploy/charts/litellm-helm/templates/deployment.yaml @@ -99,6 +99,12 @@ spec: value: {{ $val | quote }} {{- end }} {{- end }} + {{- if .Values.separateHealthApp }} + - name: SEPARATE_HEALTH_APP + value: "1" + - name: SEPARATE_HEALTH_PORT + value: {{ .Values.separateHealthPort | default "8081" | quote }} + {{- end }} {{- with .Values.extraEnvVars }} {{- toYaml . | nindent 12 }} {{- end }} @@ -118,19 +124,23 @@ spec: - name: http containerPort: {{ .Values.service.port }} protocol: TCP + {{- if .Values.separateHealthApp }} + - name: health + containerPort: {{ .Values.separateHealthPort | default 8081 }} + protocol: TCP + {{- end }} livenessProbe: httpGet: path: /health/liveliness - port: http + port: {{ if .Values.separateHealthApp }}"health"{{ else }}"http"{{ end }} readinessProbe: httpGet: path: /health/readiness - port: http - # Give the container time to start up. Up to 5 minutes (10 * 30 seconds) + port: {{ if .Values.separateHealthApp }}"health"{{ else }}"http"{{ end }} startupProbe: httpGet: path: /health/readiness - port: http + port: {{ if .Values.separateHealthApp }}"health"{{ else }}"http"{{ end }} failureThreshold: 30 periodSeconds: 10 resources: diff --git a/deploy/charts/litellm-helm/templates/migrations-job.yaml b/deploy/charts/litellm-helm/templates/migrations-job.yaml index 32b12aa10fa..143e62fceb3 100644 --- a/deploy/charts/litellm-helm/templates/migrations-job.yaml +++ b/deploy/charts/litellm-helm/templates/migrations-job.yaml @@ -5,8 +5,15 @@ kind: Job metadata: name: {{ include "litellm.fullname" . }}-migrations annotations: + {{- if .Values.migrationJob.hooks.argocd.enabled }} argocd.argoproj.io/hook: PreSync - argocd.argoproj.io/hook-delete-policy: BeforeHookCreation # delete old migration on a new deploy in case the migration needs to make updates + argocd.argoproj.io/hook-delete-policy: BeforeHookCreation + {{- end }} + {{- if .Values.migrationJob.hooks.helm.enabled }} + helm.sh/hook: "pre-install,pre-upgrade" + helm.sh/hook-delete-policy: "before-hook-creation" + helm.sh/hook-weight: {{ .Values.migrationJob.hooks.helm.weight | default "1" | quote }} + {{- end }} checksum/config: {{ toYaml .Values | sha256sum }} spec: template: @@ -47,8 +54,6 @@ spec: - name: DATABASE_URL value: postgresql://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ .Release.Name }}-postgresql/{{ .Values.postgresql.auth.database }} {{- end }} - - name: DISABLE_SCHEMA_UPDATE - value: "false" # always run the migration from the Helm PreSync hook, override the value set {{- if .Values.envVars }} {{- range $key, $val := .Values.envVars }} - name: {{ $key }} @@ -58,6 +63,8 @@ spec: {{- with .Values.extraEnvVars }} {{- toYaml . | nindent 12 }} {{- end }} + - name: DISABLE_SCHEMA_UPDATE + value: "false" # always run the migration from the Helm PreSync hook, override the value set {{- with .Values.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deploy/charts/litellm-helm/values.yaml b/deploy/charts/litellm-helm/values.yaml index 0c00d2325a6..f99204cbb4b 100644 --- a/deploy/charts/litellm-helm/values.yaml +++ b/deploy/charts/litellm-helm/values.yaml @@ -63,6 +63,12 @@ service: # optionally specify loadBalancerClass # loadBalancerClass: tailscale +# Separate health app configuration +# When enabled, health checks will use a separate port and the application +# will receive SEPARATE_HEALTH_APP=1 and SEPARATE_HEALTH_PORT from environment variables +separateHealthApp: false +separateHealthPort: 8081 + ingress: enabled: false className: "nginx" @@ -201,6 +207,13 @@ migrationJob: annotations: {} ttlSecondsAfterFinished: 120 extraContainers: [] + + # Hook configuration + hooks: + argocd: + enabled: true + helm: + enabled: false # Additional environment variables to be added to the deployment as a map of key-value pairs envVars: { diff --git a/docker-compose.yml b/docker-compose.yml index 2e90d897f21..366fbe51b5a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,68 +1,66 @@ -version: "3.11" -services: - litellm: - build: - context: . - args: - target: runtime - image: ghcr.io/berriai/litellm:main-stable - ######################################### - ## Uncomment these lines to start proxy with a config.yaml file ## - # volumes: - # - ./config.yaml:/app/config.yaml <<- this is missing in the docker-compose file currently - # command: - # - "--config=/app/config.yaml" - ############################################## - ports: - - "4000:4000" # Map the container port to the host, change the host port if necessary - environment: - DATABASE_URL: "postgresql://llmproxy:dbpassword9090@db:5432/litellm" - STORE_MODEL_IN_DB: "True" # allows adding models to proxy via UI - env_file: - - .env # Load local .env file - depends_on: - - db # Indicates that this service depends on the 'db' service, ensuring 'db' starts first - healthcheck: # Defines the health check configuration for the container - test: [ "CMD-SHELL", "wget --no-verbose --tries=1 http://localhost:4000/health/liveliness || exit 1" ] # Command to execute for health check - interval: 30s # Perform health check every 30 seconds - timeout: 10s # Health check command times out after 10 seconds - retries: 3 # Retry up to 3 times if health check fails - start_period: 40s # Wait 40 seconds after container start before beginning health checks - - db: - image: postgres:16 - restart: always - container_name: litellm_db - environment: - POSTGRES_DB: litellm - POSTGRES_USER: llmproxy - POSTGRES_PASSWORD: dbpassword9090 - ports: - - "5432:5432" - volumes: - - postgres_data:/var/lib/postgresql/data # Persists Postgres data across container restarts - healthcheck: - test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"] - interval: 1s - timeout: 5s - retries: 10 - - prometheus: - image: prom/prometheus - volumes: - - prometheus_data:/prometheus - - ./prometheus.yml:/etc/prometheus/prometheus.yml - ports: - - "9090:9090" - command: - - "--config.file=/etc/prometheus/prometheus.yml" - - "--storage.tsdb.path=/prometheus" - - "--storage.tsdb.retention.time=15d" - restart: always - -volumes: - prometheus_data: - driver: local - postgres_data: - name: litellm_postgres_data # Named volume for Postgres data persistence - +services: + litellm: + build: + context: . + args: + target: runtime + image: ghcr.io/berriai/litellm:main-stable + ######################################### + ## Uncomment these lines to start proxy with a config.yaml file ## + # volumes: + # - ./config.yaml:/app/config.yaml <<- this is missing in the docker-compose file currently + # command: + # - "--config=/app/config.yaml" + ############################################## + ports: + - "4000:4000" # Map the container port to the host, change the host port if necessary + environment: + DATABASE_URL: "postgresql://llmproxy:dbpassword9090@db:5432/litellm" + STORE_MODEL_IN_DB: "True" # allows adding models to proxy via UI + env_file: + - .env # Load local .env file + depends_on: + - db # Indicates that this service depends on the 'db' service, ensuring 'db' starts first + healthcheck: # Defines the health check configuration for the container + test: [ "CMD-SHELL", "wget --no-verbose --tries=1 http://localhost:4000/health/liveliness || exit 1" ] # Command to execute for health check + interval: 30s # Perform health check every 30 seconds + timeout: 10s # Health check command times out after 10 seconds + retries: 3 # Retry up to 3 times if health check fails + start_period: 40s # Wait 40 seconds after container start before beginning health checks + + db: + image: postgres:16 + restart: always + container_name: litellm_db + environment: + POSTGRES_DB: litellm + POSTGRES_USER: llmproxy + POSTGRES_PASSWORD: dbpassword9090 + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data # Persists Postgres data across container restarts + healthcheck: + test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"] + interval: 1s + timeout: 5s + retries: 10 + + prometheus: + image: prom/prometheus + volumes: + - prometheus_data:/prometheus + - ./prometheus.yml:/etc/prometheus/prometheus.yml + ports: + - "9090:9090" + command: + - "--config.file=/etc/prometheus/prometheus.yml" + - "--storage.tsdb.path=/prometheus" + - "--storage.tsdb.retention.time=15d" + restart: always + +volumes: + prometheus_data: + driver: local + postgres_data: + name: litellm_postgres_data # Named volume for Postgres data persistence diff --git a/docker/Dockerfile.non_root b/docker/Dockerfile.non_root index d4e672251e9..cdf4b89bff4 100644 --- a/docker/Dockerfile.non_root +++ b/docker/Dockerfile.non_root @@ -33,7 +33,7 @@ WORKDIR /app # Install runtime dependencies USER root RUN apk upgrade --no-cache && \ - apk add --no-cache bash + apk add --no-cache bash libstdc++ ca-certificates openssl # Copy only necessary artifacts from builder stage for runtime COPY --from=builder /app/docker/entrypoint.sh /app/docker/prod_entrypoint.sh /app/docker/ @@ -71,6 +71,20 @@ RUN mkdir -p /nonexistent /.npm && \ PRISMA_PATH=$(python -c "import os, prisma; print(os.path.dirname(prisma.__file__))") && \ chown -R nobody:nogroup $PRISMA_PATH +# --- OpenShift Compatibility: Apply Red Hat recommended pattern --- +# Get paths for directories that need write access at runtime +RUN PRISMA_PATH=$(python -c "import os, prisma; print(os.path.dirname(prisma.__file__))") && \ + LITELLM_PROXY_EXTRAS_PATH=$(python -c "import os, litellm_proxy_extras; print(os.path.dirname(litellm_proxy_extras.__file__))" 2>/dev/null || echo "") && \ + # Set group ownership to 0 (root group) for OpenShift compatibility && \ + chgrp -R 0 $PRISMA_PATH && \ + [ -n "$LITELLM_PROXY_EXTRAS_PATH" ] && chgrp -R 0 $LITELLM_PROXY_EXTRAS_PATH || true && \ + # Mirror owner permissions to group (g=u) as recommended by Red Hat && \ + chmod -R g=u $PRISMA_PATH && \ + [ -n "$LITELLM_PROXY_EXTRAS_PATH" ] && chmod -R g=u $LITELLM_PROXY_EXTRAS_PATH || true && \ + # Ensure directories are writable by group && \ + chmod -R g+w $PRISMA_PATH && \ + [ -n "$LITELLM_PROXY_EXTRAS_PATH" ] && chmod -R g+w $LITELLM_PROXY_EXTRAS_PATH || true + # Switch to non-root user USER nobody @@ -86,4 +100,4 @@ ENTRYPOINT ["/app/docker/prod_entrypoint.sh"] # Append "--detailed_debug" to the end of CMD to view detailed debug logs # CMD ["--port", "4000", "--detailed_debug"] -CMD ["--port", "4000"] +CMD ["--port", "4000"] \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index 8dbc59d01bf..1c3c208988c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,3 +1,65 @@ -# LiteLLM Docker +# Docker Development Guide -This is a minimal Docker Compose setup for self-hosting LiteLLM. \ No newline at end of file +This guide provides instructions for building and running the LiteLLM application using Docker and Docker Compose. + +## Prerequisites + +- Docker +- Docker Compose + +## Building and Running the Application + +To build and run the application, you will use the `docker-compose.yml` file located in the root of the project. This file is configured to use the `Dockerfile.non_root` for a secure, non-root container environment. + +### 1. Set the Master Key + +The application requires a `MASTER_KEY` for signing and validating tokens. You must set this key as an environment variable before running the application. + +Create a `.env` file in the root of the project and add the following line: + +``` +MASTER_KEY=your-secret-key +``` + +Replace `your-secret-key` with a strong, randomly generated secret. + +### 2. Build and Run the Containers + +Once you have set the `MASTER_KEY`, you can build and run the containers using the following command: + +```bash +docker-compose up -d --build +``` + +This command will: + +- Build the Docker image using `Dockerfile.non_root`. +- Start the `litellm`, `litellm_db`, and `prometheus` services in detached mode (`-d`). +- The `--build` flag ensures that the image is rebuilt if there are any changes to the Dockerfile or the application code. + +### 3. Verifying the Application is Running + +You can check the status of the running containers with the following command: + +```bash +docker-compose ps +``` + +To view the logs of the `litellm` container, run: + +```bash +docker-compose logs -f litellm +``` + +### 4. Stopping the Application + +To stop the running containers, use the following command: + +```bash +docker-compose down +``` + +## Troubleshooting + +- **`build_admin_ui.sh: not found`**: This error can occur if the Docker build context is not set correctly. Ensure that you are running the `docker-compose` command from the root of the project. +- **`Master key is not initialized`**: This error means the `MASTER_key` environment variable is not set. Make sure you have created a `.env` file in the project root with the `MASTER_KEY` defined. diff --git a/docs/my-website/docs/completion/computer_use.md b/docs/my-website/docs/completion/computer_use.md new file mode 100644 index 00000000000..ed09a73b219 --- /dev/null +++ b/docs/my-website/docs/completion/computer_use.md @@ -0,0 +1,446 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Computer Use + +Computer use allows models to interact with computer interfaces by taking screenshots and performing actions like clicking, typing, and scrolling. This enables AI models to autonomously operate desktop environments. + +**Supported Providers:** +- Anthropic API (`anthropic/`) +- Bedrock (Anthropic) (`bedrock/`) +- Vertex AI (Anthropic) (`vertex_ai/`) + +**Supported Tool Types:** +- `computer` - Computer interaction tool with display parameters +- `bash` - Bash shell tool +- `text_editor` - Text editor tool +- `web_search` - Web search tool + +LiteLLM will standardize the computer use tools across all supported providers. + +## Quick Start + + + + +```python +import os +from litellm import completion + +os.environ["ANTHROPIC_API_KEY"] = "your-api-key" + +# Computer use tool + tools = [ + { + "type": "computer_20241022", + "name": "computer", + "display_height_px": 768, + "display_width_px": 1024, + "display_number": 0, + } + ] + + messages = [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "Take a screenshot and tell me what you see" + }, + { + "type": "image_url", + "image_url": { + "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==" + } + } + ] + } +] + +response = completion( + model="anthropic/claude-3-5-sonnet-latest", + messages=messages, + tools=tools, +) + +print(response) +``` + + + + +1. Define computer use models on config.yaml + +```yaml +model_list: + - model_name: claude-3-5-sonnet-latest # Anthropic claude-3-5-sonnet-latest + litellm_params: + model: anthropic/claude-3-5-sonnet-latest + api_key: os.environ/ANTHROPIC_API_KEY + - model_name: claude-bedrock # Bedrock Anthropic model + litellm_params: + model: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0 + aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID + aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY + aws_region_name: us-west-2 + model_info: + supports_computer_use: True # set supports_computer_use to True so /model/info returns this attribute as True +``` + +2. Run proxy server + +```bash +litellm --config config.yaml +``` + +3. Test it using the OpenAI Python SDK + +```python +import os +from openai import OpenAI + +client = OpenAI( + api_key="sk-1234", # your litellm proxy api key + base_url="http://0.0.0.0:4000" +) + +response = client.chat.completions.create( + model="claude-3-5-sonnet-latest", + messages=[ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "Take a screenshot and tell me what you see" + }, + { + "type": "image_url", + "image_url": { + "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==" + } + } + ] + } + ], + tools=[ + { + "type": "computer_20241022", + "name": "computer", + "display_height_px": 768, + "display_width_px": 1024, + "display_number": 0, + } + ] +) + +print(response) +``` + + + + +## Checking if a model supports `computer use` + + + + +Use `litellm.supports_computer_use(model="")` -> returns `True` if model supports computer use and `False` if not + +```python +import litellm + +assert litellm.supports_computer_use(model="anthropic/claude-3-5-sonnet-latest") == True +assert litellm.supports_computer_use(model="anthropic/claude-3-7-sonnet-20250219") == True +assert litellm.supports_computer_use(model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0") == True +assert litellm.supports_computer_use(model="vertex_ai/claude-3-5-sonnet") == True +assert litellm.supports_computer_use(model="openai/gpt-4") == False +``` + + + + +1. Define computer use models on config.yaml + +```yaml +model_list: + - model_name: claude-3-5-sonnet-latest # Anthropic claude-3-5-sonnet-latest + litellm_params: + model: anthropic/claude-3-5-sonnet-latest + api_key: os.environ/ANTHROPIC_API_KEY + - model_name: claude-bedrock # Bedrock Anthropic model + litellm_params: + model: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0 + aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID + aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY + aws_region_name: us-west-2 + model_info: + supports_computer_use: True # set supports_computer_use to True so /model/info returns this attribute as True +``` + +2. Run proxy server + +```bash +litellm --config config.yaml +``` + +3. Call `/model_group/info` to check if your model supports `computer use` + +```shell +curl -X 'GET' \ + 'http://localhost:4000/model_group/info' \ + -H 'accept: application/json' \ + -H 'x-api-key: sk-1234' +``` + +Expected Response + +```json +{ + "data": [ + { + "model_group": "claude-3-5-sonnet-latest", + "providers": ["anthropic"], + "max_input_tokens": 200000, + "max_output_tokens": 8192, + "mode": "chat", + "supports_computer_use": true, # 👈 supports_computer_use is true + "supports_vision": true, + "supports_function_calling": true + }, + { + "model_group": "claude-bedrock", + "providers": ["bedrock"], + "max_input_tokens": 200000, + "max_output_tokens": 8192, + "mode": "chat", + "supports_computer_use": true, # 👈 supports_computer_use is true + "supports_vision": true, + "supports_function_calling": true + } + ] +} +``` + + + + +## Different Tool Types + +Computer use supports several different tool types for various interaction modes: + + + + +The `computer_20241022` tool provides direct screen interaction capabilities. + +```python +import os +from litellm import completion + +os.environ["ANTHROPIC_API_KEY"] = "your-api-key" + +tools = [ + { + "type": "computer_20241022", + "name": "computer", + "display_height_px": 768, + "display_width_px": 1024, + "display_number": 0, + } +] + +messages = [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "Click on the search button in the screenshot" + }, + { + "type": "image_url", + "image_url": { + "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==" + } + } + ] + } +] + +response = completion( + model="anthropic/claude-3-5-sonnet-latest", + messages=messages, + tools=tools, +) + +print(response) +``` + + + + +The `bash_20241022` tool provides command line interface access. + +```python +import os +from litellm import completion + +os.environ["ANTHROPIC_API_KEY"] = "your-api-key" + +tools = [ + { + "type": "bash_20241022", + "name": "bash" + } +] + +messages = [ + { + "role": "user", + "content": "List the files in the current directory using bash" + } +] + +response = completion( + model="anthropic/claude-3-5-sonnet-latest", + messages=messages, + tools=tools, +) + +print(response) +``` + + + + +The `text_editor_20250124` tool provides text file editing capabilities. + +```python +import os +from litellm import completion + +os.environ["ANTHROPIC_API_KEY"] = "your-api-key" + +tools = [ + { + "type": "text_editor_20250124", + "name": "str_replace_editor" + } +] + +messages = [ + { + "role": "user", + "content": "Create a simple Python hello world script" + } +] + +response = completion( + model="anthropic/claude-3-5-sonnet-latest", + messages=messages, + tools=tools, +) + +print(response) +``` + + + + +## Advanced Usage with Multiple Tools + +You can combine different computer use tools in a single request: + +```python +import os +from litellm import completion + +os.environ["ANTHROPIC_API_KEY"] = "your-api-key" + +tools = [ + { + "type": "computer_20241022", + "name": "computer", + "display_height_px": 768, + "display_width_px": 1024, + "display_number": 0, + }, + { + "type": "bash_20241022", + "name": "bash" + }, + { + "type": "text_editor_20250124", + "name": "str_replace_editor" + } +] + +messages = [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "Take a screenshot, then create a file describing what you see, and finally use bash to show the file contents" + }, + { + "type": "image_url", + "image_url": { + "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==" + } + } + ] + } + ] + +response = completion( + model="anthropic/claude-3-5-sonnet-latest", + messages=messages, + tools=tools, +) + +print(response) +``` + +## Spec + +### Computer Tool (`computer_20241022`) + +```json +{ + "type": "computer_20241022", + "name": "computer", + "display_height_px": 768, // Required: Screen height in pixels + "display_width_px": 1024, // Required: Screen width in pixels + "display_number": 0 // Optional: Display number (default: 0) +} +``` + +### Bash Tool (`bash_20241022`) + +```json +{ + "type": "bash_20241022", + "name": "bash" // Required: Tool name +} +``` + +### Text Editor Tool (`text_editor_20250124`) + +```json +{ + "type": "text_editor_20250124", + "name": "str_replace_editor" // Required: Tool name +} +``` + +### Web Search Tool (`web_search_20250305`) + +```json +{ + "type": "web_search_20250305", + "name": "web_search" // Required: Tool name +} +``` \ No newline at end of file diff --git a/docs/my-website/docs/observability/datadog.md b/docs/my-website/docs/observability/datadog.md index 7cd98d7269e..08ebf8b28ce 100644 --- a/docs/my-website/docs/observability/datadog.md +++ b/docs/my-website/docs/observability/datadog.md @@ -9,8 +9,14 @@ LiteLLM Supports logging to the following Datdog Integrations: - `datadog_llm_observability` [Datadog LLM Observability](https://www.datadoghq.com/product/llm-observability/) - `ddtrace-run` [Datadog Tracing](#datadog-tracing) - - +## Datadog Logs + +| Feature | Details | +|---------|---------| +| **What is logged** | [StandardLoggingPayload](../proxy/logging_spec) | +| **Events** | Success + Failure | +| **Product Link** | [Datadog Logs](https://docs.datadoghq.com/logs/) | + We will use the `--config` to set `litellm.callbacks = ["datadog"]` this will log all successful LLM calls to DataDog @@ -26,8 +32,16 @@ litellm_settings: service_callback: ["datadog"] # logs redis, postgres failures on datadog ``` - - + +## Datadog LLM Observability + +**Overview** + +| Feature | Details | +|---------|---------| +| **What is logged** | [StandardLoggingPayload](../proxy/logging_spec) | +| **Events** | Success + Failure | +| **Product Link** | [Datadog LLM Observability](https://www.datadoghq.com/product/llm-observability/) | ```yaml model_list: @@ -38,8 +52,7 @@ litellm_settings: callbacks: ["datadog_llm_observability"] # logs llm success logs on datadog ``` - - + **Step 2**: Set Required env variables for datadog @@ -80,7 +93,53 @@ Expected output on Datadog -#### Datadog Tracing +### Redacting Messages and Responses + +This section covers how to redact sensitive data from messages and responses in the logged payload on Datadog LLM Observability. + + +When redaction is enabled, the actual message content and response text will be excluded from Datadog logs while preserving metadata like token counts, latency, and model information. + +**Step 1**: Configure redaction in your `config.yaml` + +```yaml showLineNumbers title="config.yaml" +model_list: + - model_name: gpt-3.5-turbo + litellm_params: + model: gpt-3.5-turbo +litellm_settings: + callbacks: ["datadog_llm_observability"] # logs llm success logs on datadog + + # Params to apply only for "datadog_llm_observability" callback + datadog_llm_observability_params: + turn_off_message_logging: true # redacts input messages and output responses +``` + +**Step 2**: Send a chat completion request + +```shell +curl --location 'http://0.0.0.0:4000/chat/completions' \ + --header 'Content-Type: application/json' \ + --data '{ + "model": "gpt-3.5-turbo", + "messages": [ + { + "role": "user", + "content": "what llm are you" + } + ] +}' +``` + +**Step 3**: Verify redaction in Datadog LLM Observability + +On the Datadog LLM Observability page, you should see that both input messages and output responses are redacted, while metadata (token counts, timing, model info) remains visible. + + + + + +### Datadog Tracing Use `ddtrace-run` to enable [Datadog Tracing](https://ddtrace.readthedocs.io/en/stable/installation_quickstart.html) on litellm proxy @@ -104,7 +163,7 @@ docker run \ --config /app/config.yaml --detailed_debug ``` -### Set DD variables (`DD_SERVICE` etc) +## Set DD variables (`DD_SERVICE` etc) LiteLLM supports customizing the following Datadog environment variables diff --git a/docs/my-website/docs/observability/mlflow.md b/docs/my-website/docs/observability/mlflow.md index 39746b2cad7..5fa46bdfdac 100644 --- a/docs/my-website/docs/observability/mlflow.md +++ b/docs/my-website/docs/observability/mlflow.md @@ -17,7 +17,7 @@ MLflow’s integration with LiteLLM supports advanced observability compatible w Install MLflow: ```shell -pip install mlflow +pip install "litellm[mlflow]" ``` To enable MLflow auto tracing for LiteLLM: @@ -160,6 +160,102 @@ class CustomAgent: This approach generates a unified trace, combining your custom Python code with LiteLLM calls. +## LiteLLM Proxy Server + +### Dependencies + +For using `mlflow` on LiteLLM Proxy Server, you need to install the `mlflow` package on your docker container. + +```shell +pip install "mlflow>=3.1.4" +``` + +### Configuration + +Configure MLflow in your LiteLLM proxy configuration file: + +```yaml +model_list: + - model_name: openai/* + litellm_params: + model: openai/* + +litellm_settings: + success_callback: ["mlflow"] + failure_callback: ["mlflow"] +``` + +### Environment Variables + +For MLflow with Databricks service, set these required environment variables: + +```shell +DATABRICKS_TOKEN="dapixxxxx" +DATABRICKS_HOST="https://dbc-xxxx.cloud.databricks.com" +MLFLOW_TRACKING_URI="databricks" +MLFLOW_REGISTRY_URI="databricks-uc" +MLFLOW_EXPERIMENT_ID="xxxx" +``` + +### Adding Tags for Better Tracing + +You can add custom tags to your requests for improved trace organization and filtering in MLflow. Tags help you categorize and search your traces by job ID, task name, or any custom metadata. + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +```shell +curl --location 'http://0.0.0.0:4000/chat/completions' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer sk-1234' \ + --data '{ + "model": "gemini-2.5-flash", + "messages": [ + { + "role": "user", + "content": "what llm are you" + } + ], + "litellm_metadata": { + "tags": ["jobID:214590dsff09fds", "taskName:run_page_classification"] + } +}' +``` + + + + +```python +from openai import OpenAI + +# Initialize the OpenAI client pointing to your LiteLLM proxy +client = OpenAI( + api_key="sk-1234", # Your LiteLLM proxy API key + base_url="http://0.0.0.0:4000" # Your LiteLLM proxy URL +) + +# Make a request with tags in metadata +response = client.chat.completions.create( + model="gemini-2.5-flash", + messages=[ + { + "role": "user", + "content": "what llm are you" + } + ], + extra_body={ + "litellm_metadata": { + "tags": ["jobID:214590dsff09fds", "taskName:run_page_classification"] + } + } +) +``` + + + ## Support diff --git a/docs/my-website/docs/pass_through/bedrock.md b/docs/my-website/docs/pass_through/bedrock.md index 7aba721a09d..48502864d78 100644 --- a/docs/my-website/docs/pass_through/bedrock.md +++ b/docs/my-website/docs/pass_through/bedrock.md @@ -33,7 +33,7 @@ Supports **ALL** Bedrock Endpoints (including streaming). Let's call the Bedrock [`/converse` endpoint](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) -1. Add AWS Keyss to your environment +1. Add AWS Keys to your environment ```bash export AWS_ACCESS_KEY_ID="" # Access key @@ -295,4 +295,4 @@ for event in response.get("completion"): print(completion) -``` \ No newline at end of file +``` diff --git a/docs/my-website/docs/providers/azure/azure.md b/docs/my-website/docs/providers/azure/azure.md index ab4391798f8..69f8db538e0 100644 --- a/docs/my-website/docs/providers/azure/azure.md +++ b/docs/my-website/docs/providers/azure/azure.md @@ -175,6 +175,25 @@ print(response) +### Setting API Version + +You can set the `api_version` for Azure OpenAI in your proxy config.yaml in the following ways + +#### Option 1: Per Model Configuration + +```yaml showLineNumbers title="config.yaml" +model_list: + - model_name: gpt-4 + litellm_params: + model: azure/my-gpt4-deployment + api_base: https://your-resource.openai.azure.com/ + api_version: "2024-08-01-preview" # Set version per model + api_key: os.environ/AZURE_API_KEY +``` + + + + ## Azure OpenAI Chat Completion Models diff --git a/docs/my-website/docs/proxy/admin_ui_sso.md b/docs/my-website/docs/proxy/admin_ui_sso.md index 3e64cad7726..86cb6b0bf8c 100644 --- a/docs/my-website/docs/proxy/admin_ui_sso.md +++ b/docs/my-website/docs/proxy/admin_ui_sso.md @@ -14,29 +14,7 @@ import TabItem from '@theme/TabItem'; ::: -### SSO for UI - -#### Step 1: Set upperbounds for keys -Control the upperbound that users can use for `max_budget`, `budget_duration` or any `key/generate` param per key. - -```yaml -litellm_settings: - upperbound_key_generate_params: - max_budget: 100 # Optional[float], optional): upperbound of $100, for all /key/generate requests - budget_duration: "10d" # Optional[str], optional): upperbound of 10 days for budget_duration values - duration: "30d" # Optional[str], optional): upperbound of 30 days for all /key/generate requests - max_parallel_requests: 1000 # (Optional[int], optional): Max number of requests that can be made in parallel. Defaults to None. - tpm_limit: 1000 #(Optional[int], optional): Tpm limit. Defaults to None. - rpm_limit: 1000 #(Optional[int], optional): Rpm limit. Defaults to None. - -``` - -** Expected Behavior ** - -- Send a `/key/generate` request with `max_budget=200` -- Key will be created with `max_budget=100` since 100 is the upper bound - -#### Step 2: Setup Oauth Client +### Usage (Google, Microsoft, Okta, etc.) diff --git a/docs/my-website/docs/proxy/config_settings.md b/docs/my-website/docs/proxy/config_settings.md index f0f21797ac6..853322bd19b 100644 --- a/docs/my-website/docs/proxy/config_settings.md +++ b/docs/my-website/docs/proxy/config_settings.md @@ -38,8 +38,7 @@ litellm_settings: context_window_fallbacks: [{"gpt-3.5-turbo-small": ["gpt-3.5-turbo-large", "claude-opus"]}] # fallbacks for ContextWindowExceededErrors # MCP Aliases - Map aliases to MCP server names for easier tool access - mcp_aliases: { "github": "github_mcp_server", "zapier": "zapier_mcp_server", "deepwiki": "deepwiki_mcp_server" } # Maps friendly aliases to MCP server names. Only the first alias for each server is used. - + mcp_aliases: { "github": "github_mcp_server", "zapier": "zapier_mcp_server", "deepwiki": "deepwiki_mcp_server" } # Maps friendly aliases to MCP server names. Only the first alias for each server is used # Caching settings cache: true @@ -327,6 +326,7 @@ router_settings: | ATHINA_BASE_URL | Base URL for Athina service (defaults to `https://log.athina.ai`) | AUTH_STRATEGY | Strategy used for authentication (e.g., OAuth, API key) | ANTHROPIC_API_KEY | API key for Anthropic service +| ANTHROPIC_API_BASE | Base URL for Anthropic API. Default is https://api.anthropic.com | AWS_ACCESS_KEY_ID | Access Key ID for AWS services | AWS_PROFILE_NAME | AWS CLI profile name to be used | AWS_REGION_NAME | Default AWS region for service interactions @@ -336,6 +336,7 @@ router_settings: | AWS_WEB_IDENTITY_TOKEN | Web identity token for AWS | AZURE_API_VERSION | Version of the Azure API being used | AZURE_AUTHORITY_HOST | Azure authority host URL +| AZURE_CERTIFICATE_PASSWORD | Password for Azure OpenAI certificate | AZURE_CLIENT_ID | Client ID for Azure services | AZURE_CLIENT_SECRET | Client secret for Azure services | AZURE_CODE_INTERPRETER_COST_PER_SESSION | Cost per session for Azure Code Interpreter service @@ -371,6 +372,7 @@ router_settings: | CONFIDENT_API_KEY | API key for DeepEval integration | CUSTOM_TIKTOKEN_CACHE_DIR | Custom directory for Tiktoken cache | CONFIDENT_API_KEY | API key for Confident AI (Deepeval) Logging service +| COHERE_API_BASE | Base URL for Cohere API. Default is https://api.cohere.com | DATABASE_HOST | Hostname for the database server | DATABASE_NAME | Name of the database | DATABASE_PASSWORD | Password for the database user @@ -481,6 +483,7 @@ router_settings: | GENERIC_USER_PROVIDER_ATTRIBUTE | Attribute specifying the user's provider | GENERIC_USER_ROLE_ATTRIBUTE | Attribute specifying the user's role | GENERIC_USERINFO_ENDPOINT | Endpoint to fetch user information in generic OAuth +| GEMINI_API_BASE | Base URL for Gemini API. Default is https://generativelanguage.googleapis.com | GALILEO_BASE_URL | Base URL for Galileo platform | GALILEO_PASSWORD | Password for Galileo authentication | GALILEO_PROJECT_ID | Project ID for Galileo usage @@ -580,7 +583,7 @@ router_settings: | MAX_LANGFUSE_INITIALIZED_CLIENTS | Maximum number of Langfuse clients to initialize on proxy. Default is 20. This is set since langfuse initializes 1 thread everytime a client is initialized. We've had an incident in the past where we reached 100% cpu utilization because Langfuse was initialized several times. | MIN_NON_ZERO_TEMPERATURE | Minimum non-zero temperature value. Default is 0.0001 | MINIMUM_PROMPT_CACHE_TOKEN_COUNT | Minimum token count for caching a prompt. Default is 1024 -| MISTRAL_API_BASE | Base URL for Mistral API +| MISTRAL_API_BASE | Base URL for Mistral API. Default is https://api.mistral.ai | MISTRAL_API_KEY | API key for Mistral API | MICROSOFT_CLIENT_ID | Client ID for Microsoft services | MICROSOFT_CLIENT_SECRET | Client secret for Microsoft services @@ -592,7 +595,7 @@ router_settings: | NON_LLM_CONNECTION_TIMEOUT | Timeout in seconds for non-LLM service connections. Default is 15 | OAUTH_TOKEN_INFO_ENDPOINT | Endpoint for OAuth token info retrieval | OPENAI_BASE_URL | Base URL for OpenAI API -| OPENAI_API_BASE | Base URL for OpenAI API +| OPENAI_API_BASE | Base URL for OpenAI API. Default is https://api.openai.com/ | OPENAI_API_KEY | API key for OpenAI services | OPENAI_FILE_SEARCH_COST_PER_1K_CALLS | Cost per 1000 calls for OpenAI file search. Default is 0.0025 | OPENAI_ORGANIZATION | Organization identifier for OpenAI diff --git a/docs/my-website/docs/proxy/custom_auth.md b/docs/my-website/docs/proxy/custom_auth.md index 646a68b9d3f..3787f9bdd7c 100644 --- a/docs/my-website/docs/proxy/custom_auth.md +++ b/docs/my-website/docs/proxy/custom_auth.md @@ -60,9 +60,114 @@ Supported from v1.72.2+ [Get free 7-day trial key](https://www.litellm.ai/enterprise#trial) ::: +### Usage + +1. Setup custom auth file + +```python +""" +Example custom auth function. + +This will allow all keys starting with "my-custom-key" to pass through. +""" +from typing import Union + +from fastapi import Request + +from litellm.proxy._types import UserAPIKeyAuth + + +async def user_api_key_auth( + request: Request, api_key: str +) -> Union[UserAPIKeyAuth, str]: + try: + if api_key.startswith("my-custom-key"): + return "sk-P1zJMdsqCPNN54alZd_ETw" + else: + raise Exception("Invalid API key") + except Exception: + raise Exception("Invalid API key") + +``` + +2. Setup config.yaml + +Key change set `mode: auto`. This will check both litellm api key auth + custom auth. + ```yaml +model_list: + - model_name: "openai-model" + litellm_params: + model: "gpt-3.5-turbo" + api_key: os.environ/OPENAI_API_KEY + general_settings: custom_auth: custom_auth_auto.user_api_key_auth custom_auth_settings: mode: "auto" # can be 'on', 'off', 'auto' - 'auto' checks both litellm api key auth + custom auth +``` + +Flow: +1. Checks custom auth first +2. If custom auth fails, checks litellm api key auth +3. If both fail, returns 401 + + +3. Test it! + +```bash +curl -L -X POST 'http://0.0.0.0:4000/v1/chat/completions' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Bearer sk-P1zJMdsqCPNN54alZd_ETw' \ +-d '{ + "model": "openai-model", + "messages": [ + { + "role": "user", + "content": "Hey! My name is John" + } + ] +}' +``` + + + + +#### Bubble up custom exceptions + +If you want to bubble up custom exceptions, you can do so by raising a `ProxyException`. + +```python +""" +Example custom auth function. + +This will allow all keys starting with "my-custom-key" to pass through. +""" + +from typing import Union + +from fastapi import Request + +from litellm.proxy._types import UserAPIKeyAuth, ProxyException + + +async def user_api_key_auth( + request: Request, api_key: str +) -> Union[UserAPIKeyAuth, str]: + try: + if api_key.startswith("my-custom-key"): + return "sk-P1zJMdsqCPNN54alZd_ETw" + if api_key == "invalid-api-key": + # raise a custom exception back to the client + raise ProxyException( + message="Invalid API key", + type="invalid_request_error", + param="api_key", + code=401, + ) + else: + raise Exception("Invalid API key") + except Exception: + raise Exception("Invalid API key") + ``` \ No newline at end of file diff --git a/docs/my-website/docs/proxy/guardrails/quick_start.md b/docs/my-website/docs/proxy/guardrails/quick_start.md index 824d4b241be..c0c1a23baca 100644 --- a/docs/my-website/docs/proxy/guardrails/quick_start.md +++ b/docs/my-website/docs/proxy/guardrails/quick_start.md @@ -491,6 +491,47 @@ guardrails: default_on: true # run on every request ``` + +### ✨ Model-level Guardrails + +:::info + +✨ This is an Enterprise only feature [Get a free trial](https://www.litellm.ai/enterprise#trial) + +::: + + +This is great for cases when you have an on-prem and hosted model, and just want to run prevent sending PII to the hosted model. + + +```yaml +model_list: + - model_name: claude-sonnet-4 + litellm_params: + model: anthropic/claude-sonnet-4-20250514 + api_key: os.environ/ANTHROPIC_API_KEY + api_base: https://api.anthropic.com/v1 + guardrails: ["azure-text-moderation"] + - model_name: openai-gpt-4o + litellm_params: + model: openai/gpt-4o + +guardrails: + - guardrail_name: "presidio-pii" + litellm_params: + guardrail: presidio # supported values: "aporia", "bedrock", "lakera", "presidio" + mode: "pre_call" + presidio_language: "en" # optional: set default language for PII analysis + pii_entities_config: + PERSON: "BLOCK" # Will mask credit card numbers + - guardrail_name: azure-text-moderation + litellm_params: + guardrail: azure/text_moderations + mode: "post_call" + api_key: os.environ/AZURE_GUARDRAIL_API_KEY + api_base: os.environ/AZURE_GUARDRAIL_API_BASE +``` + ### ✨ Disable team from turning on/off guardrails :::info diff --git a/docs/my-website/docs/proxy/health.md b/docs/my-website/docs/proxy/health.md index 52321a38457..5cd6b5d18a7 100644 --- a/docs/my-website/docs/proxy/health.md +++ b/docs/my-website/docs/proxy/health.md @@ -1,6 +1,15 @@ # Health Checks Use this to health check all LLMs defined in your config.yaml +## When to Use Each Endpoint + +| Endpoint | Use Case | Purpose | +|----------|----------|---------| +| `/health/liveliness` | **Container liveness probes** | Basic alive check - use for container restart decisions | +| `/health/readiness` | **Load balancer health checks** | Ready to accept traffic - includes DB connection status | +| `/health` | **Model health monitoring** | Comprehensive LLM model health - makes actual API calls | +| `/health/services` | **Service debugging** | Check specific integrations (datadog, langfuse, etc.) | + ## Summary The proxy exposes: @@ -219,7 +228,7 @@ Here's how to use it: ``` general_settings: background_health_checks: True # enable background health checks - health_check_interval: 300 # frequency of background health checks + health_check_interval: 300 # frequency of background health checks ``` 2. Start server @@ -229,7 +238,24 @@ $ litellm /path/to/config.yaml 3. Query health endpoint: ``` -curl --location 'http://0.0.0.0:4000/health' + curl --location 'http://0.0.0.0:4000/health' +``` + +### Disable Background Health Checks For Specific Models + +Use this if you want to disable background health checks for specific models. + +If `background_health_checks` is enabled you can skip individual models by +setting `disable_background_health_check: true` in the model's `model_info`. + +```yaml +model_list: + - model_name: openai/gpt-4o + litellm_params: + model: openai/gpt-4o + api_key: os.environ/OPENAI_API_KEY + model_info: + disable_background_health_check: true ``` ### Hide details diff --git a/docs/my-website/docs/proxy/logging.md b/docs/my-website/docs/proxy/logging.md index 7e42790604e..5d3f8417222 100644 --- a/docs/my-website/docs/proxy/logging.md +++ b/docs/my-website/docs/proxy/logging.md @@ -1539,6 +1539,9 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \ ## [Datadog](../observability/datadog) +👉 Go here for using [Datadog LLM Observability](../observability/datadog) with LiteLLM Proxy + + ## Lunary #### Step1: Install dependencies and set your environment variables Install the dependencies @@ -1590,54 +1593,7 @@ curl -X POST 'http://0.0.0.0:4000/chat/completions' \ ## MLflow - -#### Step1: Install dependencies -Install the dependencies. - -```shell -pip install litellm mlflow -``` - -#### Step 2: Create a `config.yaml` with `mlflow` callback - -```yaml -model_list: - - model_name: "*" - litellm_params: - model: "*" -litellm_settings: - success_callback: ["mlflow"] - failure_callback: ["mlflow"] -``` - -#### Step 3: Start the LiteLLM proxy -```shell -litellm --config config.yaml -``` - -#### Step 4: Make a request - -```shell -curl -X POST 'http://0.0.0.0:4000/chat/completions' \ --H 'Content-Type: application/json' \ --d '{ - "model": "gpt-4o-mini", - "messages": [ - { - "role": "user", - "content": "What is the capital of France?" - } - ] -}' -``` - -#### Step 5: Review traces - -Run the following command to start MLflow UI and review recorded traces. - -```shell -mlflow ui -``` +👉 Follow the tutorial [here](../observability/mlflow) to get started with mlflow on LiteLLM Proxy Server diff --git a/docs/my-website/docs/proxy/prod.md b/docs/my-website/docs/proxy/prod.md index 5ea1871cae9..3a24a3427bd 100644 --- a/docs/my-website/docs/proxy/prod.md +++ b/docs/my-website/docs/proxy/prod.md @@ -271,16 +271,7 @@ Or [watch on Loom](https://www.loom.com/share/b08be303331246b88fdc053940d03281?s ## Extras ### Expected Performance in Production -1 LiteLLM Uvicorn Worker on Kubernetes - -| Description | Value | -|--------------|-------| -| Avg latency | `50ms` | -| Median latency | `51ms` | -| `/chat/completions` Requests/second | `100` | -| `/chat/completions` Requests/minute | `6000` | -| `/chat/completions` Requests/hour | `360K` | - +See benchmarks [here](../benchmarks#performance-metrics) ### Verifying Debugging logs are off diff --git a/docs/my-website/docs/proxy/token_auth.md b/docs/my-website/docs/proxy/token_auth.md index 82d2266dd0d..4e6ff30a188 100644 --- a/docs/my-website/docs/proxy/token_auth.md +++ b/docs/my-website/docs/proxy/token_auth.md @@ -130,28 +130,57 @@ general_settings: Set the field in the jwt token, which corresponds to a litellm user / team / org. +**Note:** All JWT fields support dot notation to access nested claims (e.g., `"user.sub"`, `"resource_access.client.roles"`). + ```yaml general_settings: master_key: sk-1234 enable_jwt_auth: True litellm_jwtauth: admin_jwt_scope: "litellm-proxy-admin" - team_id_jwt_field: "client_id" # 👈 CAN BE ANY FIELD - user_id_jwt_field: "sub" # 👈 CAN BE ANY FIELD - org_id_jwt_field: "org_id" # 👈 CAN BE ANY FIELD - end_user_id_jwt_field: "customer_id" # 👈 CAN BE ANY FIELD + team_id_jwt_field: "client_id" # 👈 CAN BE ANY FIELD (supports dot notation for nested claims) + user_id_jwt_field: "sub" # 👈 CAN BE ANY FIELD (supports dot notation for nested claims) + org_id_jwt_field: "org_id" # 👈 CAN BE ANY FIELD (supports dot notation for nested claims) + end_user_id_jwt_field: "customer_id" # 👈 CAN BE ANY FIELD (supports dot notation for nested claims) ``` -Expected JWT: +Expected JWT (flat structure): -``` +```json { "client_id": "my-unique-team", "sub": "my-unique-user", - "org_id": "my-unique-org", + "org_id": "my-unique-org" } ``` +**Or with nested structure using dot notation:** + +```json +{ + "user": { + "sub": "my-unique-user", + "email": "user@example.com" + }, + "tenant": { + "team_id": "my-unique-team" + }, + "organization": { + "id": "my-unique-org" + } +} +``` + +**Configuration for nested example:** + +```yaml +litellm_jwtauth: + user_id_jwt_field: "user.sub" + user_email_jwt_field: "user.email" + team_id_jwt_field: "tenant.team_id" + org_id_jwt_field: "organization.id" +``` + Now litellm will automatically update the spend for the user/team/org in the db for each call. ### JWT Scopes @@ -407,9 +436,15 @@ environment_variables: JWT_AUDIENCE: "api://LiteLLM_Proxy" # ensures audience is validated ``` -- `object_id_jwt_field`: The field in the JWT token that contains the object id. This id can be either a user id or a team id. Use this instead of `user_id_jwt_field` and `team_id_jwt_field`. If the same field could be both. +- `object_id_jwt_field`: The field in the JWT token that contains the object id. This id can be either a user id or a team id. Use this instead of `user_id_jwt_field` and `team_id_jwt_field`. If the same field could be both. **Supports dot notation** for nested claims (e.g., `"profile.object_id"`). -- `roles_jwt_field`: The field in the JWT token that contains the roles. This field is a list of roles that the user has. To index into a nested field, use dot notation - eg. `resource_access.litellm-test-client-id.roles`. +- `roles_jwt_field`: The field in the JWT token that contains the roles. This field is a list of roles that the user has. **Supports dot notation** for nested fields - e.g., `resource_access.litellm-test-client-id.roles`. + +**Additional JWT Field Configuration Options:** + +- `team_ids_jwt_field`: Field containing team IDs (as a list). **Supports dot notation** (e.g., `"groups"`, `"teams.ids"`). +- `user_email_jwt_field`: Field containing user email. **Supports dot notation** (e.g., `"email"`, `"user.email"`). +- `end_user_id_jwt_field`: Field containing end-user ID for cost tracking. **Supports dot notation** (e.g., `"customer_id"`, `"customer.id"`). - `role_mappings`: A list of role mappings. Map the received role in the JWT token to an internal role on LiteLLM. diff --git a/docs/my-website/docs/tutorials/cost_tracking_coding.md b/docs/my-website/docs/tutorials/cost_tracking_coding.md new file mode 100644 index 00000000000..ffad2d45c80 --- /dev/null +++ b/docs/my-website/docs/tutorials/cost_tracking_coding.md @@ -0,0 +1,91 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import Image from '@theme/IdealImage'; + +# Track Usage for Coding Tools + +Track usage and costs for AI-powered coding tools like Claude Code, Roo Code, Gemini CLI, and OpenAI Codex through LiteLLM. + +Monitor requests, costs, and user engagement metrics for each coding tool using User-Agent headers. + + + + +## Who This Is For + +Central AI Platform teams providing developers access to coding tools through LiteLLM. Monitor tool engagement and track individual user usage patterns. + +## What You Can Track + +### Summary Metrics +- Cost per coding tool +- Successful requests and token usage per tool + +### User Engagement Metrics +- Daily, weekly, and monthly active users for each User-Agent + +## Quick Start + +### 1. Connect Your Coding Tool to LiteLLM + +Configure your coding tool to send requests through the LiteLLM proxy with appropriate User-Agent headers. + +**Setup guides:** +- [Use LiteLLM with Claude Code](../../docs/tutorials/claude_responses_api) +- [Use LiteLLM with Gemini CLI](../../docs/tutorials/litellm_gemini_cli) +- [Use LiteLLM with OpenAI Codex](../../docs/tutorials/openai_codex) + +### 2. Send Requests with User-Agent Headers + +Ensure your coding tool includes identifying User-Agent headers in API requests. + +### 3. Verify Tracking in LiteLLM Logs + +Confirm LiteLLM is properly tracking requests by checking logs for the expected User-Agent values. + + + +### 4. View Usage Dashboard + +Access the LiteLLM dashboard to view aggregated usage metrics and user engagement data. + +#### Summary Metrics + +View total cost and successful requests for each coding tool. + + + +#### Daily, Weekly, and Monthly Active Users + +View active user metrics for each coding tool. + + + +## How LiteLLM Identifies Coding Tools + +LiteLLM tracks coding tools by monitoring the `User-Agent` header in incoming API requests (`/chat/completions`, `/responses`, etc.). Each unique User-Agent is tracked separately for usage analytics. + +### Example Request + +Example using `claude-cli` as the User-Agent: + +```shell +curl -X POST \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer sk-1234" \ + -H "User-Agent: claude-cli/1.0" \ + -d '{"model": "claude-3-5-sonnet-latest", "messages": [{"role": "user", "content": "Hello, how are you?"}]}' \ + http://localhost:4000/chat/completions +``` diff --git a/docs/my-website/img/agent_1.png b/docs/my-website/img/agent_1.png new file mode 100644 index 00000000000..42ef6ebdd98 Binary files /dev/null and b/docs/my-website/img/agent_1.png differ diff --git a/docs/my-website/img/agent_2.png b/docs/my-website/img/agent_2.png new file mode 100644 index 00000000000..13819a8c711 Binary files /dev/null and b/docs/my-website/img/agent_2.png differ diff --git a/docs/my-website/img/agent_3.png b/docs/my-website/img/agent_3.png new file mode 100644 index 00000000000..81cf96070cf Binary files /dev/null and b/docs/my-website/img/agent_3.png differ diff --git a/docs/my-website/img/agent_4.png b/docs/my-website/img/agent_4.png new file mode 100644 index 00000000000..2239e70cd86 Binary files /dev/null and b/docs/my-website/img/agent_4.png differ diff --git a/docs/my-website/img/dd_llm_obs.png b/docs/my-website/img/dd_llm_obs.png new file mode 100644 index 00000000000..be7c7c77178 Binary files /dev/null and b/docs/my-website/img/dd_llm_obs.png differ diff --git a/docs/my-website/img/release_notes/auto_router.png b/docs/my-website/img/release_notes/auto_router.png new file mode 100644 index 00000000000..238d2dc22cd Binary files /dev/null and b/docs/my-website/img/release_notes/auto_router.png differ diff --git a/docs/my-website/img/release_notes/mcp_header_propogation.png b/docs/my-website/img/release_notes/mcp_header_propogation.png new file mode 100644 index 00000000000..e37d2255d11 Binary files /dev/null and b/docs/my-website/img/release_notes/mcp_header_propogation.png differ diff --git a/docs/my-website/img/release_notes/model_level_guardrails.jpg b/docs/my-website/img/release_notes/model_level_guardrails.jpg new file mode 100644 index 00000000000..a432bd9e296 Binary files /dev/null and b/docs/my-website/img/release_notes/model_level_guardrails.jpg differ diff --git a/docs/my-website/release_notes/v1.74.15-stable/index.md b/docs/my-website/release_notes/v1.74.15-stable/index.md new file mode 100644 index 00000000000..a94359e3403 --- /dev/null +++ b/docs/my-website/release_notes/v1.74.15-stable/index.md @@ -0,0 +1,291 @@ +--- +title: "[Pre-Release] v1.74.15-stable" +slug: "v1-74-15" +date: 2025-08-02T10:00:00 +authors: + - name: Krrish Dholakia + title: CEO, LiteLLM + url: https://www.linkedin.com/in/krish-d/ + image_url: https://pbs.twimg.com/profile_images/1298587542745358340/DZv3Oj-h_400x400.jpg + - name: Ishaan Jaffer + title: CTO, LiteLLM + url: https://www.linkedin.com/in/reffajnaahsi/ + image_url: https://pbs.twimg.com/profile_images/1613813310264340481/lz54oEiB_400x400.jpg + +hide_table_of_contents: false +--- + +import Image from '@theme/IdealImage'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +## Deploy this version + + + + +``` showLineNumbers title="docker run litellm" +docker run \ +-e STORE_MODEL_IN_DB=True \ +-p 4000:4000 \ +ghcr.io/berriai/litellm:v1.74.15.rc.1 +``` + + + + +``` showLineNumbers title="pip install litellm" +pip install litellm==1.74.15.post1 +``` + + + + +--- + +## Key Highlights + +- **User Agent Activity Tracking** - Track how much usage each coding tool gets. +- **Prompt Management** - Use Git-Ops style prompt management with prompt templates. +- **MCP Gateway: Guardrails** - Support for using Guardrails with MCP servers. +- **Google AI Studio Imagen4** - Support for using Imagen4 models on Google AI Studio. + +--- + +## User Agent Activity Tracking + + + +
+ +This release brings support for tracking usage and costs for AI-powered coding tools like Claude Code, Roo Code, Gemini CLI through LiteLLM. You can now track LLM cost, total tokens used, and DAU/WAU/MAU for each coding tool. + +This is great to central AI Platform teams looking to track how they are helping developer productivity. + +[Read More](https://docs.litellm.ai/docs/tutorials/cost_tracking_coding) + +--- + +## Prompt Management + +
+ + + +[Read More](../../docs/proxy/prompt_management) + +--- + +## New Models / Updated Models + +#### New Model Support + +| Provider | Model | Context Window | Input ($/1M tokens) | Output ($/1M tokens) | Cost per Image | +| ----------- | -------------------------------------- | -------------- | ------------------- | -------------------- | -------------- | +| OpenRouter | `openrouter/x-ai/grok-4` | 256k | $3 | $15 | N/A | +| Google AI Studio | `gemini/imagen-4.0-generate-preview-06-06` | N/A | N/A | N/A | $0.04 | +| Google AI Studio | `gemini/imagen-4.0-ultra-generate-preview-06-06` | N/A | N/A | N/A | $0.06 | +| Google AI Studio | `gemini/imagen-4.0-fast-generate-preview-06-06` | N/A | N/A | N/A | $0.02 | +| Google AI Studio | `gemini/imagen-3.0-generate-002` | N/A | N/A | N/A | $0.04 | +| Google AI Studio | `gemini/imagen-3.0-generate-001` | N/A | N/A | N/A | $0.04 | +| Google AI Studio | `gemini/imagen-3.0-fast-generate-001` | N/A | N/A | N/A | $0.02 | + +#### Features + +- **[Google AI Studio](../../docs/providers/gemini)** + - Added Google AI Studio Imagen4 model family support - [PR #13065](https://github.com/BerriAI/litellm/pull/13065), [Get Started](../../docs/providers/google_ai_studio/image_gen) +- **[Azure OpenAI](../../docs/providers/azure/azure)** + - Azure `api_version="preview"` support - [PR #13072](https://github.com/BerriAI/litellm/pull/13072), [Get Started](../../docs/providers/azure/azure#setting-api-version) + - Password protected certificate files support - [PR #12995](https://github.com/BerriAI/litellm/pull/12995), [Get Started](../../docs/providers/azure/azure#authentication) +- **[AWS Bedrock](../../docs/providers/bedrock)** + - Cost tracking via Anthropic `/v1/messages` - [PR #13072](https://github.com/BerriAI/litellm/pull/13072) + - Computer use support - [PR #13150](https://github.com/BerriAI/litellm/pull/13150) +- **[OpenRouter](../../docs/providers/openrouter)** + - Added Grok4 model support - [PR #13018](https://github.com/BerriAI/litellm/pull/13018) +- **[Anthropic](../../docs/providers/anthropic)** + - Auto Cache Control Injection - Improved cache_control_injection_points with negative index support - [PR #13187](https://github.com/BerriAI/litellm/pull/13187), [Get Started](../../docs/tutorials/prompt_caching) + - Working mid-stream fallbacks with token usage tracking - [PR #13149](https://github.com/BerriAI/litellm/pull/13149), [PR #13170](https://github.com/BerriAI/litellm/pull/13170) +- **[Perplexity](../../docs/providers/perplexity)** + - Citation annotations support - [PR #13225](https://github.com/BerriAI/litellm/pull/13225) + +#### Bugs + +- **[Gemini](../../docs/providers/gemini)** + - Fix merge_reasoning_content_in_choices parameter issue - [PR #13066](https://github.com/BerriAI/litellm/pull/13066), [Get Started](../../docs/tutorials/openweb_ui#render-thinking-content-on-open-webui) + - Added support for using `GOOGLE_API_KEY` environment variable for Google AI Studio - [PR #12507](https://github.com/BerriAI/litellm/pull/12507) +- **[vLLM/OpenAI-like](../../docs/providers/vllm)** + - Fix missing extra_headers support for embeddings - [PR #13198](https://github.com/BerriAI/litellm/pull/13198) + +--- + +## LLM API Endpoints + +#### Bugs + +- **[/generateContent](../../docs/generateContent)** + - Support for query_params in generateContent routes for API Key setting - [PR #13100](https://github.com/BerriAI/litellm/pull/13100) + - Ensure "x-goog-api-key" is used for auth to google ai studio when using /generateContent on LiteLLM - [PR #13098](https://github.com/BerriAI/litellm/pull/13098) + - Ensure tool calling works as expected on generateContent - [PR #13189](https://github.com/BerriAI/litellm/pull/13189) +- **[/vertex_ai (Passthrough)](../../docs/pass_through/vertex_ai)** + - Ensure multimodal embedding responses are logged properly - [PR #13050](https://github.com/BerriAI/litellm/pull/13050) + +--- + +## [MCP Gateway](../../docs/mcp) + +#### Features + +- **Health Check Improvements** + - Add health check endpoints for MCP servers - [PR #13106](https://github.com/BerriAI/litellm/pull/13106) +- **Guardrails Integration** + - Add pre and during call hooks initialization - [PR #13067](https://github.com/BerriAI/litellm/pull/13067) + - Move pre and during hooks to ProxyLogging - [PR #13109](https://github.com/BerriAI/litellm/pull/13109) + - MCP pre and during guardrails implementation - [PR #13188](https://github.com/BerriAI/litellm/pull/13188) +- **Protocol & Header Support** + - Add protocol headers support - [PR #13062](https://github.com/BerriAI/litellm/pull/13062) +- **URL & Namespacing** + - Improve MCP server URL validation for internal/Kubernetes URLs - [PR #13099](https://github.com/BerriAI/litellm/pull/13099) + + +#### Bugs + +- **UI** + - Fix scrolling issue with MCP tools - [PR #13015](https://github.com/BerriAI/litellm/pull/13015) + - Fix MCP client list failure - [PR #13114](https://github.com/BerriAI/litellm/pull/13114) + + +[Read More](../../docs/mcp) + + +--- + +## Management Endpoints / UI + +#### Features + +- **Usage Analytics** + - New tab for user agent activity tracking - [PR #13146](https://github.com/BerriAI/litellm/pull/13146) + - Daily usage per user analytics - [PR #13147](https://github.com/BerriAI/litellm/pull/13147) + - Default usage chart date range set to last 7 days - [PR #12917](https://github.com/BerriAI/litellm/pull/12917) + - New advanced date range picker component - [PR #13141](https://github.com/BerriAI/litellm/pull/13141), [PR #13221](https://github.com/BerriAI/litellm/pull/13221) + - Show loader on usage cost charts after date selection - [PR #13113](https://github.com/BerriAI/litellm/pull/13113) +- **Models** + - Added Voyage, Jinai, Deepinfra and VolcEngine providers on UI - [PR #13131](https://github.com/BerriAI/litellm/pull/13131) + - Added Sagemaker on UI - [PR #13117](https://github.com/BerriAI/litellm/pull/13117) + - Preserve model order in `/v1/models` and `/model_group/info` endpoints - [PR #13178](https://github.com/BerriAI/litellm/pull/13178) + +- **Key Management** + - Properly parse JSON options for key generation in UI - [PR #12989](https://github.com/BerriAI/litellm/pull/12989) +- **Authentication** + - **JWT Fields** + - Add dot notation support for all JWT fields - [PR #13013](https://github.com/BerriAI/litellm/pull/13013) + +#### Bugs + +- **Permissions** + - Fix object permission for organizations - [PR #13142](https://github.com/BerriAI/litellm/pull/13142) + - Fix list team v2 security check - [PR #13094](https://github.com/BerriAI/litellm/pull/13094) +- **Models** + - Fix model reload on model update - [PR #13216](https://github.com/BerriAI/litellm/pull/13216) +- **Router Settings** + - Fix displaying models for fallbacks in UI - [PR #13191](https://github.com/BerriAI/litellm/pull/13191) + - Fix wildcard model name handling with custom values - [PR #13116](https://github.com/BerriAI/litellm/pull/13116) + - Fix fallback delete functionality - [PR #12606](https://github.com/BerriAI/litellm/pull/12606) + +--- + +## Logging / Guardrail Integrations + +#### Features + +- **[MLFlow](../../docs/proxy/logging#mlflow)** + - Allow adding tags for MLFlow logging requests - [PR #13108](https://github.com/BerriAI/litellm/pull/13108) +- **[Langfuse OTEL](../../docs/proxy/logging#langfuse)** + - Add comprehensive metadata support to Langfuse OpenTelemetry integration - [PR #12956](https://github.com/BerriAI/litellm/pull/12956) +- **[Datadog LLM Observability](../../docs/proxy/logging#datadog)** + - Allow redacting message/response content for specific logging integrations - [PR #13158](https://github.com/BerriAI/litellm/pull/13158) + +#### Bugs + +- **API Key Logging** + - Fix API Key being logged inappropriately - [PR #12978](https://github.com/BerriAI/litellm/pull/12978) +- **MCP Spend Tracking** + - Set default value for MCP namespace tool name in spend table - [PR #12894](https://github.com/BerriAI/litellm/pull/12894) + +--- + +## Performance / Loadbalancing / Reliability improvements + +#### Features + +- **Background Health Checks** + - Allow disabling background health checks for specific deployments - [PR #13186](https://github.com/BerriAI/litellm/pull/13186) +- **Database Connection Management** + - Ensure stale Prisma clients disconnect DB connections properly - [PR #13140](https://github.com/BerriAI/litellm/pull/13140) +- **Jitter Improvements** + - Fix jitter calculation (should be added not multiplied) - [PR #12901](https://github.com/BerriAI/litellm/pull/12901) + +#### Bugs + +- **Anthropic Streaming** + - Always use choice index=0 for Anthropic streaming responses - [PR #12666](https://github.com/BerriAI/litellm/pull/12666) +- **Custom Auth** + - Bubble up custom exceptions properly - [PR #13093](https://github.com/BerriAI/litellm/pull/13093) +- **OTEL with Managed Files** + - Fix using managed files with OTEL integration - [PR #13171](https://github.com/BerriAI/litellm/pull/13171) + +--- + +## General Proxy Improvements + +#### Features + +- **Database Migration** + - Move to use_prisma_migrate by default - [PR #13117](https://github.com/BerriAI/litellm/pull/13117) + - Resolve team-only models on auth checks - [PR #13117](https://github.com/BerriAI/litellm/pull/13117) +- **Infrastructure** + - Loosened MCP Python version restrictions - [PR #13102](https://github.com/BerriAI/litellm/pull/13102) + - Migrate build_and_test to CI/CD Postgres DB - [PR #13166](https://github.com/BerriAI/litellm/pull/13166) +- **Helm Charts** + - Allow Helm hooks for migration jobs - [PR #13174](https://github.com/BerriAI/litellm/pull/13174) + - Fix Helm migration job schema updates - [PR #12809](https://github.com/BerriAI/litellm/pull/12809) + +#### Bugs + +- **Docker** + - Remove obsolete `version` attribute in docker-compose - [PR #13172](https://github.com/BerriAI/litellm/pull/13172) + - Add openssl in runtime stage for non-root Dockerfile - [PR #13168](https://github.com/BerriAI/litellm/pull/13168) +- **Database Configuration** + - Fix DB config through environment variables - [PR #13111](https://github.com/BerriAI/litellm/pull/13111) +- **Logging** + - Suppress httpx logging - [PR #13217](https://github.com/BerriAI/litellm/pull/13217) +- **Token Counting** + - Ignore unsupported keys like prefix in token counter - [PR #11954](https://github.com/BerriAI/litellm/pull/11954) +--- + +## New Contributors +* @5731la made their first contribution in https://github.com/BerriAI/litellm/pull/12989 +* @restato made their first contribution in https://github.com/BerriAI/litellm/pull/12980 +* @strickvl made their first contribution in https://github.com/BerriAI/litellm/pull/12956 +* @Ne0-1 made their first contribution in https://github.com/BerriAI/litellm/pull/12995 +* @maxrabin made their first contribution in https://github.com/BerriAI/litellm/pull/13079 +* @lvuna made their first contribution in https://github.com/BerriAI/litellm/pull/12894 +* @Maximgitman made their first contribution in https://github.com/BerriAI/litellm/pull/12666 +* @pathikrit made their first contribution in https://github.com/BerriAI/litellm/pull/12901 +* @huetterma made their first contribution in https://github.com/BerriAI/litellm/pull/12809 +* @betterthanbreakfast made their first contribution in https://github.com/BerriAI/litellm/pull/13029 +* @phosae made their first contribution in https://github.com/BerriAI/litellm/pull/12606 +* @sahusiddharth made their first contribution in https://github.com/BerriAI/litellm/pull/12507 +* @Amit-kr26 made their first contribution in https://github.com/BerriAI/litellm/pull/11954 +* @kowyo made their first contribution in https://github.com/BerriAI/litellm/pull/13172 +* @AnandKhinvasara made their first contribution in https://github.com/BerriAI/litellm/pull/13187 +* @unique-jakub made their first contribution in https://github.com/BerriAI/litellm/pull/13174 +* @tyumentsev4 made their first contribution in https://github.com/BerriAI/litellm/pull/13134 +* @aayush-malviya-acquia made their first contribution in https://github.com/BerriAI/litellm/pull/12978 +* @kankute-sameer made their first contribution in https://github.com/BerriAI/litellm/pull/13225 +* @AlexanderYastrebov made their first contribution in https://github.com/BerriAI/litellm/pull/13178 + +## **[Full Changelog](https://github.com/BerriAI/litellm/compare/v1.74.9-stable...v1.74.15.rc)** \ No newline at end of file diff --git a/docs/my-website/release_notes/v1.74.9-stable/index.md b/docs/my-website/release_notes/v1.74.9-stable/index.md index a72ffe1a2cf..3f100745dfe 100644 --- a/docs/my-website/release_notes/v1.74.9-stable/index.md +++ b/docs/my-website/release_notes/v1.74.9-stable/index.md @@ -1,5 +1,5 @@ --- -title: "[PRE-RELEASE] v1.74.9-stable" +title: "v1.74.9-stable - Auto-Router" slug: "v1-74-9" date: 2025-07-27T10:00:00 authors: @@ -21,21 +21,104 @@ import TabItem from '@theme/TabItem'; ## Deploy this version -:::info + + -This release is not live yet. +``` showLineNumbers title="docker run litellm" +docker run \ +-e STORE_MODEL_IN_DB=True \ +-p 4000:4000 \ +ghcr.io/berriai/litellm:v1.74.9-stable.patch.1 +``` + -::: + + +``` showLineNumbers title="pip install litellm" +pip install litellm==1.74.9.post2 +``` + + + --- +## Key Highlights + +- **Auto-Router** - Automatically route requests to specific models based on request content. +- **Model-level Guardrails** - Only run guardrails when specific models are used. +- **MCP Header Propagation** - Propagate headers from client to backend MCP. +- **New LLM Providers** - Added Bedrock inpainting support and Recraft API image generation / image edits support. + +--- + +## Auto-Router + + + +
+ +This release introduces auto-routing to models based on request content. This means **Proxy Admins** can define a set of keywords that always routes to specific models when **users** opt in to using the auto-router. + +This is great for internal use cases where you don't want **users** to think about which model to use - for example, use Claude models for coding vs GPT models for generating ad copy. + + +[Read More](../../docs/proxy/auto_routing) + +--- + +## Model-level Guardrails + + + +
+ +This release brings model-level guardrails support to your config.yaml + UI. This is great for cases when you have an on-prem and hosted model, and just want to run prevent sending PII to the hosted model. + +```yaml +model_list: + - model_name: claude-sonnet-4 + litellm_params: + model: anthropic/claude-sonnet-4-20250514 + api_key: os.environ/ANTHROPIC_API_KEY + api_base: https://api.anthropic.com/v1 + guardrails: ["azure-text-moderation"] # 👈 KEY CHANGE + +guardrails: + - guardrail_name: azure-text-moderation + litellm_params: + guardrail: azure/text_moderations + mode: "post_call" + api_key: os.environ/AZURE_GUARDRAIL_API_KEY + api_base: os.environ/AZURE_GUARDRAIL_API_BASE +``` + + +[Read More](../../docs/proxy/guardrails/quick_start#model-level-guardrails) + +--- +## MCP Header Propagation + + + +
+ +v1.74.9-stable allows you to propagate MCP server specific authentication headers via LiteLLM + +- Allowing users to specify which `header_name` is to be propagated to which `mcp_server` via headers +- Allows adding of different deployments of same MCP server type to use different authentication headers + + +[Read More](https://docs.litellm.ai/docs/mcp#new-server-specific-auth-headers-recommended) + +--- ## New Models / Updated Models #### Pricing / Context Window Updates | Provider | Model | Context Window | Input ($/1M tokens) | Output ($/1M tokens) | | ----------- | -------------------------------------- | -------------- | ------------------- | -------------------- | -| Fireworks AI | `fireworks/models/kimi-k2-instruct | 131k | $0.6 | $2.5 | +| Fireworks AI | `fireworks/models/kimi-k2-instruct` | 131k | $0.6 | $2.5 | | OpenRouter | `openrouter/qwen/qwen-vl-plus` | 8192 | $0.21 | $0.63 | | OpenRouter | `openrouter/qwen/qwen3-coder` | 8192 | $1 | $5 | | OpenRouter | `openrouter/bytedance/ui-tars-1.5-7b` | 128k | $0.10 | $0.20 | diff --git a/docs/my-website/sidebars.js b/docs/my-website/sidebars.js index 47785a7fde0..83ebfe29dc4 100644 --- a/docs/my-website/sidebars.js +++ b/docs/my-website/sidebars.js @@ -78,6 +78,7 @@ const sidebars = { "tutorials/litellm_qwen_code_cli", "tutorials/github_copilot_integration", "tutorials/claude_responses_api", + "tutorials/cost_tracking_coding", ] }, @@ -485,6 +486,7 @@ const sidebars = { "completion/vision", "completion/json_mode", "reasoning_content", + "completion/computer_use", "completion/prompt_caching", "completion/predict_outputs", "completion/knowledgebase", diff --git a/enterprise/enterprise_hooks/aporia_ai.py b/enterprise/enterprise_hooks/aporia_ai.py index d2184e92f2f..de741aa6ca7 100644 --- a/enterprise/enterprise_hooks/aporia_ai.py +++ b/enterprise/enterprise_hooks/aporia_ai.py @@ -173,6 +173,7 @@ class AporiaGuardrail(CustomGuardrail): "moderation", "audio_transcription", "responses", + "mcp_call", ], ): from litellm.proxy.common_utils.callback_utils import ( diff --git a/enterprise/enterprise_hooks/google_text_moderation.py b/enterprise/enterprise_hooks/google_text_moderation.py index fe26a03207f..61987af7532 100644 --- a/enterprise/enterprise_hooks/google_text_moderation.py +++ b/enterprise/enterprise_hooks/google_text_moderation.py @@ -95,6 +95,7 @@ class _ENTERPRISE_GoogleTextModeration(CustomLogger): "moderation", "audio_transcription", "responses", + "mcp_call", ], ): """ diff --git a/enterprise/enterprise_hooks/openai_moderation.py b/enterprise/enterprise_hooks/openai_moderation.py index ee8ac495099..0b6f34018b4 100644 --- a/enterprise/enterprise_hooks/openai_moderation.py +++ b/enterprise/enterprise_hooks/openai_moderation.py @@ -42,6 +42,7 @@ class _ENTERPRISE_OpenAI_Moderation(CustomLogger): "moderation", "audio_transcription", "responses", + "mcp_call", ], ): text = "" diff --git a/enterprise/litellm_enterprise/enterprise_callbacks/llama_guard.py b/enterprise/litellm_enterprise/enterprise_callbacks/llama_guard.py index a44af55d4b1..ea428b51b8e 100644 --- a/enterprise/litellm_enterprise/enterprise_callbacks/llama_guard.py +++ b/enterprise/litellm_enterprise/enterprise_callbacks/llama_guard.py @@ -105,6 +105,7 @@ class _ENTERPRISE_LlamaGuard(CustomLogger): "moderation", "audio_transcription", "responses", + "mcp_call", ], ): """ diff --git a/enterprise/litellm_enterprise/enterprise_callbacks/llm_guard.py b/enterprise/litellm_enterprise/enterprise_callbacks/llm_guard.py index 1475a94303e..6735998960b 100644 --- a/enterprise/litellm_enterprise/enterprise_callbacks/llm_guard.py +++ b/enterprise/litellm_enterprise/enterprise_callbacks/llm_guard.py @@ -127,6 +127,7 @@ class _ENTERPRISE_LLMGuard(CustomLogger): "moderation", "audio_transcription", "responses", + "mcp_call", ], ): """ diff --git a/enterprise/litellm_enterprise/enterprise_callbacks/pagerduty/pagerduty.py b/enterprise/litellm_enterprise/enterprise_callbacks/pagerduty/pagerduty.py index 00230937b32..1028a443a42 100644 --- a/enterprise/litellm_enterprise/enterprise_callbacks/pagerduty/pagerduty.py +++ b/enterprise/litellm_enterprise/enterprise_callbacks/pagerduty/pagerduty.py @@ -147,6 +147,7 @@ class PagerDutyAlerting(SlackAlerting): "audio_transcription", "pass_through_endpoint", "rerank", + "mcp_call", ], ) -> Optional[Union[Exception, str, dict]]: """ diff --git a/enterprise/litellm_enterprise/proxy/auth/user_api_key_auth.py b/enterprise/litellm_enterprise/proxy/auth/user_api_key_auth.py index 35b4c2a1f3b..dc9fdeb78e2 100644 --- a/enterprise/litellm_enterprise/proxy/auth/user_api_key_auth.py +++ b/enterprise/litellm_enterprise/proxy/auth/user_api_key_auth.py @@ -3,7 +3,7 @@ from typing import Any, Optional from fastapi import Request from litellm._logging import verbose_proxy_logger -from litellm.proxy._types import UserAPIKeyAuth +from litellm.proxy._types import ProxyException, UserAPIKeyAuth async def enterprise_custom_auth( @@ -24,6 +24,8 @@ async def enterprise_custom_auth( elif custom_auth_settings["mode"] == "auto": try: return await user_custom_auth(request, api_key) + except ProxyException as e: + raise e except Exception as e: verbose_proxy_logger.debug( f"Error in custom auth, checking litellm auth: {e}" diff --git a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py index a2c788a8f21..e069a89b9c5 100644 --- a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py +++ b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py @@ -290,6 +290,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints): "aretrieve_fine_tuning_job", "alist_fine_tuning_jobs", "acancel_fine_tuning_job", + "mcp_call", ], ) -> Union[Exception, str, Dict, None]: """ diff --git a/litellm-proxy-extras/dist/litellm_proxy_extras-0.2.14-py3-none-any.whl b/litellm-proxy-extras/dist/litellm_proxy_extras-0.2.14-py3-none-any.whl new file mode 100644 index 00000000000..fc160319c07 Binary files /dev/null and b/litellm-proxy-extras/dist/litellm_proxy_extras-0.2.14-py3-none-any.whl differ diff --git a/litellm-proxy-extras/dist/litellm_proxy_extras-0.2.14.tar.gz b/litellm-proxy-extras/dist/litellm_proxy_extras-0.2.14.tar.gz new file mode 100644 index 00000000000..b5d3f317b96 Binary files /dev/null and b/litellm-proxy-extras/dist/litellm_proxy_extras-0.2.14.tar.gz differ diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20250507161527_add_health_check_fields_to_mcp_servers/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20250507161527_add_health_check_fields_to_mcp_servers/migration.sql new file mode 100644 index 00000000000..d5c206d1929 --- /dev/null +++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20250507161527_add_health_check_fields_to_mcp_servers/migration.sql @@ -0,0 +1,4 @@ +-- Add health check fields to MCP server table +ALTER TABLE "LiteLLM_MCPServerTable" ADD COLUMN "status" TEXT DEFAULT 'unknown'; +ALTER TABLE "LiteLLM_MCPServerTable" ADD COLUMN "last_health_check" TIMESTAMP(3); +ALTER TABLE "LiteLLM_MCPServerTable" ADD COLUMN "health_check_error" TEXT; \ No newline at end of file diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20250802162330_prompt_table/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20250802162330_prompt_table/migration.sql new file mode 100644 index 00000000000..e5c00ef4adb --- /dev/null +++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20250802162330_prompt_table/migration.sql @@ -0,0 +1,15 @@ +-- CreateTable +CREATE TABLE "LiteLLM_PromptTable" ( + "id" TEXT NOT NULL, + "prompt_id" TEXT NOT NULL, + "litellm_params" JSONB NOT NULL, + "prompt_info" JSONB, + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "LiteLLM_PromptTable_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "LiteLLM_PromptTable_prompt_id_key" ON "LiteLLM_PromptTable"("prompt_id"); + diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma index ef29d7c9bfa..b8f2201d6b5 100644 --- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma +++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma @@ -179,6 +179,10 @@ model LiteLLM_MCPServerTable { updated_by String? mcp_info Json? @default("{}") mcp_access_groups String[] + // Health check status + status String? @default("unknown") + last_health_check DateTime? + health_check_error String? // Stdio-specific fields command String? args String[] @default([]) @@ -516,6 +520,16 @@ model LiteLLM_GuardrailsTable { updated_at DateTime @updatedAt } +// Prompt table for storing prompt configurations +model LiteLLM_PromptTable { + id String @id @default(uuid()) + prompt_id String @unique + litellm_params Json + prompt_info Json? + created_at DateTime @default(now()) + updated_at DateTime @updatedAt +} + model LiteLLM_HealthCheckTable { health_check_id String @id @default(uuid()) model_name String diff --git a/litellm-proxy-extras/pyproject.toml b/litellm-proxy-extras/pyproject.toml index db24e4f42a1..ceffd9adefd 100644 --- a/litellm-proxy-extras/pyproject.toml +++ b/litellm-proxy-extras/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm-proxy-extras" -version = "0.2.12" +version = "0.2.15" description = "Additional files for the LiteLLM Proxy. Reduces the size of the main litellm package." authors = ["BerriAI"] readme = "README.md" @@ -22,7 +22,7 @@ requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.commitizen] -version = "0.2.12" +version = "0.2.15" version_files = [ "pyproject.toml:version", "../requirements.txt:litellm-proxy-extras==", diff --git a/litellm/__init__.py b/litellm/__init__.py index 412f552e9c2..8cf7d3922a9 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -5,7 +5,18 @@ warnings.filterwarnings("ignore", message=".*conflict with protected namespace.* ### INIT VARIABLES #################### import threading import os -from typing import Callable, List, Optional, Dict, Union, Any, Literal, get_args +from typing import ( + Callable, + List, + Optional, + Dict, + Union, + Any, + Literal, + get_args, + TYPE_CHECKING, +) +from litellm.types.integrations.datadog_llm_obs import DatadogLLMObsInitParams from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler from litellm.caching.caching import Cache, DualCache, RedisCache, InMemoryCache from litellm.caching.llm_caching_handler import LLMClientCache @@ -60,6 +71,11 @@ from litellm.constants import ( DEFAULT_SOFT_BUDGET, DEFAULT_ALLOWED_FAILS, ) +from litellm.integrations.dotprompt import ( + global_prompt_manager, + global_prompt_directory, + set_global_prompt_directory, +) from litellm.types.guardrails import GuardrailItem from litellm.types.secret_managers.main import ( KeyManagementSystem, @@ -82,7 +98,6 @@ if litellm_mode == "DEV": # Register async client cleanup to prevent resource leaks register_async_client_cleanup() - #################################################### if set_verbose == True: _turn_on_debug() @@ -129,6 +144,7 @@ _custom_logger_compatible_callbacks_literal = Literal[ "s3_v2", "aws_sqs", "vector_store_pre_call_hook", + "dotprompt", ] logged_real_time_event_types: Optional[Union[List[str], Literal["*"]]] = None _known_custom_logger_compatible_callbacks: List = list( @@ -144,22 +160,22 @@ prometheus_initialize_budget_metrics: Optional[bool] = False require_auth_for_metrics_endpoint: Optional[bool] = False argilla_batch_size: Optional[int] = None datadog_use_v1: Optional[bool] = False # if you want to use v1 datadog logged payload. -gcs_pub_sub_use_v1: Optional[ - bool -] = False # if you want to use v1 gcs pubsub logged payload -generic_api_use_v1: Optional[ - bool -] = False # if you want to use v1 generic api logged payload +gcs_pub_sub_use_v1: Optional[bool] = ( + False # if you want to use v1 gcs pubsub logged payload +) +generic_api_use_v1: Optional[bool] = ( + False # if you want to use v1 generic api logged payload +) argilla_transformation_object: Optional[Dict[str, Any]] = None -_async_input_callback: List[ - Union[str, Callable, CustomLogger] -] = [] # internal variable - async custom callbacks are routed here. -_async_success_callback: List[ - Union[str, Callable, CustomLogger] -] = [] # internal variable - async custom callbacks are routed here. -_async_failure_callback: List[ - Union[str, Callable, CustomLogger] -] = [] # internal variable - async custom callbacks are routed here. +_async_input_callback: List[Union[str, Callable, CustomLogger]] = ( + [] +) # internal variable - async custom callbacks are routed here. +_async_success_callback: List[Union[str, Callable, CustomLogger]] = ( + [] +) # internal variable - async custom callbacks are routed here. +_async_failure_callback: List[Union[str, Callable, CustomLogger]] = ( + [] +) # internal variable - async custom callbacks are routed here. pre_call_rules: List[Callable] = [] post_call_rules: List[Callable] = [] turn_off_message_logging: Optional[bool] = False @@ -167,18 +183,18 @@ log_raw_request_response: bool = False redact_messages_in_exceptions: Optional[bool] = False redact_user_api_key_info: Optional[bool] = False filter_invalid_headers: Optional[bool] = False -add_user_information_to_llm_headers: Optional[ - bool -] = None # adds user_id, team_id, token hash (params from StandardLoggingMetadata) to request headers +add_user_information_to_llm_headers: Optional[bool] = ( + None # adds user_id, team_id, token hash (params from StandardLoggingMetadata) to request headers +) store_audit_logs = False # Enterprise feature, allow users to see audit logs ### end of callbacks ############# -email: Optional[ - str -] = None # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 -token: Optional[ - str -] = None # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 +email: Optional[str] = ( + None # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 +) +token: Optional[str] = ( + None # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 +) telemetry = True max_tokens: int = DEFAULT_MAX_TOKENS # OpenAI Defaults drop_params = bool(os.getenv("LITELLM_DROP_PARAMS", False)) @@ -253,6 +269,11 @@ blocked_user_list: Optional[Union[str, List]] = None banned_keywords_list: Optional[Union[str, List]] = None llm_guard_mode: Literal["all", "key-specific", "request-specific"] = "all" guardrail_name_config_map: Dict[str, GuardrailItem] = {} +### PROMPTS ### +from litellm.types.prompts.init_prompts import PromptSpec + +prompt_name_config_map: Dict[str, PromptSpec] = {} + ################## ### PREVIEW FEATURES ### enable_preview_features: bool = False @@ -266,11 +287,15 @@ enable_loadbalancing_on_batch_endpoints: Optional[bool] = None enable_caching_on_provider_specific_optional_params: bool = ( False # feature-flag for caching on optional params - e.g. 'top_k' ) -caching: bool = False # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 -caching_with_models: bool = False # # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 -cache: Optional[ - Cache -] = None # cache object <- use this - https://docs.litellm.ai/docs/caching +caching: bool = ( + False # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 +) +caching_with_models: bool = ( + False # # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 +) +cache: Optional[Cache] = ( + None # cache object <- use this - https://docs.litellm.ai/docs/caching +) default_in_memory_ttl: Optional[float] = None default_redis_ttl: Optional[float] = None default_redis_batch_cache_expiry: Optional[float] = None @@ -278,9 +303,9 @@ model_alias_map: Dict[str, str] = {} model_group_alias_map: Dict[str, str] = {} model_group_settings: Optional["ModelGroupSettings"] = None max_budget: float = 0.0 # set the max budget across all providers -budget_duration: Optional[ - str -] = None # proxy only - resets budget after fixed duration. You can set duration as seconds ("30s"), minutes ("30m"), hours ("30h"), days ("30d"). +budget_duration: Optional[str] = ( + None # proxy only - resets budget after fixed duration. You can set duration as seconds ("30s"), minutes ("30m"), hours ("30h"), days ("30d"). +) default_soft_budget: float = ( DEFAULT_SOFT_BUDGET # by default all litellm proxy keys have a soft budget of 50.0 ) @@ -289,14 +314,19 @@ forward_traceparent_to_llm_provider: bool = False _current_cost = 0.0 # private variable, used if max budget is set error_logs: Dict = {} -add_function_to_prompt: bool = False # if function calling not supported by api, append function call details to system prompt +add_function_to_prompt: bool = ( + False # if function calling not supported by api, append function call details to system prompt +) client_session: Optional[httpx.Client] = None aclient_session: Optional[httpx.AsyncClient] = None model_fallbacks: Optional[List] = None # Deprecated for 'litellm.fallbacks' -model_cost_map_url: str = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json" +model_cost_map_url: str = ( + "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json" +) suppress_debug_info = False dynamodb_table_name: Optional[str] = None s3_callback_params: Optional[Dict] = None +datadog_llm_observability_params: Optional[Union[DatadogLLMObsInitParams, Dict]] = None aws_sqs_callback_params: Optional[Dict] = None generic_logger_headers: Optional[Dict] = None default_key_generate_params: Optional[Dict] = None @@ -321,7 +351,9 @@ prometheus_metrics_config: Optional[List] = None disable_add_prefix_to_prompt: bool = ( False # used by anthropic, to disable adding prefix to prompt ) -disable_copilot_system_to_assistant: bool = False # If false (default), converts all 'system' role messages to 'assistant' for GitHub Copilot compatibility. Set to true to disable this behavior. +disable_copilot_system_to_assistant: bool = ( + False # If false (default), converts all 'system' role messages to 'assistant' for GitHub Copilot compatibility. Set to true to disable this behavior. +) public_model_groups: Optional[List[str]] = None public_model_groups_links: Dict[str, str] = {} #### REQUEST PRIORITIZATION ##### @@ -329,13 +361,17 @@ priority_reservation: Optional[Dict[str, float]] = None ######## Networking Settings ######## -use_aiohttp_transport: bool = True # Older variable, aiohttp is now the default. use disable_aiohttp_transport instead. +use_aiohttp_transport: bool = ( + True # Older variable, aiohttp is now the default. use disable_aiohttp_transport instead. +) aiohttp_trust_env: bool = False # set to true to use HTTP_ Proxy settings disable_aiohttp_transport: bool = False # Set this to true to use httpx instead disable_aiohttp_trust_env: bool = ( False # When False, aiohttp will respect HTTP(S)_PROXY env vars ) -force_ipv4: bool = False # when True, litellm will force ipv4 for all LLM requests. Some users have seen httpx ConnectionError when using ipv6. +force_ipv4: bool = ( + False # when True, litellm will force ipv4 for all LLM requests. Some users have seen httpx ConnectionError when using ipv6. +) module_level_aclient = AsyncHTTPHandler( timeout=request_timeout, client_alias="module level aclient" ) @@ -349,13 +385,13 @@ fallbacks: Optional[List] = None context_window_fallbacks: Optional[List] = None content_policy_fallbacks: Optional[List] = None allowed_fails: int = 3 -num_retries_per_request: Optional[ - int -] = None # for the request overall (incl. fallbacks + model retries) +num_retries_per_request: Optional[int] = ( + None # for the request overall (incl. fallbacks + model retries) +) ####### SECRET MANAGERS ##################### -secret_manager_client: Optional[ - Any -] = None # list of instantiated key management clients - e.g. azure kv, infisical, etc. +secret_manager_client: Optional[Any] = ( + None # list of instantiated key management clients - e.g. azure kv, infisical, etc. +) _google_kms_resource_name: Optional[str] = None _key_management_system: Optional[KeyManagementSystem] = None _key_management_settings: KeyManagementSettings = KeyManagementSettings() @@ -494,6 +530,7 @@ lambda_ai_models: List = [] hyperbolic_models: List = [] recraft_models: List = [] + def is_bedrock_pricing_only_model(key: str) -> bool: """ Excludes keys with the pattern 'bedrock//'. These are in the model_prices_and_context_window.json file for pricing purposes only. @@ -1223,12 +1260,12 @@ from .types.llms.custom_llm import CustomLLMItem from .types.utils import GenericStreamingChunk custom_provider_map: List[CustomLLMItem] = [] -_custom_providers: List[ - str -] = [] # internal helper util, used to track names of custom providers -disable_hf_tokenizer_download: Optional[ - bool -] = None # disable huggingface tokenizer download. Defaults to openai clk100 +_custom_providers: List[str] = ( + [] +) # internal helper util, used to track names of custom providers +disable_hf_tokenizer_download: Optional[bool] = ( + None # disable huggingface tokenizer download. Defaults to openai clk100 +) global_disable_no_log_param: bool = False ### PASSTHROUGH ### diff --git a/litellm/_logging.py b/litellm/_logging.py index 356bb3dcaf7..d1084900dee 100644 --- a/litellm/_logging.py +++ b/litellm/_logging.py @@ -108,6 +108,10 @@ verbose_router_logger.addHandler(handler) verbose_proxy_logger.addHandler(handler) verbose_logger.addHandler(handler) +# Suppress httpx request logging at INFO level +httpx_logger = logging.getLogger("httpx") +httpx_logger.setLevel(logging.WARNING) + ALL_LOGGERS = [ logging.getLogger(), verbose_logger, diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index c8892cd26a5..6fecc7fa976 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -789,6 +789,7 @@ def completion_cost( # noqa: PLR0915 from litellm.llms.recraft.cost_calculator import ( cost_calculator as recraft_image_cost_calculator, ) + return recraft_image_cost_calculator( model=model, image_response=completion_response, @@ -797,6 +798,7 @@ def completion_cost( # noqa: PLR0915 from litellm.llms.gemini.image_generation.cost_calculator import ( cost_calculator as gemini_image_cost_calculator, ) + return gemini_image_cost_calculator( model=model, image_response=completion_response, @@ -867,7 +869,10 @@ def completion_cost( # noqa: PLR0915 from litellm.proxy._experimental.mcp_server.cost_calculator import ( MCPCostCalculator, ) - return MCPCostCalculator.calculate_mcp_tool_call_cost(litellm_logging_obj=litellm_logging_obj) + + return MCPCostCalculator.calculate_mcp_tool_call_cost( + litellm_logging_obj=litellm_logging_obj + ) # Calculate cost based on prompt_tokens, completion_tokens if ( "togethercomputer" in model @@ -1318,7 +1323,7 @@ class BaseTokenUsageProcessor: combined.completion_tokens_details = CompletionTokensDetails() # Check what keys exist in the model's completion_tokens_details - for attr in dir(usage.completion_tokens_details): + for attr in usage.completion_tokens_details.model_fields: if not attr.startswith("_") and not callable( getattr(usage.completion_tokens_details, attr) ): @@ -1326,7 +1331,8 @@ class BaseTokenUsageProcessor: combined.completion_tokens_details, attr, 0 ) new_val = getattr(usage.completion_tokens_details, attr, 0) - if new_val is not None: + + if new_val is not None and current_val is not None: setattr( combined.completion_tokens_details, attr, diff --git a/litellm/exceptions.py b/litellm/exceptions.py index 9f3411143a6..153230518cc 100644 --- a/litellm/exceptions.py +++ b/litellm/exceptions.py @@ -829,3 +829,65 @@ class BlockedPiiEntityError(Exception): self.guardrail_name = guardrail_name self.message = f"Blocked entity detected: {entity_type} by Guardrail: {guardrail_name}. This entity is not allowed to be used in this request." super().__init__(self.message) + + +class MidStreamFallbackError(ServiceUnavailableError): # type: ignore + def __init__( + self, + message: str, + model: str, + llm_provider: str, + original_exception: Optional[Exception] = None, + response: Optional[httpx.Response] = None, + litellm_debug_info: Optional[str] = None, + max_retries: Optional[int] = None, + num_retries: Optional[int] = None, + generated_content: str = "", + is_pre_first_chunk: bool = False, + ): + self.status_code = 503 # Service Unavailable + self.message = f"litellm.MidStreamFallbackError: {message}" + self.model = model + self.llm_provider = llm_provider + self.original_exception = original_exception + self.litellm_debug_info = litellm_debug_info + self.max_retries = max_retries + self.num_retries = num_retries + self.generated_content = generated_content + self.is_pre_first_chunk = is_pre_first_chunk + + # Create a response if one wasn't provided + if response is None: + self.response = httpx.Response( + status_code=self.status_code, + request=httpx.Request( + method="POST", + url=f"https://{llm_provider}.com/v1/", + ), + ) + else: + self.response = response + + # Call the parent constructor + super().__init__( + message=self.message, + llm_provider=llm_provider, + model=model, + response=self.response, + litellm_debug_info=self.litellm_debug_info, + max_retries=self.max_retries, + num_retries=self.num_retries, + ) + + def __str__(self): + _message = self.message + if self.num_retries: + _message += f" LiteLLM Retried: {self.num_retries} times" + if self.max_retries: + _message += f", LiteLLM Max Retries: {self.max_retries}" + if self.original_exception: + _message += f" Original exception: {type(self.original_exception).__name__}: {str(self.original_exception)}" + return _message + + def __repr__(self): + return self.__str__() diff --git a/litellm/experimental_mcp_client/client.py b/litellm/experimental_mcp_client/client.py index 843a9fb0e20..185fe34a3fb 100644 --- a/litellm/experimental_mcp_client/client.py +++ b/litellm/experimental_mcp_client/client.py @@ -12,11 +12,15 @@ from mcp.client.stdio import stdio_client from mcp.client.streamable_http import streamablehttp_client from mcp.types import CallToolRequestParams as MCPCallToolRequestParams from mcp.types import CallToolResult as MCPCallToolResult +from mcp.types import TextContent from mcp.types import Tool as MCPTool +from litellm._logging import verbose_logger from litellm.types.mcp import ( MCPAuth, MCPAuthType, + MCPSpecVersion, + MCPSpecVersionType, MCPStdioConfig, MCPTransport, MCPTransportType, @@ -44,6 +48,7 @@ class MCPClient: auth_value: Optional[str] = None, timeout: float = 60.0, stdio_config: Optional[MCPStdioConfig] = None, + protocol_version: MCPSpecVersionType = MCPSpecVersion.jun_2025, ): self.server_url: str = server_url self.transport_type: MCPTransport = transport_type @@ -57,6 +62,7 @@ class MCPClient: self._session_ctx = None self._task: Optional[asyncio.Task] = None self.stdio_config: Optional[MCPStdioConfig] = stdio_config + self.protocol_version: MCPSpecVersionType = protocol_version # handle the basic auth value if provided if auth_value: @@ -118,9 +124,18 @@ class MCPClient: self._session_ctx = ClientSession(self._transport[0], self._transport[1]) self._session = await self._session_ctx.__aenter__() await self._session.initialize() - except Exception: + except ValueError as e: + # Re-raise ValueError exceptions (like missing stdio_config) + verbose_logger.warning(f"MCP client connection failed: {str(e)}") await self.disconnect() raise + except Exception as e: + verbose_logger.warning(f"MCP client connection failed: {str(e)}") + await self.disconnect() + # Don't raise other exceptions, let the calling code handle it gracefully + # This allows the server manager to continue with other servers + # Instead of raising, we'll let the calling code handle the failure + pass async def __aexit__(self, exc_type, exc_val, exc_tb): """Cleanup when exiting context manager.""" @@ -169,23 +184,40 @@ class MCPClient: def _get_auth_headers(self) -> dict: """Generate authentication headers based on auth type.""" - if not self._mcp_auth_value: - return {} + headers = {} + + if self._mcp_auth_value: + if self.auth_type == MCPAuth.bearer_token: + headers["Authorization"] = f"Bearer {self._mcp_auth_value}" + elif self.auth_type == MCPAuth.basic: + headers["Authorization"] = f"Basic {self._mcp_auth_value}" + elif self.auth_type == MCPAuth.api_key: + headers["X-API-Key"] = self._mcp_auth_value + + # Handle protocol version - it might be a string or enum + if hasattr(self.protocol_version, 'value'): + # It's an enum + protocol_version_str = self.protocol_version.value + else: + # It's a string + protocol_version_str = str(self.protocol_version) + + headers["MCP-Protocol-Version"] = protocol_version_str + return headers - if self.auth_type == MCPAuth.bearer_token: - return {"Authorization": f"Bearer {self._mcp_auth_value}"} - elif self.auth_type == MCPAuth.basic: - return {"Authorization": f"Basic {self._mcp_auth_value}"} - elif self.auth_type == MCPAuth.api_key: - return {"X-API-Key": self._mcp_auth_value} - return {} async def list_tools(self) -> List[MCPTool]: """List available tools from the server.""" if not self._session: - await self.connect() + try: + await self.connect() + except Exception as e: + verbose_logger.warning(f"MCP client connection failed: {str(e)}") + return [] + if self._session is None: - raise ValueError("Session is not initialized") + verbose_logger.warning("MCP client session is not initialized") + return [] try: result = await self._session.list_tools() @@ -193,9 +225,11 @@ class MCPClient: except asyncio.CancelledError: await self.disconnect() raise - except Exception: + except Exception as e: + verbose_logger.warning(f"MCP client list_tools failed: {str(e)}") await self.disconnect() - raise + # Return empty list instead of raising to allow graceful degradation + return [] async def call_tool( self, call_tool_request_params: MCPCallToolRequestParams @@ -204,10 +238,21 @@ class MCPClient: Call an MCP Tool. """ if not self._session: - await self.connect() + try: + await self.connect() + except Exception as e: + verbose_logger.warning(f"MCP client connection failed: {str(e)}") + return MCPCallToolResult( + content=[TextContent(type="text", text=f"{str(e)}")], + isError=True + ) if self._session is None: - raise ValueError("Session is not initialized") + verbose_logger.warning("MCP client session is not initialized") + return MCPCallToolResult( + content=[TextContent(type="text", text="MCP client session is not initialized")], + isError=True, + ) try: tool_result = await self._session.call_tool( @@ -218,8 +263,13 @@ class MCPClient: except asyncio.CancelledError: await self.disconnect() raise - except Exception: + except Exception as e: + verbose_logger.warning(f"MCP client call_tool failed: {str(e)}") await self.disconnect() - raise + # Return a default error result instead of raising + return MCPCallToolResult( + content=[TextContent(type="text", text=f"{str(e)}")], # Empty content for error case + isError=True, + ) diff --git a/litellm/google_genai/main.py b/litellm/google_genai/main.py index c34b1663e6f..87970885355 100644 --- a/litellm/google_genai/main.py +++ b/litellm/google_genai/main.py @@ -24,11 +24,14 @@ if TYPE_CHECKING: GenerateContentConfigDict, GenerateContentContentListUnionDict, GenerateContentResponse, + ToolConfigDict, ) else: GenerateContentConfigDict = Any GenerateContentContentListUnionDict = Any GenerateContentResponse = Any + ToolConfigDict = Any + ####### ENVIRONMENT VARIABLES ################### # Initialize any necessary instances or variables here @@ -83,6 +86,7 @@ class GenerateContentHelper: config: Optional[GenerateContentConfigDict] = None, custom_llm_provider: Optional[str] = None, stream: bool = False, + tools: Optional[ToolConfigDict] = None, **kwargs, ) -> GenerateContentSetupResult: """ @@ -166,6 +170,7 @@ class GenerateContentHelper: generate_content_provider_config.transform_generate_content_request( model=model, contents=contents, + tools=tools, generate_content_config_dict=generate_content_config_dict, ) ) @@ -200,6 +205,7 @@ async def agenerate_content( model: str, contents: GenerateContentContentListUnionDict, config: Optional[GenerateContentConfigDict] = None, + tools: Optional[ToolConfigDict] = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Optional[Dict[str, Any]] = None, @@ -235,6 +241,7 @@ async def agenerate_content( extra_body=extra_body, timeout=timeout, custom_llm_provider=custom_llm_provider, + tools=tools, **kwargs, ) @@ -263,6 +270,7 @@ def generate_content( model: str, contents: GenerateContentContentListUnionDict, config: Optional[GenerateContentConfigDict] = None, + tools: Optional[ToolConfigDict] = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Optional[Dict[str, Any]] = None, @@ -296,6 +304,7 @@ def generate_content( config=config, custom_llm_provider=custom_llm_provider, stream=False, + tools=tools, **kwargs, ) @@ -316,6 +325,7 @@ def generate_content( response = base_llm_http_handler.generate_content_handler( model=setup_result.model, contents=contents, + tools=tools, generate_content_provider_config=setup_result.generate_content_provider_config, generate_content_config_dict=setup_result.generate_content_config_dict, custom_llm_provider=setup_result.custom_llm_provider, @@ -346,6 +356,7 @@ async def agenerate_content_stream( model: str, contents: GenerateContentContentListUnionDict, config: Optional[GenerateContentConfigDict] = None, + tools: Optional[ToolConfigDict] = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Optional[Dict[str, Any]] = None, @@ -377,6 +388,7 @@ async def agenerate_content_stream( "config": config, "custom_llm_provider": custom_llm_provider, "stream": True, + "tools": tools, **kwargs, } ) @@ -402,6 +414,7 @@ async def agenerate_content_stream( contents=contents, generate_content_provider_config=setup_result.generate_content_provider_config, generate_content_config_dict=setup_result.generate_content_config_dict, + tools=tools, custom_llm_provider=setup_result.custom_llm_provider, litellm_params=setup_result.litellm_params, logging_obj=setup_result.litellm_logging_obj, @@ -429,6 +442,7 @@ def generate_content_stream( model: str, contents: GenerateContentContentListUnionDict, config: Optional[GenerateContentConfigDict] = None, + tools: Optional[ToolConfigDict] = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Optional[Dict[str, Any]] = None, @@ -454,6 +468,7 @@ def generate_content_stream( config=config, custom_llm_provider=custom_llm_provider, stream=True, + tools=tools, **kwargs, ) @@ -476,6 +491,7 @@ def generate_content_stream( contents=contents, generate_content_provider_config=setup_result.generate_content_provider_config, generate_content_config_dict=setup_result.generate_content_config_dict, + tools=tools, custom_llm_provider=setup_result.custom_llm_provider, litellm_params=setup_result.litellm_params, logging_obj=setup_result.litellm_logging_obj, diff --git a/litellm/integrations/anthropic_cache_control_hook.py b/litellm/integrations/anthropic_cache_control_hook.py index 29d9920da43..c1fb45b3042 100644 --- a/litellm/integrations/anthropic_cache_control_hook.py +++ b/litellm/integrations/anthropic_cache_control_hook.py @@ -9,6 +9,7 @@ Users can define import copy from typing import Dict, List, Optional, Tuple, Union, cast +from litellm._logging import verbose_logger from litellm.integrations.custom_logger import CustomLogger from litellm.integrations.custom_prompt_management import CustomPromptManagement from litellm.types.integrations.anthropic_cache_control_hook import ( @@ -80,12 +81,22 @@ class AnthropicCacheControlHook(CustomPromptManagement): # Case 1: Target by specific index if targetted_index is not None: + original_index = targetted_index + # Handle negative indices (convert to positive) + if targetted_index < 0: + targetted_index += len(messages) + if 0 <= targetted_index < len(messages): messages[targetted_index] = ( AnthropicCacheControlHook._safe_insert_cache_control_in_message( messages[targetted_index], control ) ) + else: + verbose_logger.warning( + f"AnthropicCacheControlHook: Provided index {original_index} is out of bounds for message list of length {len(messages)}. " + f"Targeted index was {targetted_index}. Skipping cache control injection for this point." + ) # Case 2: Target by role elif targetted_role is not None: for msg in messages: diff --git a/litellm/integrations/custom_guardrail.py b/litellm/integrations/custom_guardrail.py index b6792354334..501185b207e 100644 --- a/litellm/integrations/custom_guardrail.py +++ b/litellm/integrations/custom_guardrail.py @@ -234,7 +234,6 @@ class CustomGuardrail(CustomLogger): Returns True if the guardrail should be run on the event_type """ requested_guardrails = self.get_guardrail_from_metadata(data) - verbose_logger.debug( "inside should_run_guardrail for guardrail=%s event_type= %s guardrail_supported_event_hooks= %s requested_guardrails= %s self.default_on= %s", self.guardrail_name, @@ -243,7 +242,6 @@ class CustomGuardrail(CustomLogger): requested_guardrails, self.default_on, ) - if self.default_on is True: if self._event_hook_is_event_type(event_type): if isinstance(self.event_hook, Mode): @@ -287,7 +285,6 @@ class CustomGuardrail(CustomLogger): ) if result is not None: return result - return True def _event_hook_is_event_type(self, event_type: GuardrailEventHooks) -> bool: diff --git a/litellm/integrations/custom_logger.py b/litellm/integrations/custom_logger.py index 08ff197c208..ded5ccca766 100644 --- a/litellm/integrations/custom_logger.py +++ b/litellm/integrations/custom_logger.py @@ -33,7 +33,13 @@ if TYPE_CHECKING: from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj from litellm.proxy._types import UserAPIKeyAuth - from litellm.types.mcp import MCPPostCallResponseObject + from litellm.types.mcp import ( + MCPDuringCallRequestObject, + MCPDuringCallResponseObject, + MCPPostCallResponseObject, + MCPPreCallRequestObject, + MCPPreCallResponseObject, + ) from litellm.types.router import PreRoutingHookResponse Span = Union[_Span, Any] @@ -42,13 +48,30 @@ else: LiteLLMLoggingObj = Any UserAPIKeyAuth = Any MCPPostCallResponseObject = Any + MCPPreCallRequestObject = Any + MCPPreCallResponseObject = Any + MCPDuringCallRequestObject = Any + MCPDuringCallResponseObject = Any PreRoutingHookResponse = Any class CustomLogger: # https://docs.litellm.ai/docs/observability/custom_callback#callback-class # Class variables or attributes - def __init__(self, message_logging: bool = True, **kwargs) -> None: + def __init__( + self, + turn_off_message_logging: bool = False, + + # deprecated param, use `turn_off_message_logging` instead + message_logging: bool = True, + **kwargs + ) -> None: + """ + Args: + turn_off_message_logging: bool - if True, the message logging will be turned off. Message and response will be redacted from StandardLoggingPayload. + message_logging: bool - deprecated param, use `turn_off_message_logging` instead + """ self.message_logging = message_logging + self.turn_off_message_logging = turn_off_message_logging pass def log_pre_api_call(self, model, messages, kwargs): @@ -258,6 +281,7 @@ class CustomLogger: # https://docs.litellm.ai/docs/observability/custom_callbac "audio_transcription", "pass_through_endpoint", "rerank", + "mcp_call", ], ) -> Optional[ Union[Exception, str, dict] @@ -304,6 +328,7 @@ class CustomLogger: # https://docs.litellm.ai/docs/observability/custom_callbac "moderation", "audio_transcription", "responses", + "mcp_call", ], ) -> Any: pass @@ -387,6 +412,60 @@ class CustomLogger: # https://docs.litellm.ai/docs/observability/custom_callbac ######################################################### # MCP TOOL CALL HOOKS ######################################################### + async def async_pre_mcp_tool_call_hook( + self, + kwargs, + request_obj: MCPPreCallRequestObject, + start_time, + end_time + ) -> Optional[MCPPreCallResponseObject]: + """ + This hook gets called before the MCP tool call is made. + + Useful for: + - Validating tool calls before execution + - Modifying arguments before they are sent to the MCP server + - Implementing access control and rate limiting + - Adding custom metadata or tracking information + + Args: + kwargs: The logging kwargs containing model call details + request_obj: MCPPreCallRequestObject containing tool name, arguments, and metadata + start_time: Start time of the request + end_time: End time of the request + + Returns: + MCPPreCallResponseObject with validation results and any modifications + """ + return None + + async def async_during_mcp_tool_call_hook( + self, + kwargs, + request_obj: MCPDuringCallRequestObject, + start_time, + end_time + ) -> Optional[MCPDuringCallResponseObject]: + """ + This hook gets called during the MCP tool call execution. + + Useful for: + - Concurrent monitoring and validation during tool execution + - Implementing timeouts and cancellation logic + - Real-time cost tracking and billing + - Performance monitoring and metrics collection + + Args: + kwargs: The logging kwargs containing model call details + request_obj: MCPDuringCallRequestObject containing tool execution context + start_time: Start time of the request + end_time: End time of the request + + Returns: + MCPDuringCallResponseObject with execution control decisions + """ + return None + async def async_post_mcp_tool_call_hook( self, kwargs, response_obj: MCPPostCallResponseObject, start_time, end_time ) -> Optional[MCPPostCallResponseObject]: @@ -470,3 +549,49 @@ class CustomLogger: # https://docs.litellm.ai/docs/observability/custom_callbac if LITELLM_METADATA_FIELD in request_kwargs: return LITELLM_METADATA_FIELD return OLD_LITELLM_METADATA_FIELD + + def redact_standard_logging_payload_from_model_call_details( + self, model_call_details: Dict + ) -> Dict: + """ + Only redacts messages and responses when self.turn_off_message_logging is True + + + By default, self.turn_off_message_logging is False and this does nothing. + + Return a redacted deepcopy of the provided logging payload. + + This is useful for logging payloads that contain sensitive information. + """ + from copy import copy + + from litellm import Choices, Message, ModelResponse + from litellm.types.utils import LiteLLMCommonStrings + turn_off_message_logging: bool = getattr(self, "turn_off_message_logging", False) + + if turn_off_message_logging is False: + return model_call_details + + # Only make a shallow copy of the top-level dict to avoid deepcopy issues + # with complex objects like AuthenticationError that may be present + model_call_details_copy = copy(model_call_details) + redacted_str = LiteLLMCommonStrings.redacted_by_litellm.value + standard_logging_object = model_call_details.get("standard_logging_object") + if standard_logging_object is None: + return model_call_details_copy + + # Make a copy of just the standard_logging_object to avoid modifying the original + standard_logging_object_copy = copy(standard_logging_object) + + if standard_logging_object_copy.get("messages") is not None: + standard_logging_object_copy["messages"] = [Message(content=redacted_str).model_dump()] + + if standard_logging_object_copy.get("response") is not None: + model_response = ModelResponse( + choices=[Choices(message=Message(content=redacted_str))] + ) + model_response_dict = model_response.model_dump() + standard_logging_object_copy["response"] = model_response_dict + + model_call_details_copy["standard_logging_object"] = standard_logging_object_copy + return model_call_details_copy diff --git a/litellm/integrations/datadog/datadog_llm_obs.py b/litellm/integrations/datadog/datadog_llm_obs.py index 8cee33968b3..2577ed3ddf0 100644 --- a/litellm/integrations/datadog/datadog_llm_obs.py +++ b/litellm/integrations/datadog/datadog_llm_obs.py @@ -58,18 +58,40 @@ class DataDogLLMObsLogger(DataDogLogger, CustomBatchLogger): asyncio.create_task(self.periodic_flush()) self.flush_lock = asyncio.Lock() self.log_queue: List[LLMObsPayload] = [] + + ######################################################### + # Handle datadog_llm_observability_params set as litellm.datadog_llm_observability_params + ######################################################### + dict_datadog_llm_obs_params = self._get_datadog_llm_obs_params() + kwargs.update(dict_datadog_llm_obs_params) CustomBatchLogger.__init__(self, **kwargs, flush_lock=self.flush_lock) except Exception as e: verbose_logger.exception(f"DataDogLLMObs: Error initializing - {str(e)}") raise e + def _get_datadog_llm_obs_params(self) -> Dict: + """ + Get the datadog_llm_observability_params from litellm.datadog_llm_observability_params + + These are params specific to initializing the DataDogLLMObsLogger e.g. turn_off_message_logging + """ + dict_datadog_llm_obs_params: Dict = {} + if litellm.datadog_llm_observability_params is not None: + if isinstance(litellm.datadog_llm_observability_params, DatadogLLMObsInitParams): + dict_datadog_llm_obs_params = litellm.datadog_llm_observability_params.model_dump() + elif isinstance(litellm.datadog_llm_observability_params, Dict): + # only allow params that are of DatadogLLMObsInitParams + dict_datadog_llm_obs_params = DatadogLLMObsInitParams(**litellm.datadog_llm_observability_params).model_dump() + return dict_datadog_llm_obs_params + + async def async_log_success_event(self, kwargs, response_obj, start_time, end_time): try: verbose_logger.debug( f"DataDogLLMObs: Logging success event for model {kwargs.get('model', 'unknown')}" ) payload = self.create_llm_obs_payload( - kwargs, response_obj, start_time, end_time + kwargs, start_time, end_time ) verbose_logger.debug(f"DataDogLLMObs: Payload: {payload}") self.log_queue.append(payload) @@ -128,7 +150,7 @@ class DataDogLLMObsLogger(DataDogLogger, CustomBatchLogger): verbose_logger.exception(f"DataDogLLMObs: Error sending batch - {str(e)}") def create_llm_obs_payload( - self, kwargs: Dict, response_obj: Any, start_time: datetime, end_time: datetime + self, kwargs: Dict, start_time: datetime, end_time: datetime ) -> LLMObsPayload: standard_logging_payload: Optional[StandardLoggingPayload] = kwargs.get( "standard_logging_object" @@ -138,6 +160,7 @@ class DataDogLLMObsLogger(DataDogLogger, CustomBatchLogger): messages = standard_logging_payload["messages"] messages = self._ensure_string_content(messages=messages) + response_obj = standard_logging_payload.get("response") metadata = kwargs.get("litellm_params", {}).get("metadata", {}) @@ -146,7 +169,10 @@ class DataDogLLMObsLogger(DataDogLogger, CustomBatchLogger): messages ) ) - output_meta = OutputMeta(messages=self._get_response_messages(response_obj)) + output_meta = OutputMeta(messages=self._get_response_messages( + response_obj=response_obj, + call_type=standard_logging_payload.get("call_type") + )) meta = Meta( kind=self._get_datadog_span_kind(standard_logging_payload.get("call_type")), @@ -198,14 +224,16 @@ class DataDogLLMObsLogger(DataDogLogger, CustomBatchLogger): return 0.0 - def _get_response_messages(self, response_obj: Any) -> List[Any]: + def _get_response_messages( + self, response_obj: Any, call_type: Optional[str] + ) -> List[Any]: """ Get the messages from the response object for now this handles logging /chat/completions responses """ - if isinstance(response_obj, litellm.ModelResponse): - return [response_obj["choices"][0]["message"].json()] + if call_type in [CallTypes.completion.value, CallTypes.acompletion.value]: + return [response_obj["choices"][0]["message"]] return [] def _get_datadog_span_kind(self, call_type: Optional[str]) -> Literal["llm", "tool", "task", "embedding", "retrieval"]: diff --git a/litellm/integrations/dotprompt/README.md b/litellm/integrations/dotprompt/README.md new file mode 100644 index 00000000000..c69c96824be --- /dev/null +++ b/litellm/integrations/dotprompt/README.md @@ -0,0 +1,316 @@ +# LiteLLM Dotprompt Manager + +A powerful prompt management system for LiteLLM that supports [Google's Dotprompt specification](https://google.github.io/dotprompt/getting-started/). This allows you to manage your AI prompts in organized `.prompt` files with YAML frontmatter, Handlebars templating, and full integration with LiteLLM's completion API. + +## Features + +- **📁 File-based prompt management**: Organize prompts in `.prompt` files +- **🎯 YAML frontmatter**: Define model, parameters, and schemas in file headers +- **🔧 Handlebars templating**: Use `{{variable}}` syntax with Jinja2 backend +- **✅ Input validation**: Automatic validation against defined schemas +- **🔗 LiteLLM integration**: Works seamlessly with `litellm.completion()` +- **💬 Smart message parsing**: Converts prompts to proper chat messages +- **⚙️ Parameter extraction**: Automatically applies model settings from prompts + +## Quick Start + +### 1. Create a `.prompt` file + +Create a file called `chat_assistant.prompt`: + +```yaml +--- +model: gpt-4 +temperature: 0.7 +max_tokens: 150 +input: + schema: + user_message: string + system_context?: string +--- + +{% if system_context %}System: {{system_context}} + +{% endif %}User: {{user_message}} +``` + +### 2. Use with LiteLLM + +```python +import litellm + +litellm.set_global_prompt_directory("path/to/your/prompts") + +# Use with completion - the model prefix 'dotprompt/' tells LiteLLM to use prompt management +response = litellm.completion( + model="dotprompt/gpt-4", # The actual model comes from the .prompt file + prompt_id="chat_assistant", + prompt_variables={ + "user_message": "What is machine learning?", + "system_context": "You are a helpful AI tutor." + }, + # Any additional messages will be appended after the prompt + messages=[{"role": "user", "content": "Please explain it simply."}] +) + +print(response.choices[0].message.content) +``` + +## Prompt File Format + +### Basic Structure + +```yaml +--- +# Model configuration +model: gpt-4 +temperature: 0.7 +max_tokens: 500 + +# Input schema (optional) +input: + schema: + name: string + age: integer + preferences?: array +--- + +# Template content using Handlebars syntax +Hello {{name}}! + +{% if age >= 18 %} +You're an adult, so here are some mature recommendations: +{% else %} +Here are some age-appropriate suggestions: +{% endif %} + +{% for pref in preferences %} +- Based on your interest in {{pref}}, I recommend... +{% endfor %} +``` + +### Supported Frontmatter Fields + +- **`model`**: The LLM model to use (e.g., `gpt-4`, `claude-3-sonnet`) +- **`input.schema`**: Define expected input variables and their types +- **`output.format`**: Expected output format (`json`, `text`, etc.) +- **`output.schema`**: Structure of expected output + +### Additional Parameters + +- **`temperature`**: Model temperature (0.0 to 1.0) +- **`max_tokens`**: Maximum tokens to generate +- **`top_p`**: Nucleus sampling parameter (0.0 to 1.0) +- **`frequency_penalty`**: Frequency penalty (0.0 to 1.0) +- **`presence_penalty`**: Presence penalty (0.0 to 1.0) +- any other parameters that are not model or schema-related will be treated as optional parameters to the model. + +### Input Schema Types + +- `string` or `str`: Text values +- `integer` or `int`: Whole numbers +- `float`: Decimal numbers +- `boolean` or `bool`: True/false values +- `array` or `list`: Lists of values +- `object` or `dict`: Key-value objects + +Use `?` suffix for optional fields: `name?: string` + +## Message Format Conversion + +The dotprompt manager intelligently converts your rendered prompts into proper chat messages: + +### Simple Text → User Message +```yaml +--- +model: gpt-4 +--- +Tell me about {{topic}}. +``` +Becomes: `[{"role": "user", "content": "Tell me about AI."}]` + +### Role-Based Format → Multiple Messages +```yaml +--- +model: gpt-4 +--- +System: You are a {{role}}. + +User: {{question}} +``` + +Becomes: +```python +[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "What is AI?"} +] +``` + + +## Example Prompts + +### Data Extraction +```yaml +# extract_info.prompt +--- +model: gemini/gemini-1.5-pro +input: + schema: + text: string +output: + format: json + schema: + title?: string + summary: string + tags: array +--- + +Extract the requested information from the given text. Return JSON format. + +Text: {{text}} +``` + +### Code Assistant +```yaml +# code_helper.prompt +--- +model: claude-3-5-sonnet-20241022 +temperature: 0.2 +max_tokens: 2000 +input: + schema: + language: string + task: string + code?: string +--- + +You are an expert {{language}} programmer. + +Task: {{task}} + +{% if code %} +Current code: +```{{language}} +{{code}} +``` +{% endif %} + +Please provide a complete, well-documented solution. +``` + +### Multi-turn Conversation +```yaml +# conversation.prompt +--- +model: gpt-4 +temperature: 0.8 +input: + schema: + personality: string + context: string +--- + +System: You are a {{personality}}. {{context}} + +User: Let's start our conversation. +``` + +## API Reference + +### PromptManager + +The core class for managing `.prompt` files. + +#### Methods + +- **`__init__(prompt_directory: str)`**: Initialize with directory path +- **`render(prompt_id: str, variables: dict) -> str`**: Render prompt with variables +- **`list_prompts() -> List[str]`**: Get all available prompt IDs +- **`get_prompt(prompt_id: str) -> PromptTemplate`**: Get prompt template object +- **`get_prompt_metadata(prompt_id: str) -> dict`**: Get prompt metadata +- **`reload_prompts() -> None`**: Reload all prompts from directory +- **`add_prompt(prompt_id: str, content: str, metadata: dict)`**: Add prompt programmatically + +### DotpromptManager + +LiteLLM integration class extending `PromptManagementBase`. + +#### Methods + +- **`__init__(prompt_directory: str)`**: Initialize with directory path +- **`should_run_prompt_management(prompt_id: str, params: dict) -> bool`**: Check if prompt exists +- **`set_prompt_directory(directory: str)`**: Change prompt directory +- **`reload_prompts()`**: Reload prompts from directory + +### PromptTemplate + +Represents a single prompt with metadata. + +#### Properties + +- **`content: str`**: The prompt template content +- **`metadata: dict`**: Full metadata from frontmatter +- **`model: str`**: Specified model name +- **`temperature: float`**: Model temperature +- **`max_tokens: int`**: Token limit +- **`input_schema: dict`**: Input validation schema +- **`output_format: str`**: Expected output format +- **`output_schema: dict`**: Output structure schema + +## Best Practices + +1. **Organize by purpose**: Group related prompts in subdirectories +2. **Use descriptive names**: `extract_user_info.prompt` vs `prompt1.prompt` +3. **Define schemas**: Always specify input schemas for validation +4. **Version control**: Store `.prompt` files in git for change tracking +5. **Test prompts**: Use the test framework to validate prompt behavior +6. **Keep templates focused**: One prompt should do one thing well +7. **Use includes**: Break complex prompts into reusable components + +## Troubleshooting + +### Common Issues + +**Prompt not found**: Ensure the `.prompt` file exists and has correct extension +```python +# Check available prompts +from litellm.integrations.dotprompt import get_dotprompt_manager +manager = get_dotprompt_manager() +print(manager.prompt_manager.list_prompts()) +``` + +**Template errors**: Verify Handlebars syntax and variable names +```python +# Test rendering directly +manager.prompt_manager.render("my_prompt", {"test": "value"}) +``` + +**Model not working**: Check that model name in frontmatter is correct +```python +# Check prompt metadata +metadata = manager.prompt_manager.get_prompt_metadata("my_prompt") +print(metadata) +``` + +### Validation Errors + +Input validation failures show helpful error messages: +``` +ValueError: Invalid type for field 'age': expected int, got str +``` + +Make sure your variables match the defined schema types. + +## Contributing + +The LiteLLM Dotprompt manager follows the [Dotprompt specification](https://google.github.io/dotprompt/) for maximum compatibility. When contributing: + +1. Ensure compatibility with existing `.prompt` files +2. Add tests for new features +3. Update documentation +4. Follow the existing code style + +## License + +This prompt management system is part of LiteLLM and follows the same license terms. \ No newline at end of file diff --git a/litellm/integrations/dotprompt/__init__.py b/litellm/integrations/dotprompt/__init__.py new file mode 100644 index 00000000000..3af7fbf6dd3 --- /dev/null +++ b/litellm/integrations/dotprompt/__init__.py @@ -0,0 +1,71 @@ +from typing import TYPE_CHECKING, Optional + +if TYPE_CHECKING: + from .prompt_manager import PromptManager, PromptTemplate + from litellm.types.prompts.init_prompts import PromptLiteLLMParams, PromptSpec + from litellm.integrations.custom_prompt_management import CustomPromptManagement + +from litellm.types.prompts.init_prompts import SupportedPromptIntegrations + +from .dotprompt_manager import DotpromptManager + +# Global instances +global_prompt_directory: Optional[str] = None +global_prompt_manager: Optional["PromptManager"] = None + + +def set_global_prompt_directory(directory: str) -> None: + """ + Set the global prompt directory for dotprompt files. + + Args: + directory: Path to directory containing .prompt files + """ + import litellm + + litellm.global_prompt_directory = directory # type: ignore + + +def prompt_initializer( + litellm_params: "PromptLiteLLMParams", prompt_spec: "PromptSpec" +) -> "CustomPromptManagement": + """ + Initialize a prompt from a .prompt file. + """ + prompt_directory = getattr(litellm_params, "prompt_directory", None) + prompt_data = getattr(litellm_params, "prompt_data", None) + prompt_id = getattr(litellm_params, "prompt_id", None) + if prompt_directory: + raise ValueError( + "Cannot set prompt_directory when working with prompt_initializer. Needs to be a specific dotprompt file" + ) + + prompt_file = getattr(litellm_params, "prompt_file", None) + + try: + dot_prompt_manager = DotpromptManager( + prompt_directory=prompt_directory, + prompt_data=prompt_data, + prompt_file=prompt_file, + prompt_id=prompt_id, + ) + + return dot_prompt_manager + except Exception as e: + + raise e + + +prompt_initializer_registry = { + SupportedPromptIntegrations.DOT_PROMPT.value: prompt_initializer, +} + +# Export public API +__all__ = [ + "PromptManager", + "DotpromptManager", + "PromptTemplate", + "set_global_prompt_directory", + "global_prompt_directory", + "global_prompt_manager", +] diff --git a/litellm/integrations/dotprompt/dotprompt_manager.py b/litellm/integrations/dotprompt/dotprompt_manager.py new file mode 100644 index 00000000000..0f0d7b938f3 --- /dev/null +++ b/litellm/integrations/dotprompt/dotprompt_manager.py @@ -0,0 +1,291 @@ +""" +Dotprompt manager that integrates with LiteLLM's prompt management system. +Builds on top of PromptManagementBase to provide .prompt file support. +""" + +import json +from typing import Any, Dict, List, Optional, Tuple, Union + +from litellm.integrations.custom_prompt_management import CustomPromptManagement +from litellm.integrations.prompt_management_base import PromptManagementClient +from litellm.types.llms.openai import AllMessageValues +from litellm.types.utils import StandardCallbackDynamicParams + +from .prompt_manager import PromptManager, PromptTemplate + + +class DotpromptManager(CustomPromptManagement): + """ + Dotprompt manager that integrates with LiteLLM's prompt management system. + + This class enables using .prompt files with the litellm completion() function + by implementing the PromptManagementBase interface. + + Usage: + # Set global prompt directory + litellm.prompt_directory = "path/to/prompts" + + # Use with completion + response = litellm.completion( + model="dotprompt/gpt-4", + prompt_id="my_prompt", + prompt_variables={"variable": "value"}, + messages=[{"role": "user", "content": "This will be combined with the prompt"}] + ) + """ + + def __init__( + self, + prompt_directory: Optional[str] = None, + prompt_file: Optional[str] = None, + prompt_data: Optional[Union[dict, str]] = None, + prompt_id: Optional[str] = None, + ): + import litellm + + self.prompt_directory = prompt_directory or litellm.global_prompt_directory + # Support for JSON-based prompts stored in memory/database + if isinstance(prompt_data, str): + self.prompt_data = json.loads(prompt_data) + else: + self.prompt_data = prompt_data or {} + + self._prompt_manager: Optional[PromptManager] = None + self.prompt_file = prompt_file + self.prompt_id = prompt_id + + @property + def integration_name(self) -> str: + """Integration name used in model names like 'dotprompt/gpt-4'.""" + return "dotprompt" + + @property + def prompt_manager(self) -> PromptManager: + """Lazy-load the prompt manager.""" + if self._prompt_manager is None: + if ( + self.prompt_directory is None + and not self.prompt_data + and not self.prompt_file + ): + raise ValueError( + "Either prompt_directory or prompt_data must be set before using dotprompt manager. " + "Set litellm.global_prompt_directory, initialize with prompt_directory parameter, or provide prompt_data." + ) + self._prompt_manager = PromptManager( + prompt_directory=self.prompt_directory, + prompt_data=self.prompt_data, + prompt_file=self.prompt_file, + prompt_id=self.prompt_id, + ) + return self._prompt_manager + + def should_run_prompt_management( + self, + prompt_id: str, + dynamic_callback_params: StandardCallbackDynamicParams, + ) -> bool: + """ + Determine if prompt management should run based on the prompt_id. + + Returns True if the prompt_id exists in our prompt manager. + """ + try: + return prompt_id in self.prompt_manager.list_prompts() + except Exception: + # If there's any error accessing prompts, don't run prompt management + return False + + def _compile_prompt_helper( + self, + prompt_id: str, + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + """ + Compile a .prompt file into a PromptManagementClient structure. + + This method: + 1. Loads the prompt template from the .prompt file + 2. Renders it with the provided variables + 3. Converts the rendered text into chat messages + 4. Extracts model and optional parameters from metadata + """ + + try: + + # Get the prompt template + template = self.prompt_manager.get_prompt(prompt_id) + if template is None: + raise ValueError(f"Prompt '{prompt_id}' not found in prompt directory") + + # Render the template with variables + rendered_content = self.prompt_manager.render(prompt_id, prompt_variables) + + # Convert rendered content to chat messages + messages = self._convert_to_messages(rendered_content) + + # Extract model from metadata (if specified) + template_model = template.model + + # Extract optional parameters from metadata + optional_params = self._extract_optional_params(template) + + return PromptManagementClient( + prompt_id=prompt_id, + prompt_template=messages, + prompt_template_model=template_model, + prompt_template_optional_params=optional_params, + completed_messages=None, + ) + + except Exception as e: + raise ValueError(f"Error compiling prompt '{prompt_id}': {e}") + + def get_chat_completion_prompt( + self, + model: str, + messages: List[AllMessageValues], + non_default_params: dict, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> Tuple[str, List[AllMessageValues], dict]: + + from litellm.integrations.prompt_management_base import PromptManagementBase + + return PromptManagementBase.get_chat_completion_prompt( + self, + model, + messages, + non_default_params, + prompt_id, + prompt_variables, + dynamic_callback_params, + prompt_label, + prompt_version, + ) + + def _convert_to_messages(self, rendered_content: str) -> List[AllMessageValues]: + """ + Convert rendered prompt content to chat messages. + + This method supports multiple formats: + 1. Simple text -> converted to user message + 2. Text with role prefixes (System:, User:, Assistant:) -> parsed into separate messages + 3. Already formatted as a single message + """ + # Clean up the content + content = rendered_content.strip() + + # Try to parse role-based format (System: ..., User: ..., etc.) + messages = [] + current_role = None + current_content = [] + + lines = content.split("\n") + + for line in lines: + line = line.strip() + + # Check for role prefixes + if line.startswith("System:"): + if current_role and current_content: + messages.append( + self._create_message( + current_role, "\n".join(current_content).strip() + ) + ) + current_role = "system" + current_content = [line[7:].strip()] # Remove "System:" prefix + elif line.startswith("User:"): + if current_role and current_content: + messages.append( + self._create_message( + current_role, "\n".join(current_content).strip() + ) + ) + current_role = "user" + current_content = [line[5:].strip()] # Remove "User:" prefix + elif line.startswith("Assistant:"): + if current_role and current_content: + messages.append( + self._create_message( + current_role, "\n".join(current_content).strip() + ) + ) + current_role = "assistant" + current_content = [line[10:].strip()] # Remove "Assistant:" prefix + else: + # Continue current message content + if current_role: + current_content.append(line) + else: + # No role prefix found, treat as user message + current_role = "user" + current_content = [line] + + # Add the last message + if current_role and current_content: + content_text = "\n".join(current_content).strip() + if content_text: # Only add if there's actual content + messages.append(self._create_message(current_role, content_text)) + + # If no messages were created, treat the entire content as a user message + if not messages and content: + messages.append(self._create_message("user", content)) + + return messages + + def _create_message(self, role: str, content: str) -> AllMessageValues: + """Create a message with the specified role and content.""" + return { + "role": role, # type: ignore + "content": content, + } + + def _extract_optional_params(self, template: PromptTemplate) -> dict: + """ + Extract optional parameters from the prompt template metadata. + + Includes parameters like temperature, max_tokens, etc. + """ + optional_params = {} + + # Extract common parameters from metadata + if template.optional_params is not None: + optional_params.update(template.optional_params) + + return optional_params + + def set_prompt_directory(self, prompt_directory: str) -> None: + """Set the prompt directory and reload prompts.""" + self.prompt_directory = prompt_directory + self._prompt_manager = None # Reset to force reload + + def reload_prompts(self) -> None: + """Reload all prompts from the directory.""" + if self._prompt_manager: + self._prompt_manager.reload_prompts() + + def add_prompt_from_json(self, prompt_id: str, json_data: Dict[str, Any]) -> None: + """Add a prompt from JSON data.""" + content = json_data.get("content", "") + metadata = json_data.get("metadata", {}) + self.prompt_manager.add_prompt(prompt_id, content, metadata) + + def load_prompts_from_json(self, prompts_data: Dict[str, Dict[str, Any]]) -> None: + """Load multiple prompts from JSON data.""" + self.prompt_manager.load_prompts_from_json_data(prompts_data) + + def get_prompts_as_json(self) -> Dict[str, Dict[str, Any]]: + """Get all prompts in JSON format.""" + return self.prompt_manager.get_all_prompts_as_json() + + def convert_prompt_file_to_json(self, file_path: str) -> Dict[str, Any]: + """Convert a .prompt file to JSON format.""" + return self.prompt_manager.prompt_file_to_json(file_path) diff --git a/litellm/integrations/dotprompt/prompt_manager.py b/litellm/integrations/dotprompt/prompt_manager.py new file mode 100644 index 00000000000..9623ddab5fb --- /dev/null +++ b/litellm/integrations/dotprompt/prompt_manager.py @@ -0,0 +1,343 @@ +""" +Based on Google's GenAI Kit dotprompt implementation: https://google.github.io/dotprompt/reference/frontmatter/ +""" + +import re +from pathlib import Path +from typing import Any, Dict, List, Optional, Tuple, Union + +import yaml +from jinja2 import DictLoader, Environment, select_autoescape + + +class PromptTemplate: + """Represents a single prompt template with metadata and content.""" + + def __init__( + self, + content: str, + metadata: Optional[Dict[str, Any]] = None, + template_id: Optional[str] = None, + ): + self.content = content + self.metadata = metadata or {} + self.template_id = template_id + + # Extract common metadata fields + restricted_keys = ["model", "input", "output"] + self.model = self.metadata.get("model") + self.input_schema = self.metadata.get("input", {}).get("schema", {}) + self.output_format = self.metadata.get("output", {}).get("format") + self.output_schema = self.metadata.get("output", {}).get("schema", {}) + self.optional_params = {} + for key in self.metadata.keys(): + if key not in restricted_keys: + self.optional_params[key] = self.metadata[key] + + def __repr__(self): + return f"PromptTemplate(id='{self.template_id}', model='{self.model}')" + + +class PromptManager: + """ + Manager for loading and rendering .prompt files following the Dotprompt specification. + + Supports: + - YAML frontmatter for metadata + - Handlebars-style templating (using Jinja2) + - Input/output schema validation + - Model configuration + """ + + def __init__( + self, + prompt_id: Optional[str] = None, + prompt_directory: Optional[str] = None, + prompt_data: Optional[Dict[str, Dict[str, Any]]] = None, + prompt_file: Optional[str] = None, + ): + self.prompt_directory = Path(prompt_directory) if prompt_directory else None + self.prompts: Dict[str, PromptTemplate] = {} + self.prompt_file = prompt_file + self.jinja_env = Environment( + loader=DictLoader({}), + autoescape=select_autoescape(["html", "xml"]), + # Use Handlebars-style delimiters to match Dotprompt spec + variable_start_string="{{", + variable_end_string="}}", + block_start_string="{%", + block_end_string="%}", + comment_start_string="{#", + comment_end_string="#}", + ) + + # Load prompts from directory if provided + if self.prompt_directory: + self._load_prompts() + + if self.prompt_file: + if not prompt_id: + raise ValueError("prompt_id is required when prompt_file is provided") + + template = self._load_prompt_file(self.prompt_file, prompt_id) + self.prompts[prompt_id] = template + + # Load prompts from JSON data if provided + if prompt_data: + self._load_prompts_from_json(prompt_data, prompt_id) + + def _load_prompts(self) -> None: + """Load all .prompt files from the prompt directory.""" + if not self.prompt_directory or not self.prompt_directory.exists(): + raise ValueError( + f"Prompt directory does not exist: {self.prompt_directory}" + ) + + prompt_files = list(self.prompt_directory.glob("*.prompt")) + + for prompt_file in prompt_files: + try: + prompt_id = prompt_file.stem # filename without extension + template = self._load_prompt_file(prompt_file, prompt_id) + self.prompts[prompt_id] = template + # Optional: print(f"Loaded prompt: {prompt_id}") + except Exception: + # Optional: print(f"Error loading prompt file {prompt_file}") + pass + + def _load_prompts_from_json( + self, prompt_data: Dict[str, Dict[str, Any]], prompt_id: Optional[str] = None + ) -> None: + """Load prompts from JSON data structure. + + Expected format: + { + "prompt_id": { + "content": "template content", + "metadata": {"model": "gpt-4", "temperature": 0.7, ...} + } + } + + or + + { + "content": "template content", + "metadata": {"model": "gpt-4", "temperature": 0.7, ...} + } + prompt_id + """ + if prompt_id: + prompt_data = {prompt_id: prompt_data} + + for prompt_id, prompt_info in prompt_data.items(): + try: + content = prompt_info.get("content", "") + metadata = prompt_info.get("metadata", {}) + + template = PromptTemplate( + content=content, + metadata=metadata, + template_id=prompt_id, + ) + self.prompts[prompt_id] = template + except Exception: + # Optional: print(f"Error loading prompt from JSON: {prompt_id}") + pass + + def _load_prompt_file( + self, file_path: Union[str, Path], prompt_id: str + ) -> PromptTemplate: + """Load and parse a single .prompt file.""" + if isinstance(file_path, str): + file_path = Path(file_path) + + content = file_path.read_text(encoding="utf-8") + + # Split frontmatter and content + frontmatter, template_content = self._parse_frontmatter(content) + + return PromptTemplate( + content=template_content.strip(), + metadata=frontmatter, + template_id=prompt_id, + ) + + def _parse_frontmatter(self, content: str) -> Tuple[Dict[str, Any], str]: + """Parse YAML frontmatter from prompt content.""" + # Match YAML frontmatter between --- delimiters + frontmatter_pattern = r"^---\s*\n(.*?)\n---\s*\n(.*)$" + match = re.match(frontmatter_pattern, content, re.DOTALL) + + if match: + frontmatter_yaml = match.group(1) + template_content = match.group(2) + + try: + frontmatter = yaml.safe_load(frontmatter_yaml) or {} + except yaml.YAMLError as e: + raise ValueError(f"Invalid YAML frontmatter: {e}") + else: + # No frontmatter found, treat entire content as template + frontmatter = {} + template_content = content + + return frontmatter, template_content + + def render( + self, prompt_id: str, prompt_variables: Optional[Dict[str, Any]] = None + ) -> str: + """ + Render a prompt template with the given variables. + + Args: + prompt_id: The ID of the prompt template to render + prompt_variables: Variables to substitute in the template + + Returns: + The rendered prompt string + + Raises: + KeyError: If prompt_id is not found + ValueError: If template rendering fails + """ + if prompt_id not in self.prompts: + available_prompts = list(self.prompts.keys()) + raise KeyError( + f"Prompt '{prompt_id}' not found. Available prompts: {available_prompts}" + ) + + template = self.prompts[prompt_id] + variables = prompt_variables or {} + + # Validate input variables against schema if defined + if template.input_schema: + self._validate_input(variables, template.input_schema) + + try: + # Create Jinja2 template and render + jinja_template = self.jinja_env.from_string(template.content) + rendered = jinja_template.render(**variables) + return rendered + except Exception as e: + raise ValueError(f"Error rendering template '{prompt_id}': {e}") + + def _validate_input( + self, variables: Dict[str, Any], schema: Dict[str, Any] + ) -> None: + """Basic validation of input variables against schema.""" + for field_name, field_type in schema.items(): + if field_name in variables: + value = variables[field_name] + expected_type = self._get_python_type(field_type) + + if not isinstance(value, expected_type): + raise ValueError( + f"Invalid type for field '{field_name}': " + f"expected {getattr(expected_type, '__name__', str(expected_type))}, got {type(value).__name__}" + ) + + def _get_python_type(self, schema_type: str) -> Union[type, tuple]: + """Convert schema type string to Python type.""" + type_mapping: Dict[str, Union[type, tuple]] = { + "string": str, + "str": str, + "number": (int, float), + "integer": int, + "int": int, + "float": float, + "boolean": bool, + "bool": bool, + "array": list, + "list": list, + "object": dict, + "dict": dict, + } + + return type_mapping.get(schema_type.lower(), str) # type: ignore + + def get_prompt(self, prompt_id: str) -> Optional[PromptTemplate]: + """Get a prompt template by ID.""" + return self.prompts.get(prompt_id) + + def list_prompts(self) -> List[str]: + """Get a list of all available prompt IDs.""" + return list(self.prompts.keys()) + + def get_prompt_metadata(self, prompt_id: str) -> Optional[Dict[str, Any]]: + """Get metadata for a specific prompt.""" + template = self.prompts.get(prompt_id) + return template.metadata if template else None + + def reload_prompts(self) -> None: + """Reload all prompts from the directory (if directory was provided).""" + self.prompts.clear() + if self.prompt_directory: + self._load_prompts() + + def add_prompt( + self, prompt_id: str, content: str, metadata: Optional[Dict[str, Any]] = None + ) -> None: + """Add a prompt template programmatically.""" + template = PromptTemplate( + content=content, metadata=metadata or {}, template_id=prompt_id + ) + self.prompts[prompt_id] = template + + def prompt_file_to_json(self, file_path: Union[str, Path]) -> Dict[str, Any]: + """Convert a .prompt file to JSON format. + + Args: + file_path: Path to the .prompt file + + Returns: + Dictionary with 'content' and 'metadata' keys + """ + file_path = Path(file_path) + content = file_path.read_text(encoding="utf-8") + + # Parse frontmatter and content + frontmatter, template_content = self._parse_frontmatter(content) + + return {"content": template_content.strip(), "metadata": frontmatter} + + def json_to_prompt_file(self, prompt_data: Dict[str, Any]) -> str: + """Convert JSON prompt data to .prompt file format. + + Args: + prompt_data: Dictionary with 'content' and 'metadata' keys + + Returns: + String content in .prompt file format + """ + content = prompt_data.get("content", "") + metadata = prompt_data.get("metadata", {}) + + if not metadata: + # No metadata, return just the content + return content + + # Convert metadata to YAML frontmatter + import yaml + + frontmatter_yaml = yaml.dump(metadata, default_flow_style=False) + + return f"---\n{frontmatter_yaml}---\n{content}" + + def get_all_prompts_as_json(self) -> Dict[str, Dict[str, Any]]: + """Get all loaded prompts in JSON format. + + Returns: + Dictionary mapping prompt_id to prompt data + """ + result = {} + for prompt_id, template in self.prompts.items(): + result[prompt_id] = { + "content": template.content, + "metadata": template.metadata, + } + return result + + def load_prompts_from_json_data( + self, prompt_data: Dict[str, Dict[str, Any]] + ) -> None: + """Load additional prompts from JSON data (merges with existing prompts).""" + self._load_prompts_from_json(prompt_data) diff --git a/litellm/integrations/mlflow.py b/litellm/integrations/mlflow.py index e7a458accf9..ea9051db4de 100644 --- a/litellm/integrations/mlflow.py +++ b/litellm/integrations/mlflow.py @@ -1,10 +1,15 @@ import json import threading -from typing import Optional +from typing import TYPE_CHECKING, Any, Optional from litellm._logging import verbose_logger from litellm.integrations.custom_logger import CustomLogger +if TYPE_CHECKING: + from litellm.types.utils import StandardLoggingPayload +else: + StandardLoggingPayload = Any + class MlflowLogger(CustomLogger): def __init__(self): @@ -178,7 +183,7 @@ class MlflowLogger(CustomLogger): "call_type": kwargs.get("call_type"), "model": kwargs.get("model"), } - standard_obj = kwargs.get("standard_logging_object") + standard_obj: Optional[StandardLoggingPayload] = kwargs.get("standard_logging_object") if standard_obj: attributes.update( { @@ -192,6 +197,7 @@ class MlflowLogger(CustomLogger): "raw_llm_response": standard_obj.get("response"), "response_cost": standard_obj.get("response_cost"), "saved_cache_cost": standard_obj.get("saved_cache_cost"), + "request_tags": standard_obj.get("request_tags"), } ) else: @@ -226,6 +232,7 @@ class MlflowLogger(CustomLogger): """ import mlflow + call_type = kwargs.get("call_type", "completion") span_name = f"litellm-{call_type}" span_type = self._get_span_type(call_type) @@ -237,7 +244,7 @@ class MlflowLogger(CustomLogger): if active_span := mlflow.get_current_active_span(): # type: ignore return self._client.start_span( name=span_name, - request_id=active_span.request_id, + trace_id=active_span.request_id, parent_id=active_span.span_id, span_type=span_type, inputs=inputs, @@ -250,21 +257,24 @@ class MlflowLogger(CustomLogger): span_type=span_type, inputs=inputs, attributes=attributes, + tags=self._transform_tag_list_to_dict(attributes.get("request_tags", [])), start_time_ns=start_time_ns, ) + def _transform_tag_list_to_dict(self, tag_list: list) -> dict: + return {tag: "" for tag in tag_list} def _end_span_or_trace(self, span, outputs, end_time_ns, status): """End an MLflow span or a trace.""" if span.parent_id is None: self._client.end_trace( - request_id=span.request_id, + trace_id=span.request_id, outputs=outputs, status=status, end_time_ns=end_time_ns, ) else: self._client.end_span( - request_id=span.request_id, + trace_id=span.request_id, span_id=span.span_id, outputs=outputs, status=status, diff --git a/litellm/integrations/prompt_management_base.py b/litellm/integrations/prompt_management_base.py index 4a8bcd2e249..34b4455f564 100644 --- a/litellm/integrations/prompt_management_base.py +++ b/litellm/integrations/prompt_management_base.py @@ -54,6 +54,7 @@ class PromptManagementBase(ABC): prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ) -> PromptManagementClient: + compiled_prompt_client = self._compile_prompt_helper( prompt_id=prompt_id, prompt_variables=prompt_variables, @@ -91,6 +92,7 @@ class PromptManagementBase(ABC): prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ) -> Tuple[str, List[AllMessageValues], dict]: + if prompt_id is None: raise ValueError("prompt_id is required for Prompt Management Base class") if not self.should_run_prompt_management( diff --git a/litellm/litellm_core_utils/core_helpers.py b/litellm/litellm_core_utils/core_helpers.py index 86e7eb89a21..13a2e554f12 100644 --- a/litellm/litellm_core_utils/core_helpers.py +++ b/litellm/litellm_core_utils/core_helpers.py @@ -18,24 +18,22 @@ else: def safe_divide_seconds( - seconds: float, - denominator: float, - default: Optional[float] = None + seconds: float, denominator: float, default: Optional[float] = None ) -> Optional[float]: """ Safely divide seconds by denominator, handling zero division. - + Args: seconds: Time duration in seconds denominator: The divisor (e.g., number of tokens) default: Value to return if division by zero (defaults to None) - + Returns: The result of the division as a float (seconds per unit), or default if denominator is zero """ if denominator <= 0: return default - + return float(seconds / denominator) @@ -203,3 +201,50 @@ def preserve_upstream_non_openai_attributes( for key, value in original_chunk.model_dump().items(): if key not in expected_keys: setattr(model_response, key, value) + + +def safe_deep_copy(data): + """ + Safe Deep Copy + + The LiteLLM Request has some object that can-not be pickled / deep copied + + Use this function to safely deep copy the LiteLLM Request + """ + import copy + + import litellm + + if litellm.safe_memory_mode is True: + return data + + litellm_parent_otel_span: Optional[Any] = None + # Step 1: Remove the litellm_parent_otel_span + litellm_parent_otel_span = None + if isinstance(data, dict): + # remove litellm_parent_otel_span since this is not picklable + if "metadata" in data and "litellm_parent_otel_span" in data["metadata"]: + litellm_parent_otel_span = data["metadata"].pop("litellm_parent_otel_span") + data["metadata"]["litellm_parent_otel_span"] = "placeholder" + if ( + "litellm_metadata" in data + and "litellm_parent_otel_span" in data["litellm_metadata"] + ): + litellm_parent_otel_span = data["litellm_metadata"].pop( + "litellm_parent_otel_span" + ) + data["litellm_metadata"]["litellm_parent_otel_span"] = "placeholder" + new_data = copy.deepcopy(data) + + # Step 2: re-add the litellm_parent_otel_span after doing a deep copy + if isinstance(data, dict) and litellm_parent_otel_span is not None: + if "metadata" in data and "litellm_parent_otel_span" in data["metadata"]: + data["metadata"]["litellm_parent_otel_span"] = litellm_parent_otel_span + if ( + "litellm_metadata" in data + and "litellm_parent_otel_span" in data["litellm_metadata"] + ): + data["litellm_metadata"][ + "litellm_parent_otel_span" + ] = litellm_parent_otel_span + return new_data diff --git a/litellm/litellm_core_utils/custom_logger_registry.py b/litellm/litellm_core_utils/custom_logger_registry.py index 252fb29eb3a..9606b47b9b8 100644 --- a/litellm/litellm_core_utils/custom_logger_registry.py +++ b/litellm/litellm_core_utils/custom_logger_registry.py @@ -7,6 +7,7 @@ Example: "datadog" -> DataDogLogger "prometheus" -> PrometheusLogger """ + from typing import Union from litellm.integrations.agentops import AgentOps @@ -31,10 +32,12 @@ from litellm.integrations.mlflow import MlflowLogger from litellm.integrations.openmeter import OpenMeterLogger from litellm.integrations.opentelemetry import OpenTelemetry from litellm.integrations.opik.opik import OpikLogger + try: from litellm_enterprise.integrations.prometheus import PrometheusLogger except Exception: PrometheusLogger = None +from litellm.integrations.dotprompt import DotpromptManager from litellm.integrations.s3_v2 import S3Logger from litellm.integrations.sqs import SQSLogger from litellm.integrations.vector_store_integrations.vector_store_pre_call_hook import ( @@ -47,6 +50,7 @@ class CustomLoggerRegistry: """ Registry mapping the callback class string to the class type. """ + CALLBACK_CLASS_STR_TO_CLASS_TYPE = { "lago": LagoLogger, "openmeter": OpenMeterLogger, @@ -80,6 +84,7 @@ class CustomLoggerRegistry: "aws_sqs": SQSLogger, "dynamic_rate_limiter": _PROXY_DynamicRateLimitHandler, "vector_store_pre_call_hook": VectorStorePreCallHook, + "dotprompt": DotpromptManager, } try: @@ -110,14 +115,17 @@ class CustomLoggerRegistry: def get_callback_str_from_class_type(cls, class_type: type) -> Union[str, None]: """ Get the callback string from the class type. - + Args: class_type: The class type to find the string for - + Returns: str: The callback string, or None if not found """ - for callback_str, callback_class in cls.CALLBACK_CLASS_STR_TO_CLASS_TYPE.items(): + for ( + callback_str, + callback_class, + ) in cls.CALLBACK_CLASS_STR_TO_CLASS_TYPE.items(): if callback_class == class_type: return callback_str return None @@ -127,15 +135,18 @@ class CustomLoggerRegistry: """ Get all callback strings that map to the same class type. Some class types (like OpenTelemetry) have multiple string mappings. - + Args: class_type: The class type to find all strings for - + Returns: list: List of callback strings that map to the class type """ callback_strs: list[str] = [] - for callback_str, callback_class in cls.CALLBACK_CLASS_STR_TO_CLASS_TYPE.items(): + for ( + callback_str, + callback_class, + ) in cls.CALLBACK_CLASS_STR_TO_CLASS_TYPE.items(): if callback_class == class_type: callback_strs.append(callback_str) - return callback_strs \ No newline at end of file + return callback_strs diff --git a/litellm/litellm_core_utils/fallback_utils.py b/litellm/litellm_core_utils/fallback_utils.py index d5610d5fddf..a5b0c85c816 100644 --- a/litellm/litellm_core_utils/fallback_utils.py +++ b/litellm/litellm_core_utils/fallback_utils.py @@ -1,9 +1,9 @@ import uuid -from copy import deepcopy from typing import Optional import litellm from litellm._logging import verbose_logger +from litellm.litellm_core_utils.core_helpers import safe_deep_copy from .asyncify import run_async_function @@ -41,7 +41,7 @@ async def async_completion_with_fallbacks(**kwargs): most_recent_exception_str: Optional[str] = None for fallback in fallbacks: try: - completion_kwargs = deepcopy(base_kwargs) + completion_kwargs = safe_deep_copy(base_kwargs) # Handle dictionary fallback configurations if isinstance(fallback, dict): model = fallback.pop("model", original_model) diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 8bbbd6d9d40..dfa941d8301 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -120,6 +120,7 @@ from ..integrations.azure_storage.azure_storage import AzureBlobStorageLogger from ..integrations.custom_prompt_management import CustomPromptManagement from ..integrations.datadog.datadog import DataDogLogger from ..integrations.datadog.datadog_llm_obs import DataDogLLMObsLogger +from ..integrations.dotprompt import DotpromptManager from ..integrations.dynamodb import DyanmoDBLogger from ..integrations.galileo import GalileoObserve from ..integrations.gcs_bucket.gcs_bucket import GCSBucketLogger @@ -167,11 +168,10 @@ try: from litellm_enterprise.enterprise_callbacks.send_emails.smtp_email import ( SMTPEmailLogger, ) + from litellm_enterprise.integrations.prometheus import PrometheusLogger from litellm_enterprise.litellm_core_utils.litellm_logging import ( StandardLoggingPayloadSetup as EnterpriseStandardLoggingPayloadSetup, ) - from litellm_enterprise.integrations.prometheus import PrometheusLogger - EnterpriseStandardLoggingPayloadSetupVAR: Optional[ Type[EnterpriseStandardLoggingPayloadSetup] @@ -504,6 +504,15 @@ class Logging(LiteLLMLoggingBaseClass): if "custom_llm_provider" in self.model_call_details: self.custom_llm_provider = self.model_call_details["custom_llm_provider"] + def update_messages(self, messages: List[AllMessageValues]): + """ + Update the logged value of the messages in the model_call_details + + Allows pre-call hooks to update the messages before the call is made + """ + self.messages = messages + self.model_call_details["messages"] = messages + def should_run_prompt_management_hooks( self, non_default_params: Dict, @@ -599,9 +608,7 @@ class Logging(LiteLLMLoggingBaseClass): custom_logger = ( prompt_management_logger or self.get_custom_logger_for_prompt_management( - model=model, - tools=tools, - non_default_params=non_default_params + model=model, tools=tools, non_default_params=non_default_params ) ) @@ -673,16 +680,16 @@ class Logging(LiteLLMLoggingBaseClass): # Vector Store / Knowledge Base hooks ######################################################### if litellm.vector_store_registry is not None: - - vector_store_custom_logger = _init_custom_logger_compatible_class( - logging_integration="vector_store_pre_call_hook", - internal_usage_cache=None, - llm_router=None, - ) - self.model_call_details["prompt_integration"] = ( - vector_store_custom_logger.__class__.__name__ - ) - return vector_store_custom_logger + + vector_store_custom_logger = _init_custom_logger_compatible_class( + logging_integration="vector_store_pre_call_hook", + internal_usage_cache=None, + llm_router=None, + ) + self.model_call_details["prompt_integration"] = ( + vector_store_custom_logger.__class__.__name__ + ) + return vector_store_custom_logger return None @@ -945,7 +952,8 @@ class Logging(LiteLLMLoggingBaseClass): if additional_args.get("request_str", None) is not None: # print the sagemaker / bedrock client request curl_command = "\nRequest Sent from LiteLLM:\n" - curl_command += additional_args.get("request_str", None) + request_str = additional_args.get("request_str", "") + curl_command += request_str elif api_base == "": curl_command = str(self.model_call_details) return curl_command @@ -1314,9 +1322,9 @@ class Logging(LiteLLMLoggingBaseClass): if ( EnterpriseCallbackControls is not None and EnterpriseCallbackControls.is_callback_disabled_dynamically( - callback=callback, + callback=callback, litellm_params=litellm_params, - standard_callback_dynamic_params = self.standard_callback_dynamic_params + standard_callback_dynamic_params=self.standard_callback_dynamic_params, ) ): verbose_logger.debug( @@ -2265,15 +2273,20 @@ class Logging(LiteLLMLoggingBaseClass): start_time=start_time, end_time=end_time, ) + if isinstance(callback, CustomLogger): # custom logger class + model_call_details: Dict = self.model_call_details + ################################## + # call redaction hook for custom logger + model_call_details = callback.redact_standard_logging_payload_from_model_call_details( + model_call_details=model_call_details + ) + ################################## if self.stream is True: - if ( - "async_complete_streaming_response" - in self.model_call_details - ): + if "async_complete_streaming_response" in model_call_details: await callback.async_log_success_event( - kwargs=self.model_call_details, - response_obj=self.model_call_details[ + kwargs=model_call_details, + response_obj=model_call_details[ "async_complete_streaming_response" ], start_time=start_time, @@ -2281,14 +2294,14 @@ class Logging(LiteLLMLoggingBaseClass): ) else: await callback.async_log_stream_event( # [TODO]: move this to being an async log stream event function - kwargs=self.model_call_details, + kwargs=model_call_details, response_obj=result, start_time=start_time, end_time=end_time, ) else: await callback.async_log_success_event( - kwargs=self.model_call_details, + kwargs=model_call_details, response_obj=result, start_time=start_time, end_time=end_time, @@ -3209,6 +3222,8 @@ def _init_custom_logger_compatible_class( # noqa: PLR0915 _in_memory_loggers.append(_literalai_logger) return _literalai_logger # type: ignore elif logging_integration == "prometheus": + if PrometheusLogger is None: + raise ValueError("PrometheusLogger is not initialized") for callback in _in_memory_loggers: if isinstance(callback, PrometheusLogger): return callback # type: ignore @@ -3483,7 +3498,7 @@ def _init_custom_logger_compatible_class( # noqa: PLR0915 from litellm.integrations.vector_store_integrations.vector_store_pre_call_hook import ( VectorStorePreCallHook, ) - + for callback in _in_memory_loggers: if isinstance(callback, VectorStorePreCallHook): return callback @@ -3526,11 +3541,21 @@ def _init_custom_logger_compatible_class( # noqa: PLR0915 humanloop_logger = HumanloopLogger() _in_memory_loggers.append(humanloop_logger) return humanloop_logger # type: ignore + elif logging_integration == "dotprompt": + for callback in _in_memory_loggers: + if isinstance(callback, DotpromptManager): + return callback + + dotprompt_logger = DotpromptManager() + _in_memory_loggers.append(dotprompt_logger) + return dotprompt_logger # type: ignore + return None except Exception as e: verbose_logger.exception( f"[Non-Blocking Error] Error initializing custom logger: {e}" ) return None + return None def get_custom_logger_compatible_class( # noqa: PLR0915 @@ -3571,7 +3596,7 @@ def get_custom_logger_compatible_class( # noqa: PLR0915 for callback in _in_memory_loggers: if isinstance(callback, LiteralAILogger): return callback - elif logging_integration == "prometheus": + elif logging_integration == "prometheus" and PrometheusLogger is not None: for callback in _in_memory_loggers: if isinstance(callback, PrometheusLogger): return callback @@ -3674,7 +3699,7 @@ def get_custom_logger_compatible_class( # noqa: PLR0915 from litellm.integrations.vector_store_integrations.vector_store_pre_call_hook import ( VectorStorePreCallHook, ) - + for callback in _in_memory_loggers: if isinstance(callback, VectorStorePreCallHook): return callback diff --git a/litellm/litellm_core_utils/prompt_templates/common_utils.py b/litellm/litellm_core_utils/prompt_templates/common_utils.py index 258601ff5a0..827d28598ec 100644 --- a/litellm/litellm_core_utils/prompt_templates/common_utils.py +++ b/litellm/litellm_core_utils/prompt_templates/common_utils.py @@ -822,3 +822,41 @@ def set_last_user_message( messages.reverse() messages.append({"role": "user", "content": content}) return messages + + +def convert_prefix_message_to_non_prefix_messages( + messages: List[AllMessageValues], +) -> List[AllMessageValues]: + """ + For models that don't support {prefix: true} in messages, we need to convert the prefix message to a non-prefix message. + + Use prompt: + + {"role": "assistant", "content": "value", "prefix": true} -> [ + { + "role": "system", + "content": "You are a helpful assistant. You are given a message and you need to respond to it. You are also given a generated content. You need to respond to the message in continuation of the generated content. Do not repeat the same content. Your response should be in continuation of this text: ", + }, + { + "role": "assistant", + "content": message["content"], + }, + ] + + do this in place + """ + new_messages: List[AllMessageValues] = [] + for message in messages: + if message.get("prefix"): + new_messages.append( + { + "role": "system", + "content": "You are a helpful assistant. You are given a message and you need to respond to it. You are also given a generated content. You need to respond to the message in continuation of the generated content. Do not repeat the same content. Your response should be in continuation of this text: ", + } + ) + new_messages.append( + {**{k: v for k, v in message.items() if k != "prefix"}} # type: ignore + ) + else: + new_messages.append(message) + return new_messages diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py index 91a5b317fd6..b4ace1545d2 100644 --- a/litellm/litellm_core_utils/prompt_templates/factory.py +++ b/litellm/litellm_core_utils/prompt_templates/factory.py @@ -1121,13 +1121,14 @@ def convert_to_gemini_tool_call_result( } """ content_str: str = "" - if isinstance(message["content"], str): - content_str = message["content"] - elif isinstance(message["content"], List): - content_list = message["content"] - for content in content_list: - if content["type"] == "text": - content_str += content["text"] + if "content" in message: + if isinstance(message["content"], str): + content_str = message["content"] + elif isinstance(message["content"], List): + content_list = message["content"] + for content in content_list: + if content["type"] == "text": + content_str += content["text"] name: Optional[str] = message.get("name", "") # type: ignore # Recover name from last message with tool calls diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index 17f5a8d1deb..2e9e6770a1d 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -940,8 +940,8 @@ class CustomStreamWrapper: and not self.sent_last_thinking_block and model_response.choices[0].delta.content ): - model_response.choices[0].delta.content = ( - "" + (model_response.choices[0].delta.content or "") + model_response.choices[0].delta.content = "" + ( + model_response.choices[0].delta.content or "" ) self.sent_last_thinking_block = True @@ -1841,13 +1841,25 @@ class CustomStreamWrapper: self.logging_obj.async_failure_handler(e, traceback_exception) # type: ignore ) ## Map to OpenAI Exception - raise exception_type( - model=self.model, - custom_llm_provider=self.custom_llm_provider, - original_exception=e, - completion_kwargs={}, - extra_kwargs={}, - ) + try: + exception_type( + model=self.model, + custom_llm_provider=self.custom_llm_provider, + original_exception=e, + completion_kwargs={}, + extra_kwargs={}, + ) + except Exception as e: + from litellm.exceptions import MidStreamFallbackError + + raise MidStreamFallbackError( + message=str(e), + model=self.model, + llm_provider=self.custom_llm_provider or "anthropic", + original_exception=e, + generated_content=self.response_uptil_now, + is_pre_first_chunk=not self.sent_first_chunk, + ) @staticmethod def _strip_sse_data_from_chunk(chunk: Optional[str]) -> Optional[str]: diff --git a/litellm/litellm_core_utils/token_counter.py b/litellm/litellm_core_utils/token_counter.py index 1eb4fc9016a..4df944edbaa 100644 --- a/litellm/litellm_core_utils/token_counter.py +++ b/litellm/litellm_core_utils/token_counter.py @@ -462,9 +462,8 @@ def _count_messages( default_token_count, ) else: - raise ValueError( - f"Unsupported type {type(value)} for key {key} in message {message}" - ) + # Skip unsupported keys instead of raising an error + continue return num_tokens diff --git a/litellm/llms/anthropic/chat/handler.py b/litellm/llms/anthropic/chat/handler.py index 620d2f05119..5618c50923e 100644 --- a/litellm/llms/anthropic/chat/handler.py +++ b/litellm/llms/anthropic/chat/handler.py @@ -640,7 +640,8 @@ class ModelResponseIterator: ] ] = None - index = int(chunk.get("index", 0)) + # Always use index=0 for OpenAI choice format (fixes multi-choice errors) + index = 0 if type_chunk == "content_block_delta": """ Anthropic content chunk diff --git a/litellm/llms/azure/chat/gpt_transformation.py b/litellm/llms/azure/chat/gpt_transformation.py index 78fa91bbd77..0ae6fad7300 100644 --- a/litellm/llms/azure/chat/gpt_transformation.py +++ b/litellm/llms/azure/chat/gpt_transformation.py @@ -159,9 +159,16 @@ class AzureOpenAIConfig(BaseConfig): supported_openai_params = self.get_supported_openai_params(model) api_version_times = api_version.split("-") - api_version_year = api_version_times[0] - api_version_month = api_version_times[1] - api_version_day = api_version_times[2] + + if len(api_version_times) >= 3: + api_version_year = api_version_times[0] + api_version_month = api_version_times[1] + api_version_day = api_version_times[2] + else: + api_version_year = None + api_version_month = None + api_version_day = None + for param, value in non_default_params.items(): if param == "tool_choice": """ @@ -171,47 +178,57 @@ class AzureOpenAIConfig(BaseConfig): """ ## check if api version supports this param ## if ( - api_version_year < "2023" - or (api_version_year == "2023" and api_version_month < "12") - or ( - api_version_year == "2023" - and api_version_month == "12" - and api_version_day < "01" - ) + api_version_year is None + or api_version_month is None + or api_version_day is None ): - if litellm.drop_params is True or ( - drop_params is not None and drop_params is True - ): - pass - else: - raise UnsupportedParamsError( - status_code=400, - message=f"""Azure does not support 'tool_choice', for api_version={api_version}. Bump your API version to '2023-12-01-preview' or later. This parameter requires 'api_version="2023-12-01-preview"' or later. Azure API Reference: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions""", - ) - elif value == "required" and ( - api_version_year == "2024" and api_version_month <= "05" - ): ## check if tool_choice value is supported ## - if litellm.drop_params is True or ( - drop_params is not None and drop_params is True - ): - pass - else: - raise UnsupportedParamsError( - status_code=400, - message=f"Azure does not support '{value}' as a {param} param, for api_version={api_version}. To drop 'tool_choice=required' for calls with this Azure API version, set `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\nAzure API Reference: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions", - ) - else: optional_params["tool_choice"] = value + else: + if ( + api_version_year < "2023" + or (api_version_year == "2023" and api_version_month < "12") + or ( + api_version_year == "2023" + and api_version_month == "12" + and api_version_day < "01" + ) + ): + if litellm.drop_params is True or ( + drop_params is not None and drop_params is True + ): + pass + else: + raise UnsupportedParamsError( + status_code=400, + message=f"""Azure does not support 'tool_choice', for api_version={api_version}. Bump your API version to '2023-12-01-preview' or later. This parameter requires 'api_version="2023-12-01-preview"' or later. Azure API Reference: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions""", + ) + elif value == "required" and ( + api_version_year == "2024" and api_version_month <= "05" + ): ## check if tool_choice value is supported ## + if litellm.drop_params is True or ( + drop_params is not None and drop_params is True + ): + pass + else: + raise UnsupportedParamsError( + status_code=400, + message=f"Azure does not support '{value}' as a {param} param, for api_version={api_version}. To drop 'tool_choice=required' for calls with this Azure API version, set `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\nAzure API Reference: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions", + ) + else: + optional_params["tool_choice"] = value elif param == "response_format" and isinstance(value, dict): _is_response_format_supported_model = ( self._is_response_format_supported_model(model) ) - is_response_format_supported_api_version = ( - self._is_response_format_supported_api_version( - api_version_year, api_version_month + if api_version_year is None or api_version_month is None: + is_response_format_supported_api_version = True + else: + is_response_format_supported_api_version = ( + self._is_response_format_supported_api_version( + api_version_year, api_version_month + ) ) - ) is_response_format_supported = ( is_response_format_supported_api_version and _is_response_format_supported_model diff --git a/litellm/llms/base_llm/google_genai/transformation.py b/litellm/llms/base_llm/google_genai/transformation.py index 9706b226c47..6dbccaada9a 100644 --- a/litellm/llms/base_llm/google_genai/transformation.py +++ b/litellm/llms/base_llm/google_genai/transformation.py @@ -10,12 +10,14 @@ if TYPE_CHECKING: GenerateContentConfigDict, GenerateContentContentListUnionDict, GenerateContentResponse, + ToolConfigDict, ) else: GenerateContentConfigDict = Any GenerateContentContentListUnionDict = Any GenerateContentResponse = Any LiteLLMLoggingObj = Any + ToolConfigDict = Any from litellm.types.router import GenericLiteLLMParams @@ -145,6 +147,7 @@ class BaseGoogleGenAIGenerateContentConfig(ABC): self, model: str, contents: GenerateContentContentListUnionDict, + tools: Optional[ToolConfigDict], generate_content_config_dict: Dict, ) -> dict: """ @@ -153,6 +156,7 @@ class BaseGoogleGenAIGenerateContentConfig(ABC): Args: model: The model name contents: Input contents + tools: Tools generate_content_request_params: Request parameters litellm_params: LiteLLM parameters headers: Request headers diff --git a/litellm/llms/bedrock/chat/converse_transformation.py b/litellm/llms/bedrock/chat/converse_transformation.py index ec378ddbb85..e961433b52e 100644 --- a/litellm/llms/bedrock/chat/converse_transformation.py +++ b/litellm/llms/bedrock/chat/converse_transformation.py @@ -49,6 +49,14 @@ from litellm.utils import add_dummy_tool, has_tool_call_blocks, supports_reasoni from ..common_utils import BedrockError, BedrockModelInfo, get_bedrock_tool_name +# Computer use tool prefixes supported by Bedrock +BEDROCK_COMPUTER_USE_TOOLS = [ + "computer_use_preview", + "computer_", + "bash_", + "text_editor_" +] + class AmazonConverseConfig(BaseConfig): """ @@ -218,6 +226,98 @@ class AmazonConverseConfig(BaseConfig): + self.get_supported_video_types() ) + def is_computer_use_tool_used( + self, tools: Optional[List[OpenAIChatCompletionToolParam]], model: str + ) -> bool: + """Check if computer use tools are being used in the request.""" + if tools is None: + return False + + for tool in tools: + if "type" in tool: + tool_type = tool["type"] + for computer_use_prefix in BEDROCK_COMPUTER_USE_TOOLS: + if tool_type.startswith(computer_use_prefix): + return True + return False + + def _transform_computer_use_tools( + self, computer_use_tools: List[OpenAIChatCompletionToolParam] + ) -> List[dict]: + """Transform computer use tools to Bedrock format.""" + transformed_tools: List[dict] = [] + + for tool in computer_use_tools: + tool_type = tool.get("type", "") + + # Check if this is a computer use tool with the startswith method + is_computer_use_tool = False + for computer_use_prefix in BEDROCK_COMPUTER_USE_TOOLS: + if tool_type.startswith(computer_use_prefix): + is_computer_use_tool = True + break + + transformed_tool: dict = {} + if is_computer_use_tool: + if tool_type.startswith("computer_") and "function" in tool: + # Computer use tool with function format + func = tool["function"] + transformed_tool = { + "type": tool_type, + "name": func.get("name", "computer"), + **func.get("parameters", {}) + } + else: + # Direct tools - just need to ensure name is present + transformed_tool = dict(tool) + if "name" not in transformed_tool: + if tool_type.startswith("bash_"): + transformed_tool["name"] = "bash" + elif tool_type.startswith("text_editor_"): + transformed_tool["name"] = "str_replace_editor" + else: + # Pass through other tools as-is + transformed_tool = dict(tool) + + transformed_tools.append(transformed_tool) + + return transformed_tools + + def _separate_computer_use_tools( + self, tools: List[OpenAIChatCompletionToolParam], model: str + ) -> Tuple[List[OpenAIChatCompletionToolParam], List[OpenAIChatCompletionToolParam]]: + """ + Separate computer use tools from regular function tools. + + Args: + tools: List of tools to separate + model: The model name to check if it supports computer use + + Returns: + Tuple of (computer_use_tools, regular_tools) + """ + computer_use_tools = [] + regular_tools = [] + + for tool in tools: + if "type" in tool: + tool_type = tool["type"] + is_computer_use_tool = False + for computer_use_prefix in BEDROCK_COMPUTER_USE_TOOLS: + if tool_type.startswith(computer_use_prefix): + is_computer_use_tool = True + break + if is_computer_use_tool: + computer_use_tools.append(tool) + else: + regular_tools.append(tool) + else: + regular_tools.append(tool) + + return computer_use_tools, regular_tools + + + def _create_json_tool_call_for_response_format( self, json_schema: Optional[dict] = None, @@ -546,9 +646,31 @@ class AmazonConverseConfig(BaseConfig): self._handle_top_k_value(model, inference_params) ) - bedrock_tools: List[ToolBlock] = _bedrock_tools_pt( - inference_params.pop("tools", []) - ) + original_tools = inference_params.pop("tools", []) + + # Initialize bedrock_tools + bedrock_tools: List[ToolBlock] = [] + + # Only separate tools if computer use tools are actually present + if original_tools and self.is_computer_use_tool_used(original_tools, model): + # Separate computer use tools from regular function tools + computer_use_tools, regular_tools = self._separate_computer_use_tools( + original_tools, model + ) + + # Process regular function tools using existing logic + bedrock_tools = _bedrock_tools_pt(regular_tools) + + # Add computer use tools and anthropic_beta if needed (only when computer use tools are present) + if computer_use_tools: + additional_request_params["anthropic_beta"] = ["computer-use-2024-10-22"] + # Transform computer use tools to proper Bedrock format + transformed_computer_tools = self._transform_computer_use_tools(computer_use_tools) + additional_request_params["tools"] = transformed_computer_tools + else: + # No computer use tools, process all tools as regular tools + bedrock_tools = _bedrock_tools_pt(original_tools) + bedrock_tool_config: Optional[ToolConfigBlock] = None if len(bedrock_tools) > 0: tool_choice_values: ToolChoiceValuesBlock = inference_params.pop( diff --git a/litellm/llms/bedrock/chat/invoke_handler.py b/litellm/llms/bedrock/chat/invoke_handler.py index e33535043d5..b8dac7c3cd7 100644 --- a/litellm/llms/bedrock/chat/invoke_handler.py +++ b/litellm/llms/bedrock/chat/invoke_handler.py @@ -1384,7 +1384,9 @@ class AWSEventStreamDecoder: "name": None, "arguments": "{}", }, - "index": chunk_data["contentBlockIndex"], + "index": self.tool_calls_index + if self.tool_calls_index is not None + else index, } elif "stopReason" in chunk_data: finish_reason = map_finish_reason(chunk_data.get("stopReason", "stop")) diff --git a/litellm/llms/custom_httpx/llm_http_handler.py b/litellm/llms/custom_httpx/llm_http_handler.py index 46fd866be2b..3e7dff91820 100644 --- a/litellm/llms/custom_httpx/llm_http_handler.py +++ b/litellm/llms/custom_httpx/llm_http_handler.py @@ -3196,6 +3196,7 @@ class BaseLLMHTTPHandler: contents: Any, generate_content_provider_config: BaseGoogleGenAIGenerateContentConfig, generate_content_config_dict: Dict, + tools: Any, custom_llm_provider: str, litellm_params: GenericLiteLLMParams, logging_obj: LiteLLMLoggingObj, @@ -3221,6 +3222,7 @@ class BaseLLMHTTPHandler: contents=contents, generate_content_provider_config=generate_content_provider_config, generate_content_config_dict=generate_content_config_dict, + tools=tools, custom_llm_provider=custom_llm_provider, litellm_params=litellm_params, logging_obj=logging_obj, @@ -3256,6 +3258,7 @@ class BaseLLMHTTPHandler: data = generate_content_provider_config.transform_generate_content_request( model=model, contents=contents, + tools=tools, generate_content_config_dict=generate_content_config_dict, ) @@ -3317,6 +3320,7 @@ class BaseLLMHTTPHandler: contents: Any, generate_content_provider_config: BaseGoogleGenAIGenerateContentConfig, generate_content_config_dict: Dict, + tools: Any, custom_llm_provider: str, litellm_params: GenericLiteLLMParams, logging_obj: LiteLLMLoggingObj, @@ -3360,6 +3364,7 @@ class BaseLLMHTTPHandler: data = generate_content_provider_config.transform_generate_content_request( model=model, contents=contents, + tools=tools, generate_content_config_dict=generate_content_config_dict, ) diff --git a/litellm/llms/gemini/common_utils.py b/litellm/llms/gemini/common_utils.py index 31b57434e10..53de6711cad 100644 --- a/litellm/llms/gemini/common_utils.py +++ b/litellm/llms/gemini/common_utils.py @@ -44,7 +44,7 @@ class GeminiModelInfo(BaseLLMModelInfo): @staticmethod def get_api_key(api_key: Optional[str] = None) -> Optional[str]: - return api_key or (get_secret_str("GEMINI_API_KEY")) + return api_key or (get_secret_str("GOOGLE_API_KEY")) or (get_secret_str("GEMINI_API_KEY")) @staticmethod def get_base_model(model: str) -> Optional[str]: @@ -66,7 +66,7 @@ class GeminiModelInfo(BaseLLMModelInfo): endpoint = f"/{self.api_version}/models" if api_base is None or api_key is None: raise ValueError( - "GEMINI_API_BASE or GEMINI_API_KEY is not set. Please set the environment variable, to query Gemini's `/models` endpoint." + "GEMINI_API_BASE or GEMINI_API_KEY/GOOGLE_API_KEY is not set. Please set the environment variable, to query Gemini's `/models` endpoint." ) response = litellm.module_level_client.get( @@ -133,3 +133,7 @@ def encode_unserializable_types( else: processed_data[key] = value return processed_data + + +def get_api_key_from_env() -> Optional[str]: + return get_secret_str("GOOGLE_API_KEY") or get_secret_str("GEMINI_API_KEY") diff --git a/litellm/llms/gemini/google_genai/transformation.py b/litellm/llms/gemini/google_genai/transformation.py index 9910e478063..28142f72739 100644 --- a/litellm/llms/gemini/google_genai/transformation.py +++ b/litellm/llms/gemini/google_genai/transformation.py @@ -11,7 +11,6 @@ from litellm.llms.base_llm.google_genai.transformation import ( BaseGoogleGenAIGenerateContentConfig, ) from litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini import VertexLLM -from litellm.secret_managers.main import get_secret_str from litellm.types.router import GenericLiteLLMParams if TYPE_CHECKING: @@ -19,17 +18,26 @@ if TYPE_CHECKING: GenerateContentConfigDict, GenerateContentContentListUnionDict, GenerateContentResponse, + ToolConfigDict, ) else: GenerateContentConfigDict = Any GenerateContentContentListUnionDict = Any GenerateContentResponse = Any - + ToolConfigDict = Any + +from ..common_utils import get_api_key_from_env class GoogleGenAIConfig(BaseGoogleGenAIGenerateContentConfig, VertexLLM): """ Configuration for calling Google models in their native format. """ + ############################## + # Constants + ############################## + XGOOGLE_API_KEY = "x-goog-api-key" + ############################## + @property def custom_llm_provider(self) -> Literal["gemini", "vertex_ai"]: return "gemini" @@ -113,8 +121,9 @@ class GoogleGenAIConfig(BaseGoogleGenAIGenerateContentConfig, VertexLLM): default_headers = { "Content-Type": "application/json", } - if api_key is not None: - default_headers["Authorization"] = f"Bearer {api_key}" + gemini_api_key = self._get_google_ai_studio_api_key(dict(litellm_params or {})) + if gemini_api_key is not None: + default_headers[self.XGOOGLE_API_KEY] = gemini_api_key if headers is not None: default_headers.update(headers) @@ -124,7 +133,7 @@ class GoogleGenAIConfig(BaseGoogleGenAIGenerateContentConfig, VertexLLM): return ( litellm_params.pop("api_key", None) or litellm_params.pop("gemini_api_key", None) - or get_secret_str("GEMINI_API_KEY") + or get_api_key_from_env() or litellm.api_key ) @@ -252,6 +261,7 @@ class GoogleGenAIConfig(BaseGoogleGenAIGenerateContentConfig, VertexLLM): self, model: str, contents: GenerateContentContentListUnionDict, + tools: Optional[ToolConfigDict], generate_content_config_dict: Dict, ) -> dict: from litellm.types.google_genai.main import ( @@ -261,6 +271,7 @@ class GoogleGenAIConfig(BaseGoogleGenAIGenerateContentConfig, VertexLLM): typed_generate_content_request = GenerateContentRequestDict( model=model, contents=contents, + tools=tools, generationConfig=GenerateContentConfigDict(**generate_content_config_dict), ) diff --git a/litellm/llms/gemini/image_generation/transformation.py b/litellm/llms/gemini/image_generation/transformation.py index 72ba5bcf1ee..e57364fd288 100644 --- a/litellm/llms/gemini/image_generation/transformation.py +++ b/litellm/llms/gemini/image_generation/transformation.py @@ -190,11 +190,9 @@ class GoogleImageGenConfig(BaseImageGenerationConfig): predictions = response_data.get("predictions", []) for prediction in predictions: # Google AI returns base64 encoded images in the prediction - generated_images = prediction.get("generatedImages", []) - for image_data in generated_images: - model_response.data.append(ImageObject( - b64_json=image_data.get("bytesBase64Encoded", None), - url=None, # Google AI returns base64, not URLs - )) + model_response.data.append(ImageObject( + b64_json=prediction.get("bytesBase64Encoded", None), + url=None, # Google AI returns base64, not URLs + )) return model_response \ No newline at end of file diff --git a/litellm/llms/gemini/realtime/transformation.py b/litellm/llms/gemini/realtime/transformation.py index 980723eb3fe..f32a404c9e8 100644 --- a/litellm/llms/gemini/realtime/transformation.py +++ b/litellm/llms/gemini/realtime/transformation.py @@ -3,7 +3,6 @@ This file contains the transformation logic for the Gemini realtime API. """ import json -import os import uuid from typing import Any, Dict, List, Optional, Union, cast @@ -55,7 +54,7 @@ from litellm.types.realtime import ( ) from litellm.utils import get_empty_usage -from ..common_utils import encode_unserializable_types +from ..common_utils import encode_unserializable_types, get_api_key_from_env MAP_GEMINI_FIELD_TO_OPENAI_EVENT: Dict[str, OpenAIRealtimeEventTypes] = { "setupComplete": OpenAIRealtimeEventTypes.SESSION_CREATED, @@ -81,7 +80,7 @@ class GeminiRealtimeConfig(BaseRealtimeConfig): if api_base is None: api_base = "wss://generativelanguage.googleapis.com" if api_key is None: - api_key = os.environ.get("GEMINI_API_KEY") + api_key = get_api_key_from_env() if api_key is None: raise ValueError("api_key is required for Gemini API calls") api_base = api_base.replace("https://", "wss://") @@ -188,9 +187,9 @@ class GeminiRealtimeConfig(BaseRealtimeConfig): vertex_gemini_config = VertexGeminiConfig() vertex_gemini_config._map_function(value) - optional_params["generationConfig"][ - "tools" - ] = vertex_gemini_config._map_function(value) + optional_params["generationConfig"]["tools"] = ( + vertex_gemini_config._map_function(value) + ) elif key == "input_audio_transcription" and value is not None: optional_params["inputAudioTranscription"] = {} elif key == "turn_detection": @@ -201,10 +200,10 @@ class GeminiRealtimeConfig(BaseRealtimeConfig): if ( len(transformed_audio_activity_config) > 0 ): # if the config is not empty, add it to the optional params - optional_params[ - "realtimeInputConfig" - ] = BidiGenerateContentRealtimeInputConfig( - automaticActivityDetection=transformed_audio_activity_config + optional_params["realtimeInputConfig"] = ( + BidiGenerateContentRealtimeInputConfig( + automaticActivityDetection=transformed_audio_activity_config + ) ) if len(optional_params["generationConfig"]) == 0: optional_params.pop("generationConfig") @@ -405,15 +404,17 @@ class GeminiRealtimeConfig(BaseRealtimeConfig): output_index=0, event_id="event_{}".format(uuid.uuid4()), item_id=output_item_id, - part={ - "type": "text", - "text": "", - } - if delta_type == "text" - else { - "type": "audio", - "transcript": "", - }, + part=( + { + "type": "text", + "text": "", + } + if delta_type == "text" + else { + "type": "audio", + "transcript": "", + } + ), response_id=response_id, ) response_items.append(response_content_part_added) @@ -440,9 +441,11 @@ class GeminiRealtimeConfig(BaseRealtimeConfig): ) return OpenAIRealtimeResponseDelta( - type="response.text.delta" - if delta_type == "text" - else "response.audio.delta", + type=( + "response.text.delta" + if delta_type == "text" + else "response.audio.delta" + ), content_index=0, event_id="event_{}".format(uuid.uuid4()), item_id=output_item_id, @@ -513,12 +516,14 @@ class GeminiRealtimeConfig(BaseRealtimeConfig): event_id="event_{}".format(uuid.uuid4()), item_id=current_output_item_id, output_index=0, - part={"type": "text", "text": delta_done_event_text} - if delta_done_event_text and delta_type == "text" - else { - "type": "audio", - "transcript": "", # gemini doesn't return transcript for audio - }, + part=( + {"type": "text", "text": delta_done_event_text} + if delta_done_event_text and delta_type == "text" + else { + "type": "audio", + "transcript": "", # gemini doesn't return transcript for audio + } + ), response_id=current_response_id, ) returned_items.append(response_content_part_done) @@ -535,12 +540,14 @@ class GeminiRealtimeConfig(BaseRealtimeConfig): "status": "completed", "role": "assistant", "content": [ - {"type": "text", "text": delta_done_event_text} - if delta_done_event_text and delta_type == "text" - else { - "type": "audio", - "transcript": "", - } + ( + {"type": "text", "text": delta_done_event_text} + if delta_done_event_text and delta_type == "text" + else { + "type": "audio", + "transcript": "", + } + ) ], }, ) @@ -674,9 +681,11 @@ class GeminiRealtimeConfig(BaseRealtimeConfig): object="realtime.response", id=current_response_id, status="completed", - output=[output_item["item"] for output_item in output_items] - if output_items - else [], + output=( + [output_item["item"] for output_item in output_items] + if output_items + else [] + ), conversation_id=current_conversation_id, modalities=_modalities, usage=responses_api_usage.model_dump(), @@ -828,9 +837,9 @@ class GeminiRealtimeConfig(BaseRealtimeConfig): "session_configuration_request" ] current_item_chunks = realtime_response_transform_input["current_item_chunks"] - current_delta_type: Optional[ - ALL_DELTA_TYPES - ] = realtime_response_transform_input["current_delta_type"] + current_delta_type: Optional[ALL_DELTA_TYPES] = ( + realtime_response_transform_input["current_delta_type"] + ) returned_message: List[OpenAIRealtimeEvents] = [] for key, value in json_message.items(): diff --git a/litellm/llms/openai/chat/gpt_transformation.py b/litellm/llms/openai/chat/gpt_transformation.py index 551f870aca9..396d59145ff 100644 --- a/litellm/llms/openai/chat/gpt_transformation.py +++ b/litellm/llms/openai/chat/gpt_transformation.py @@ -705,8 +705,14 @@ class OpenAIGPTConfig(BaseLLMModelInfo, BaseConfig): if api_key is None: api_key = get_secret_str("OPENAI_API_KEY") + # Strip api_base to just the base URL (scheme + host + port) + parsed_url = httpx.URL(api_base) + base_url = f"{parsed_url.scheme}://{parsed_url.host}" + if parsed_url.port: + base_url += f":{parsed_url.port}" + response = litellm.module_level_client.get( - url=f"{api_base}/v1/models", + url=f"{base_url}/v1/models", headers={"Authorization": f"Bearer {api_key}"}, ) diff --git a/litellm/llms/perplexity/chat/transformation.py b/litellm/llms/perplexity/chat/transformation.py index 955fdff0818..27e6415ff8b 100644 --- a/litellm/llms/perplexity/chat/transformation.py +++ b/litellm/llms/perplexity/chat/transformation.py @@ -13,6 +13,8 @@ from litellm.types.utils import Usage, PromptTokensDetailsWrapper from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj from litellm.llms.openai.chat.gpt_transformation import OpenAIGPTConfig from litellm.types.utils import ModelResponse +from litellm.types.llms.openai import ChatCompletionAnnotation +from litellm.types.llms.openai import ChatCompletionAnnotationURLCitation class PerplexityChatConfig(OpenAIGPTConfig): @@ -102,7 +104,10 @@ class PerplexityChatConfig(OpenAIGPTConfig): # Extract and enhance usage with Perplexity-specific fields try: raw_response_json = raw_response.json() - self._enhance_usage_with_perplexity_fields(model_response, raw_response_json) + self._enhance_usage_with_perplexity_fields( + model_response, raw_response_json + ) + self._add_citations_as_annotations(model_response, raw_response_json) except Exception as e: verbose_logger.debug(f"Error extracting Perplexity-specific usage fields: {e}") @@ -131,7 +136,9 @@ class PerplexityChatConfig(OpenAIGPTConfig): if citations: # Count total characters in citations as a proxy for citation tokens # This is an estimation - in practice, you might want to use proper tokenization - total_citation_chars = sum(len(str(citation)) for citation in citations if citation) + total_citation_chars = sum( + len(str(citation)) for citation in citations if citation + ) # Rough estimation: ~4 characters per token (OpenAI's general rule) if total_citation_chars > 0: citation_tokens = max(1, total_citation_chars // 4) @@ -150,7 +157,9 @@ class PerplexityChatConfig(OpenAIGPTConfig): num_search_queries = raw_response_json.get("search_queries") # Create or update prompt_tokens_details to include web search requests and citation tokens - if citation_tokens > 0 or (num_search_queries is not None and num_search_queries > 0): + if citation_tokens > 0 or ( + num_search_queries is not None and num_search_queries > 0 + ): if usage.prompt_tokens_details is None: usage.prompt_tokens_details = PromptTokensDetailsWrapper() @@ -161,3 +170,82 @@ class PerplexityChatConfig(OpenAIGPTConfig): # Store search queries count in the standard web_search_requests field if num_search_queries is not None and num_search_queries > 0: usage.prompt_tokens_details.web_search_requests = num_search_queries + + def _add_citations_as_annotations( + self, model_response: ModelResponse, raw_response_json: dict + ) -> None: + """ + Extract citations and search_results from Perplexity API response + and add them as ChatCompletionAnnotation objects to the message. + """ + if not model_response.choices: + return + + # Get the first choice (assuming single response) + choice = model_response.choices[0] + if not hasattr(choice, "message") or choice.message is None: + return + + message = choice.message + annotations = [] + + # Extract citations from the response + citations = raw_response_json.get("citations", []) + search_results = raw_response_json.get("search_results", []) + + # Create a mapping of URLs to search result titles + url_to_title = {} + for result in search_results: + if isinstance(result, dict) and "url" in result and "title" in result: + url_to_title[result["url"]] = result["title"] + + # Get the message content to find citation positions + content = getattr(message, "content", "") + if not content: + return + + # Find all citation markers like [1], [2], [3], [4] in the text + import re + + citation_pattern = r"\[(\d+)\]" + citation_matches = list(re.finditer(citation_pattern, content)) + + # Create a mapping of citation numbers to URLs + citation_number_to_url = {} + for i, citation in enumerate(citations): + if isinstance(citation, str): + citation_number_to_url[i + 1] = citation # 1-indexed + + # Create annotations for each citation match found in the text + for match in citation_matches: + citation_number = int(match.group(1)) + if citation_number in citation_number_to_url: + url = citation_number_to_url[citation_number] + title = url_to_title.get(url, "") + + # Create the URL citation annotation with actual text positions + url_citation: ChatCompletionAnnotationURLCitation = { + "url": url, + "title": title, + "start_index": match.start(), + "end_index": match.end(), + } + + annotation: ChatCompletionAnnotation = { + "type": "url_citation", + "url_citation": url_citation, + } + + annotations.append(annotation) + + # Add annotations to the message if we have any + if annotations: + if not hasattr(message, "annotations") or message.annotations is None: + message.annotations = [] + message.annotations.extend(annotations) + + # Also add the raw citations and search_results as attributes for backward compatibility + if citations: + setattr(model_response, "citations", citations) + if search_results: + setattr(model_response, "search_results", search_results) \ No newline at end of file diff --git a/litellm/llms/vertex_ai/google_genai/transformation.py b/litellm/llms/vertex_ai/google_genai/transformation.py index 02825026e1b..47933811196 100644 --- a/litellm/llms/vertex_ai/google_genai/transformation.py +++ b/litellm/llms/vertex_ai/google_genai/transformation.py @@ -1,16 +1,39 @@ """ Transformation for Calling Google models in their native format. """ -from typing import Literal +from typing import Literal, Optional, Union from litellm.llms.gemini.google_genai.transformation import GoogleGenAIConfig +from litellm.types.router import GenericLiteLLMParams class VertexAIGoogleGenAIConfig(GoogleGenAIConfig): """ Configuration for calling Google models in their native format. """ + HEADER_NAME = "Authorization" + BEARER_PREFIX = "Bearer" + @property def custom_llm_provider(self) -> Literal["gemini", "vertex_ai"]: return "vertex_ai" + + + def validate_environment( + self, + api_key: Optional[str], + headers: Optional[dict], + model: str, + litellm_params: Optional[Union[GenericLiteLLMParams, dict]] + ) -> dict: + default_headers = { + "Content-Type": "application/json", + } + + if api_key is not None: + default_headers[self.HEADER_NAME] = f"{self.BEARER_PREFIX} {api_key}" + if headers is not None: + default_headers.update(headers) + + return default_headers \ No newline at end of file diff --git a/litellm/main.py b/litellm/main.py index fb6204c5bf0..4fc81cce6db 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -147,6 +147,7 @@ from .llms.custom_httpx.llm_http_handler import BaseLLMHTTPHandler from .llms.custom_llm import CustomLLM, custom_chat_llm_router from .llms.databricks.embed.handler import DatabricksEmbeddingHandler from .llms.deprecated_providers import aleph_alpha, palm +from .llms.gemini.common_utils import get_api_key_from_env from .llms.groq.chat.handler import GroqChatCompletion from .llms.huggingface.embedding.handler import HuggingFaceEmbedding from .llms.nlp_cloud.chat.handler import completion as nlp_cloud_chat_completion @@ -1048,11 +1049,13 @@ def completion( # type: ignore # noqa: PLR0915 non_default_params = get_non_default_completion_params(kwargs=kwargs) litellm_params = {} # used to prevent unbound var errors ## PROMPT MANAGEMENT HOOKS ## + if isinstance(litellm_logging_obj, LiteLLMLoggingObj) and ( litellm_logging_obj.should_run_prompt_management_hooks( prompt_id=prompt_id, non_default_params=non_default_params ) ): + ( model, messages, @@ -2595,7 +2598,7 @@ def completion( # type: ignore # noqa: PLR0915 gemini_api_key = ( api_key - or get_secret("GEMINI_API_KEY") + or get_api_key_from_env() or get_secret("PALM_API_KEY") # older palm api key should also work or litellm.api_key ) @@ -3895,6 +3898,9 @@ def embedding( # noqa: PLR0915 or get_secret_str("OPENAI_LIKE_API_KEY") ) + if extra_headers is not None: + optional_params["extra_headers"] = extra_headers + ## EMBEDDING CALL response = openai_like_embedding.embedding( model=model, @@ -3998,9 +4004,7 @@ def embedding( # noqa: PLR0915 litellm_params={}, ) elif custom_llm_provider == "gemini": - gemini_api_key = ( - api_key or get_secret_str("GEMINI_API_KEY") or litellm.api_key - ) + gemini_api_key = api_key or get_api_key_from_env() or litellm.api_key api_base = api_base or litellm.api_base or get_secret_str("GEMINI_API_BASE") @@ -5430,6 +5434,7 @@ def speech( # noqa: PLR0915 ##### Health Endpoints ####################### + async def ahealth_check( model_params: dict, mode: Optional[ @@ -5475,7 +5480,11 @@ async def ahealth_check( log_raw_request_response=True, ) model_params["litellm_logging_obj"] = litellm_logging_obj - model_params = HealthCheckHelpers._update_model_params_with_health_check_tracking_information(model_params=model_params) + model_params = ( + HealthCheckHelpers._update_model_params_with_health_check_tracking_information( + model_params=model_params + ) + ) ######################################################### try: model: Optional[str] = model_params.get("model", None) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 40a07a74189..ef4891c2686 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -10480,6 +10480,20 @@ "supports_tool_choice": true, "supports_prompt_caching": true }, + "openrouter/x-ai/grok-4":{ + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "input_cost_per_token": 3e-06, + "output_cost_per_token": 1.5e-05, + "litellm_provider": "openrouter", + "mode": "chat", + "supports_function_calling": true, + "supports_tool_choice": true, + "supports_reasoning": true, + "source": "https://openrouter.ai/x-ai/grok-4", + "supports_web_search": true + }, "openrouter/bytedance/ui-tars-1.5-7b":{ "max_tokens": 2048, "max_input_tokens": 131072, diff --git a/litellm/proxy/_experimental/mcp_server/auth/litellm_auth_handler.py b/litellm/proxy/_experimental/mcp_server/auth/litellm_auth_handler.py index cb4aab4bb1d..058f45d7123 100644 --- a/litellm/proxy/_experimental/mcp_server/auth/litellm_auth_handler.py +++ b/litellm/proxy/_experimental/mcp_server/auth/litellm_auth_handler.py @@ -16,8 +16,9 @@ class MCPAuthenticatedUser(AuthenticatedUser): 4. Server-specific authentication headers """ - def __init__(self, user_api_key_auth: UserAPIKeyAuth, mcp_auth_header: Optional[str] = None, mcp_servers: Optional[List[str]] = None, mcp_server_auth_headers: Optional[Dict[str, str]] = None): + def __init__(self, user_api_key_auth: UserAPIKeyAuth, mcp_auth_header: Optional[str] = None, mcp_servers: Optional[List[str]] = None, mcp_server_auth_headers: Optional[Dict[str, str]] = None, mcp_protocol_version: Optional[str] = None): self.user_api_key_auth = user_api_key_auth self.mcp_auth_header = mcp_auth_header self.mcp_servers = mcp_servers self.mcp_server_auth_headers = mcp_server_auth_headers or {} + self.mcp_protocol_version = mcp_protocol_version diff --git a/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py b/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py index 0f4acce21f2..7469848e2f2 100644 --- a/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py +++ b/litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Tuple, Dict +from typing import List, Optional, Tuple, Dict, Set from starlette.datastructures import Headers from starlette.requests import Request @@ -28,9 +28,12 @@ class MCPRequestHandler: LITELLM_MCP_SERVERS_HEADER_NAME = SpecialHeaders.mcp_servers.value LITELLM_MCP_ACCESS_GROUPS_HEADER_NAME = SpecialHeaders.mcp_access_groups.value + + # MCP Protocol Version header + MCP_PROTOCOL_VERSION_HEADER_NAME = "MCP-Protocol-Version" @staticmethod - async def process_mcp_request(scope: Scope) -> Tuple[UserAPIKeyAuth, Optional[str], Optional[List[str]], Optional[Dict[str, str]]]: + async def process_mcp_request(scope: Scope) -> Tuple[UserAPIKeyAuth, Optional[str], Optional[List[str]], Optional[Dict[str, str]], Optional[str]]: """ Process and validate MCP request headers from the ASGI scope. This includes: @@ -46,6 +49,7 @@ class MCPRequestHandler: mcp_auth_header: Optional[str] MCP auth header to be passed to the MCP server (deprecated) mcp_servers: Optional[List[str]] List of MCP servers and access groups to use mcp_server_auth_headers: Optional[Dict[str, str]] Server-specific auth headers in format {server_alias: auth_value} + mcp_protocol_version: Optional[str] MCP protocol version from request header Raises: HTTPException: If headers are invalid or missing required headers @@ -61,6 +65,9 @@ class MCPRequestHandler: # Get the new server-specific auth headers mcp_server_auth_headers = MCPRequestHandler._get_mcp_server_auth_headers_from_headers(headers) + # Get MCP protocol version from header + mcp_protocol_version = headers.get(MCPRequestHandler.MCP_PROTOCOL_VERSION_HEADER_NAME) + # Parse MCP servers from header mcp_servers_header = headers.get(MCPRequestHandler.LITELLM_MCP_SERVERS_HEADER_NAME) verbose_logger.debug(f"Raw MCP servers header: {mcp_servers_header}") @@ -82,7 +89,7 @@ class MCPRequestHandler: validated_user_api_key_auth = await user_api_key_auth( api_key=litellm_api_key, request=request ) - return validated_user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers + return validated_user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers, mcp_protocol_version @staticmethod @@ -219,25 +226,29 @@ class MCPRequestHandler: """ from typing import List - allowed_mcp_servers: List[str] = [] - allowed_mcp_servers_for_key = ( - await MCPRequestHandler._get_allowed_mcp_servers_for_key(user_api_key_auth) - ) - allowed_mcp_servers_for_team = ( - await MCPRequestHandler._get_allowed_mcp_servers_for_team(user_api_key_auth) - ) + try: + allowed_mcp_servers: List[str] = [] + allowed_mcp_servers_for_key = ( + await MCPRequestHandler._get_allowed_mcp_servers_for_key(user_api_key_auth) + ) + allowed_mcp_servers_for_team = ( + await MCPRequestHandler._get_allowed_mcp_servers_for_team(user_api_key_auth) + ) - ######################################################### - # If team has mcp_servers, then key must have a subset of the team's mcp_servers - ######################################################### - if len(allowed_mcp_servers_for_team) > 0: - for _mcp_server in allowed_mcp_servers_for_key: - if _mcp_server in allowed_mcp_servers_for_team: - allowed_mcp_servers.append(_mcp_server) - else: - allowed_mcp_servers = allowed_mcp_servers_for_key + ######################################################### + # If team has mcp_servers, then key must have a subset of the team's mcp_servers + ######################################################### + if len(allowed_mcp_servers_for_team) > 0: + for _mcp_server in allowed_mcp_servers_for_key: + if _mcp_server in allowed_mcp_servers_for_team: + allowed_mcp_servers.append(_mcp_server) + else: + allowed_mcp_servers = allowed_mcp_servers_for_key - return list(set(allowed_mcp_servers)) + return list(set(allowed_mcp_servers)) + except Exception as e: + verbose_logger.warning(f"Failed to get allowed MCP servers: {str(e)}") + return [] @staticmethod async def _get_allowed_mcp_servers_for_key( @@ -255,25 +266,29 @@ class MCPRequestHandler: verbose_logger.debug("prisma_client is None") return [] - key_object_permission = ( - await prisma_client.db.litellm_objectpermissiontable.find_unique( - where={"object_permission_id": user_api_key_auth.object_permission_id}, + try: + key_object_permission = ( + await prisma_client.db.litellm_objectpermissiontable.find_unique( + where={"object_permission_id": user_api_key_auth.object_permission_id}, + ) ) - ) - if key_object_permission is None: - return [] + if key_object_permission is None: + return [] - # Get direct MCP servers - direct_mcp_servers = key_object_permission.mcp_servers or [] - - # Get MCP servers from access groups - access_group_servers = await MCPRequestHandler._get_mcp_servers_from_access_groups( - key_object_permission.mcp_access_groups or [] - ) - - # Combine both lists - all_servers = direct_mcp_servers + access_group_servers - return list(set(all_servers)) + # Get direct MCP servers + direct_mcp_servers = key_object_permission.mcp_servers or [] + + # Get MCP servers from access groups + access_group_servers = await MCPRequestHandler._get_mcp_servers_from_access_groups( + key_object_permission.mcp_access_groups or [] + ) + + # Combine both lists + all_servers = direct_mcp_servers + access_group_servers + return list(set(all_servers)) + except Exception as e: + verbose_logger.warning(f"Failed to get allowed MCP servers for key: {str(e)}") + return [] @staticmethod async def _get_allowed_mcp_servers_for_team( @@ -297,37 +312,41 @@ class MCPRequestHandler: verbose_logger.debug("prisma_client is None") return [] - team_obj: Optional[LiteLLM_TeamTable] = ( - await prisma_client.db.litellm_teamtable.find_unique( - where={"team_id": user_api_key_auth.team_id}, + try: + team_obj: Optional[LiteLLM_TeamTable] = ( + await prisma_client.db.litellm_teamtable.find_unique( + where={"team_id": user_api_key_auth.team_id}, + ) ) - ) - if team_obj is None: - verbose_logger.debug("team_obj is None") - return [] + if team_obj is None: + verbose_logger.debug("team_obj is None") + return [] - object_permissions = team_obj.object_permission - if object_permissions is None: - return [] + object_permissions = team_obj.object_permission + if object_permissions is None: + return [] - # Get direct MCP servers - direct_mcp_servers = object_permissions.mcp_servers or [] - - # Get MCP servers from access groups - access_group_servers = await MCPRequestHandler._get_mcp_servers_from_access_groups( - object_permissions.mcp_access_groups or [] - ) - - # Combine both lists - all_servers = direct_mcp_servers + access_group_servers - return list(set(all_servers)) + # Get direct MCP servers + direct_mcp_servers = object_permissions.mcp_servers or [] + + # Get MCP servers from access groups + access_group_servers = await MCPRequestHandler._get_mcp_servers_from_access_groups( + object_permissions.mcp_access_groups or [] + ) + + # Combine both lists + all_servers = direct_mcp_servers + access_group_servers + return list(set(all_servers)) + except Exception as e: + verbose_logger.warning(f"Failed to get allowed MCP servers for team: {str(e)}") + return [] @staticmethod - def _get_config_server_ids_for_access_groups(config_mcp_servers, access_groups: List[str]) -> set: + def _get_config_server_ids_for_access_groups(config_mcp_servers, access_groups: List[str]) -> Set[str]: """ Helper to get server_ids from config-loaded servers that match any of the given access groups. """ - server_ids = set() + server_ids: Set[str] = set() for server_id, server in config_mcp_servers.items(): if server.access_groups: if any(group in server.access_groups for group in access_groups): @@ -335,11 +354,11 @@ class MCPRequestHandler: return server_ids @staticmethod - async def _get_db_server_ids_for_access_groups(prisma_client, access_groups: List[str]) -> set: + async def _get_db_server_ids_for_access_groups(prisma_client, access_groups: List[str]) -> Set[str]: """ Helper to get server_ids from DB servers that match any of the given access groups. """ - server_ids = set() + server_ids: Set[str] = set() if access_groups and prisma_client is not None: try: mcp_servers = await prisma_client.db.litellm_mcpservertable.find_many( @@ -363,20 +382,26 @@ class MCPRequestHandler: Resolve MCP access groups to server IDs by querying BOTH the MCP server table (DB) AND config-loaded servers """ from litellm.proxy.proxy_server import prisma_client - from litellm.proxy._experimental.mcp_server.mcp_server_manager import global_mcp_server_manager - # Use the new helper for config-loaded servers - server_ids = MCPRequestHandler._get_config_server_ids_for_access_groups( - global_mcp_server_manager.config_mcp_servers, access_groups - ) + try: + # Import here to avoid circular import + from litellm.proxy._experimental.mcp_server.mcp_server_manager import global_mcp_server_manager + + # Use the new helper for config-loaded servers + server_ids = MCPRequestHandler._get_config_server_ids_for_access_groups( + global_mcp_server_manager.config_mcp_servers, access_groups + ) - # Use the new helper for DB servers - db_server_ids = await MCPRequestHandler._get_db_server_ids_for_access_groups( - prisma_client, access_groups - ) - server_ids.update(db_server_ids) + # Use the new helper for DB servers + db_server_ids = await MCPRequestHandler._get_db_server_ids_for_access_groups( + prisma_client, access_groups + ) + server_ids.update(db_server_ids) - return list(server_ids) + return list(server_ids) + except Exception as e: + verbose_logger.warning(f"Failed to get MCP servers from access groups: {str(e)}") + return [] @staticmethod async def get_mcp_access_groups( diff --git a/litellm/proxy/_experimental/mcp_server/db.py b/litellm/proxy/_experimental/mcp_server/db.py index 414f8094c32..3d90c99eee2 100644 --- a/litellm/proxy/_experimental/mcp_server/db.py +++ b/litellm/proxy/_experimental/mcp_server/db.py @@ -82,14 +82,20 @@ async def get_mcp_servers( """ Returns the matching mcp servers from the db with the server_ids """ - mcp_servers: List[LiteLLM_MCPServerTable] = ( + _mcp_servers: List[LiteLLM_MCPServerTable] = ( await prisma_client.db.litellm_mcpservertable.find_many( where={ "server_id": {"in": server_ids}, } ) ) - return mcp_servers + final_mcp_servers: List[LiteLLM_MCPServerTable] = [] + for _mcp_server in _mcp_servers: + final_mcp_servers.append( + LiteLLM_MCPServerTable(**_mcp_server.model_dump()) + ) + + return final_mcp_servers async def get_mcp_servers_by_verificationtoken( diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py index 93ac08b4f0f..e1ea9918e68 100644 --- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py +++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py @@ -7,15 +7,18 @@ This is a Proxy """ import asyncio +import datetime import hashlib import json from typing import Any, Dict, List, Optional, cast +from fastapi import HTTPException from mcp.types import CallToolRequestParams as MCPCallToolRequestParams from mcp.types import CallToolResult from mcp.types import Tool as MCPTool from litellm._logging import verbose_logger +from litellm.exceptions import BlockedPiiEntityError, GuardrailRaisedException from litellm.experimental_mcp_client.client import MCPClient from litellm.proxy._experimental.mcp_server.auth.user_api_key_auth_mcp import ( MCPRequestHandler, @@ -23,10 +26,10 @@ from litellm.proxy._experimental.mcp_server.auth.user_api_key_auth_mcp import ( from litellm.proxy._experimental.mcp_server.utils import ( add_server_prefix_to_tool_name, get_server_name_prefix_tool_mcp, + get_server_prefix, is_tool_name_prefixed, normalize_server_name, validate_mcp_server_name, - get_server_prefix, ) from litellm.proxy._types import ( LiteLLM_MCPServerTable, @@ -37,6 +40,7 @@ from litellm.proxy._types import ( MCPTransportType, UserAPIKeyAuth, ) +from litellm.proxy.utils import ProxyLogging from litellm.types.mcp import MCPStdioConfig from litellm.types.mcp_server.mcp_server_manager import MCPInfo, MCPServer @@ -45,16 +49,16 @@ def _deserialize_env_dict(env_data: Any) -> Optional[Dict[str, str]]: """ Helper function to deserialize environment dictionary from database storage. Handles both JSON string and dictionary formats. - + Args: env_data: The environment data from database (could be JSON string or dict) - + Returns: Dict[str, str] or None: Deserialized environment dictionary """ if not env_data: return None - + if isinstance(env_data, str): try: return json.loads(env_data) @@ -66,6 +70,38 @@ def _deserialize_env_dict(env_data: Any) -> Optional[Dict[str, str]]: return env_data +def _convert_protocol_version_to_enum( + protocol_version: Optional[str | MCPSpecVersionType], +) -> MCPSpecVersionType: + """ + Convert string protocol version to MCPSpecVersion enum. + + Args: + protocol_version: String protocol version, enum, or None + + Returns: + MCPSpecVersionType: The enum value + """ + if not protocol_version: + return cast(MCPSpecVersionType, MCPSpecVersion.jun_2025) + + # If it's already an MCPSpecVersion enum, return it + if isinstance(protocol_version, MCPSpecVersion): + return cast(MCPSpecVersionType, protocol_version) + + # If it's a string, try to match it to enum values + if isinstance(protocol_version, str): + for version in MCPSpecVersion: + if version.value == protocol_version: + return cast(MCPSpecVersionType, version) + + # If no match found, return default + verbose_logger.warning( + f"Unknown protocol version '{protocol_version}', using default" + ) + return cast(MCPSpecVersionType, MCPSpecVersion.jun_2025) + + class MCPServerManager: def __init__(self): self.registry: Dict[str, MCPServer] = {} @@ -100,70 +136,86 @@ class MCPServerManager: """ return self.config_mcp_servers | self.registry - def load_servers_from_config(self, mcp_servers_config: Dict[str, Any], mcp_aliases: Optional[Dict[str, str]] = None): + def load_servers_from_config( + self, + mcp_servers_config: Dict[str, Any], + mcp_aliases: Optional[Dict[str, str]] = None, + ): """ Load the MCP Servers from the config - + Args: mcp_servers_config: Dictionary of MCP server configurations mcp_aliases: Optional dictionary mapping aliases to server names from litellm_settings """ verbose_logger.debug("Loading MCP Servers from config-----") - + # Track which aliases have been used to ensure only first occurrence is used used_aliases = set() - + for server_name, server_config in mcp_servers_config.items(): validate_mcp_server_name(server_name) _mcp_info: Dict[str, Any] = server_config.get("mcp_info", None) or {} # Convert Dict[str, Any] to MCPInfo properly mcp_info: MCPInfo = { "server_name": _mcp_info.get("server_name", server_name), - "description": _mcp_info.get("description", server_config.get("description", None)), + "description": _mcp_info.get( + "description", server_config.get("description", None) + ), "logo_url": _mcp_info.get("logo_url", None), "mcp_server_cost_info": _mcp_info.get("mcp_server_cost_info", None), } # Use alias for name if present, else server_name alias = server_config.get("alias", None) - + # Apply mcp_aliases mapping if provided if mcp_aliases and alias is None: # Check if this server_name has an alias in mcp_aliases for alias_name, target_server_name in mcp_aliases.items(): - if target_server_name == server_name and alias_name not in used_aliases: + if ( + target_server_name == server_name + and alias_name not in used_aliases + ): alias = alias_name used_aliases.add(alias_name) - verbose_logger.debug(f"Mapped alias '{alias_name}' to server '{server_name}'") + verbose_logger.debug( + f"Mapped alias '{alias_name}' to server '{server_name}'" + ) break - + # Create a temporary server object to use with get_server_prefix utility - temp_server = type('TempServer', (), { - 'alias': alias, - 'server_name': server_name, - 'server_id': None - })() + temp_server = type( + "TempServer", + (), + {"alias": alias, "server_name": server_name, "server_id": None}, + )() name_for_prefix = get_server_prefix(temp_server) # Use alias for name if present, else server_name alias = server_config.get("alias", None) - + # Apply mcp_aliases mapping if provided if mcp_aliases and alias is None: # Check if this server_name has an alias in mcp_aliases for alias_name, target_server_name in mcp_aliases.items(): - if target_server_name == server_name and alias_name not in used_aliases: + if ( + target_server_name == server_name + and alias_name not in used_aliases + ): alias = alias_name used_aliases.add(alias_name) - verbose_logger.debug(f"Mapped alias '{alias_name}' to server '{server_name}'") + verbose_logger.debug( + f"Mapped alias '{alias_name}' to server '{server_name}'" + ) break - + # Create a temporary server object to use with get_server_prefix utility - temp_server = type('TempServer', (), { - 'alias': alias, - 'server_name': server_name, - 'server_id': None - })() + temp_server = type( + "TempServer", + (), + {"alias": alias, "server_name": server_name, "server_id": None}, + )() name_for_prefix = get_server_prefix(temp_server) # Generate stable server ID based on parameters @@ -171,7 +223,7 @@ class MCPServerManager: server_name=server_name, url=server_config.get("url", None) or "", transport=server_config.get("transport", MCPTransport.http), - spec_version=server_config.get("spec_version", MCPSpecVersion.mar_2025), + spec_version=server_config.get("spec_version", MCPSpecVersion.jun_2025), auth_type=server_config.get("auth_type", None), alias=alias, ) @@ -187,7 +239,7 @@ class MCPServerManager: env=server_config.get("env", None) or {}, # TODO: utility fn the default values transport=server_config.get("transport", MCPTransport.http), - spec_version=server_config.get("spec_version", MCPSpecVersion.mar_2025), + spec_version=server_config.get("spec_version", MCPSpecVersion.jun_2025), auth_type=server_config.get("auth_type", None), mcp_info=mcp_info, access_groups=server_config.get("access_groups", None), @@ -219,18 +271,20 @@ class MCPServerManager: _mcp_info: MCPInfo = mcp_server.mcp_info or {} # Use helper to deserialize environment dictionary # Safely access env field which may not exist on Prisma model objects - env_data = getattr(mcp_server, 'env', None) + env_data = getattr(mcp_server, "env", None) env_dict = _deserialize_env_dict(env_data) # Use alias for name if present, else server_name - name_for_prefix = mcp_server.alias or mcp_server.server_name or mcp_server.server_id + name_for_prefix = ( + mcp_server.alias or mcp_server.server_name or mcp_server.server_id + ) new_server = MCPServer( server_id=mcp_server.server_id, name=name_for_prefix, - alias=getattr(mcp_server, 'alias', None), - server_name=getattr(mcp_server, 'server_name', None), + alias=getattr(mcp_server, "alias", None), + server_name=getattr(mcp_server, "server_name", None), url=mcp_server.url, transport=cast(MCPTransportType, mcp_server.transport), - spec_version=cast(MCPSpecVersionType, mcp_server.spec_version), + spec_version=_convert_protocol_version_to_enum(mcp_server.spec_version), auth_type=cast(MCPAuthType, mcp_server.auth_type), mcp_info=MCPInfo( server_name=mcp_server.server_name or mcp_server.server_id, @@ -238,14 +292,12 @@ class MCPServerManager: mcp_server_cost_info=_mcp_info.get("mcp_server_cost_info", None), ), # Stdio-specific fields - command=getattr(mcp_server, 'command', None), - args=getattr(mcp_server, 'args', None) or [], + command=getattr(mcp_server, "command", None), + args=getattr(mcp_server, "args", None) or [], env=env_dict, ) self.registry[mcp_server.server_id] = new_server - verbose_logger.debug( - f"Added MCP Server: {name_for_prefix}" - ) + verbose_logger.debug(f"Added MCP Server: {name_for_prefix}") async def get_allowed_mcp_servers( self, user_api_key_auth: Optional[UserAPIKeyAuth] = None @@ -253,36 +305,48 @@ class MCPServerManager: """ Get the allowed MCP Servers for the user """ - allowed_mcp_servers = await MCPRequestHandler.get_allowed_mcp_servers( - user_api_key_auth - ) - verbose_logger.debug( - f"Allowed MCP Servers for user api key auth: {allowed_mcp_servers}" - ) - if len(allowed_mcp_servers) > 0: - return allowed_mcp_servers - else: + try: + allowed_mcp_servers = await MCPRequestHandler.get_allowed_mcp_servers( + user_api_key_auth + ) verbose_logger.debug( - "No allowed MCP Servers found for user api key auth, returning default registry servers" + f"Allowed MCP Servers for user api key auth: {allowed_mcp_servers}" + ) + if len(allowed_mcp_servers) > 0: + return allowed_mcp_servers + else: + verbose_logger.debug( + "No allowed MCP Servers found for user api key auth, returning default registry servers" + ) + return list(self.get_registry().keys()) + except Exception as e: + verbose_logger.warning( + f"Failed to get allowed MCP servers: {str(e)}. Returning default registry servers." ) return list(self.get_registry().keys()) - async def get_tools_for_server(self, server_id: str) -> List[MCPTool]: """ Get the tools for a given server """ - server = self.get_mcp_server_by_id(server_id) - if server is None: + try: + server = self.get_mcp_server_by_id(server_id) + if server is None: + verbose_logger.warning(f"MCP Server {server_id} not found") + return [] + return await self._get_tools_from_server(server) + except Exception as e: + verbose_logger.warning( + f"Failed to get tools from server {server_id}: {str(e)}" + ) return [] - return await self._get_tools_from_server(server) - async def list_tools( - self, + self, user_api_key_auth: Optional[UserAPIKeyAuth] = None, mcp_auth_header: Optional[str] = None, mcp_server_auth_headers: Optional[Dict[str, str]] = None, + mcp_protocol_version: Optional[str] = None, ) -> List[MCPTool]: """ List all tools available across all MCP Servers. @@ -291,6 +355,7 @@ class MCPServerManager: user_api_key_auth: User authentication mcp_auth_header: MCP auth header (deprecated) mcp_server_auth_headers: Optional dict of server-specific auth headers {server_alias: auth_value} + mcp_protocol_version: Optional MCP protocol version from request header Returns: List[MCPTool]: Combined list of tools from all servers @@ -305,61 +370,75 @@ class MCPServerManager: if server is None: verbose_logger.warning(f"MCP Server {server_id} not found") continue - + # Get server-specific auth header if available server_auth_header = None if mcp_server_auth_headers and server.alias: server_auth_header = mcp_server_auth_headers.get(server.alias) elif mcp_server_auth_headers and server.server_name: server_auth_header = mcp_server_auth_headers.get(server.server_name) - + # Fall back to deprecated mcp_auth_header if no server-specific header found if server_auth_header is None: server_auth_header = mcp_auth_header - + try: tools = await self._get_tools_from_server( server=server, mcp_auth_header=server_auth_header, + mcp_protocol_version=mcp_protocol_version, ) list_tools_result.extend(tools) - verbose_logger.info(f"Successfully fetched {len(tools)} tools from server {server.name}") + verbose_logger.info( + f"Successfully fetched {len(tools)} tools from server {server.name}" + ) except Exception as e: verbose_logger.warning( f"Failed to list tools from server {server.name}: {str(e)}. Continuing with other servers." ) # Continue with other servers instead of failing completely - verbose_logger.info(f"Successfully fetched {len(list_tools_result)} tools total from all servers") + verbose_logger.info( + f"Successfully fetched {len(list_tools_result)} tools total from all servers" + ) return list_tools_result ######################################################### # Methods that call the upstream MCP servers ######################################################### - def _create_mcp_client(self, server: MCPServer, mcp_auth_header: Optional[str] = None) -> MCPClient: + def _create_mcp_client( + self, + server: MCPServer, + mcp_auth_header: Optional[str] = None, + protocol_version: Optional[str] = None, + ) -> MCPClient: """ Create an MCPClient instance for the given server. Args: server (MCPServer): The server configuration mcp_auth_header: MCP auth header to be passed to the MCP server. This is optional and will be used if provided. + protocol_version: Optional MCP protocol version to use. If not provided, uses server's default. Returns: MCPClient: Configured MCP client instance """ transport = server.transport or MCPTransport.sse - + + # Convert protocol version string to enum + protocol_version_enum = _convert_protocol_version_to_enum( + protocol_version or server.spec_version + ) + # Handle stdio transport if transport == MCPTransport.stdio: # For stdio, we need to get the stdio config from the server stdio_config: Optional[MCPStdioConfig] = None if server.command and server.args is not None: stdio_config = MCPStdioConfig( - command=server.command, - args=server.args, - env=server.env or {} + command=server.command, args=server.args, env=server.env or {} ) - + return MCPClient( server_url="", # Not used for stdio transport_type=transport, @@ -367,6 +446,7 @@ class MCPServerManager: auth_value=mcp_auth_header or server.authentication_token, timeout=60.0, stdio_config=stdio_config, + protocol_version=protocol_version_enum, ) else: # For HTTP/SSE transports @@ -377,9 +457,15 @@ class MCPServerManager: auth_type=server.auth_type, auth_value=mcp_auth_header or server.authentication_token, timeout=60.0, + protocol_version=protocol_version_enum, ) - async def _get_tools_from_server(self, server: MCPServer, mcp_auth_header: Optional[str] = None) -> List[MCPTool]: + async def _get_tools_from_server( + self, + server: MCPServer, + mcp_auth_header: Optional[str] = None, + mcp_protocol_version: Optional[str] = None, + ) -> List[MCPTool]: """ Helper method to get tools from a single MCP server with prefixed names. @@ -393,71 +479,26 @@ class MCPServerManager: verbose_logger.debug(f"Connecting to url: {server.url}") verbose_logger.info(f"_get_tools_from_server for {server.name}...") + protocol_version = ( + mcp_protocol_version if mcp_protocol_version else server.spec_version + ) client = None + try: client = self._create_mcp_client( server=server, mcp_auth_header=mcp_auth_header, + protocol_version=protocol_version, ) - # Create a task for the client operations to ensure proper cancellation handling - async def _list_tools_task(): - try: - async with client: - tools = await client.list_tools() - verbose_logger.debug(f"Tools from {server.name}: {tools}") - return tools - except asyncio.CancelledError: - verbose_logger.warning(f"Client operation cancelled for {server.name}") - return [] - except Exception as e: - verbose_logger.warning(f"Client operation failed for {server.name}: {str(e)}") - return [] + tools = await self._fetch_tools_with_timeout(client, server.name) + return self._create_prefixed_tools(tools, server) - try: - # Add timeout to prevent hanging - tools = await asyncio.wait_for(_list_tools_task(), timeout=30.0) - - # Create new tools with prefixed names - prefixed_tools = [] - for tool in tools: - # Always use alias for prefixing if present - prefix = get_server_prefix(server) - prefixed_name = add_server_prefix_to_tool_name(tool.name, prefix) - - # Create new tool with prefixed name - prefixed_tool = MCPTool( - name=prefixed_name, - description=tool.description, - inputSchema=tool.inputSchema - ) - prefixed_tools.append(prefixed_tool) - - # Update tool to server mapping with both original and prefixed names - self.tool_name_to_mcp_server_name_mapping[tool.name] = prefix - self.tool_name_to_mcp_server_name_mapping[prefixed_name] = prefix - - verbose_logger.info(f"Successfully fetched {len(prefixed_tools)} tools from server {server.name}") - return prefixed_tools - except asyncio.TimeoutError: - verbose_logger.warning(f"Timeout while listing tools from {server.name}") - # Don't re-raise the exception, just return empty list - return [] - except asyncio.CancelledError: - verbose_logger.warning(f"Task cancelled while listing tools from {server.name}") - # Don't re-raise cancellation, just return empty list - return [] - except ConnectionError as e: - verbose_logger.warning(f"Connection error while listing tools from {server.name}: {str(e)}") - # Don't re-raise the exception, just return empty list - return [] - except Exception as e: - verbose_logger.warning(f"Error listing tools from {server.name}: {str(e)}") - # Don't re-raise the exception, just return empty list - return [] except Exception as e: - verbose_logger.warning(f"Failed to get tools from server {server.name}: {str(e)}") - return [] # Return empty list on failure + verbose_logger.warning( + f"Failed to get tools from server {server.name}: {str(e)}" + ) + return [] finally: if client: try: @@ -465,13 +506,103 @@ class MCPServerManager: except Exception: pass + async def _fetch_tools_with_timeout( + self, client: MCPClient, server_name: str + ) -> List[MCPTool]: + """ + Fetch tools from MCP client with timeout and error handling. + + Args: + client: MCP client instance + server_name: Name of the server for logging + + Returns: + List of tools from the server + """ + + async def _list_tools_task(): + try: + await client.connect() + tools = await client.list_tools() + verbose_logger.debug(f"Tools from {server_name}: {tools}") + return tools + except asyncio.CancelledError: + verbose_logger.warning(f"Client operation cancelled for {server_name}") + return [] + except Exception as e: + verbose_logger.warning( + f"Client operation failed for {server_name}: {str(e)}" + ) + return [] + finally: + try: + await client.disconnect() + except Exception: + pass + + try: + return await asyncio.wait_for(_list_tools_task(), timeout=30.0) + except asyncio.TimeoutError: + verbose_logger.warning(f"Timeout while listing tools from {server_name}") + return [] + except asyncio.CancelledError: + verbose_logger.warning( + f"Task cancelled while listing tools from {server_name}" + ) + return [] + except ConnectionError as e: + verbose_logger.warning( + f"Connection error while listing tools from {server_name}: {str(e)}" + ) + return [] + except Exception as e: + verbose_logger.warning(f"Error listing tools from {server_name}: {str(e)}") + return [] + + def _create_prefixed_tools( + self, tools: List[MCPTool], server: MCPServer + ) -> List[MCPTool]: + """ + Create prefixed tools and update tool mapping. + + Args: + tools: List of original tools from server + server: Server instance + + Returns: + List of tools with prefixed names + """ + prefixed_tools = [] + prefix = get_server_prefix(server) + + for tool in tools: + prefixed_name = add_server_prefix_to_tool_name(tool.name, prefix) + + prefixed_tool = MCPTool( + name=prefixed_name, + description=tool.description, + inputSchema=tool.inputSchema, + ) + prefixed_tools.append(prefixed_tool) + + # Update tool to server mapping with both original and prefixed names + self.tool_name_to_mcp_server_name_mapping[tool.name] = prefix + self.tool_name_to_mcp_server_name_mapping[prefixed_name] = prefix + + verbose_logger.info( + f"Successfully fetched {len(prefixed_tools)} tools from server {server.name}" + ) + return prefixed_tools + async def call_tool( - self, - name: str, - arguments: Dict[str, Any], - user_api_key_auth: Optional[UserAPIKeyAuth] = None, - mcp_auth_header: Optional[str] = None, - mcp_server_auth_headers: Optional[Dict[str, str]] = None, + self, + name: str, + arguments: Dict[str, Any], + user_api_key_auth: Optional[UserAPIKeyAuth] = None, + mcp_auth_header: Optional[str] = None, + mcp_server_auth_headers: Optional[Dict[str, str]] = None, + mcp_protocol_version: Optional[str] = None, + proxy_logging_obj: Optional[ProxyLogging] = None, ) -> CallToolResult: """ Call a tool with the given name and arguments (handles prefixed tool names) @@ -482,12 +613,18 @@ class MCPServerManager: user_api_key_auth: User authentication mcp_auth_header: MCP auth header (deprecated) mcp_server_auth_headers: Optional dict of server-specific auth headers {server_alias: auth_value} + proxy_logging_obj: Optional ProxyLogging object for hook integration + Returns: CallToolResult from the MCP server """ + start_time = datetime.datetime.now() + # Remove prefix if present to get the original tool name - original_tool_name, server_name_from_prefix = get_server_name_prefix_tool_mcp(name) + original_tool_name, server_name_from_prefix = get_server_name_prefix_tool_mcp( + name + ) # Get the MCP server mcp_server = self._get_mcp_server_from_tool_name(name) @@ -497,9 +634,46 @@ class MCPServerManager: # Validate that the server from prefix matches the actual server (if prefix was used) if server_name_from_prefix: expected_prefix = get_server_prefix(mcp_server) - if normalize_server_name(server_name_from_prefix) != normalize_server_name(expected_prefix): + if normalize_server_name(server_name_from_prefix) != normalize_server_name( + expected_prefix + ): raise ValueError( - f"Tool {name} server prefix mismatch: expected {expected_prefix}, got {server_name_from_prefix}") + f"Tool {name} server prefix mismatch: expected {expected_prefix}, got {server_name_from_prefix}" + ) + + ######################################################### + # Pre MCP Tool Call Hook + # Allow validation and modification of tool calls before execution + ######################################################### + if proxy_logging_obj: + pre_hook_kwargs = { + "name": name, + "arguments": arguments, + "server_name": server_name_from_prefix, + "user_api_key_auth": user_api_key_auth, + } + try: + pre_hook_result = await proxy_logging_obj.async_pre_mcp_tool_call_hook( + kwargs=pre_hook_kwargs, + request_obj=None, # Will be created in the hook + start_time=start_time, + end_time=start_time, + ) + + if pre_hook_result: + # Apply any argument modifications + if pre_hook_result.get("modified_arguments"): + arguments = pre_hook_result["modified_arguments"] + except ( + BlockedPiiEntityError, + GuardrailRaisedException, + HTTPException, + ) as e: + # Re-raise guardrail exceptions to properly fail the MCP call + verbose_logger.error( + f"Guardrail blocked MCP tool call pre call: {str(e)}" + ) + raise e # Get server-specific auth header if available server_auth_header = None @@ -507,7 +681,7 @@ class MCPServerManager: server_auth_header = mcp_server_auth_headers.get(mcp_server.alias) elif mcp_server_auth_headers and mcp_server.server_name: server_auth_header = mcp_server_auth_headers.get(mcp_server.server_name) - + # Fall back to deprecated mcp_auth_header if no server-specific header found if server_auth_header is None: server_auth_header = mcp_auth_header @@ -515,20 +689,62 @@ class MCPServerManager: client = self._create_mcp_client( server=mcp_server, mcp_auth_header=server_auth_header, + protocol_version=mcp_protocol_version, ) + async with client: + # Use the original tool name (without prefix) for the actual call call_tool_params = MCPCallToolRequestParams( name=original_tool_name, arguments=arguments, ) - return await client.call_tool(call_tool_params) + + # Initialize during_hook_task as None + during_hook_task = None + tasks = [] + # Start during hook if proxy_logging_obj is available + if proxy_logging_obj: + during_hook_task = asyncio.create_task( + proxy_logging_obj.async_during_mcp_tool_call_hook( + kwargs={ + "name": name, + "arguments": arguments, + "server_name": server_name_from_prefix, + }, + request_obj=None, # Will be created in the hook + start_time=start_time, + end_time=start_time, + ) + ) + tasks.append(during_hook_task) + + tasks.append(asyncio.create_task(client.call_tool(call_tool_params))) + try: + + mcp_responses = await asyncio.gather(*tasks) + + # If proxy_logging_obj is None, the tool call result is at index 0 + # If proxy_logging_obj is not None, the tool call result is at index 1 (after the during hook task) + result_index = 1 if proxy_logging_obj else 0 + result = mcp_responses[result_index] + + return cast(CallToolResult, result) + except ( + BlockedPiiEntityError, + GuardrailRaisedException, + HTTPException, + ) as e: + # Re-raise guardrail exceptions to properly fail the MCP call + verbose_logger.error( + f"Guardrail blocked MCP tool call during result check: {str(e)}" + ) + raise e ######################################################### # End of Methods that call the upstream MCP servers ######################################################### - def initialize_tool_name_to_mcp_server_name_mapping(self): """ On startup, initialize the tool name to MCP server name mapping @@ -571,14 +787,18 @@ class MCPServerManager: if tool_name in self.tool_name_to_mcp_server_name_mapping: server_name = self.tool_name_to_mcp_server_name_mapping[tool_name] for server in self.get_registry().values(): - if normalize_server_name(server.name) == normalize_server_name(server_name): + if normalize_server_name(server.name) == normalize_server_name( + server_name + ): return server # If not found and tool name is prefixed, try extracting server name from prefix if is_tool_name_prefixed(tool_name): _, server_name_from_prefix = get_server_name_prefix_tool_mcp(tool_name) for server in self.get_registry().values(): - if normalize_server_name(server.name) == normalize_server_name(server_name_from_prefix): + if normalize_server_name(server.name) == normalize_server_name( + server_name_from_prefix + ): return server return None @@ -636,9 +856,7 @@ class MCPServerManager: A deterministic server ID string """ # Create a string from all the identifying parameters - params_string = ( - f"{server_name}|{url}|{transport}|{spec_version}|{auth_type or ''}|{alias or ''}" - ) + params_string = f"{server_name}|{url}|{transport}|{spec_version}|{auth_type or ''}|{alias or ''}" # Generate SHA-256 hash hash_object = hashlib.sha256(params_string.encode("utf-8")) @@ -647,5 +865,236 @@ class MCPServerManager: # Take first 32 characters and format as UUID-like string return hash_hex[:32] + async def health_check_server( + self, server_id: str, mcp_auth_header: Optional[str] = None + ) -> Dict[str, Any]: + """ + Perform a health check on a specific MCP server. + + Args: + server_id: The ID of the server to health check + mcp_auth_header: Optional authentication header for the MCP server + + Returns: + Dict containing health check results + """ + import time + from datetime import datetime + + server = self.get_mcp_server_by_id(server_id) + if not server: + return { + "server_id": server_id, + "status": "unknown", + "error": "Server not found", + "last_health_check": datetime.now().isoformat(), + "response_time_ms": None, + } + + start_time = time.time() + try: + # Try to get tools from the server as a health check + tools = await self._get_tools_from_server(server, mcp_auth_header) + response_time = (time.time() - start_time) * 1000 + + return { + "server_id": server_id, + "status": "healthy", + "tools_count": len(tools), + "last_health_check": datetime.now().isoformat(), + "response_time_ms": round(response_time, 2), + "error": None, + } + except Exception as e: + response_time = (time.time() - start_time) * 1000 + error_message = str(e) + + return { + "server_id": server_id, + "status": "unhealthy", + "last_health_check": datetime.now().isoformat(), + "response_time_ms": round(response_time, 2), + "error": error_message, + } + + async def health_check_all_servers( + self, mcp_auth_header: Optional[str] = None + ) -> Dict[str, Any]: + """ + Perform health checks on all MCP servers. + + Args: + mcp_auth_header: Optional authentication header for the MCP servers + + Returns: + Dict containing health check results for all servers + """ + all_servers = self.get_registry() + results = {} + + for server_id, server in all_servers.items(): + results[server_id] = await self.health_check_server( + server_id, mcp_auth_header + ) + + return results + + async def health_check_allowed_servers( + self, + user_api_key_auth: Optional[UserAPIKeyAuth] = None, + mcp_auth_header: Optional[str] = None, + ) -> Dict[str, Any]: + """ + Perform health checks on all MCP servers that the user has access to. + + Args: + user_api_key_auth: User authentication info for access control + mcp_auth_header: Optional authentication header for the MCP servers + + Returns: + Dict containing health check results for accessible servers + """ + # Get allowed servers for the user + allowed_server_ids = await self.get_allowed_mcp_servers(user_api_key_auth) + + # Perform health checks on allowed servers + results = {} + for server_id in allowed_server_ids: + results[server_id] = await self.health_check_server( + server_id, mcp_auth_header + ) + + return results + + async def get_all_mcp_servers_with_health_and_teams( + self, + user_api_key_auth: Optional[UserAPIKeyAuth] = None, + include_health: bool = True, + ) -> List[LiteLLM_MCPServerTable]: + """ + Get all MCP servers that the user has access to, with health status and team information. + + Args: + user_api_key_auth: User authentication info for access control + include_health: Whether to include health check information + + Returns: + List of MCP server objects with health and team data + """ + from litellm.proxy._experimental.mcp_server.db import ( + get_all_mcp_servers, + get_mcp_servers, + ) + from litellm.proxy.management_endpoints.common_utils import _user_has_admin_view + from litellm.proxy.proxy_server import prisma_client + + # Get allowed server IDs + allowed_server_ids = await self.get_allowed_mcp_servers(user_api_key_auth) + + # Get servers from database + list_mcp_servers: List[LiteLLM_MCPServerTable] = [] + if prisma_client is not None: + list_mcp_servers = await get_mcp_servers(prisma_client, allowed_server_ids) + + # If admin, also get all servers from database + if user_api_key_auth and _user_has_admin_view(user_api_key_auth): + all_mcp_servers = await get_all_mcp_servers(prisma_client) + for server in all_mcp_servers: + if server.server_id not in allowed_server_ids: + list_mcp_servers.append(server) + + # Add config.yaml servers + for _server_id, _server_config in self.config_mcp_servers.items(): + if _server_id in allowed_server_ids: + list_mcp_servers.append( + LiteLLM_MCPServerTable( + server_id=_server_id, + server_name=_server_config.name, + alias=_server_config.alias, + url=_server_config.url, + transport=_server_config.transport, + spec_version=_server_config.spec_version, + auth_type=_server_config.auth_type, + created_at=datetime.datetime.now(), + updated_at=datetime.datetime.now(), + mcp_info=_server_config.mcp_info, + # Stdio-specific fields + command=getattr(_server_config, "command", None), + args=getattr(_server_config, "args", None) or [], + env=getattr(_server_config, "env", None) or {}, + ) + ) + + # Get team information for non-admin users + server_to_teams_map: Dict[str, List[Dict[str, str]]] = {} + if ( + user_api_key_auth + and not _user_has_admin_view(user_api_key_auth) + and prisma_client is not None + ): + teams = await prisma_client.db.litellm_teamtable.find_many( + include={"object_permission": True} + ) + + user_teams = [] + for team in teams: + if team.members_with_roles: + for member in team.members_with_roles: + if ( + "user_id" in member + and member["user_id"] is not None + and member["user_id"] == user_api_key_auth.user_id + ): + user_teams.append(team) + + # Create a mapping of server_id to teams that have access to it + for team in user_teams: + if team.object_permission and team.object_permission.mcp_servers: + for server_id in team.object_permission.mcp_servers: + if server_id not in server_to_teams_map: + server_to_teams_map[server_id] = [] + server_to_teams_map[server_id].append( + { + "team_id": team.team_id, + "team_alias": team.team_alias, + "organization_id": team.organization_id, + } + ) + + # Map servers to their teams and return with health data + from typing import cast + + return [ + LiteLLM_MCPServerTable( + server_id=server.server_id, + server_name=server.server_name, + alias=server.alias, + description=server.description, + url=server.url, + transport=server.transport, + spec_version=server.spec_version, + auth_type=server.auth_type, + created_at=server.created_at, + created_by=server.created_by, + updated_at=server.updated_at, + updated_by=server.updated_by, + mcp_access_groups=( + server.mcp_access_groups + if server.mcp_access_groups is not None + else [] + ), + mcp_info=server.mcp_info, + teams=cast( + List[Dict[str, str | None]], + server_to_teams_map.get(server.server_id, []), + ), + # Stdio-specific fields + command=getattr(server, "command", None), + args=getattr(server, "args", None) or [], + env=getattr(server, "env", None) or {}, + ) + for server in list_mcp_servers + ] + global_mcp_server_manager: MCPServerManager = MCPServerManager() diff --git a/litellm/proxy/_experimental/mcp_server/rest_endpoints.py b/litellm/proxy/_experimental/mcp_server/rest_endpoints.py index 86cb13746ae..a31fabf57cf 100644 --- a/litellm/proxy/_experimental/mcp_server/rest_endpoints.py +++ b/litellm/proxy/_experimental/mcp_server/rest_endpoints.py @@ -23,6 +23,7 @@ router = APIRouter( if MCP_AVAILABLE: from litellm.proxy._experimental.mcp_server.mcp_server_manager import ( global_mcp_server_manager, + _convert_protocol_version_to_enum, ) from litellm.proxy._experimental.mcp_server.server import ( ListMCPToolsRestAPIResponseObject, @@ -140,15 +141,52 @@ if MCP_AVAILABLE: REST API to call a specific MCP tool with the provided arguments """ from litellm.proxy.proxy_server import add_litellm_data_to_request, proxy_config + from litellm.exceptions import BlockedPiiEntityError, GuardrailRaisedException + from fastapi import HTTPException - data = await request.json() - data = await add_litellm_data_to_request( - data=data, - request=request, - user_api_key_dict=user_api_key_dict, - proxy_config=proxy_config, - ) - return await call_mcp_tool(**data) + try: + data = await request.json() + data = await add_litellm_data_to_request( + data=data, + request=request, + user_api_key_dict=user_api_key_dict, + proxy_config=proxy_config, + ) + return await call_mcp_tool(**data) + except BlockedPiiEntityError as e: + verbose_logger.error(f"BlockedPiiEntityError in MCP tool call: {str(e)}") + raise HTTPException( + status_code=400, + detail={ + "error": "blocked_pii_entity", + "message": str(e), + "entity_type": getattr(e, 'entity_type', None), + "guardrail_name": getattr(e, 'guardrail_name', None) + } + ) + except GuardrailRaisedException as e: + verbose_logger.error(f"GuardrailRaisedException in MCP tool call: {str(e)}") + raise HTTPException( + status_code=400, + detail={ + "error": "guardrail_violation", + "message": str(e), + "guardrail_name": getattr(e, 'guardrail_name', None) + } + ) + except HTTPException as e: + # Re-raise HTTPException as-is to preserve status code and detail + verbose_logger.error(f"HTTPException in MCP tool call: {str(e)}") + raise e + except Exception as e: + verbose_logger.exception(f"Unexpected error in MCP tool call: {str(e)}") + raise HTTPException( + status_code=500, + detail={ + "error": "internal_server_error", + "message": f"An unexpected error occurred: {str(e)}" + } + ) ######################################################## # MCP Connection testing routes @@ -174,7 +212,7 @@ if MCP_AVAILABLE: name=request.alias or request.server_name or "", url=request.url, transport=request.transport, - spec_version=request.spec_version, + spec_version=_convert_protocol_version_to_enum(request.spec_version), auth_type=request.auth_type, mcp_info=request.mcp_info, ), @@ -203,7 +241,7 @@ if MCP_AVAILABLE: name=request.alias or request.server_name or "", url=request.url, transport=request.transport, - spec_version=request.spec_version, + spec_version=_convert_protocol_version_to_enum(request.spec_version), auth_type=request.auth_type, mcp_info=request.mcp_info, ), diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.py index 8250b3e769a..dd4ac9b007d 100644 --- a/litellm/proxy/_experimental/mcp_server/server.py +++ b/litellm/proxy/_experimental/mcp_server/server.py @@ -64,7 +64,7 @@ if MCP_AVAILABLE: global_mcp_tool_registry, ) from litellm.proxy._experimental.mcp_server.utils import ( - get_server_name_prefix_tool_mcp, + get_server_name_prefix_tool_mcp, ) ###################################################### @@ -168,24 +168,34 @@ if MCP_AVAILABLE: """ List all available tools """ - # Get user authentication from context variable - user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers = get_auth_context() - verbose_logger.debug( - f"MCP list_tools - User API Key Auth from context: {user_api_key_auth}" - ) - verbose_logger.debug( - f"MCP list_tools - MCP servers from context: {mcp_servers}" - ) - verbose_logger.debug( - f"MCP list_tools - MCP server auth headers: {list(mcp_server_auth_headers.keys()) if mcp_server_auth_headers else None}" - ) - # Get mcp_servers from context variable - return await _list_mcp_tools( - user_api_key_auth=user_api_key_auth, - mcp_auth_header=mcp_auth_header, - mcp_servers=mcp_servers, - mcp_server_auth_headers=mcp_server_auth_headers, - ) + try: + # Get user authentication from context variable + user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers, mcp_protocol_version = get_auth_context() + verbose_logger.debug( + f"MCP list_tools - User API Key Auth from context: {user_api_key_auth}" + ) + verbose_logger.debug( + f"MCP list_tools - MCP servers from context: {mcp_servers}" + ) + verbose_logger.debug( + f"MCP list_tools - MCP server auth headers: {list(mcp_server_auth_headers.keys()) if mcp_server_auth_headers else None}" + ) + # Get mcp_servers from context variable + verbose_logger.debug("MCP list_tools - Calling _list_mcp_tools") + tools = await _list_mcp_tools( + user_api_key_auth=user_api_key_auth, + mcp_auth_header=mcp_auth_header, + mcp_servers=mcp_servers, + mcp_server_auth_headers=mcp_server_auth_headers, + mcp_protocol_version=mcp_protocol_version, + ) + verbose_logger.info(f"MCP list_tools - Successfully returned {len(tools)} tools") + return tools + except Exception as e: + verbose_logger.exception(f"Error in list_tools endpoint: {str(e)}") + # Return empty list instead of failing completely + # This prevents the HTTP stream from failing and allows the client to get a response + return [] @server.call_tool() async def mcp_server_tool_call( @@ -208,9 +218,10 @@ if MCP_AVAILABLE: from litellm.proxy.litellm_pre_call_utils import add_litellm_data_to_request from litellm.proxy.proxy_server import proxy_config + from litellm.exceptions import BlockedPiiEntityError, GuardrailRaisedException # Validate arguments - user_api_key_auth, mcp_auth_header, _, mcp_server_auth_headers = get_auth_context() + user_api_key_auth, mcp_auth_header, _, mcp_server_auth_headers, mcp_protocol_version = get_auth_context() verbose_logger.debug( f"MCP mcp_server_tool_call - User API Key Auth from context: {user_api_key_auth}" @@ -241,11 +252,37 @@ if MCP_AVAILABLE: user_api_key_auth=user_api_key_auth, mcp_auth_header=mcp_auth_header, mcp_server_auth_headers=mcp_server_auth_headers, + mcp_protocol_version=mcp_protocol_version, **data, # for logging ) + except BlockedPiiEntityError as e: + verbose_logger.error(f"BlockedPiiEntityError in MCP tool call: {str(e)}") + # Return error as text content for MCP protocol + return [TextContent( + text=f"Error: Blocked PII entity detected - {str(e)}", + type="text" + )] + except GuardrailRaisedException as e: + verbose_logger.error(f"GuardrailRaisedException in MCP tool call: {str(e)}") + # Return error as text content for MCP protocol + return [TextContent( + text=f"Error: Guardrail violation - {str(e)}", + type="text" + )] + except HTTPException as e: + verbose_logger.error(f"HTTPException in MCP tool call: {str(e)}") + # Return error as text content for MCP protocol + return [TextContent( + text=f"Error: {str(e.detail)}", + type="text" + )] except Exception as e: verbose_logger.exception(f"MCP mcp_server_tool_call - error: {e}") - raise e + # Return error as text content for MCP protocol + return [TextContent( + text=f"Error: {str(e)}", + type="text" + )] return response @@ -262,6 +299,7 @@ if MCP_AVAILABLE: mcp_auth_header: Optional[str], mcp_servers: Optional[List[str]], mcp_server_auth_headers: Optional[Dict[str, str]] = None, + mcp_protocol_version: Optional[str] = None, ) -> List[MCPTool]: """ Helper method to fetch tools from MCP servers based on server filtering criteria. @@ -325,6 +363,7 @@ if MCP_AVAILABLE: tools = await global_mcp_server_manager._get_tools_from_server( server=server, mcp_auth_header=server_auth_header, + mcp_protocol_version=mcp_protocol_version, ) all_tools.extend(tools) verbose_logger.debug(f"Successfully fetched {len(tools)} tools from server {server.name}") @@ -342,6 +381,7 @@ if MCP_AVAILABLE: mcp_auth_header: Optional[str] = None, mcp_servers: Optional[List[str]] = None, mcp_server_auth_headers: Optional[Dict[str, str]] = None, + mcp_protocol_version: Optional[str] = None, ) -> List[MCPTool]: """ List all available MCP tools. @@ -357,28 +397,38 @@ if MCP_AVAILABLE: """ if not MCP_AVAILABLE: return [] - - # Get tools from managed MCP servers - managed_tools = await _get_tools_from_mcp_servers( - user_api_key_auth=user_api_key_auth, - mcp_auth_header=mcp_auth_header, - mcp_servers=mcp_servers, - mcp_server_auth_headers=mcp_server_auth_headers, - ) + # Get tools from managed MCP servers with error handling + managed_tools = [] + try: + managed_tools = await _get_tools_from_mcp_servers( + user_api_key_auth=user_api_key_auth, + mcp_auth_header=mcp_auth_header, + mcp_servers=mcp_servers, + mcp_server_auth_headers=mcp_server_auth_headers, + mcp_protocol_version=mcp_protocol_version, + ) + verbose_logger.debug(f"Successfully fetched {len(managed_tools)} tools from managed MCP servers") + except Exception as e: + verbose_logger.exception(f"Error getting tools from managed MCP servers: {str(e)}") + # Continue with empty managed tools list instead of failing completely # Get tools from local registry - local_tools_raw = global_mcp_tool_registry.list_tools() - - # Convert local tools to MCPTool format local_tools = [] - for tool in local_tools_raw: - # Convert from litellm.types.mcp_server.tool_registry.MCPTool to mcp.types.Tool - mcp_tool = MCPTool( - name=tool.name, - description=tool.description, - inputSchema=tool.input_schema - ) - local_tools.append(mcp_tool) + try: + local_tools_raw = global_mcp_tool_registry.list_tools() + + # Convert local tools to MCPTool format + for tool in local_tools_raw: + # Convert from litellm.types.mcp_server.tool_registry.MCPTool to mcp.types.Tool + mcp_tool = MCPTool( + name=tool.name, + description=tool.description, + inputSchema=tool.input_schema + ) + local_tools.append(mcp_tool) + except Exception as e: + verbose_logger.exception(f"Error getting tools from local registry: {str(e)}") + # Continue with empty local tools list instead of failing completely # Combine all tools all_tools = managed_tools + local_tools @@ -392,6 +442,7 @@ if MCP_AVAILABLE: user_api_key_auth: Optional[UserAPIKeyAuth] = None, mcp_auth_header: Optional[str] = None, mcp_server_auth_headers: Optional[Dict[str, str]] = None, + mcp_protocol_version: Optional[str] = None, **kwargs: Any ) -> List[Union[TextContent, ImageContent, EmbeddedResource]]: """ @@ -439,6 +490,8 @@ if MCP_AVAILABLE: user_api_key_auth=user_api_key_auth, mcp_auth_header=mcp_auth_header, mcp_server_auth_headers=mcp_server_auth_headers, + mcp_protocol_version=mcp_protocol_version, + litellm_logging_obj=litellm_logging_obj, ) # Fall back to local tool registry (use original name) @@ -490,14 +543,20 @@ if MCP_AVAILABLE: user_api_key_auth: Optional[UserAPIKeyAuth] = None, mcp_auth_header: Optional[str] = None, mcp_server_auth_headers: Optional[Dict[str, str]] = None, + mcp_protocol_version: Optional[str] = None, + litellm_logging_obj: Optional[Any] = None, ) -> List[Union[TextContent, ImageContent, EmbeddedResource]]: """Handle tool execution for managed server tools""" + # Import here to avoid circular import + from litellm.proxy.proxy_server import proxy_logging_obj + call_tool_result = await global_mcp_server_manager.call_tool( name=name, arguments=arguments, user_api_key_auth=user_api_key_auth, mcp_auth_header=mcp_auth_header, mcp_server_auth_headers=mcp_server_auth_headers, + proxy_logging_obj=proxy_logging_obj, ) verbose_logger.debug("CALL TOOL RESULT: %s", call_tool_result) return call_tool_result.content # type: ignore[return-value] @@ -533,15 +592,15 @@ if MCP_AVAILABLE: mcp_servers_from_path = [s.strip() for s in mcp_servers_str.split(",") if s.strip()] if mcp_servers_from_path is not None: - user_api_key_auth, mcp_auth_header, _, mcp_server_auth_headers = ( + user_api_key_auth, mcp_auth_header, _, mcp_server_auth_headers, mcp_protocol_version = ( await MCPRequestHandler.process_mcp_request(scope) ) mcp_servers = mcp_servers_from_path else: - user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers = ( + user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers, mcp_protocol_version = ( await MCPRequestHandler.process_mcp_request(scope) ) - return user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers + return user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers, mcp_protocol_version async def handle_streamable_http_mcp( scope: Scope, receive: Receive, send: Send @@ -549,15 +608,17 @@ if MCP_AVAILABLE: """Handle MCP requests through StreamableHTTP.""" try: path = scope.get("path", "") - user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers = await extract_mcp_auth_context(scope, path) + user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers, mcp_protocol_version = await extract_mcp_auth_context(scope, path) verbose_logger.debug(f"MCP request mcp_servers (header/path): {mcp_servers}") verbose_logger.debug(f"MCP server auth headers: {list(mcp_server_auth_headers.keys()) if mcp_server_auth_headers else None}") + verbose_logger.debug(f"MCP protocol version: {mcp_protocol_version}") # Set the auth context variable for easy access in MCP functions set_auth_context( user_api_key_auth=user_api_key_auth, mcp_auth_header=mcp_auth_header, mcp_servers=mcp_servers, mcp_server_auth_headers=mcp_server_auth_headers, + mcp_protocol_version=mcp_protocol_version, ) # Ensure session managers are initialized @@ -569,20 +630,36 @@ if MCP_AVAILABLE: await session_manager.handle_request(scope, receive, send) except Exception as e: verbose_logger.exception(f"Error handling MCP request: {e}") - raise e + # Instead of re-raising, try to send a graceful error response + try: + # Send a proper HTTP error response instead of letting the exception bubble up + from starlette.responses import JSONResponse + from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR + + error_response = JSONResponse( + status_code=HTTP_500_INTERNAL_SERVER_ERROR, + content={"error": "MCP request failed", "details": str(e)} + ) + await error_response(scope, receive, send) + except Exception as response_error: + verbose_logger.exception(f"Failed to send error response: {response_error}") + # If we can't send a proper response, re-raise the original error + raise e async def handle_sse_mcp(scope: Scope, receive: Receive, send: Send) -> None: """Handle MCP requests through SSE.""" try: path = scope.get("path", "") - user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers = await extract_mcp_auth_context(scope, path) + user_api_key_auth, mcp_auth_header, mcp_servers, mcp_server_auth_headers, mcp_protocol_version = await extract_mcp_auth_context(scope, path) verbose_logger.debug(f"MCP request mcp_servers (header/path): {mcp_servers}") verbose_logger.debug(f"MCP server auth headers: {list(mcp_server_auth_headers.keys()) if mcp_server_auth_headers else None}") + verbose_logger.debug(f"MCP protocol version: {mcp_protocol_version}") set_auth_context( user_api_key_auth=user_api_key_auth, mcp_auth_header=mcp_auth_header, mcp_servers=mcp_servers, mcp_server_auth_headers=mcp_server_auth_headers, + mcp_protocol_version=mcp_protocol_version, ) if not _SESSION_MANAGERS_INITIALIZED: @@ -592,7 +669,21 @@ if MCP_AVAILABLE: await sse_session_manager.handle_request(scope, receive, send) except Exception as e: verbose_logger.exception(f"Error handling MCP request: {e}") - raise e + # Instead of re-raising, try to send a graceful error response + try: + # Send a proper HTTP error response instead of letting the exception bubble up + from starlette.responses import JSONResponse + from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR + + error_response = JSONResponse( + status_code=HTTP_500_INTERNAL_SERVER_ERROR, + content={"error": "MCP request failed", "details": str(e)} + ) + await error_response(scope, receive, send) + except Exception as response_error: + verbose_logger.exception(f"Failed to send error response: {response_error}") + # If we can't send a proper response, re-raise the original error + raise e app = FastAPI( title=LITELLM_MCP_SERVER_NAME, @@ -626,6 +717,7 @@ if MCP_AVAILABLE: mcp_auth_header: Optional[str] = None, mcp_servers: Optional[List[str]] = None, mcp_server_auth_headers: Optional[Dict[str, str]] = None, + mcp_protocol_version: Optional[str] = None, ) -> None: """ Set the UserAPIKeyAuth in the auth context variable. @@ -641,11 +733,12 @@ if MCP_AVAILABLE: mcp_auth_header=mcp_auth_header, mcp_servers=mcp_servers, mcp_server_auth_headers=mcp_server_auth_headers, + mcp_protocol_version=mcp_protocol_version, ) auth_context_var.set(auth_user) def get_auth_context() -> ( - Tuple[Optional[UserAPIKeyAuth], Optional[str], Optional[List[str]], Optional[Dict[str, str]]] + Tuple[Optional[UserAPIKeyAuth], Optional[str], Optional[List[str]], Optional[Dict[str, str]], Optional[str]] ): """ Get the UserAPIKeyAuth from the auth context variable. @@ -661,8 +754,9 @@ if MCP_AVAILABLE: auth_user.mcp_auth_header, auth_user.mcp_servers, auth_user.mcp_server_auth_headers, + auth_user.mcp_protocol_version, ) - return None, None, None, None + return None, None, None, None, None ######################################################## ############ End of Auth Context Functions ############# diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/152-c78d9bb44a92a615.js b/litellm/proxy/_experimental/out/_next/static/chunks/152-c78d9bb44a92a615.js deleted file mode 100644 index e9495002fce..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/152-c78d9bb44a92a615.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[152],{9738:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},46346:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M899.6 276.5L705 396.4 518.4 147.5a8.06 8.06 0 00-12.9 0L319 396.4 124.3 276.5c-5.7-3.5-13.1 1.2-12.2 7.9L188.5 865c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6c.8-6.7-6.5-11.4-12.3-7.9zm-126 534.1H250.3l-53.8-409.4 139.8 86.1L512 252.9l175.7 234.4 139.8-86.1-53.9 409.4zM512 509c-62.1 0-112.6 50.5-112.6 112.6S449.9 734.2 512 734.2s112.6-50.5 112.6-112.6S574.1 509 512 509zm0 160.9c-26.6 0-48.2-21.6-48.2-48.3 0-26.6 21.6-48.3 48.2-48.3s48.2 21.6 48.2 48.3c0 26.6-21.6 48.3-48.2 48.3z"}}]},name:"crown",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},70464:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},39760:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},15327:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},40428:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 01-112.7 75.9A352.8 352.8 0 01512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 01-112.7-75.9 353.28 353.28 0 01-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z"}}]},name:"logout",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},91870:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},77565:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},57400:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64L128 192v384c0 212.1 171.9 384 384 384s384-171.9 384-384V192L512 64zm312 512c0 172.3-139.7 312-312 312S200 748.3 200 576V246l312-110 312 110v330z"}},{tag:"path",attrs:{d:"M378.4 475.1a35.91 35.91 0 00-50.9 0 35.91 35.91 0 000 50.9l129.4 129.4 2.1 2.1a33.98 33.98 0 0048.1 0L730.6 434a33.98 33.98 0 000-48.1l-2.8-2.8a33.98 33.98 0 00-48.1 0L483 579.7 378.4 475.1z"}}]},name:"safety",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},29436:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},15883:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(1119),r=n(2265),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},a=n(55015),i=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:l}))})},21626:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(5853),r=n(2265),l=n(97324);let a=(0,n(1153).fn)("Table"),i=r.forwardRef((e,t)=>{let{children:n,className:i}=e,c=(0,o._T)(e,["children","className"]);return r.createElement("div",{className:(0,l.q)(a("root"),"overflow-auto",i)},r.createElement("table",Object.assign({ref:t,className:(0,l.q)(a("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},c),n))});i.displayName="Table"},97214:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(5853),r=n(2265),l=n(97324);let a=(0,n(1153).fn)("TableBody"),i=r.forwardRef((e,t)=>{let{children:n,className:i}=e,c=(0,o._T)(e,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("tbody",Object.assign({ref:t,className:(0,l.q)(a("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",i)},c),n))});i.displayName="TableBody"},28241:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(5853),r=n(2265),l=n(97324);let a=(0,n(1153).fn)("TableCell"),i=r.forwardRef((e,t)=>{let{children:n,className:i}=e,c=(0,o._T)(e,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("td",Object.assign({ref:t,className:(0,l.q)(a("root"),"align-middle whitespace-nowrap text-left p-4",i)},c),n))});i.displayName="TableCell"},58834:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(5853),r=n(2265),l=n(97324);let a=(0,n(1153).fn)("TableHead"),i=r.forwardRef((e,t)=>{let{children:n,className:i}=e,c=(0,o._T)(e,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("thead",Object.assign({ref:t,className:(0,l.q)(a("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",i)},c),n))});i.displayName="TableHead"},69552:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(5853),r=n(2265),l=n(97324);let a=(0,n(1153).fn)("TableHeaderCell"),i=r.forwardRef((e,t)=>{let{children:n,className:i}=e,c=(0,o._T)(e,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("th",Object.assign({ref:t,className:(0,l.q)(a("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content","dark:text-dark-tremor-content",i)},c),n))});i.displayName="TableHeaderCell"},71876:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(5853),r=n(2265),l=n(97324);let a=(0,n(1153).fn)("TableRow"),i=r.forwardRef((e,t)=>{let{children:n,className:i}=e,c=(0,o._T)(e,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("tr",Object.assign({ref:t,className:(0,l.q)(a("row"),i)},c),n))});i.displayName="TableRow"},93942:function(e,t,n){n.d(t,{i:function(){return i}});var o=n(2265),r=n(50506),l=n(13959),a=n(71744);function i(e){return t=>o.createElement(l.ZP,{theme:{token:{motion:!1,zIndexPopupBase:0}}},o.createElement(e,Object.assign({},t)))}t.Z=(e,t,n,l)=>i(i=>{let{prefixCls:c,style:u}=i,s=o.useRef(null),[d,f]=o.useState(0),[g,p]=o.useState(0),[m,v]=(0,r.Z)(!1,{value:i.open}),{getPrefixCls:h}=o.useContext(a.E_),b=h(t||"select",c);o.useEffect(()=>{if(v(!0),"undefined"!=typeof ResizeObserver){let e=new ResizeObserver(e=>{let t=e[0].target;f(t.offsetHeight+8),p(t.offsetWidth)}),t=setInterval(()=>{var o;let r=n?".".concat(n(b)):".".concat(b,"-dropdown"),l=null===(o=s.current)||void 0===o?void 0:o.querySelector(r);l&&(clearInterval(t),e.observe(l))},10);return()=>{clearInterval(t),e.disconnect()}}},[]);let C=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},u),{margin:0}),open:m,visible:m,getPopupContainer:()=>s.current});return l&&(C=l(C)),o.createElement("div",{ref:s,style:{paddingBottom:d,position:"relative",minWidth:g}},o.createElement(e,Object.assign({},C)))})},53445:function(e,t,n){var o=n(2265),r=n(49638);t.Z=function(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o.createElement(r.Z,null),a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if("boolean"==typeof e?!e:void 0===t?!a:!1===t||null===t)return[!1,null];let i="boolean"==typeof t||null==t?l:t;return[!0,n?n(i):i]}},12757:function(e,t,n){n.d(t,{F:function(){return a},Z:function(){return l}});var o=n(36760),r=n.n(o);function l(e,t,n){return r()({["".concat(e,"-status-success")]:"success"===t,["".concat(e,"-status-warning")]:"warning"===t,["".concat(e,"-status-error")]:"error"===t,["".concat(e,"-status-validating")]:"validating"===t,["".concat(e,"-has-feedback")]:n})}let a=(e,t)=>t||e},91086:function(e,t,n){var o=n(2265),r=n(71744),l=n(85180);t.Z=e=>{let{componentName:t}=e,{getPrefixCls:n}=(0,o.useContext)(r.E_),a=n("empty");switch(t){case"Table":case"List":return o.createElement(l.Z,{image:l.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return o.createElement(l.Z,{image:l.Z.PRESENTED_IMAGE_SIMPLE,className:"".concat(a,"-small")});default:return o.createElement(l.Z,null)}}},80795:function(e,t,n){n.d(t,{Z:function(){return B}});var o=n(2265),r=n(77565),l=n(36760),a=n.n(l),i=n(71030),c=n(74126),u=n(50506),s=n(18694),d=n(62236),f=n(92736),g=n(93942),p=n(19722),m=n(13613),v=n(95140),h=n(71744),b=n(45937),C=n(88208),y=n(29961),w=n(12918),S=n(18544),E=n(29382),R=n(691),x=n(88260),I=n(80669),O=n(3104),P=e=>{let{componentCls:t,menuCls:n,colorError:o,colorTextLightSolid:r}=e,l="".concat(n,"-item");return{["".concat(t,", ").concat(t,"-menu-submenu")]:{["".concat(n," ").concat(l)]:{["&".concat(l,"-danger:not(").concat(l,"-disabled)")]:{color:o,"&:hover":{color:r,backgroundColor:o}}}}}},M=n(34442),Z=n(352);let N=e=>{let{componentCls:t,menuCls:n,zIndexPopup:o,dropdownArrowDistance:r,sizePopupArrow:l,antCls:a,iconCls:i,motionDurationMid:c,paddingBlock:u,fontSize:s,dropdownEdgeChildPadding:d,colorTextDisabled:f,fontSizeIcon:g,controlPaddingHorizontal:p,colorBgElevated:m}=e;return[{[t]:Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:o,display:"block","&::before":{position:"absolute",insetBlock:e.calc(l).div(2).sub(r).equal(),zIndex:-9999,opacity:1e-4,content:'""'},["&-trigger".concat(a,"-btn")]:{["& > ".concat(i,"-down, & > ").concat(a,"-btn-icon > ").concat(i,"-down")]:{fontSize:g}},["".concat(t,"-wrap")]:{position:"relative",["".concat(a,"-btn > ").concat(i,"-down")]:{fontSize:g},["".concat(i,"-down::before")]:{transition:"transform ".concat(c)}},["".concat(t,"-wrap-open")]:{["".concat(i,"-down::before")]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},["&".concat(a,"-slide-down-enter").concat(a,"-slide-down-enter-active").concat(t,"-placement-bottomLeft,\n &").concat(a,"-slide-down-appear").concat(a,"-slide-down-appear-active").concat(t,"-placement-bottomLeft,\n &").concat(a,"-slide-down-enter").concat(a,"-slide-down-enter-active").concat(t,"-placement-bottom,\n &").concat(a,"-slide-down-appear").concat(a,"-slide-down-appear-active").concat(t,"-placement-bottom,\n &").concat(a,"-slide-down-enter").concat(a,"-slide-down-enter-active").concat(t,"-placement-bottomRight,\n &").concat(a,"-slide-down-appear").concat(a,"-slide-down-appear-active").concat(t,"-placement-bottomRight")]:{animationName:S.fJ},["&".concat(a,"-slide-up-enter").concat(a,"-slide-up-enter-active").concat(t,"-placement-topLeft,\n &").concat(a,"-slide-up-appear").concat(a,"-slide-up-appear-active").concat(t,"-placement-topLeft,\n &").concat(a,"-slide-up-enter").concat(a,"-slide-up-enter-active").concat(t,"-placement-top,\n &").concat(a,"-slide-up-appear").concat(a,"-slide-up-appear-active").concat(t,"-placement-top,\n &").concat(a,"-slide-up-enter").concat(a,"-slide-up-enter-active").concat(t,"-placement-topRight,\n &").concat(a,"-slide-up-appear").concat(a,"-slide-up-appear-active").concat(t,"-placement-topRight")]:{animationName:S.Qt},["&".concat(a,"-slide-down-leave").concat(a,"-slide-down-leave-active").concat(t,"-placement-bottomLeft,\n &").concat(a,"-slide-down-leave").concat(a,"-slide-down-leave-active").concat(t,"-placement-bottom,\n &").concat(a,"-slide-down-leave").concat(a,"-slide-down-leave-active").concat(t,"-placement-bottomRight")]:{animationName:S.Uw},["&".concat(a,"-slide-up-leave").concat(a,"-slide-up-leave-active").concat(t,"-placement-topLeft,\n &").concat(a,"-slide-up-leave").concat(a,"-slide-up-leave-active").concat(t,"-placement-top,\n &").concat(a,"-slide-up-leave").concat(a,"-slide-up-leave-active").concat(t,"-placement-topRight")]:{animationName:S.ly}})},(0,x.ZP)(e,m,{arrowPlacement:{top:!0,bottom:!0}}),{["".concat(t," ").concat(n)]:{position:"relative",margin:0},["".concat(n,"-submenu-popup")]:{position:"absolute",zIndex:o,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},["".concat(t,", ").concat(t,"-menu-submenu")]:{[n]:Object.assign(Object.assign({padding:d,listStyleType:"none",backgroundColor:m,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},(0,w.Qy)(e)),{["".concat(n,"-item-group-title")]:{padding:"".concat((0,Z.bf)(u)," ").concat((0,Z.bf)(p)),color:e.colorTextDescription,transition:"all ".concat(c)},["".concat(n,"-item")]:{position:"relative",display:"flex",alignItems:"center"},["".concat(n,"-item-icon")]:{minWidth:s,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},["".concat(n,"-title-content")]:{flex:"auto","> a":{color:"inherit",transition:"all ".concat(c),"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},["".concat(n,"-item, ").concat(n,"-submenu-title")]:Object.assign(Object.assign({clear:"both",margin:0,padding:"".concat((0,Z.bf)(u)," ").concat((0,Z.bf)(p)),color:e.colorText,fontWeight:"normal",fontSize:s,lineHeight:e.lineHeight,cursor:"pointer",transition:"all ".concat(c),borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},(0,w.Qy)(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:f,cursor:"not-allowed","&:hover":{color:f,backgroundColor:m,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:"".concat((0,Z.bf)(e.marginXXS)," 0"),overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},["".concat(t,"-menu-submenu-expand-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,["".concat(t,"-menu-submenu-arrow-icon")]:{marginInlineEnd:"0 !important",color:e.colorTextDescription,fontSize:g,fontStyle:"normal"}}}),["".concat(n,"-item-group-list")]:{margin:"0 ".concat((0,Z.bf)(e.marginXS)),padding:0,listStyle:"none"},["".concat(n,"-submenu-title")]:{paddingInlineEnd:e.calc(p).add(e.fontSizeSM).equal()},["".concat(n,"-submenu-vertical")]:{position:"relative"},["".concat(n,"-submenu").concat(n,"-submenu-disabled ").concat(t,"-menu-submenu-title")]:{["&, ".concat(t,"-menu-submenu-arrow-icon")]:{color:f,backgroundColor:m,cursor:"not-allowed"}},["".concat(n,"-submenu-selected ").concat(t,"-menu-submenu-title")]:{color:e.colorPrimary}})}},[(0,S.oN)(e,"slide-up"),(0,S.oN)(e,"slide-down"),(0,E.Fm)(e,"move-up"),(0,E.Fm)(e,"move-down"),(0,R._y)(e,"zoom-big")]]};var k=(0,I.I$)("Dropdown",e=>{let{marginXXS:t,sizePopupArrow:n,paddingXXS:o,componentCls:r}=e,l=(0,O.TS)(e,{menuCls:"".concat(r,"-menu"),dropdownArrowDistance:e.calc(n).div(2).add(t).equal(),dropdownEdgeChildPadding:o});return[N(l),P(l)]},e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},(0,x.wZ)({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),(0,M.w)(e))),_=n(64024);let T=e=>{let t;let{menu:n,arrow:l,prefixCls:g,children:w,trigger:S,disabled:E,dropdownRender:R,getPopupContainer:x,overlayClassName:I,rootClassName:O,overlayStyle:P,open:M,onOpenChange:Z,visible:N,onVisibleChange:T,mouseEnterDelay:j=.15,mouseLeaveDelay:A=.1,autoAdjustOverflow:L=!0,placement:F="",overlay:D,transitionName:z}=e,{getPopupContainer:H,getPrefixCls:B,direction:V,dropdown:G}=o.useContext(h.E_);(0,m.ln)("Dropdown");let W=o.useMemo(()=>{let e=B();return void 0!==z?z:F.includes("top")?"".concat(e,"-slide-down"):"".concat(e,"-slide-up")},[B,F,z]),K=o.useMemo(()=>F?F.includes("Center")?F.slice(0,F.indexOf("Center")):F:"rtl"===V?"bottomRight":"bottomLeft",[F,V]),U=B("dropdown",g),X=(0,_.Z)(U),[q,Y,$]=k(U,X),[,Q]=(0,y.ZP)(),J=o.Children.only(w),ee=(0,p.Tm)(J,{className:a()("".concat(U,"-trigger"),{["".concat(U,"-rtl")]:"rtl"===V},J.props.className),disabled:E}),et=E?[]:S;et&&et.includes("contextMenu")&&(t=!0);let[en,eo]=(0,u.Z)(!1,{value:null!=M?M:N}),er=(0,c.zX)(e=>{null==Z||Z(e,{source:"trigger"}),null==T||T(e),eo(e)}),el=a()(I,O,Y,$,X,null==G?void 0:G.className,{["".concat(U,"-rtl")]:"rtl"===V}),ea=(0,f.Z)({arrowPointAtCenter:"object"==typeof l&&l.pointAtCenter,autoAdjustOverflow:L,offset:Q.marginXXS,arrowWidth:l?Q.sizePopupArrow:0,borderRadius:Q.borderRadius}),ei=o.useCallback(()=>{null!=n&&n.selectable&&null!=n&&n.multiple||(null==Z||Z(!1,{source:"menu"}),eo(!1))},[null==n?void 0:n.selectable,null==n?void 0:n.multiple]),[ec,eu]=(0,d.Cn)("Dropdown",null==P?void 0:P.zIndex),es=o.createElement(i.Z,Object.assign({alignPoint:t},(0,s.Z)(e,["rootClassName"]),{mouseEnterDelay:j,mouseLeaveDelay:A,visible:en,builtinPlacements:ea,arrow:!!l,overlayClassName:el,prefixCls:U,getPopupContainer:x||H,transitionName:W,trigger:et,overlay:()=>{let e;return e=(null==n?void 0:n.items)?o.createElement(b.Z,Object.assign({},n)):"function"==typeof D?D():D,R&&(e=R(e)),e=o.Children.only("string"==typeof e?o.createElement("span",null,e):e),o.createElement(C.J,{prefixCls:"".concat(U,"-menu"),rootClassName:a()($,X),expandIcon:o.createElement("span",{className:"".concat(U,"-menu-submenu-arrow")},o.createElement(r.Z,{className:"".concat(U,"-menu-submenu-arrow-icon")})),mode:"vertical",selectable:!1,onClick:ei,validator:e=>{let{mode:t}=e}},e)},placement:K,onVisibleChange:er,overlayStyle:Object.assign(Object.assign(Object.assign({},null==G?void 0:G.style),P),{zIndex:ec})}),ee);return ec&&(es=o.createElement(v.Z.Provider,{value:eu},es)),q(es)},j=(0,g.Z)(T,"dropdown",e=>e,function(e){return Object.assign(Object.assign({},e),{align:{overflow:{adjustX:!1,adjustY:!1}}})});T._InternalPanelDoNotUseOrYouWillBeFired=e=>o.createElement(j,Object.assign({},e),o.createElement("span",null));var A=n(39760),L=n(73002),F=n(93142),D=n(65658),z=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let H=e=>{let{getPopupContainer:t,getPrefixCls:n,direction:r}=o.useContext(h.E_),{prefixCls:l,type:i="default",danger:c,disabled:u,loading:s,onClick:d,htmlType:f,children:g,className:p,menu:m,arrow:v,autoFocus:b,overlay:C,trigger:y,align:w,open:S,onOpenChange:E,placement:R,getPopupContainer:x,href:I,icon:O=o.createElement(A.Z,null),title:P,buttonsRender:M=e=>e,mouseEnterDelay:Z,mouseLeaveDelay:N,overlayClassName:k,overlayStyle:_,destroyPopupOnHide:j,dropdownRender:H}=e,B=z(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),V=n("dropdown",l),G={menu:m,arrow:v,autoFocus:b,align:w,disabled:u,trigger:u?[]:y,onOpenChange:E,getPopupContainer:x||t,mouseEnterDelay:Z,mouseLeaveDelay:N,overlayClassName:k,overlayStyle:_,destroyPopupOnHide:j,dropdownRender:H},{compactSize:W,compactItemClassnames:K}=(0,D.ri)(V,r),U=a()("".concat(V,"-button"),K,p);"overlay"in e&&(G.overlay=C),"open"in e&&(G.open=S),"placement"in e?G.placement=R:G.placement="rtl"===r?"bottomLeft":"bottomRight";let[X,q]=M([o.createElement(L.ZP,{type:i,danger:c,disabled:u,loading:s,onClick:d,htmlType:f,href:I,title:P},g),o.createElement(L.ZP,{type:i,danger:c,icon:O})]);return o.createElement(F.Z.Compact,Object.assign({className:U,size:W,block:!0},B),X,o.createElement(T,Object.assign({},G),q))};H.__ANT_BUTTON=!0,T.Button=H;var B=T},85180:function(e,t,n){n.d(t,{Z:function(){return b}});var o=n(36760),r=n.n(o),l=n(2265),a=n(71744),i=n(55274),c=n(36360),u=n(29961),s=n(80669),d=n(3104);let f=e=>{let{componentCls:t,margin:n,marginXS:o,marginXL:r,fontSize:l,lineHeight:a}=e;return{[t]:{marginInline:o,fontSize:l,lineHeight:a,textAlign:"center",["".concat(t,"-image")]:{height:e.emptyImgHeight,marginBottom:o,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},["".concat(t,"-description")]:{color:e.colorText},["".concat(t,"-footer")]:{marginTop:n},"&-normal":{marginBlock:r,color:e.colorTextDisabled,["".concat(t,"-description")]:{color:e.colorTextDisabled},["".concat(t,"-image")]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:o,color:e.colorTextDisabled,["".concat(t,"-image")]:{height:e.emptyImgHeightSM}}}}};var g=(0,s.I$)("Empty",e=>{let{componentCls:t,controlHeightLG:n,calc:o}=e;return[f((0,d.TS)(e,{emptyImgCls:"".concat(t,"-img"),emptyImgHeight:o(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:o(n).mul(.875).equal()}))]}),p=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let m=l.createElement(()=>{let[,e]=(0,u.ZP)(),t=new c.C(e.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return l.createElement("svg",{style:t,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{fill:"none",fillRule:"evenodd"},l.createElement("g",{transform:"translate(24 31.67)"},l.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),l.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),l.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),l.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),l.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),l.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),l.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},l.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),l.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},null),v=l.createElement(()=>{let[,e]=(0,u.ZP)(),{colorFill:t,colorFillTertiary:n,colorFillQuaternary:o,colorBgContainer:r}=e,{borderColor:a,shadowColor:i,contentColor:s}=(0,l.useMemo)(()=>({borderColor:new c.C(t).onBackground(r).toHexShortString(),shadowColor:new c.C(n).onBackground(r).toHexShortString(),contentColor:new c.C(o).onBackground(r).toHexShortString()}),[t,n,o,r]);return l.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},l.createElement("ellipse",{fill:i,cx:"32",cy:"33",rx:"32",ry:"7"}),l.createElement("g",{fillRule:"nonzero",stroke:a},l.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),l.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:s}))))},null),h=e=>{var{className:t,rootClassName:n,prefixCls:o,image:c=m,description:u,children:s,imageStyle:d,style:f}=e,h=p(e,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);let{getPrefixCls:b,direction:C,empty:y}=l.useContext(a.E_),w=b("empty",o),[S,E,R]=g(w),[x]=(0,i.Z)("Empty"),I=void 0!==u?u:null==x?void 0:x.description,O=null;return O="string"==typeof c?l.createElement("img",{alt:"string"==typeof I?I:"empty",src:c}):c,S(l.createElement("div",Object.assign({className:r()(E,R,w,null==y?void 0:y.className,{["".concat(w,"-normal")]:c===v,["".concat(w,"-rtl")]:"rtl"===C},t,n),style:Object.assign(Object.assign({},null==y?void 0:y.style),f)},h),l.createElement("div",{className:"".concat(w,"-image"),style:d},O),I&&l.createElement("div",{className:"".concat(w,"-description")},I),s&&l.createElement("div",{className:"".concat(w,"-footer")},s)))};h.PRESENTED_IMAGE_DEFAULT=m,h.PRESENTED_IMAGE_SIMPLE=v;var b=h},56250:function(e,t,n){var o=n(2265),r=n(39109);let l=["outlined","borderless","filled"];t.Z=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=(0,o.useContext)(r.pg);t=void 0!==e?e:!1===n?"borderless":null!=a?a:"outlined";let i=l.includes(t);return[t,i]}},92239:function(e,t,n){let o;n.d(t,{D:function(){return C},Z:function(){return w}});var r=n(2265),l=n(1119),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},i=n(55015),c=r.forwardRef(function(e,t){return r.createElement(i.Z,(0,l.Z)({},e,{ref:t,icon:a}))}),u=n(15327),s=n(77565),d=n(36760),f=n.n(d),g=n(18694),p=e=>!isNaN(parseFloat(e))&&isFinite(e),m=n(71744),v=n(80856),h=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let b={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},C=r.createContext({}),y=(o=0,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return o+=1,"".concat(e).concat(o)});var w=r.forwardRef((e,t)=>{let{prefixCls:n,className:o,trigger:l,children:a,defaultCollapsed:i=!1,theme:d="dark",style:w={},collapsible:S=!1,reverseArrow:E=!1,width:R=200,collapsedWidth:x=80,zeroWidthTriggerStyle:I,breakpoint:O,onCollapse:P,onBreakpoint:M}=e,Z=h(e,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:N}=(0,r.useContext)(v.V),[k,_]=(0,r.useState)("collapsed"in e?e.collapsed:i),[T,j]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"collapsed"in e&&_(e.collapsed)},[e.collapsed]);let A=(t,n)=>{"collapsed"in e||_(t),null==P||P(t,n)},L=(0,r.useRef)();L.current=e=>{j(e.matches),null==M||M(e.matches),k!==e.matches&&A(e.matches,"responsive")},(0,r.useEffect)(()=>{let e;function t(e){return L.current(e)}if("undefined"!=typeof window){let{matchMedia:n}=window;if(n&&O&&O in b){e=n("screen and (max-width: ".concat(b[O],")"));try{e.addEventListener("change",t)}catch(n){e.addListener(t)}t(e)}}return()=>{try{null==e||e.removeEventListener("change",t)}catch(n){null==e||e.removeListener(t)}}},[O]),(0,r.useEffect)(()=>{let e=y("ant-sider-");return N.addSider(e),()=>N.removeSider(e)},[]);let F=()=>{A(!k,"clickTrigger")},{getPrefixCls:D}=(0,r.useContext)(m.E_),z=r.useMemo(()=>({siderCollapsed:k}),[k]);return r.createElement(C.Provider,{value:z},(()=>{let e=D("layout-sider",n),i=(0,g.Z)(Z,["collapsed"]),m=k?x:R,v=p(m)?"".concat(m,"px"):String(m),h=0===parseFloat(String(x||0))?r.createElement("span",{onClick:F,className:f()("".concat(e,"-zero-width-trigger"),"".concat(e,"-zero-width-trigger-").concat(E?"right":"left")),style:I},l||r.createElement(c,null)):null,b={expanded:E?r.createElement(s.Z,null):r.createElement(u.Z,null),collapsed:E?r.createElement(u.Z,null):r.createElement(s.Z,null)}[k?"collapsed":"expanded"],C=null!==l?h||r.createElement("div",{className:"".concat(e,"-trigger"),onClick:F,style:{width:v}},l||b):null,y=Object.assign(Object.assign({},w),{flex:"0 0 ".concat(v),maxWidth:v,minWidth:v,width:v}),O=f()(e,"".concat(e,"-").concat(d),{["".concat(e,"-collapsed")]:!!k,["".concat(e,"-has-trigger")]:S&&null!==l&&!h,["".concat(e,"-below")]:!!T,["".concat(e,"-zero-width")]:0===parseFloat(v)},o);return r.createElement("aside",Object.assign({className:O},i,{style:y,ref:t}),r.createElement("div",{className:"".concat(e,"-children")},a),S||T&&h?C:null)})())})},80856:function(e,t,n){n.d(t,{V:function(){return o}});let o=n(2265).createContext({siderHook:{addSider:()=>null,removeSider:()=>null}})},88208:function(e,t,n){n.d(t,{J:function(){return c}});var o=n(2265),r=n(74126),l=n(65658),a=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let i=o.createContext(null),c=o.forwardRef((e,t)=>{let{children:n}=e,c=a(e,["children"]),u=o.useContext(i),s=o.useMemo(()=>Object.assign(Object.assign({},u),c),[u,c.prefixCls,c.mode,c.selectable,c.rootClassName]),d=(0,r.t4)(n),f=(0,r.x1)(t,d?n.ref:null);return o.createElement(i.Provider,{value:s},o.createElement(l.BR,null,d?o.cloneElement(n,{ref:f}):n))});t.Z=i},45937:function(e,t,n){n.d(t,{Z:function(){return K}});var o=n(2265),r=n(33082),l=n(92239),a=n(39760),i=n(36760),c=n.n(i),u=n(74126),s=n(18694),d=n(68710),f=n(19722),g=n(71744),p=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},m=e=>{let{prefixCls:t,className:n,dashed:l}=e,a=p(e,["prefixCls","className","dashed"]),{getPrefixCls:i}=o.useContext(g.E_),u=i("menu",t),s=c()({["".concat(u,"-item-divider-dashed")]:!!l},n);return o.createElement(r.iz,Object.assign({className:s},a))},v=n(45287),h=n(89970);let b=(0,o.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var C=e=>{var t;let{className:n,children:a,icon:i,title:u,danger:d}=e,{prefixCls:g,firstLevel:p,direction:m,disableMenuItemTitleTooltip:C,inlineCollapsed:y}=o.useContext(b),{siderCollapsed:w}=o.useContext(l.D),S=u;void 0===u?S=p?a:"":!1===u&&(S="");let E={title:S};w||y||(E.title=null,E.open=!1);let R=(0,v.Z)(a).length,x=o.createElement(r.ck,Object.assign({},(0,s.Z)(e,["title","icon","danger"]),{className:c()({["".concat(g,"-item-danger")]:d,["".concat(g,"-item-only-child")]:(i?R+1:R)===1},n),title:"string"==typeof u?u:void 0}),(0,f.Tm)(i,{className:c()((0,f.l$)(i)?null===(t=i.props)||void 0===t?void 0:t.className:"","".concat(g,"-item-icon"))}),(e=>{let t=o.createElement("span",{className:"".concat(g,"-title-content")},a);return(!i||(0,f.l$)(a)&&"span"===a.type)&&a&&e&&p&&"string"==typeof a?o.createElement("div",{className:"".concat(g,"-inline-collapsed-noicon")},a.charAt(0)):t})(y));return C||(x=o.createElement(h.Z,Object.assign({},E,{placement:"rtl"===m?"left":"right",overlayClassName:"".concat(g,"-inline-collapsed-tooltip")}),x)),x},y=n(62236),w=e=>{var t;let n;let{popupClassName:l,icon:a,title:i,theme:u}=e,d=o.useContext(b),{prefixCls:g,inlineCollapsed:p,theme:m}=d,v=(0,r.Xl)();if(a){let e=(0,f.l$)(i)&&"span"===i.type;n=o.createElement(o.Fragment,null,(0,f.Tm)(a,{className:c()((0,f.l$)(a)?null===(t=a.props)||void 0===t?void 0:t.className:"","".concat(g,"-item-icon"))}),e?i:o.createElement("span",{className:"".concat(g,"-title-content")},i))}else n=p&&!v.length&&i&&"string"==typeof i?o.createElement("div",{className:"".concat(g,"-inline-collapsed-noicon")},i.charAt(0)):o.createElement("span",{className:"".concat(g,"-title-content")},i);let h=o.useMemo(()=>Object.assign(Object.assign({},d),{firstLevel:!1}),[d]),[C]=(0,y.Cn)("Menu");return o.createElement(b.Provider,{value:h},o.createElement(r.Wd,Object.assign({},(0,s.Z)(e,["icon"]),{title:n,popupClassName:c()(g,l,"".concat(g,"-").concat(u||m)),popupStyle:{zIndex:C}})))},S=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},E=n(88208),R=n(352),x=n(36360),I=n(12918),O=n(63074),P=n(18544),M=n(691),Z=n(80669),N=n(3104),k=e=>{let{componentCls:t,motionDurationSlow:n,horizontalLineHeight:o,colorSplit:r,lineWidth:l,lineType:a,itemPaddingInline:i}=e;return{["".concat(t,"-horizontal")]:{lineHeight:o,border:0,borderBottom:"".concat((0,R.bf)(l)," ").concat(a," ").concat(r),boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},["".concat(t,"-item, ").concat(t,"-submenu")]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:i},["> ".concat(t,"-item:hover,\n > ").concat(t,"-item-active,\n > ").concat(t,"-submenu ").concat(t,"-submenu-title:hover")]:{backgroundColor:"transparent"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{transition:["border-color ".concat(n),"background ".concat(n)].join(",")},["".concat(t,"-submenu-arrow")]:{display:"none"}}}},_=e=>{let{componentCls:t,menuArrowOffset:n,calc:o}=e;return{["".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-submenu-rtl")]:{transformOrigin:"100% 0"},["".concat(t,"-rtl").concat(t,"-vertical,\n ").concat(t,"-submenu-rtl ").concat(t,"-vertical")]:{["".concat(t,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateY(".concat((0,R.bf)(o(n).mul(-1).equal()),")")},"&::after":{transform:"rotate(45deg) translateY(".concat((0,R.bf)(n),")")}}}}};let T=e=>Object.assign({},(0,I.oN)(e));var j=(e,t)=>{let{componentCls:n,itemColor:o,itemSelectedColor:r,groupTitleColor:l,itemBg:a,subMenuItemBg:i,itemSelectedBg:c,activeBarHeight:u,activeBarWidth:s,activeBarBorderWidth:d,motionDurationSlow:f,motionEaseInOut:g,motionEaseOut:p,itemPaddingInline:m,motionDurationMid:v,itemHoverColor:h,lineType:b,colorSplit:C,itemDisabledColor:y,dangerItemColor:w,dangerItemHoverColor:S,dangerItemSelectedColor:E,dangerItemActiveBg:x,dangerItemSelectedBg:I,popupBg:O,itemHoverBg:P,itemActiveBg:M,menuSubMenuBg:Z,horizontalItemSelectedColor:N,horizontalItemSelectedBg:k,horizontalItemBorderRadius:_,horizontalItemHoverBg:j}=e;return{["".concat(n,"-").concat(t,", ").concat(n,"-").concat(t," > ").concat(n)]:{color:o,background:a,["&".concat(n,"-root:focus-visible")]:Object.assign({},T(e)),["".concat(n,"-item-group-title")]:{color:l},["".concat(n,"-submenu-selected")]:{["> ".concat(n,"-submenu-title")]:{color:r}},["".concat(n,"-item-disabled, ").concat(n,"-submenu-disabled")]:{color:"".concat(y," !important")},["".concat(n,"-item:not(").concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{["&:hover, > ".concat(n,"-submenu-title:hover")]:{color:h}},["&:not(".concat(n,"-horizontal)")]:{["".concat(n,"-item:not(").concat(n,"-item-selected)")]:{"&:hover":{backgroundColor:P},"&:active":{backgroundColor:M}},["".concat(n,"-submenu-title")]:{"&:hover":{backgroundColor:P},"&:active":{backgroundColor:M}}},["".concat(n,"-item-danger")]:{color:w,["&".concat(n,"-item:hover")]:{["&:not(".concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{color:S}},["&".concat(n,"-item:active")]:{background:x}},["".concat(n,"-item a")]:{"&, &:hover":{color:"inherit"}},["".concat(n,"-item-selected")]:{color:r,["&".concat(n,"-item-danger")]:{color:E},"a, a:hover":{color:"inherit"}},["& ".concat(n,"-item-selected")]:{backgroundColor:c,["&".concat(n,"-item-danger")]:{backgroundColor:I}},["".concat(n,"-item, ").concat(n,"-submenu-title")]:{["&:not(".concat(n,"-item-disabled):focus-visible")]:Object.assign({},T(e))},["&".concat(n,"-submenu > ").concat(n)]:{backgroundColor:Z},["&".concat(n,"-popup > ").concat(n)]:{backgroundColor:O},["&".concat(n,"-submenu-popup > ").concat(n)]:{backgroundColor:O},["&".concat(n,"-horizontal")]:Object.assign(Object.assign({},"dark"===t?{borderBottom:0}:{}),{["> ".concat(n,"-item, > ").concat(n,"-submenu")]:{top:d,marginTop:e.calc(d).mul(-1).equal(),marginBottom:0,borderRadius:_,"&::after":{position:"absolute",insetInline:m,bottom:0,borderBottom:"".concat((0,R.bf)(u)," solid transparent"),transition:"border-color ".concat(f," ").concat(g),content:'""'},"&:hover, &-active, &-open":{background:j,"&::after":{borderBottomWidth:u,borderBottomColor:N}},"&-selected":{color:N,backgroundColor:k,"&:hover":{backgroundColor:k},"&::after":{borderBottomWidth:u,borderBottomColor:N}}}}),["&".concat(n,"-root")]:{["&".concat(n,"-inline, &").concat(n,"-vertical")]:{borderInlineEnd:"".concat((0,R.bf)(d)," ").concat(b," ").concat(C)}},["&".concat(n,"-inline")]:{["".concat(n,"-sub").concat(n,"-inline")]:{background:i},["".concat(n,"-item")]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:"".concat((0,R.bf)(s)," solid ").concat(r),transform:"scaleY(0.0001)",opacity:0,transition:["transform ".concat(v," ").concat(p),"opacity ".concat(v," ").concat(p)].join(","),content:'""'},["&".concat(n,"-item-danger")]:{"&::after":{borderInlineEndColor:E}}},["".concat(n,"-selected, ").concat(n,"-item-selected")]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:["transform ".concat(v," ").concat(g),"opacity ".concat(v," ").concat(g)].join(",")}}}}}};let A=e=>{let{componentCls:t,itemHeight:n,itemMarginInline:o,padding:r,menuArrowSize:l,marginXS:a,itemMarginBlock:i,itemWidth:c}=e,u=e.calc(l).add(r).add(a).equal();return{["".concat(t,"-item")]:{position:"relative",overflow:"hidden"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,R.bf)(n),paddingInline:r,overflow:"hidden",textOverflow:"ellipsis",marginInline:o,marginBlock:i,width:c},["> ".concat(t,"-item,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,R.bf)(n)},["".concat(t,"-item-group-list ").concat(t,"-submenu-title,\n ").concat(t,"-submenu-title")]:{paddingInlineEnd:u}}};var L=e=>{let{componentCls:t,iconCls:n,itemHeight:o,colorTextLightSolid:r,dropdownWidth:l,controlHeightLG:a,motionDurationMid:i,motionEaseOut:c,paddingXL:u,itemMarginInline:s,fontSizeLG:d,motionDurationSlow:f,paddingXS:g,boxShadowSecondary:p,collapsedWidth:m,collapsedIconSize:v}=e,h={height:o,lineHeight:(0,R.bf)(o),listStylePosition:"inside",listStyleType:"disc"};return[{[t]:{"&-inline, &-vertical":Object.assign({["&".concat(t,"-root")]:{boxShadow:"none"}},A(e))},["".concat(t,"-submenu-popup")]:{["".concat(t,"-vertical")]:Object.assign(Object.assign({},A(e)),{boxShadow:p})}},{["".concat(t,"-submenu-popup ").concat(t,"-vertical").concat(t,"-sub")]:{minWidth:l,maxHeight:"calc(100vh - ".concat((0,R.bf)(e.calc(a).mul(2.5).equal()),")"),padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{["".concat(t,"-inline")]:{width:"100%",["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{display:"flex",alignItems:"center",transition:["border-color ".concat(f),"background ".concat(f),"padding ".concat(i," ").concat(c)].join(","),["> ".concat(t,"-title-content")]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},["".concat(t,"-sub").concat(t,"-inline")]:{padding:0,border:0,borderRadius:0,boxShadow:"none",["& > ".concat(t,"-submenu > ").concat(t,"-submenu-title")]:h,["& ".concat(t,"-item-group-title")]:{paddingInlineStart:u}},["".concat(t,"-item")]:h}},{["".concat(t,"-inline-collapsed")]:{width:m,["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu ").concat(t,"-submenu-title")]:{["> ".concat(t,"-inline-collapsed-noicon")]:{fontSize:d,textAlign:"center"}}},["> ".concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-submenu > ").concat(t,"-submenu-title,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{insetInlineStart:0,paddingInline:"calc(50% - ".concat((0,R.bf)(e.calc(d).div(2).equal())," - ").concat((0,R.bf)(s),")"),textOverflow:"clip",["\n ".concat(t,"-submenu-arrow,\n ").concat(t,"-submenu-expand-icon\n ")]:{opacity:0},["".concat(t,"-item-icon, ").concat(n)]:{margin:0,fontSize:v,lineHeight:(0,R.bf)(o),"+ span":{display:"inline-block",opacity:0}}},["".concat(t,"-item-icon, ").concat(n)]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",["".concat(t,"-item-icon, ").concat(n)]:{display:"none"},"a, a:hover":{color:r}},["".concat(t,"-item-group-title")]:Object.assign(Object.assign({},I.vS),{paddingInline:g})}}]};let F=e=>{let{componentCls:t,motionDurationSlow:n,motionDurationMid:o,motionEaseInOut:r,motionEaseOut:l,iconCls:a,iconSize:i,iconMarginInlineEnd:c}=e;return{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:["border-color ".concat(n),"background ".concat(n),"padding ".concat(n," ").concat(r)].join(","),["".concat(t,"-item-icon, ").concat(a)]:{minWidth:i,fontSize:i,transition:["font-size ".concat(o," ").concat(l),"margin ".concat(n," ").concat(r),"color ".concat(n)].join(","),"+ span":{marginInlineStart:c,opacity:1,transition:["opacity ".concat(n," ").concat(r),"margin ".concat(n),"color ".concat(n)].join(",")}},["".concat(t,"-item-icon")]:Object.assign({},(0,I.Ro)()),["&".concat(t,"-item-only-child")]:{["> ".concat(a,", > ").concat(t,"-item-icon")]:{marginInlineEnd:0}}},["".concat(t,"-item-disabled, ").concat(t,"-submenu-disabled")]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},["> ".concat(t,"-submenu-title")]:{color:"inherit !important",cursor:"not-allowed"}}}},D=e=>{let{componentCls:t,motionDurationSlow:n,motionEaseInOut:o,borderRadius:r,menuArrowSize:l,menuArrowOffset:a}=e;return{["".concat(t,"-submenu")]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:l,color:"currentcolor",transform:"translateY(-50%)",transition:"transform ".concat(n," ").concat(o,", opacity ").concat(n)},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(l).mul(.6).equal(),height:e.calc(l).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:r,transition:["background ".concat(n," ").concat(o),"transform ".concat(n," ").concat(o),"top ".concat(n," ").concat(o),"color ".concat(n," ").concat(o)].join(","),content:'""'},"&::before":{transform:"rotate(45deg) translateY(".concat((0,R.bf)(e.calc(a).mul(-1).equal()),")")},"&::after":{transform:"rotate(-45deg) translateY(".concat((0,R.bf)(a),")")}}}}},z=e=>{let{antCls:t,componentCls:n,fontSize:o,motionDurationSlow:r,motionDurationMid:l,motionEaseInOut:a,paddingXS:i,padding:c,colorSplit:u,lineWidth:s,zIndexPopup:d,borderRadiusLG:f,subMenuItemBorderRadius:g,menuArrowSize:p,menuArrowOffset:m,lineType:v,menuPanelMaskInset:h,groupTitleLineHeight:b,groupTitleFontSize:C}=e;return[{"":{["".concat(n)]:Object.assign(Object.assign({},(0,I.dF)()),{"&-hidden":{display:"none"}})},["".concat(n,"-submenu-hidden")]:{display:"none"}},{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,I.Wf)(e)),(0,I.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:o,lineHeight:0,listStyle:"none",outline:"none",transition:"width ".concat(r," cubic-bezier(0.2, 0, 0, 1) 0s"),"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",["".concat(n,"-item")]:{flex:"none"}},["".concat(n,"-item, ").concat(n,"-submenu, ").concat(n,"-submenu-title")]:{borderRadius:e.itemBorderRadius},["".concat(n,"-item-group-title")]:{padding:"".concat((0,R.bf)(i)," ").concat((0,R.bf)(c)),fontSize:C,lineHeight:b,transition:"all ".concat(r)},["&-horizontal ".concat(n,"-submenu")]:{transition:["border-color ".concat(r," ").concat(a),"background ".concat(r," ").concat(a)].join(",")},["".concat(n,"-submenu, ").concat(n,"-submenu-inline")]:{transition:["border-color ".concat(r," ").concat(a),"background ".concat(r," ").concat(a),"padding ".concat(l," ").concat(a)].join(",")},["".concat(n,"-submenu ").concat(n,"-sub")]:{cursor:"initial",transition:["background ".concat(r," ").concat(a),"padding ".concat(r," ").concat(a)].join(",")},["".concat(n,"-title-content")]:{transition:"color ".concat(r),["> ".concat(t,"-typography-ellipsis-single-line")]:{display:"inline",verticalAlign:"unset"}},["".concat(n,"-item a")]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},["".concat(n,"-item-divider")]:{overflow:"hidden",lineHeight:0,borderColor:u,borderStyle:v,borderWidth:0,borderTopWidth:s,marginBlock:s,padding:0,"&-dashed":{borderStyle:"dashed"}}}),F(e)),{["".concat(n,"-item-group")]:{["".concat(n,"-item-group-list")]:{margin:0,padding:0,["".concat(n,"-item, ").concat(n,"-submenu-title")]:{paddingInline:"".concat((0,R.bf)(e.calc(o).mul(2).equal())," ").concat((0,R.bf)(c))}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:d,borderRadius:f,boxShadow:"none",transformOrigin:"0 0",["&".concat(n,"-submenu")]:{background:"transparent"},"&::before":{position:"absolute",inset:"".concat((0,R.bf)(h)," 0 0"),zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:h},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS},["> ".concat(n)]:Object.assign(Object.assign(Object.assign({borderRadius:f},F(e)),D(e)),{["".concat(n,"-item, ").concat(n,"-submenu > ").concat(n,"-submenu-title")]:{borderRadius:g},["".concat(n,"-submenu-title::after")]:{transition:"transform ".concat(r," ").concat(a)}})}}),D(e)),{["&-inline-collapsed ".concat(n,"-submenu-arrow,\n &-inline ").concat(n,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateX(".concat((0,R.bf)(m),")")},"&::after":{transform:"rotate(45deg) translateX(".concat((0,R.bf)(e.calc(m).mul(-1).equal()),")")}},["".concat(n,"-submenu-open").concat(n,"-submenu-inline > ").concat(n,"-submenu-title > ").concat(n,"-submenu-arrow")]:{transform:"translateY(".concat((0,R.bf)(e.calc(p).mul(.2).mul(-1).equal()),")"),"&::after":{transform:"rotate(-45deg) translateX(".concat((0,R.bf)(e.calc(m).mul(-1).equal()),")")},"&::before":{transform:"rotate(45deg) translateX(".concat((0,R.bf)(m),")")}}})},{["".concat(t,"-layout-header")]:{[n]:{lineHeight:"inherit"}}}]},H=e=>{var t,n,o;let{colorPrimary:r,colorError:l,colorTextDisabled:a,colorErrorBg:i,colorText:c,colorTextDescription:u,colorBgContainer:s,colorFillAlter:d,colorFillContent:f,lineWidth:g,lineWidthBold:p,controlItemBgActive:m,colorBgTextHover:v,controlHeightLG:h,lineHeight:b,colorBgElevated:C,marginXXS:y,padding:w,fontSize:S,controlHeightSM:E,fontSizeLG:R,colorTextLightSolid:I,colorErrorHover:O}=e,P=null!==(t=e.activeBarWidth)&&void 0!==t?t:0,M=null!==(n=e.activeBarBorderWidth)&&void 0!==n?n:g,Z=null!==(o=e.itemMarginInline)&&void 0!==o?o:e.marginXXS,N=new x.C(I).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:c,itemColor:c,colorItemTextHover:c,itemHoverColor:c,colorItemTextHoverHorizontal:r,horizontalItemHoverColor:r,colorGroupTitle:u,groupTitleColor:u,colorItemTextSelected:r,itemSelectedColor:r,colorItemTextSelectedHorizontal:r,horizontalItemSelectedColor:r,colorItemBg:s,itemBg:s,colorItemBgHover:v,itemHoverBg:v,colorItemBgActive:f,itemActiveBg:m,colorSubItemBg:d,subMenuItemBg:d,colorItemBgSelected:m,itemSelectedBg:m,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:P,colorActiveBarHeight:p,activeBarHeight:p,colorActiveBarBorderSize:g,activeBarBorderWidth:M,colorItemTextDisabled:a,itemDisabledColor:a,colorDangerItemText:l,dangerItemColor:l,colorDangerItemTextHover:l,dangerItemHoverColor:l,colorDangerItemTextSelected:l,dangerItemSelectedColor:l,colorDangerItemBgActive:i,dangerItemActiveBg:i,colorDangerItemBgSelected:i,dangerItemSelectedBg:i,itemMarginInline:Z,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:h,groupTitleLineHeight:b,collapsedWidth:2*h,popupBg:C,itemMarginBlock:y,itemPaddingInline:w,horizontalLineHeight:"".concat(1.15*h,"px"),iconSize:S,iconMarginInlineEnd:E-S,collapsedIconSize:R,groupTitleFontSize:S,darkItemDisabledColor:new x.C(I).setAlpha(.25).toRgbString(),darkItemColor:N,darkDangerItemColor:l,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:I,darkItemSelectedBg:r,darkDangerItemSelectedBg:l,darkItemHoverBg:"transparent",darkGroupTitleColor:N,darkItemHoverColor:I,darkDangerItemHoverColor:O,darkDangerItemSelectedColor:I,darkDangerItemActiveBg:l,itemWidth:P?"calc(100% + ".concat(M,"px)"):"calc(100% - ".concat(2*Z,"px)")}};var B=n(64024),V=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let G=(0,o.forwardRef)((e,t)=>{var n,l;let i;let p=o.useContext(E.Z),v=p||{},{getPrefixCls:h,getPopupContainer:y,direction:R,menu:x}=o.useContext(g.E_),I=h(),{prefixCls:T,className:A,style:F,theme:D="light",expandIcon:G,_internalDisableMenuItemTitleTooltip:W,inlineCollapsed:K,siderCollapsed:U,items:X,children:q,rootClassName:Y,mode:$,selectable:Q,onClick:J,overflowedIndicatorPopupClassName:ee}=e,et=V(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),en=(0,s.Z)(et,["collapsedWidth"]),eo=o.useMemo(()=>X?function e(t){return(t||[]).map((t,n)=>{if(t&&"object"==typeof t){let{label:l,children:a,key:i,type:c}=t,u=S(t,["label","children","key","type"]),s=null!=i?i:"tmp-".concat(n);return a||"group"===c?"group"===c?o.createElement(r.BW,Object.assign({key:s},u,{title:l}),e(a)):o.createElement(w,Object.assign({key:s},u,{title:l}),e(a)):"divider"===c?o.createElement(m,Object.assign({key:s},u)):o.createElement(C,Object.assign({key:s},u),l)}return null}).filter(e=>e)}(X):X,[X])||q;null===(n=v.validator)||void 0===n||n.call(v,{mode:$});let er=(0,u.zX)(function(){var e;null==J||J.apply(void 0,arguments),null===(e=v.onClick)||void 0===e||e.call(v)}),el=v.mode||$,ea=null!=Q?Q:v.selectable,ei=o.useMemo(()=>void 0!==U?U:K,[K,U]),ec={horizontal:{motionName:"".concat(I,"-slide-up")},inline:(0,d.Z)(I),other:{motionName:"".concat(I,"-zoom-big")}},eu=h("menu",T||v.prefixCls),es=(0,B.Z)(eu),[ed,ef,eg]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return(0,Z.I$)("Menu",e=>{let{colorBgElevated:t,colorPrimary:n,colorTextLightSolid:o,controlHeightLG:r,fontSize:l,darkItemColor:a,darkDangerItemColor:i,darkItemBg:c,darkSubMenuItemBg:u,darkItemSelectedColor:s,darkItemSelectedBg:d,darkDangerItemSelectedBg:f,darkItemHoverBg:g,darkGroupTitleColor:p,darkItemHoverColor:m,darkItemDisabledColor:v,darkDangerItemHoverColor:h,darkDangerItemSelectedColor:b,darkDangerItemActiveBg:C,popupBg:y,darkPopupBg:w}=e,S=e.calc(l).div(7).mul(5).equal(),E=(0,N.TS)(e,{menuArrowSize:S,menuHorizontalHeight:e.calc(r).mul(1.15).equal(),menuArrowOffset:e.calc(S).mul(.25).equal(),menuPanelMaskInset:-7,menuSubMenuBg:t,calc:e.calc,popupBg:y}),R=(0,N.TS)(E,{itemColor:a,itemHoverColor:m,groupTitleColor:p,itemSelectedColor:s,itemBg:c,popupBg:w,subMenuItemBg:u,itemActiveBg:"transparent",itemSelectedBg:d,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:g,itemDisabledColor:v,dangerItemColor:i,dangerItemHoverColor:h,dangerItemSelectedColor:b,dangerItemActiveBg:C,dangerItemSelectedBg:f,menuSubMenuBg:u,horizontalItemSelectedColor:o,horizontalItemSelectedBg:n});return[z(E),k(E),L(E),j(E,"light"),j(R,"dark"),_(E),(0,O.Z)(E),(0,P.oN)(E,"slide-up"),(0,P.oN)(E,"slide-down"),(0,M._y)(E,"zoom-big")]},H,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:n,unitless:{groupTitleLineHeight:!0}})(e,t)}(eu,es,!p),ep=c()("".concat(eu,"-").concat(D),null==x?void 0:x.className,A);if("function"==typeof G)i=G;else if(null===G||!1===G)i=null;else if(null===v.expandIcon||!1===v.expandIcon)i=null;else{let e=null!=G?G:v.expandIcon;i=(0,f.Tm)(e,{className:c()("".concat(eu,"-submenu-expand-icon"),(0,f.l$)(e)?null===(l=e.props)||void 0===l?void 0:l.className:"")})}let em=o.useMemo(()=>({prefixCls:eu,inlineCollapsed:ei||!1,direction:R,firstLevel:!0,theme:D,mode:el,disableMenuItemTitleTooltip:W}),[eu,ei,R,W,D]);return ed(o.createElement(E.Z.Provider,{value:null},o.createElement(b.Provider,{value:em},o.createElement(r.ZP,Object.assign({getPopupContainer:y,overflowedIndicator:o.createElement(a.Z,null),overflowedIndicatorPopupClassName:c()(eu,"".concat(eu,"-").concat(D),ee),mode:el,selectable:ea,onClick:er},en,{inlineCollapsed:ei,style:Object.assign(Object.assign({},null==x?void 0:x.style),F),className:ep,prefixCls:eu,direction:R,defaultMotions:ec,expandIcon:i,ref:t,rootClassName:c()(Y,ef,v.rootClassName,eg,es)}),eo))))}),W=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null),r=o.useContext(l.D);return(0,o.useImperativeHandle)(t,()=>({menu:n.current,focus:e=>{var t;null===(t=n.current)||void 0===t||t.focus(e)}})),o.createElement(G,Object.assign({ref:n},e,r))});W.Item=C,W.SubMenu=w,W.Divider=m,W.ItemGroup=r.BW;var K=W},91679:function(e,t,n){let o;n.d(t,{Z:function(){return eX}});var r=n(83145),l=n(2265),a=n(18404),i=n(71744),c=n(13959),u=n(8900),s=n(39725),d=n(54537),f=n(55726),g=n(36760),p=n.n(g),m=n(62236),v=n(68710),h=n(55274),b=n(29961),C=n(69819),y=n(73002),w=n(51248),S=e=>{let{type:t,children:n,prefixCls:o,buttonProps:r,close:a,autoFocus:i,emitEvent:c,isSilent:u,quitOnNullishReturnValue:s,actionFn:d}=e,f=l.useRef(!1),g=l.useRef(null),[p,m]=(0,C.Z)(!1),v=function(){null==a||a.apply(void 0,arguments)};l.useEffect(()=>{let e=null;return i&&(e=setTimeout(()=>{var e;null===(e=g.current)||void 0===e||e.focus()})),()=>{e&&clearTimeout(e)}},[]);let h=e=>{e&&e.then&&(m(!0),e.then(function(){m(!1,!0),v.apply(void 0,arguments),f.current=!1},e=>{if(m(!1,!0),f.current=!1,null==u||!u())return Promise.reject(e)}))};return l.createElement(y.ZP,Object.assign({},(0,w.nx)(t),{onClick:e=>{let t;if(!f.current){if(f.current=!0,!d){v();return}if(c){var n;if(t=d(e),s&&!((n=t)&&n.then)){f.current=!1,v(e);return}}else if(d.length)t=d(a),f.current=!1;else if(!(t=d())){v();return}h(t)}},loading:p,prefixCls:o},r,{ref:g}),n)};let E=l.createContext({}),{Provider:R}=E;var x=()=>{let{autoFocusButton:e,cancelButtonProps:t,cancelTextLocale:n,isSilent:o,mergedOkCancel:r,rootPrefixCls:a,close:i,onCancel:c,onConfirm:u}=(0,l.useContext)(E);return r?l.createElement(S,{isSilent:o,actionFn:c,close:function(){null==i||i.apply(void 0,arguments),null==u||u(!1)},autoFocus:"cancel"===e,buttonProps:t,prefixCls:"".concat(a,"-btn")},n):null},I=()=>{let{autoFocusButton:e,close:t,isSilent:n,okButtonProps:o,rootPrefixCls:r,okTextLocale:a,okType:i,onConfirm:c,onOk:u}=(0,l.useContext)(E);return l.createElement(S,{isSilent:n,type:i||"primary",actionFn:u,close:function(){null==t||t.apply(void 0,arguments),null==c||c(!0)},autoFocus:"ok"===e,buttonProps:o,prefixCls:"".concat(r,"-btn")},a)},O=n(49638),P=n(1119),M=n(26365),Z=n(28036),N=l.createContext({}),k=n(31686),_=n(2161),T=n(92491),j=n(95814),A=n(18242);function L(e,t,n){var o=t;return!o&&n&&(o="".concat(e,"-").concat(n)),o}function F(e,t){var n=e["page".concat(t?"Y":"X","Offset")],o="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}var D=n(47970),z=n(28791),H=l.memo(function(e){return e.children},function(e,t){return!t.shouldUpdate}),B={width:0,height:0,overflow:"hidden",outline:"none"},V=l.forwardRef(function(e,t){var n,o,r,a=e.prefixCls,i=e.className,c=e.style,u=e.title,s=e.ariaId,d=e.footer,f=e.closable,g=e.closeIcon,m=e.onClose,v=e.children,h=e.bodyStyle,b=e.bodyProps,C=e.modalRender,y=e.onMouseDown,w=e.onMouseUp,S=e.holderRef,E=e.visible,R=e.forceRender,x=e.width,I=e.height,O=e.classNames,M=e.styles,Z=l.useContext(N).panel,_=(0,z.x1)(S,Z),T=(0,l.useRef)(),j=(0,l.useRef)();l.useImperativeHandle(t,function(){return{focus:function(){var e;null===(e=T.current)||void 0===e||e.focus()},changeActive:function(e){var t=document.activeElement;e&&t===j.current?T.current.focus():e||t!==T.current||j.current.focus()}}});var A={};void 0!==x&&(A.width=x),void 0!==I&&(A.height=I),d&&(n=l.createElement("div",{className:p()("".concat(a,"-footer"),null==O?void 0:O.footer),style:(0,k.Z)({},null==M?void 0:M.footer)},d)),u&&(o=l.createElement("div",{className:p()("".concat(a,"-header"),null==O?void 0:O.header),style:(0,k.Z)({},null==M?void 0:M.header)},l.createElement("div",{className:"".concat(a,"-title"),id:s},u))),f&&(r=l.createElement("button",{type:"button",onClick:m,"aria-label":"Close",className:"".concat(a,"-close")},g||l.createElement("span",{className:"".concat(a,"-close-x")})));var L=l.createElement("div",{className:p()("".concat(a,"-content"),null==O?void 0:O.content),style:null==M?void 0:M.content},r,o,l.createElement("div",(0,P.Z)({className:p()("".concat(a,"-body"),null==O?void 0:O.body),style:(0,k.Z)((0,k.Z)({},h),null==M?void 0:M.body)},b),v),n);return l.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":u?s:null,"aria-modal":"true",ref:_,style:(0,k.Z)((0,k.Z)({},c),A),className:p()(a,i),onMouseDown:y,onMouseUp:w},l.createElement("div",{tabIndex:0,ref:T,style:B,"aria-hidden":"true"}),l.createElement(H,{shouldUpdate:E||R},C?C(L):L),l.createElement("div",{tabIndex:0,ref:j,style:B,"aria-hidden":"true"}))}),G=l.forwardRef(function(e,t){var n=e.prefixCls,o=e.title,r=e.style,a=e.className,i=e.visible,c=e.forceRender,u=e.destroyOnClose,s=e.motionName,d=e.ariaId,f=e.onVisibleChanged,g=e.mousePosition,m=(0,l.useRef)(),v=l.useState(),h=(0,M.Z)(v,2),b=h[0],C=h[1],y={};function w(){var e,t,n,o,r,l=(n={left:(t=(e=m.current).getBoundingClientRect()).left,top:t.top},r=(o=e.ownerDocument).defaultView||o.parentWindow,n.left+=F(r),n.top+=F(r,!0),n);C(g?"".concat(g.x-l.left,"px ").concat(g.y-l.top,"px"):"")}return b&&(y.transformOrigin=b),l.createElement(D.ZP,{visible:i,onVisibleChanged:f,onAppearPrepare:w,onEnterPrepare:w,forceRender:c,motionName:s,removeOnLeave:u,ref:m},function(i,c){var u=i.className,s=i.style;return l.createElement(V,(0,P.Z)({},e,{ref:t,title:o,ariaId:d,prefixCls:n,holderRef:c,style:(0,k.Z)((0,k.Z)((0,k.Z)({},s),r),y),className:p()(a,u)}))})});function W(e){var t=e.prefixCls,n=e.style,o=e.visible,r=e.maskProps,a=e.motionName,i=e.className;return l.createElement(D.ZP,{key:"mask",visible:o,motionName:a,leavedClassName:"".concat(t,"-mask-hidden")},function(e,o){var a=e.className,c=e.style;return l.createElement("div",(0,P.Z)({ref:o,style:(0,k.Z)((0,k.Z)({},c),n),className:p()("".concat(t,"-mask"),a,i)},r))})}function K(e){var t=e.prefixCls,n=void 0===t?"rc-dialog":t,o=e.zIndex,r=e.visible,a=void 0!==r&&r,i=e.keyboard,c=void 0===i||i,u=e.focusTriggerAfterClose,s=void 0===u||u,d=e.wrapStyle,f=e.wrapClassName,g=e.wrapProps,m=e.onClose,v=e.afterOpenChange,h=e.afterClose,b=e.transitionName,C=e.animation,y=e.closable,w=e.mask,S=void 0===w||w,E=e.maskTransitionName,R=e.maskAnimation,x=e.maskClosable,I=e.maskStyle,O=e.maskProps,Z=e.rootClassName,N=e.classNames,F=e.styles,D=(0,l.useRef)(),z=(0,l.useRef)(),H=(0,l.useRef)(),B=l.useState(a),V=(0,M.Z)(B,2),K=V[0],U=V[1],X=(0,T.Z)();function q(e){null==m||m(e)}var Y=(0,l.useRef)(!1),$=(0,l.useRef)(),Q=null;return(void 0===x||x)&&(Q=function(e){Y.current?Y.current=!1:z.current===e.target&&q(e)}),(0,l.useEffect)(function(){a&&(U(!0),(0,_.Z)(z.current,document.activeElement)||(D.current=document.activeElement))},[a]),(0,l.useEffect)(function(){return function(){clearTimeout($.current)}},[]),l.createElement("div",(0,P.Z)({className:p()("".concat(n,"-root"),Z)},(0,A.Z)(e,{data:!0})),l.createElement(W,{prefixCls:n,visible:S&&a,motionName:L(n,E,R),style:(0,k.Z)((0,k.Z)({zIndex:o},I),null==F?void 0:F.mask),maskProps:O,className:null==N?void 0:N.mask}),l.createElement("div",(0,P.Z)({tabIndex:-1,onKeyDown:function(e){if(c&&e.keyCode===j.Z.ESC){e.stopPropagation(),q(e);return}a&&e.keyCode===j.Z.TAB&&H.current.changeActive(!e.shiftKey)},className:p()("".concat(n,"-wrap"),f,null==N?void 0:N.wrapper),ref:z,onClick:Q,style:(0,k.Z)((0,k.Z)((0,k.Z)({zIndex:o},d),null==F?void 0:F.wrapper),{},{display:K?null:"none"})},g),l.createElement(G,(0,P.Z)({},e,{onMouseDown:function(){clearTimeout($.current),Y.current=!0},onMouseUp:function(){$.current=setTimeout(function(){Y.current=!1})},ref:H,closable:void 0===y||y,ariaId:X,prefixCls:n,visible:a&&K,onClose:q,onVisibleChanged:function(e){if(e)!function(){if(!(0,_.Z)(z.current,document.activeElement)){var e;null===(e=H.current)||void 0===e||e.focus()}}();else{if(U(!1),S&&D.current&&s){try{D.current.focus({preventScroll:!0})}catch(e){}D.current=null}K&&(null==h||h())}null==v||v(e)},motionName:L(n,b,C)}))))}G.displayName="Content",n(32559);var U=function(e){var t=e.visible,n=e.getContainer,o=e.forceRender,r=e.destroyOnClose,a=void 0!==r&&r,i=e.afterClose,c=e.panelRef,u=l.useState(t),s=(0,M.Z)(u,2),d=s[0],f=s[1],g=l.useMemo(function(){return{panel:c}},[c]);return(l.useEffect(function(){t&&f(!0)},[t]),o||!a||d)?l.createElement(N.Provider,{value:g},l.createElement(Z.Z,{open:t||o||d,autoDestroy:!1,getContainer:n,autoLock:t||d},l.createElement(K,(0,P.Z)({},e,{destroyOnClose:a,afterClose:function(){null==i||i(),f(!1)}})))):null};U.displayName="Dialog";var X=n(53445),q=n(94981),Y=n(95140),$=n(39109),Q=n(65658),J=n(74126);function ee(){}let et=l.createContext({add:ee,remove:ee});var en=n(86586),eo=()=>{let{cancelButtonProps:e,cancelTextLocale:t,onCancel:n}=(0,l.useContext)(E);return l.createElement(y.ZP,Object.assign({onClick:n},e),t)},er=()=>{let{confirmLoading:e,okButtonProps:t,okType:n,okTextLocale:o,onOk:r}=(0,l.useContext)(E);return l.createElement(y.ZP,Object.assign({},(0,w.nx)(n),{loading:e,onClick:r},t),o)},el=n(92246);function ea(e,t){return l.createElement("span",{className:"".concat(e,"-close-x")},t||l.createElement(O.Z,{className:"".concat(e,"-close-icon")}))}let ei=e=>{let t;let{okText:n,okType:o="primary",cancelText:a,confirmLoading:i,onOk:c,onCancel:u,okButtonProps:s,cancelButtonProps:d,footer:f}=e,[g]=(0,h.Z)("Modal",(0,el.A)()),p={confirmLoading:i,okButtonProps:s,cancelButtonProps:d,okTextLocale:n||(null==g?void 0:g.okText),cancelTextLocale:a||(null==g?void 0:g.cancelText),okType:o,onOk:c,onCancel:u},m=l.useMemo(()=>p,(0,r.Z)(Object.values(p)));return"function"==typeof f||void 0===f?(t=l.createElement(l.Fragment,null,l.createElement(eo,null),l.createElement(er,null)),"function"==typeof f&&(t=f(t,{OkBtn:er,CancelBtn:eo})),t=l.createElement(R,{value:m},t)):t=f,l.createElement(en.n,{disabled:!1},t)};var ec=n(12918),eu=n(11699),es=n(691),ed=n(3104),ef=n(80669),eg=n(352);function ep(e){return{position:e,inset:0}}let em=e=>{let{componentCls:t,antCls:n}=e;return[{["".concat(t,"-root")]:{["".concat(t).concat(n,"-zoom-enter, ").concat(t).concat(n,"-zoom-appear")]:{transform:"none",opacity:0,animationDuration:e.motionDurationSlow,userSelect:"none"},["".concat(t).concat(n,"-zoom-leave ").concat(t,"-content")]:{pointerEvents:"none"},["".concat(t,"-mask")]:Object.assign(Object.assign({},ep("fixed")),{zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask,pointerEvents:"none",["".concat(t,"-hidden")]:{display:"none"}}),["".concat(t,"-wrap")]:Object.assign(Object.assign({},ep("fixed")),{zIndex:e.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch",["&:has(".concat(t).concat(n,"-zoom-enter), &:has(").concat(t).concat(n,"-zoom-appear)")]:{pointerEvents:"none"}})}},{["".concat(t,"-root")]:(0,eu.J$)(e)}]},ev=e=>{let{componentCls:t}=e;return[{["".concat(t,"-root")]:{["".concat(t,"-wrap-rtl")]:{direction:"rtl"},["".concat(t,"-centered")]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[t]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},["@media (max-width: ".concat(e.screenSMMax,"px)")]:{[t]:{maxWidth:"calc(100vw - 16px)",margin:"".concat((0,eg.bf)(e.marginXS)," auto")},["".concat(t,"-centered")]:{[t]:{flex:1}}}}},{[t]:Object.assign(Object.assign({},(0,ec.Wf)(e)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:"calc(100vw - ".concat((0,eg.bf)(e.calc(e.margin).mul(2).equal()),")"),margin:"0 auto",paddingBottom:e.paddingLG,["".concat(t,"-title")]:{margin:0,color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.titleFontSize,lineHeight:e.titleLineHeight,wordWrap:"break-word"},["".concat(t,"-content")]:{position:"relative",backgroundColor:e.contentBg,backgroundClip:"padding-box",border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadow,pointerEvents:"auto",padding:e.contentPadding},["".concat(t,"-close")]:Object.assign({position:"absolute",top:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),insetInlineEnd:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),zIndex:e.calc(e.zIndexPopupBase).add(10).equal(),padding:0,color:e.modalCloseIconColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:e.borderRadiusSM,width:e.modalCloseBtnSize,height:e.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:"color ".concat(e.motionDurationMid,", background-color ").concat(e.motionDurationMid),"&-x":{display:"flex",fontSize:e.fontSizeLG,fontStyle:"normal",lineHeight:"".concat((0,eg.bf)(e.modalCloseBtnSize)),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:e.modalIconHoverColor,backgroundColor:e.closeBtnHoverBg,textDecoration:"none"},"&:active":{backgroundColor:e.closeBtnActiveBg}},(0,ec.Qy)(e)),["".concat(t,"-header")]:{color:e.colorText,background:e.headerBg,borderRadius:"".concat((0,eg.bf)(e.borderRadiusLG)," ").concat((0,eg.bf)(e.borderRadiusLG)," 0 0"),marginBottom:e.headerMarginBottom,padding:e.headerPadding,borderBottom:e.headerBorderBottom},["".concat(t,"-body")]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:"break-word",padding:e.bodyPadding},["".concat(t,"-footer")]:{textAlign:"end",background:e.footerBg,marginTop:e.footerMarginTop,padding:e.footerPadding,borderTop:e.footerBorderTop,borderRadius:e.footerBorderRadius,["> ".concat(e.antCls,"-btn + ").concat(e.antCls,"-btn")]:{marginInlineStart:e.marginXS}},["".concat(t,"-open")]:{overflow:"hidden"}})},{["".concat(t,"-pure-panel")]:{top:"auto",padding:0,display:"flex",flexDirection:"column",["".concat(t,"-content,\n ").concat(t,"-body,\n ").concat(t,"-confirm-body-wrapper")]:{display:"flex",flexDirection:"column",flex:"auto"},["".concat(t,"-confirm-body")]:{marginBottom:"auto"}}}]},eh=e=>{let{componentCls:t}=e;return{["".concat(t,"-root")]:{["".concat(t,"-wrap-rtl")]:{direction:"rtl",["".concat(t,"-confirm-body")]:{direction:"rtl"}}}}},eb=e=>{let t=e.padding,n=e.fontSizeHeading5,o=e.lineHeightHeading5;return(0,ed.TS)(e,{modalHeaderHeight:e.calc(e.calc(o).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalIconHoverColor:e.colorIconHover,modalCloseIconColor:e.colorIcon,modalCloseBtnSize:e.fontHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},eC=e=>({footerBg:"transparent",headerBg:e.colorBgElevated,titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,closeBtnHoverBg:e.wireframe?"transparent":e.colorFillContent,closeBtnActiveBg:e.wireframe?"transparent":e.colorFillContentHover,contentPadding:e.wireframe?0:"".concat((0,eg.bf)(e.paddingMD)," ").concat((0,eg.bf)(e.paddingContentHorizontalLG)),headerPadding:e.wireframe?"".concat((0,eg.bf)(e.padding)," ").concat((0,eg.bf)(e.paddingLG)):0,headerBorderBottom:e.wireframe?"".concat((0,eg.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit):"none",headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?"".concat((0,eg.bf)(e.paddingXS)," ").concat((0,eg.bf)(e.padding)):0,footerBorderTop:e.wireframe?"".concat((0,eg.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit):"none",footerBorderRadius:e.wireframe?"0 0 ".concat((0,eg.bf)(e.borderRadiusLG)," ").concat((0,eg.bf)(e.borderRadiusLG)):0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?"".concat((0,eg.bf)(2*e.padding)," ").concat((0,eg.bf)(2*e.padding)," ").concat((0,eg.bf)(e.paddingLG)):0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM});var ey=(0,ef.I$)("Modal",e=>{let t=eb(e);return[ev(t),eh(t),em(t),(0,es._y)(t,"zoom")]},eC,{unitless:{titleLineHeight:!0}}),ew=n(64024),eS=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};(0,q.Z)()&&window.document.documentElement&&document.documentElement.addEventListener("click",e=>{o={x:e.pageX,y:e.pageY},setTimeout(()=>{o=null},100)},!0);var eE=e=>{var t;let{getPopupContainer:n,getPrefixCls:r,direction:a,modal:c}=l.useContext(i.E_),u=t=>{let{onCancel:n}=e;null==n||n(t)},{prefixCls:s,className:d,rootClassName:f,open:g,wrapClassName:h,centered:b,getContainer:C,closeIcon:y,closable:w,focusTriggerAfterClose:S=!0,style:E,visible:R,width:x=520,footer:I,classNames:P,styles:M}=e,Z=eS(e,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","closeIcon","closable","focusTriggerAfterClose","style","visible","width","footer","classNames","styles"]),N=r("modal",s),k=r(),_=(0,ew.Z)(N),[T,j,A]=ey(N,_),L=p()(h,{["".concat(N,"-centered")]:!!b,["".concat(N,"-wrap-rtl")]:"rtl"===a}),F=null!==I&&l.createElement(ei,Object.assign({},e,{onOk:t=>{let{onOk:n}=e;null==n||n(t)},onCancel:u})),[D,z]=(0,X.Z)(w,y,e=>ea(N,e),l.createElement(O.Z,{className:"".concat(N,"-close-icon")}),!0),H=function(e){let t=l.useContext(et),n=l.useRef();return(0,J.zX)(o=>{if(o){let r=e?o.querySelector(e):o;t.add(r),n.current=r}else t.remove(n.current)})}(".".concat(N,"-content")),[B,V]=(0,m.Cn)("Modal",Z.zIndex);return T(l.createElement(Q.BR,null,l.createElement($.Ux,{status:!0,override:!0},l.createElement(Y.Z.Provider,{value:V},l.createElement(U,Object.assign({width:x},Z,{zIndex:B,getContainer:void 0===C?n:C,prefixCls:N,rootClassName:p()(j,f,A,_),footer:F,visible:null!=g?g:R,mousePosition:null!==(t=Z.mousePosition)&&void 0!==t?t:o,onClose:u,closable:D,closeIcon:z,focusTriggerAfterClose:S,transitionName:(0,v.m)(k,"zoom",e.transitionName),maskTransitionName:(0,v.m)(k,"fade",e.maskTransitionName),className:p()(j,d,null==c?void 0:c.className),style:Object.assign(Object.assign({},null==c?void 0:c.style),E),classNames:Object.assign(Object.assign({wrapper:L},null==c?void 0:c.classNames),P),styles:Object.assign(Object.assign({},null==c?void 0:c.styles),M),panelRef:H}))))))};let eR=e=>{let{componentCls:t,titleFontSize:n,titleLineHeight:o,modalConfirmIconSize:r,fontSize:l,lineHeight:a,modalTitleHeight:i,fontHeight:c,confirmBodyPadding:u}=e,s="".concat(t,"-confirm");return{[s]:{"&-rtl":{direction:"rtl"},["".concat(e.antCls,"-modal-header")]:{display:"none"},["".concat(s,"-body-wrapper")]:Object.assign({},(0,ec.dF)()),["&".concat(t," ").concat(t,"-body")]:{padding:u},["".concat(s,"-body")]:{display:"flex",flexWrap:"nowrap",alignItems:"start",["> ".concat(e.iconCls)]:{flex:"none",fontSize:r,marginInlineEnd:e.confirmIconMarginInlineEnd,marginTop:e.calc(e.calc(c).sub(r).equal()).div(2).equal()},["&-has-title > ".concat(e.iconCls)]:{marginTop:e.calc(e.calc(i).sub(r).equal()).div(2).equal()}},["".concat(s,"-paragraph")]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:e.marginXS,maxWidth:"calc(100% - ".concat((0,eg.bf)(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal()),")")},["".concat(s,"-title")]:{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:n,lineHeight:o},["".concat(s,"-content")]:{color:e.colorText,fontSize:l,lineHeight:a},["".concat(s,"-btns")]:{textAlign:"end",marginTop:e.confirmBtnsMarginTop,["".concat(e.antCls,"-btn + ").concat(e.antCls,"-btn")]:{marginBottom:0,marginInlineStart:e.marginXS}}},["".concat(s,"-error ").concat(s,"-body > ").concat(e.iconCls)]:{color:e.colorError},["".concat(s,"-warning ").concat(s,"-body > ").concat(e.iconCls,",\n ").concat(s,"-confirm ").concat(s,"-body > ").concat(e.iconCls)]:{color:e.colorWarning},["".concat(s,"-info ").concat(s,"-body > ").concat(e.iconCls)]:{color:e.colorInfo},["".concat(s,"-success ").concat(s,"-body > ").concat(e.iconCls)]:{color:e.colorSuccess}}};var ex=(0,ef.bk)(["Modal","confirm"],e=>[eR(eb(e))],eC,{order:-1e3}),eI=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};function eO(e){let{prefixCls:t,icon:n,okText:o,cancelText:a,confirmPrefixCls:i,type:c,okCancel:g,footer:m,locale:v}=e,b=eI(e,["prefixCls","icon","okText","cancelText","confirmPrefixCls","type","okCancel","footer","locale"]),C=n;if(!n&&null!==n)switch(c){case"info":C=l.createElement(f.Z,null);break;case"success":C=l.createElement(u.Z,null);break;case"error":C=l.createElement(s.Z,null);break;default:C=l.createElement(d.Z,null)}let y=null!=g?g:"confirm"===c,w=null!==e.autoFocusButton&&(e.autoFocusButton||"ok"),[S]=(0,h.Z)("Modal"),E=v||S,O=o||(y?null==E?void 0:E.okText:null==E?void 0:E.justOkText),P=Object.assign({autoFocusButton:w,cancelTextLocale:a||(null==E?void 0:E.cancelText),okTextLocale:O,mergedOkCancel:y},b),M=l.useMemo(()=>P,(0,r.Z)(Object.values(P))),Z=l.createElement(l.Fragment,null,l.createElement(x,null),l.createElement(I,null)),N=void 0!==e.title&&null!==e.title,k="".concat(i,"-body");return l.createElement("div",{className:"".concat(i,"-body-wrapper")},l.createElement("div",{className:p()(k,{["".concat(k,"-has-title")]:N})},C,l.createElement("div",{className:"".concat(i,"-paragraph")},N&&l.createElement("span",{className:"".concat(i,"-title")},e.title),l.createElement("div",{className:"".concat(i,"-content")},e.content))),void 0===m||"function"==typeof m?l.createElement(R,{value:M},l.createElement("div",{className:"".concat(i,"-btns")},"function"==typeof m?m(Z,{OkBtn:I,CancelBtn:x}):Z)):m,l.createElement(ex,{prefixCls:t}))}let eP=e=>{let{close:t,zIndex:n,afterClose:o,open:r,keyboard:a,centered:i,getContainer:c,maskStyle:u,direction:s,prefixCls:d,wrapClassName:f,rootPrefixCls:g,bodyStyle:h,closable:C=!1,closeIcon:y,modalRender:w,focusTriggerAfterClose:S,onConfirm:E,styles:R}=e,x="".concat(d,"-confirm"),I=e.width||416,O=e.style||{},P=void 0===e.mask||e.mask,M=void 0!==e.maskClosable&&e.maskClosable,Z=p()(x,"".concat(x,"-").concat(e.type),{["".concat(x,"-rtl")]:"rtl"===s},e.className),[,N]=(0,b.ZP)(),k=l.useMemo(()=>void 0!==n?n:N.zIndexPopupBase+m.u6,[n,N]);return l.createElement(eE,{prefixCls:d,className:Z,wrapClassName:p()({["".concat(x,"-centered")]:!!e.centered},f),onCancel:()=>{null==t||t({triggerCancel:!0}),null==E||E(!1)},open:r,title:"",footer:null,transitionName:(0,v.m)(g||"","zoom",e.transitionName),maskTransitionName:(0,v.m)(g||"","fade",e.maskTransitionName),mask:P,maskClosable:M,style:O,styles:Object.assign({body:h,mask:u},R),width:I,zIndex:k,afterClose:o,keyboard:a,centered:i,getContainer:c,closable:C,closeIcon:y,modalRender:w,focusTriggerAfterClose:S},l.createElement(eO,Object.assign({},e,{confirmPrefixCls:x})))};var eM=e=>{let{rootPrefixCls:t,iconPrefixCls:n,direction:o,theme:r}=e;return l.createElement(c.ZP,{prefixCls:t,iconPrefixCls:n,direction:o,theme:r},l.createElement(eP,Object.assign({},e)))},eZ=[];let eN="",ek=e=>{var t,n;let{prefixCls:o,getContainer:r,direction:a}=e,c=(0,el.A)(),u=(0,l.useContext)(i.E_),s=eN||u.getPrefixCls(),d=o||"".concat(s,"-modal"),f=r;return!1===f&&(f=void 0),l.createElement(eM,Object.assign({},e,{rootPrefixCls:s,prefixCls:d,iconPrefixCls:u.iconPrefixCls,theme:u.theme,direction:null!=a?a:u.direction,locale:null!==(n=null===(t=u.locale)||void 0===t?void 0:t.Modal)&&void 0!==n?n:c,getContainer:f}))};function e_(e){let t;let n=(0,c.w6)(),o=document.createDocumentFragment(),i=Object.assign(Object.assign({},e),{close:d,open:!0});function u(){for(var t=arguments.length,n=Array(t),l=0;le&&e.triggerCancel);e.onCancel&&i&&e.onCancel.apply(e,[()=>{}].concat((0,r.Z)(n.slice(1))));for(let e=0;e{let t=n.getPrefixCls(void 0,eN),r=n.getIconPrefixCls(),i=n.getTheme(),u=l.createElement(ek,Object.assign({},e));(0,a.s)(l.createElement(c.ZP,{prefixCls:t,iconPrefixCls:r,theme:i},n.holderRender?n.holderRender(u):u),o)})}function d(){for(var t=arguments.length,n=Array(t),o=0;o{"function"==typeof e.afterClose&&e.afterClose(),u.apply(this,n)}})).visible&&delete i.visible,s(i)}return s(i),eZ.push(d),{destroy:d,update:function(e){s(i="function"==typeof e?e(i):Object.assign(Object.assign({},i),e))}}}function eT(e){return Object.assign(Object.assign({},e),{type:"warning"})}function ej(e){return Object.assign(Object.assign({},e),{type:"info"})}function eA(e){return Object.assign(Object.assign({},e),{type:"success"})}function eL(e){return Object.assign(Object.assign({},e),{type:"error"})}function eF(e){return Object.assign(Object.assign({},e),{type:"confirm"})}var eD=n(93942),ez=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},eH=(0,eD.i)(e=>{let{prefixCls:t,className:n,closeIcon:o,closable:r,type:a,title:c,children:u,footer:s}=e,d=ez(e,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:f}=l.useContext(i.E_),g=f(),m=t||f("modal"),v=(0,ew.Z)(g),[h,b,C]=ey(m,v),y="".concat(m,"-confirm"),w={};return w=a?{closable:null!=r&&r,title:"",footer:"",children:l.createElement(eO,Object.assign({},e,{prefixCls:m,confirmPrefixCls:y,rootPrefixCls:g,content:u}))}:{closable:null==r||r,title:c,footer:null!==s&&l.createElement(ei,Object.assign({},e)),children:u},h(l.createElement(V,Object.assign({prefixCls:m,className:p()(b,"".concat(m,"-pure-panel"),a&&y,a&&"".concat(y,"-").concat(a),n,C,v)},d,{closeIcon:ea(m,o),closable:r},w)))}),eB=n(13823),eV=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},eG=l.forwardRef((e,t)=>{var n,{afterClose:o,config:a}=e,c=eV(e,["afterClose","config"]);let[u,s]=l.useState(!0),[d,f]=l.useState(a),{direction:g,getPrefixCls:p}=l.useContext(i.E_),m=p("modal"),v=p(),b=function(){s(!1);for(var e=arguments.length,t=Array(e),n=0;ne&&e.triggerCancel);d.onCancel&&o&&d.onCancel.apply(d,[()=>{}].concat((0,r.Z)(t.slice(1))))};l.useImperativeHandle(t,()=>({destroy:b,update:e=>{f(t=>Object.assign(Object.assign({},t),e))}}));let C=null!==(n=d.okCancel)&&void 0!==n?n:"confirm"===d.type,[y]=(0,h.Z)("Modal",eB.Z.Modal);return l.createElement(eM,Object.assign({prefixCls:m,rootPrefixCls:v},d,{close:b,open:u,afterClose:()=>{var e;o(),null===(e=d.afterClose)||void 0===e||e.call(d)},okText:d.okText||(C?null==y?void 0:y.okText:null==y?void 0:y.justOkText),direction:d.direction||g,cancelText:d.cancelText||(null==y?void 0:y.cancelText)},c))});let eW=0,eK=l.memo(l.forwardRef((e,t)=>{let[n,o]=function(){let[e,t]=l.useState([]);return[e,l.useCallback(e=>(t(t=>[].concat((0,r.Z)(t),[e])),()=>{t(t=>t.filter(t=>t!==e))}),[])]}();return l.useImperativeHandle(t,()=>({patchElement:o}),[]),l.createElement(l.Fragment,null,n)}));function eU(e){return e_(eT(e))}eE.useModal=function(){let e=l.useRef(null),[t,n]=l.useState([]);l.useEffect(()=>{t.length&&((0,r.Z)(t).forEach(e=>{e()}),n([]))},[t]);let o=l.useCallback(t=>function(o){var a;let i,c;eW+=1;let u=l.createRef(),s=new Promise(e=>{i=e}),d=!1,f=l.createElement(eG,{key:"modal-".concat(eW),config:t(o),ref:u,afterClose:()=>{null==c||c()},isSilent:()=>d,onConfirm:e=>{i(e)}});return(c=null===(a=e.current)||void 0===a?void 0:a.patchElement(f))&&eZ.push(c),{destroy:()=>{function e(){var e;null===(e=u.current)||void 0===e||e.destroy()}u.current?e():n(t=>[].concat((0,r.Z)(t),[e]))},update:e=>{function t(){var t;null===(t=u.current)||void 0===t||t.update(e)}u.current?t():n(e=>[].concat((0,r.Z)(e),[t]))},then:e=>(d=!0,s.then(e))}},[]);return[l.useMemo(()=>({info:o(ej),success:o(eA),error:o(eL),warning:o(eT),confirm:o(eF)}),[]),l.createElement(eK,{key:"modal-holder",ref:e})]},eE.info=function(e){return e_(ej(e))},eE.success=function(e){return e_(eA(e))},eE.error=function(e){return e_(eL(e))},eE.warning=eU,eE.warn=eU,eE.confirm=function(e){return e_(eF(e))},eE.destroyAll=function(){for(;eZ.length;){let e=eZ.pop();e&&e()}},eE.config=function(e){let{rootPrefixCls:t}=e;eN=t},eE._InternalPanelDoNotUseOrYouWillBeFired=eH;var eX=eE},52787:function(e,t,n){n.d(t,{default:function(){return tt}});var o=n(2265),r=n(36760),l=n.n(r),a=n(1119),i=n(83145),c=n(11993),u=n(31686),s=n(26365),d=n(6989),f=n(41154),g=n(50506),p=n(32559),m=n(27380),v=n(79267),h=n(95814),b=n(28791),C=function(e){var t=e.className,n=e.customizeIcon,r=e.customizeIconProps,a=e.children,i=e.onMouseDown,c=e.onClick,u="function"==typeof n?n(r):n;return o.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),null==i||i(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:c,"aria-hidden":!0},void 0!==u?u:o.createElement("span",{className:l()(t.split(/\s+/).map(function(e){return"".concat(e,"-icon")}))},a))},y=function(e,t,n,r,l){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],i=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0,u=o.useMemo(function(){return"object"===(0,f.Z)(r)?r.clearIcon:l||void 0},[r,l]);return{allowClear:o.useMemo(function(){return!a&&!!r&&(!!n.length||!!i)&&!("combobox"===c&&""===i)},[r,a,n.length,i,c]),clearIcon:o.createElement(C,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:u},"\xd7")}},w=o.createContext(null);function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=o.useRef(null),n=o.useRef(null);return o.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]),[function(){return t.current},function(o){(o||null===t.current)&&(t.current=o),window.clearTimeout(n.current),n.current=window.setTimeout(function(){t.current=null},e)}]}var E=n(18242),R=n(1699),x=o.forwardRef(function(e,t){var n,r=e.prefixCls,a=e.id,i=e.inputElement,c=e.disabled,s=e.tabIndex,d=e.autoFocus,f=e.autoComplete,g=e.editable,m=e.activeDescendantId,v=e.value,h=e.maxLength,C=e.onKeyDown,y=e.onMouseDown,w=e.onChange,S=e.onPaste,E=e.onCompositionStart,R=e.onCompositionEnd,x=e.open,I=e.attrs,O=i||o.createElement("input",null),P=O,M=P.ref,Z=P.props,N=Z.onKeyDown,k=Z.onChange,_=Z.onMouseDown,T=Z.onCompositionStart,j=Z.onCompositionEnd,A=Z.style;return(0,p.Kp)(!("maxLength"in O.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),O=o.cloneElement(O,(0,u.Z)((0,u.Z)((0,u.Z)({type:"search"},Z),{},{id:a,ref:(0,b.sQ)(t,M),disabled:c,tabIndex:s,autoComplete:f||"off",autoFocus:d,className:l()("".concat(r,"-selection-search-input"),null===(n=O)||void 0===n||null===(n=n.props)||void 0===n?void 0:n.className),role:"combobox","aria-expanded":x||!1,"aria-haspopup":"listbox","aria-owns":"".concat(a,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(a,"_list"),"aria-activedescendant":x?m:void 0},I),{},{value:g?v:"",maxLength:h,readOnly:!g,unselectable:g?null:"on",style:(0,u.Z)((0,u.Z)({},A),{},{opacity:g?null:0}),onKeyDown:function(e){C(e),N&&N(e)},onMouseDown:function(e){y(e),_&&_(e)},onChange:function(e){w(e),k&&k(e)},onCompositionStart:function(e){E(e),T&&T(e)},onCompositionEnd:function(e){R(e),j&&j(e)},onPaste:S}))});function I(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var O="undefined"!=typeof window&&window.document&&window.document.documentElement;function P(e){return["string","number"].includes((0,f.Z)(e))}function M(e){var t=void 0;return e&&(P(e.title)?t=e.title.toString():P(e.label)&&(t=e.label.toString())),t}function Z(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var N=function(e){e.preventDefault(),e.stopPropagation()},k=function(e){var t,n,r=e.id,a=e.prefixCls,i=e.values,u=e.open,d=e.searchValue,f=e.autoClearSearchValue,g=e.inputRef,p=e.placeholder,m=e.disabled,v=e.mode,h=e.showSearch,b=e.autoFocus,y=e.autoComplete,w=e.activeDescendantId,S=e.tabIndex,I=e.removeIcon,P=e.maxTagCount,k=e.maxTagTextLength,_=e.maxTagPlaceholder,T=void 0===_?function(e){return"+ ".concat(e.length," ...")}:_,j=e.tagRender,A=e.onToggleOpen,L=e.onRemove,F=e.onInputChange,D=e.onInputPaste,z=e.onInputKeyDown,H=e.onInputMouseDown,B=e.onInputCompositionStart,V=e.onInputCompositionEnd,G=o.useRef(null),W=(0,o.useState)(0),K=(0,s.Z)(W,2),U=K[0],X=K[1],q=(0,o.useState)(!1),Y=(0,s.Z)(q,2),$=Y[0],Q=Y[1],J="".concat(a,"-selection"),ee=u||"multiple"===v&&!1===f||"tags"===v?d:"",et="tags"===v||"multiple"===v&&!1===f||h&&(u||$);t=function(){X(G.current.scrollWidth)},n=[ee],O?o.useLayoutEffect(t,n):o.useEffect(t,n);var en=function(e,t,n,r,a){return o.createElement("span",{title:M(e),className:l()("".concat(J,"-item"),(0,c.Z)({},"".concat(J,"-item-disabled"),n))},o.createElement("span",{className:"".concat(J,"-item-content")},t),r&&o.createElement(C,{className:"".concat(J,"-item-remove"),onMouseDown:N,onClick:a,customizeIcon:I},"\xd7"))},eo=o.createElement("div",{className:"".concat(J,"-search"),style:{width:U},onFocus:function(){Q(!0)},onBlur:function(){Q(!1)}},o.createElement(x,{ref:g,open:u,prefixCls:a,id:r,inputElement:null,disabled:m,autoFocus:b,autoComplete:y,editable:et,activeDescendantId:w,value:ee,onKeyDown:z,onMouseDown:H,onChange:F,onPaste:D,onCompositionStart:B,onCompositionEnd:V,tabIndex:S,attrs:(0,E.Z)(e,!0)}),o.createElement("span",{ref:G,className:"".concat(J,"-search-mirror"),"aria-hidden":!0},ee,"\xa0")),er=o.createElement(R.Z,{prefixCls:"".concat(J,"-overflow"),data:i,renderItem:function(e){var t,n=e.disabled,r=e.label,l=e.value,a=!m&&!n,i=r;if("number"==typeof k&&("string"==typeof r||"number"==typeof r)){var c=String(i);c.length>k&&(i="".concat(c.slice(0,k),"..."))}var s=function(t){t&&t.stopPropagation(),L(e)};return"function"==typeof j?(t=i,o.createElement("span",{onMouseDown:function(e){N(e),A(!u)}},j({label:t,value:l,disabled:n,closable:a,onClose:s}))):en(e,i,n,a,s)},renderRest:function(e){var t="function"==typeof T?T(e):T;return en({title:t},t,!1)},suffix:eo,itemKey:Z,maxCount:P});return o.createElement(o.Fragment,null,er,!i.length&&!ee&&o.createElement("span",{className:"".concat(J,"-placeholder")},p))},_=function(e){var t=e.inputElement,n=e.prefixCls,r=e.id,l=e.inputRef,a=e.disabled,i=e.autoFocus,c=e.autoComplete,u=e.activeDescendantId,d=e.mode,f=e.open,g=e.values,p=e.placeholder,m=e.tabIndex,v=e.showSearch,h=e.searchValue,b=e.activeValue,C=e.maxLength,y=e.onInputKeyDown,w=e.onInputMouseDown,S=e.onInputChange,R=e.onInputPaste,I=e.onInputCompositionStart,O=e.onInputCompositionEnd,P=e.title,Z=o.useState(!1),N=(0,s.Z)(Z,2),k=N[0],_=N[1],T="combobox"===d,j=T||v,A=g[0],L=h||"";T&&b&&!k&&(L=b),o.useEffect(function(){T&&_(!1)},[T,b]);var F=("combobox"===d||!!f||!!v)&&!!L,D=void 0===P?M(A):P,z=o.useMemo(function(){return A?null:o.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:F?{visibility:"hidden"}:void 0},p)},[A,F,p,n]);return o.createElement(o.Fragment,null,o.createElement("span",{className:"".concat(n,"-selection-search")},o.createElement(x,{ref:l,prefixCls:n,id:r,open:f,inputElement:t,disabled:a,autoFocus:i,autoComplete:c,editable:j,activeDescendantId:u,value:L,onKeyDown:y,onMouseDown:w,onChange:function(e){_(!0),S(e)},onPaste:R,onCompositionStart:I,onCompositionEnd:O,tabIndex:m,attrs:(0,E.Z)(e,!0),maxLength:T?C:void 0})),!T&&A?o.createElement("span",{className:"".concat(n,"-selection-item"),title:D,style:F?{visibility:"hidden"}:void 0},A.label):null,z)},T=o.forwardRef(function(e,t){var n=(0,o.useRef)(null),r=(0,o.useRef)(!1),l=e.prefixCls,i=e.open,c=e.mode,u=e.showSearch,d=e.tokenWithEnter,f=e.autoClearSearchValue,g=e.onSearch,p=e.onSearchSubmit,m=e.onToggleOpen,v=e.onInputKeyDown,b=e.domRef;o.useImperativeHandle(t,function(){return{focus:function(){n.current.focus()},blur:function(){n.current.blur()}}});var C=S(0),y=(0,s.Z)(C,2),w=y[0],E=y[1],R=(0,o.useRef)(null),x=function(e){!1!==g(e,!0,r.current)&&m(!0)},I={inputRef:n,onInputKeyDown:function(e){var t=e.which;(t===h.Z.UP||t===h.Z.DOWN)&&e.preventDefault(),v&&v(e),t!==h.Z.ENTER||"tags"!==c||r.current||i||null==p||p(e.target.value),[h.Z.ESC,h.Z.SHIFT,h.Z.BACKSPACE,h.Z.TAB,h.Z.WIN_KEY,h.Z.ALT,h.Z.META,h.Z.WIN_KEY_RIGHT,h.Z.CTRL,h.Z.SEMICOLON,h.Z.EQUALS,h.Z.CAPS_LOCK,h.Z.CONTEXT_MENU,h.Z.F1,h.Z.F2,h.Z.F3,h.Z.F4,h.Z.F5,h.Z.F6,h.Z.F7,h.Z.F8,h.Z.F9,h.Z.F10,h.Z.F11,h.Z.F12].includes(t)||m(!0)},onInputMouseDown:function(){E(!0)},onInputChange:function(e){var t=e.target.value;if(d&&R.current&&/[\r\n]/.test(R.current)){var n=R.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,R.current)}R.current=null,x(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");R.current=n||""},onInputCompositionStart:function(){r.current=!0},onInputCompositionEnd:function(e){r.current=!1,"combobox"!==c&&x(e.target.value)}},O="multiple"===c||"tags"===c?o.createElement(k,(0,a.Z)({},e,I)):o.createElement(_,(0,a.Z)({},e,I));return o.createElement("div",{ref:b,className:"".concat(l,"-selector"),onClick:function(e){e.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout(function(){n.current.focus()}):n.current.focus())},onMouseDown:function(e){var t=w();e.target===n.current||t||"combobox"===c||e.preventDefault(),("combobox"===c||u&&t)&&i||(i&&!1!==f&&g("",!0,!1),m())}},O)}),j=n(97821),A=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],L=function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}},F=o.forwardRef(function(e,t){var n=e.prefixCls,r=(e.disabled,e.visible),i=e.children,s=e.popupElement,f=e.animation,g=e.transitionName,p=e.dropdownStyle,m=e.dropdownClassName,v=e.direction,h=e.placement,b=e.builtinPlacements,C=e.dropdownMatchSelectWidth,y=e.dropdownRender,w=e.dropdownAlign,S=e.getPopupContainer,E=e.empty,R=e.getTriggerDOMNode,x=e.onPopupVisibleChange,I=e.onPopupMouseEnter,O=(0,d.Z)(e,A),P="".concat(n,"-dropdown"),M=s;y&&(M=y(s));var Z=o.useMemo(function(){return b||L(C)},[b,C]),N=f?"".concat(P,"-").concat(f):g,k="number"==typeof C,_=o.useMemo(function(){return k?null:!1===C?"minWidth":"width"},[C,k]),T=p;k&&(T=(0,u.Z)((0,u.Z)({},T),{},{width:C}));var F=o.useRef(null);return o.useImperativeHandle(t,function(){return{getPopupElement:function(){return F.current}}}),o.createElement(j.Z,(0,a.Z)({},O,{showAction:x?["click"]:[],hideAction:x?["click"]:[],popupPlacement:h||("rtl"===(void 0===v?"ltr":v)?"bottomRight":"bottomLeft"),builtinPlacements:Z,prefixCls:P,popupTransitionName:N,popup:o.createElement("div",{ref:F,onMouseEnter:I},M),stretch:_,popupAlign:w,popupVisible:r,getPopupContainer:S,popupClassName:l()(m,(0,c.Z)({},"".concat(P,"-empty"),E)),popupStyle:T,getTriggerDOMNode:R,onPopupVisibleChange:x}),i)}),D=n(87099);function z(e,t){var n,o=e.key;return("value"in e&&(n=e.value),null!=o)?o:void 0!==n?n:"rc-index-key-".concat(t)}function H(e,t){var n=e||{},o=n.label,r=n.value,l=n.options,a=n.groupLabel,i=o||(t?"children":"label");return{label:i,value:r||"value",options:l||"options",groupLabel:a||i}}function B(e){var t=(0,u.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,p.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var V=function(e,t,n){if(!t||!t.length)return null;var o=!1,r=function e(t,n){var r=(0,D.Z)(n),l=r[0],a=r.slice(1);if(!l)return[t];var c=t.split(l);return o=o||c.length>1,c.reduce(function(t,n){return[].concat((0,i.Z)(t),(0,i.Z)(e(n,a)))},[]).filter(Boolean)}(e,t);return o?void 0!==n?r.slice(0,n):r:null},G=o.createContext(null),W=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],K=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],U=function(e){return"tags"===e||"multiple"===e},X=o.forwardRef(function(e,t){var n,r,p,E,R,x,I,O,P=e.id,M=e.prefixCls,Z=e.className,N=e.showSearch,k=e.tagRender,_=e.direction,j=e.omitDomProps,A=e.displayValues,L=e.onDisplayValuesChange,D=e.emptyOptions,z=e.notFoundContent,H=void 0===z?"Not Found":z,B=e.onClear,X=e.mode,q=e.disabled,Y=e.loading,$=e.getInputElement,Q=e.getRawInputElement,J=e.open,ee=e.defaultOpen,et=e.onDropdownVisibleChange,en=e.activeValue,eo=e.onActiveValueChange,er=e.activeDescendantId,el=e.searchValue,ea=e.autoClearSearchValue,ei=e.onSearch,ec=e.onSearchSplit,eu=e.tokenSeparators,es=e.allowClear,ed=e.suffixIcon,ef=e.clearIcon,eg=e.OptionList,ep=e.animation,em=e.transitionName,ev=e.dropdownStyle,eh=e.dropdownClassName,eb=e.dropdownMatchSelectWidth,eC=e.dropdownRender,ey=e.dropdownAlign,ew=e.placement,eS=e.builtinPlacements,eE=e.getPopupContainer,eR=e.showAction,ex=void 0===eR?[]:eR,eI=e.onFocus,eO=e.onBlur,eP=e.onKeyUp,eM=e.onKeyDown,eZ=e.onMouseDown,eN=(0,d.Z)(e,W),ek=U(X),e_=(void 0!==N?N:ek)||"combobox"===X,eT=(0,u.Z)({},eN);K.forEach(function(e){delete eT[e]}),null==j||j.forEach(function(e){delete eT[e]});var ej=o.useState(!1),eA=(0,s.Z)(ej,2),eL=eA[0],eF=eA[1];o.useEffect(function(){eF((0,v.Z)())},[]);var eD=o.useRef(null),ez=o.useRef(null),eH=o.useRef(null),eB=o.useRef(null),eV=o.useRef(null),eG=o.useRef(!1),eW=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=o.useState(!1),n=(0,s.Z)(t,2),r=n[0],l=n[1],a=o.useRef(null),i=function(){window.clearTimeout(a.current)};return o.useEffect(function(){return i},[]),[r,function(t,n){i(),a.current=window.setTimeout(function(){l(t),n&&n()},e)},i]}(),eK=(0,s.Z)(eW,3),eU=eK[0],eX=eK[1],eq=eK[2];o.useImperativeHandle(t,function(){var e,t;return{focus:null===(e=eB.current)||void 0===e?void 0:e.focus,blur:null===(t=eB.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=eV.current)||void 0===t?void 0:t.scrollTo(e)}}});var eY=o.useMemo(function(){if("combobox"!==X)return el;var e,t=null===(e=A[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""},[el,X,A]),e$="combobox"===X&&"function"==typeof $&&$()||null,eQ="function"==typeof Q&&Q(),eJ=(0,b.x1)(ez,null==eQ||null===(E=eQ.props)||void 0===E?void 0:E.ref),e0=o.useState(!1),e1=(0,s.Z)(e0,2),e2=e1[0],e5=e1[1];(0,m.Z)(function(){e5(!0)},[]);var e6=(0,g.Z)(!1,{defaultValue:ee,value:J}),e4=(0,s.Z)(e6,2),e3=e4[0],e8=e4[1],e9=!!e2&&e3,e7=!H&&D;(q||e7&&e9&&"combobox"===X)&&(e9=!1);var te=!e7&&e9,tt=o.useCallback(function(e){var t=void 0!==e?e:!e9;q||(e8(t),e9!==t&&(null==et||et(t)))},[q,e9,e8,et]),tn=o.useMemo(function(){return(eu||[]).some(function(e){return["\n","\r\n"].includes(e)})},[eu]),to=o.useContext(G)||{},tr=to.maxCount,tl=to.rawValues,ta=function(e,t,n){if(!((null==tl?void 0:tl.size)>=tr)){var o=!0,r=e;null==eo||eo(null);var l=V(e,eu,tr&&tr-tl.size),a=n?null:l;return"combobox"!==X&&a&&(r="",null==ec||ec(a),tt(!1),o=!1),ei&&eY!==r&&ei(r,{source:t?"typing":"effect"}),o}};o.useEffect(function(){e9||ek||"combobox"===X||ta("",!1,!1)},[e9]),o.useEffect(function(){e3&&q&&e8(!1),q&&!eG.current&&eX(!1)},[q]);var ti=S(),tc=(0,s.Z)(ti,2),tu=tc[0],ts=tc[1],td=o.useRef(!1),tf=[];o.useEffect(function(){return function(){tf.forEach(function(e){return clearTimeout(e)}),tf.splice(0,tf.length)}},[]);var tg=o.useState({}),tp=(0,s.Z)(tg,2)[1];eQ&&(x=function(e){tt(e)}),n=function(){var e;return[eD.current,null===(e=eH.current)||void 0===e?void 0:e.getPopupElement()]},r=!!eQ,(p=o.useRef(null)).current={open:te,triggerOpen:tt,customizedTrigger:r},o.useEffect(function(){function e(e){if(null===(t=p.current)||void 0===t||!t.customizedTrigger){var t,o=e.target;o.shadowRoot&&e.composed&&(o=e.composedPath()[0]||o),p.current.open&&n().filter(function(e){return e}).every(function(e){return!e.contains(o)&&e!==o})&&p.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}},[]);var tm=o.useMemo(function(){return(0,u.Z)((0,u.Z)({},e),{},{notFoundContent:H,open:e9,triggerOpen:te,id:P,showSearch:e_,multiple:ek,toggleOpen:tt})},[e,H,te,e9,P,e_,ek,tt]),tv=!!ed||Y;tv&&(I=o.createElement(C,{className:l()("".concat(M,"-arrow"),(0,c.Z)({},"".concat(M,"-arrow-loading"),Y)),customizeIcon:ed,customizeIconProps:{loading:Y,searchValue:eY,open:e9,focused:eU,showSearch:e_}}));var th=y(M,function(){var e;null==B||B(),null===(e=eB.current)||void 0===e||e.focus(),L([],{type:"clear",values:A}),ta("",!1,!1)},A,es,ef,q,eY,X),tb=th.allowClear,tC=th.clearIcon,ty=o.createElement(eg,{ref:eV}),tw=l()(M,Z,(R={},(0,c.Z)(R,"".concat(M,"-focused"),eU),(0,c.Z)(R,"".concat(M,"-multiple"),ek),(0,c.Z)(R,"".concat(M,"-single"),!ek),(0,c.Z)(R,"".concat(M,"-allow-clear"),es),(0,c.Z)(R,"".concat(M,"-show-arrow"),tv),(0,c.Z)(R,"".concat(M,"-disabled"),q),(0,c.Z)(R,"".concat(M,"-loading"),Y),(0,c.Z)(R,"".concat(M,"-open"),e9),(0,c.Z)(R,"".concat(M,"-customize-input"),e$),(0,c.Z)(R,"".concat(M,"-show-search"),e_),R)),tS=o.createElement(F,{ref:eH,disabled:q,prefixCls:M,visible:te,popupElement:ty,animation:ep,transitionName:em,dropdownStyle:ev,dropdownClassName:eh,direction:_,dropdownMatchSelectWidth:eb,dropdownRender:eC,dropdownAlign:ey,placement:ew,builtinPlacements:eS,getPopupContainer:eE,empty:D,getTriggerDOMNode:function(){return ez.current},onPopupVisibleChange:x,onPopupMouseEnter:function(){tp({})}},eQ?o.cloneElement(eQ,{ref:eJ}):o.createElement(T,(0,a.Z)({},e,{domRef:ez,prefixCls:M,inputElement:e$,ref:eB,id:P,showSearch:e_,autoClearSearchValue:ea,mode:X,activeDescendantId:er,tagRender:k,values:A,open:e9,onToggleOpen:tt,activeValue:en,searchValue:eY,onSearch:ta,onSearchSubmit:function(e){e&&e.trim()&&ei(e,{source:"submit"})},onRemove:function(e){L(A.filter(function(t){return t!==e}),{type:"remove",values:[e]})},tokenWithEnter:tn})));return O=eQ?tS:o.createElement("div",(0,a.Z)({className:tw},eT,{ref:eD,onMouseDown:function(e){var t,n=e.target,o=null===(t=eH.current)||void 0===t?void 0:t.getPopupElement();if(o&&o.contains(n)){var r=setTimeout(function(){var e,t=tf.indexOf(r);-1!==t&&tf.splice(t,1),eq(),eL||o.contains(document.activeElement)||null===(e=eB.current)||void 0===e||e.focus()});tf.push(r)}for(var l=arguments.length,a=Array(l>1?l-1:0),i=1;i=0;a-=1){var c=r[a];if(!c.disabled){r.splice(a,1),l=c;break}}l&&L(r,{type:"remove",values:[l]})}for(var u=arguments.length,s=Array(u>1?u-1:0),d=1;d1?n-1:0),r=1;r=R},[g,R,null==Z?void 0:Z.size]),H=function(e){e.preventDefault()},B=function(e){var t;null===(t=D.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},V=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=F.length,o=0;o1&&void 0!==arguments[1]&&arguments[1];X(e);var n={source:t?"keyboard":"mouse"},o=F[e];if(!o){I(null,-1,n);return}I(o.value,e,n)};(0,o.useEffect)(function(){q(!1!==O?V(0):-1)},[F.length,m]);var Y=o.useCallback(function(e){return Z.has(e)&&"combobox"!==p},[p,(0,i.Z)(Z).toString(),Z.size]);(0,o.useEffect)(function(){var e,t=setTimeout(function(){if(!g&&f&&1===Z.size){var e=Array.from(Z)[0],t=F.findIndex(function(t){return t.data.value===e});-1!==t&&(q(t),B(t))}});return f&&(null===(e=D.current)||void 0===e||e.scrollTo(void 0)),function(){return clearTimeout(t)}},[f,m]);var en=function(e){void 0!==e&&P(e,{selected:!Z.has(e)}),g||v(!1)};if(o.useImperativeHandle(t,function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case h.Z.N:case h.Z.P:case h.Z.UP:case h.Z.DOWN:var o=0;if(t===h.Z.UP?o=-1:t===h.Z.DOWN?o=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===h.Z.N?o=1:t===h.Z.P&&(o=-1)),0!==o){var r=V(U+o,o);B(r),q(r,!0)}break;case h.Z.ENTER:var l,a=F[U];!a||null!=a&&null!==(l=a.data)&&void 0!==l&&l.disabled||z?en(void 0):en(a.value),f&&e.preventDefault();break;case h.Z.ESC:v(!1),f&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){B(e)}}}),0===F.length)return o.createElement("div",{role:"listbox",id:"".concat(u,"_list"),className:"".concat(L,"-empty"),onMouseDown:H},b);var eo=Object.keys(N).map(function(e){return N[e]}),er=function(e){return e.label};function el(e,t){return{role:e.group?"presentation":"option",id:"".concat(u,"_list_").concat(t)}}var ea=function(e){var t=F[e];if(!t)return null;var n=t.data||{},r=n.value,l=t.group,i=(0,E.Z)(n,!0),c=er(t);return t?o.createElement("div",(0,a.Z)({"aria-label":"string"!=typeof c||l?null:c},i,{key:e},el(t,e),{"aria-selected":Y(r)}),r):null},ei={role:"listbox",id:"".concat(u,"_list")};return o.createElement(o.Fragment,null,k&&o.createElement("div",(0,a.Z)({},ei,{style:{height:0,width:0,overflow:"hidden"}}),ea(U-1),ea(U),ea(U+1)),o.createElement(J.Z,{itemKey:"key",ref:D,data:F,height:T,itemHeight:j,fullHeight:!1,onMouseDown:H,onScroll:y,virtual:k,direction:_,innerProps:k?null:ei},function(e,t){var n=e.group,r=e.groupOption,i=e.data,u=e.label,s=e.value,f=i.key;if(n){var g,p,m=null!==(p=i.title)&&void 0!==p?p:et(u)?u.toString():void 0;return o.createElement("div",{className:l()(L,"".concat(L,"-group")),title:m},void 0!==u?u:f)}var v=i.disabled,h=i.title,b=(i.children,i.style),y=i.className,w=(0,d.Z)(i,ee),S=(0,Q.Z)(w,eo),R=Y(s),x=v||!R&&z,I="".concat(L,"-option"),O=l()(L,I,y,(g={},(0,c.Z)(g,"".concat(I,"-grouped"),r),(0,c.Z)(g,"".concat(I,"-active"),U===t&&!x),(0,c.Z)(g,"".concat(I,"-disabled"),x),(0,c.Z)(g,"".concat(I,"-selected"),R),g)),P=er(e),Z=!M||"function"==typeof M||R,N="number"==typeof P?P:P||s,_=et(N)?N.toString():void 0;return void 0!==h&&(_=h),o.createElement("div",(0,a.Z)({},(0,E.Z)(S),k?{}:el(e,t),{"aria-selected":R,className:O,title:_,onMouseMove:function(){U===t||x||q(t)},onClick:function(){x||en(s)},style:b}),o.createElement("div",{className:"".concat(I,"-content")},"function"==typeof A?A(e,{index:t}):N),o.isValidElement(M)||R,Z&&o.createElement(C,{className:"".concat(L,"-option-state"),customizeIcon:M,customizeIconProps:{value:s,disabled:x,isSelected:R}},R?"✓":null))}))}),eo=function(e,t){var n=o.useRef({values:new Map,options:new Map});return[o.useMemo(function(){var o=n.current,r=o.values,l=o.options,a=e.map(function(e){if(void 0===e.label){var t;return(0,u.Z)((0,u.Z)({},e),{},{label:null===(t=r.get(e.value))||void 0===t?void 0:t.label})}return e}),i=new Map,c=new Map;return a.forEach(function(e){i.set(e.value,e),c.set(e.value,t.get(e.value)||l.get(e.value))}),n.current.values=i,n.current.options=c,a},[e,t]),o.useCallback(function(e){return t.get(e)||n.current.options.get(e)},[t])]};function er(e,t){return I(e).join("").toUpperCase().includes(t)}var el=n(94981),ea=0,ei=(0,el.Z)(),ec=n(45287),eu=["children","value"],es=["children"];function ed(e){var t=o.useRef();return t.current=e,o.useCallback(function(){return t.current.apply(t,arguments)},[])}var ef=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange","maxCount"],eg=["inputValue"],ep=o.forwardRef(function(e,t){var n,r,l,p,m,v=e.id,h=e.mode,b=e.prefixCls,C=e.backfill,y=e.fieldNames,w=e.inputValue,S=e.searchValue,E=e.onSearch,R=e.autoClearSearchValue,x=void 0===R||R,O=e.onSelect,P=e.onDeselect,M=e.dropdownMatchSelectWidth,Z=void 0===M||M,N=e.filterOption,k=e.filterSort,_=e.optionFilterProp,T=e.optionLabelProp,j=e.options,A=e.optionRender,L=e.children,F=e.defaultActiveFirstOption,D=e.menuItemSelectedIcon,V=e.virtual,W=e.direction,K=e.listHeight,q=void 0===K?200:K,Y=e.listItemHeight,$=void 0===Y?20:Y,Q=e.value,J=e.defaultValue,ee=e.labelInValue,et=e.onChange,el=e.maxCount,ep=(0,d.Z)(e,ef),em=(n=o.useState(),l=(r=(0,s.Z)(n,2))[0],p=r[1],o.useEffect(function(){var e;p("rc_select_".concat((ei?(e=ea,ea+=1):e="TEST_OR_SSR",e)))},[]),v||l),ev=U(h),eh=!!(!j&&L),eb=o.useMemo(function(){return(void 0!==N||"combobox"!==h)&&N},[N,h]),eC=o.useMemo(function(){return H(y,eh)},[JSON.stringify(y),eh]),ey=(0,g.Z)("",{value:void 0!==S?S:w,postState:function(e){return e||""}}),ew=(0,s.Z)(ey,2),eS=ew[0],eE=ew[1],eR=o.useMemo(function(){var e=j;j||(e=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,ec.Z)(t).map(function(t,r){if(!o.isValidElement(t)||!t.type)return null;var l,a,i,c,s,f=t.type.isSelectOptGroup,g=t.key,p=t.props,m=p.children,v=(0,d.Z)(p,es);return n||!f?(l=t.key,i=(a=t.props).children,c=a.value,s=(0,d.Z)(a,eu),(0,u.Z)({key:l,value:void 0!==c?c:l,children:i},s)):(0,u.Z)((0,u.Z)({key:"__RC_SELECT_GRP__".concat(null===g?r:g,"__"),label:g},v),{},{options:e(m)})}).filter(function(e){return e})}(L));var t=new Map,n=new Map,r=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(o){for(var l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=0;a1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,o=t.childrenAsData,r=[],l=H(n,!1),a=l.label,i=l.value,c=l.options,u=l.groupLabel;return!function e(t,n){Array.isArray(t)&&t.forEach(function(t){if(!n&&c in t){var l=t[u];void 0===l&&o&&(l=t.label),r.push({key:z(t,r.length),group:!0,data:t,label:l}),e(t[c],!0)}else{var s=t[i];r.push({key:z(t,r.length),groupOption:n,data:t,label:t[a],value:s})}})}(e,!1),r}(eB,{fieldNames:eC,childrenAsData:eh})},[eB,eC,eh]),eG=function(e){var t=eP(e);if(ek(t),et&&(t.length!==ej.length||t.some(function(e,t){var n;return(null===(n=ej[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)}))){var n=ee?t:t.map(function(e){return e.value}),o=t.map(function(e){return B(eA(e.value))});et(ev?n:n[0],ev?o:o[0])}},eW=o.useState(null),eK=(0,s.Z)(eW,2),eU=eK[0],eX=eK[1],eq=o.useState(0),eY=(0,s.Z)(eq,2),e$=eY[0],eQ=eY[1],eJ=void 0!==F?F:"combobox"!==h,e0=o.useCallback(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.source;eQ(t),C&&"combobox"===h&&null!==e&&"keyboard"===(void 0===o?"keyboard":o)&&eX(String(e))},[C,h]),e1=function(e,t,n){var o=function(){var t,n=eA(e);return[ee?{label:null==n?void 0:n[eC.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,B(n)]};if(t&&O){var r=o(),l=(0,s.Z)(r,2);O(l[0],l[1])}else if(!t&&P&&"clear"!==n){var a=o(),i=(0,s.Z)(a,2);P(i[0],i[1])}},e2=ed(function(e,t){var n=!ev||t.selected;eG(n?ev?[].concat((0,i.Z)(ej),[e]):[e]:ej.filter(function(t){return t.value!==e})),e1(e,n),"combobox"===h?eX(""):(!U||x)&&(eE(""),eX(""))}),e5=o.useMemo(function(){var e=!1!==V&&!1!==Z;return(0,u.Z)((0,u.Z)({},eR),{},{flattenOptions:eV,onActiveValue:e0,defaultActiveFirstOption:eJ,onSelect:e2,menuItemSelectedIcon:D,rawValues:eF,fieldNames:eC,virtual:e,direction:W,listHeight:q,listItemHeight:$,childrenAsData:eh,maxCount:el,optionRender:A})},[el,eR,eV,e0,eJ,e2,D,eF,eC,V,Z,W,q,$,eh,A]);return o.createElement(G.Provider,{value:e5},o.createElement(X,(0,a.Z)({},ep,{id:em,prefixCls:void 0===b?"rc-select":b,ref:t,omitDomProps:eg,mode:h,displayValues:eL,onDisplayValuesChange:function(e,t){eG(e);var n=t.type,o=t.values;("remove"===n||"clear"===n)&&o.forEach(function(e){e1(e.value,!1,n)})},direction:W,searchValue:eS,onSearch:function(e,t){if(eE(e),eX(null),"submit"===t.source){var n=(e||"").trim();n&&(eG(Array.from(new Set([].concat((0,i.Z)(eF),[n])))),e1(n,!0),eE(""));return}"blur"!==t.source&&("combobox"===h&&eG(e),null==E||E(e))},autoClearSearchValue:x,onSearchSplit:function(e){var t=e;"tags"!==h&&(t=e.map(function(e){var t=eI.get(e);return null==t?void 0:t.value}).filter(function(e){return void 0!==e}));var n=Array.from(new Set([].concat((0,i.Z)(eF),(0,i.Z)(t))));eG(n),n.forEach(function(e){e1(e,!0)})},dropdownMatchSelectWidth:Z,OptionList:en,emptyOptions:!eV.length,activeValue:eU,activeDescendantId:"".concat(em,"_list_").concat(e$)})))});ep.Option=Y,ep.OptGroup=q;var em=n(62236),ev=n(68710),eh=n(93942),eb=n(12757),eC=n(71744),ey=n(91086),ew=n(86586),eS=n(64024),eE=n(33759),eR=n(39109),ex=n(56250),eI=n(65658),eO=n(29961);let eP=e=>{let t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"scroll"===e?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}};var eM=n(12918),eZ=n(17691),eN=n(80669),ek=n(3104),e_=n(18544),eT=n(29382);let ej=e=>{let{optionHeight:t,optionFontSize:n,optionLineHeight:o,optionPadding:r}=e;return{position:"relative",display:"block",minHeight:t,padding:r,color:e.colorText,fontWeight:"normal",fontSize:n,lineHeight:o,boxSizing:"border-box"}};var eA=e=>{let{antCls:t,componentCls:n}=e,o="".concat(n,"-item"),r="&".concat(t,"-slide-up-enter").concat(t,"-slide-up-enter-active"),l="&".concat(t,"-slide-up-appear").concat(t,"-slide-up-appear-active"),a="&".concat(t,"-slide-up-leave").concat(t,"-slide-up-leave-active"),i="".concat(n,"-dropdown-placement-");return[{["".concat(n,"-dropdown")]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,["\n ".concat(r).concat(i,"bottomLeft,\n ").concat(l).concat(i,"bottomLeft\n ")]:{animationName:e_.fJ},["\n ".concat(r).concat(i,"topLeft,\n ").concat(l).concat(i,"topLeft,\n ").concat(r).concat(i,"topRight,\n ").concat(l).concat(i,"topRight\n ")]:{animationName:e_.Qt},["".concat(a).concat(i,"bottomLeft")]:{animationName:e_.Uw},["\n ".concat(a).concat(i,"topLeft,\n ").concat(a).concat(i,"topRight\n ")]:{animationName:e_.ly},"&-hidden":{display:"none"},["".concat(o)]:Object.assign(Object.assign({},ej(e)),{cursor:"pointer",transition:"background ".concat(e.motionDurationSlow," ease"),borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},eM.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},["&-active:not(".concat(o,"-option-disabled)")]:{backgroundColor:e.optionActiveBg},["&-selected:not(".concat(o,"-option-disabled)")]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,["".concat(o,"-option-state")]:{color:e.colorPrimary},["&:has(+ ".concat(o,"-option-selected:not(").concat(o,"-option-disabled))")]:{borderEndStartRadius:0,borderEndEndRadius:0,["& + ".concat(o,"-option-selected:not(").concat(o,"-option-disabled)")]:{borderStartStartRadius:0,borderStartEndRadius:0}}},"&-disabled":{["&".concat(o,"-option-selected")]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}}}),"&-rtl":{direction:"rtl"}})},(0,e_.oN)(e,"slide-up"),(0,e_.oN)(e,"slide-down"),(0,eT.Fm)(e,"move-up"),(0,eT.Fm)(e,"move-down")]},eL=n(352);let eF=e=>{let{multipleSelectItemHeight:t,selectHeight:n,lineWidth:o}=e;return e.calc(n).sub(t).div(2).sub(o).equal()};function eD(e,t){let{componentCls:n,iconCls:o}=e,r="".concat(n,"-selection-overflow"),l=e.multipleSelectItemHeight,a=eF(e),i=t?"".concat(n,"-").concat(t):"";return{["".concat(n,"-multiple").concat(i)]:{fontSize:e.fontSize,[r]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},["".concat(n,"-selector")]:{display:"flex",flexWrap:"wrap",alignItems:"center",height:"100%",paddingInline:e.calc(2).mul(2).equal(),paddingBlock:e.calc(a).sub(2).equal(),borderRadius:e.borderRadius,["".concat(n,"-show-search&")]:{cursor:"text"},["".concat(n,"-disabled&")]:{background:e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:"".concat((0,eL.bf)(2)," 0"),lineHeight:(0,eL.bf)(l),visibility:"hidden",content:'"\\a0"'}},["\n &".concat(n,"-show-arrow ").concat(n,"-selector,\n &").concat(n,"-allow-clear ").concat(n,"-selector\n ")]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()},["".concat(n,"-selection-item")]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:l,marginTop:2,marginBottom:2,lineHeight:(0,eL.bf)(e.calc(l).sub(e.calc(e.lineWidth).mul(2)).equal()),borderRadius:e.borderRadiusSM,cursor:"default",transition:"font-size ".concat(e.motionDurationSlow,", line-height ").concat(e.motionDurationSlow,", height ").concat(e.motionDurationSlow),marginInlineEnd:e.calc(2).mul(2).equal(),paddingInlineStart:e.paddingXS,paddingInlineEnd:e.calc(e.paddingXS).div(2).equal(),["".concat(n,"-disabled&")]:{color:e.multipleItemColorDisabled,borderColor:e.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:e.calc(e.paddingXS).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,eM.Ro)()),{display:"inline-flex",alignItems:"center",color:e.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",["> ".concat(o)]:{verticalAlign:"-0.2em"},"&:hover":{color:e.colorIconHover}})},["".concat(r,"-item + ").concat(r,"-item")]:{["".concat(n,"-selection-search")]:{marginInlineStart:0}},["".concat(r,"-item-suffix")]:{height:"100%"},["".concat(n,"-selection-search")]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(a).equal(),"\n &-input,\n &-mirror\n ":{height:l,fontFamily:e.fontFamily,lineHeight:(0,eL.bf)(l),transition:"all ".concat(e.motionDurationSlow)},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},["".concat(n,"-selection-placeholder")]:{position:"absolute",top:"50%",insetInlineStart:e.inputPaddingHorizontalBase,insetInlineEnd:e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:"all ".concat(e.motionDurationSlow)}}}}var ez=e=>{let{componentCls:t}=e,n=(0,ek.TS)(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.controlHeightXS,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),o=(0,ek.TS)(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[eD(e),eD(n,"sm"),{["".concat(t,"-multiple").concat(t,"-sm")]:{["".concat(t,"-selection-placeholder")]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},["".concat(t,"-selection-search")]:{marginInlineStart:2}}},eD(o,"lg")]};function eH(e,t){let{componentCls:n,inputPaddingHorizontalBase:o,borderRadius:r}=e,l=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),a=t?"".concat(n,"-").concat(t):"";return{["".concat(n,"-single").concat(a)]:{fontSize:e.fontSize,height:e.controlHeight,["".concat(n,"-selector")]:Object.assign(Object.assign({},(0,eM.Wf)(e,!0)),{display:"flex",borderRadius:r,["".concat(n,"-selection-search")]:{position:"absolute",top:0,insetInlineStart:o,insetInlineEnd:o,bottom:0,"&-input":{width:"100%",WebkitAppearance:"textfield"}},["\n ".concat(n,"-selection-item,\n ").concat(n,"-selection-placeholder\n ")]:{padding:0,lineHeight:(0,eL.bf)(l),transition:"all ".concat(e.motionDurationSlow,", visibility 0s"),alignSelf:"center"},["".concat(n,"-selection-placeholder")]:{transition:"none",pointerEvents:"none"},[["&:after","".concat(n,"-selection-item:empty:after"),"".concat(n,"-selection-placeholder:empty:after")].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),["\n &".concat(n,"-show-arrow ").concat(n,"-selection-item,\n &").concat(n,"-show-arrow ").concat(n,"-selection-placeholder\n ")]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},["&".concat(n,"-open ").concat(n,"-selection-item")]:{color:e.colorTextPlaceholder},["&:not(".concat(n,"-customize-input)")]:{["".concat(n,"-selector")]:{width:"100%",height:"100%",padding:"0 ".concat((0,eL.bf)(o)),["".concat(n,"-selection-search-input")]:{height:l},"&:after":{lineHeight:(0,eL.bf)(l)}}},["&".concat(n,"-customize-input")]:{["".concat(n,"-selector")]:{"&:after":{display:"none"},["".concat(n,"-selection-search")]:{position:"static",width:"100%"},["".concat(n,"-selection-placeholder")]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:"0 ".concat((0,eL.bf)(o)),"&:after":{display:"none"}}}}}}}let eB=(e,t)=>{let{componentCls:n,antCls:o,controlOutlineWidth:r}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(t.borderColor),background:e.selectorBg},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(o,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{borderColor:t.hoverBorderHover},["".concat(n,"-focused& ").concat(n,"-selector")]:{borderColor:t.activeBorderColor,boxShadow:"0 0 0 ".concat((0,eL.bf)(r)," ").concat(t.activeShadowColor),outline:0}}}},eV=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},eB(e,t))}),eG=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},eB(e,{borderColor:e.colorBorder,hoverBorderHover:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadowColor:e.controlOutline})),eV(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeShadowColor:e.colorErrorOutline})),eV(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeShadowColor:e.colorWarningOutline})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)}})}),eW=(e,t)=>{let{componentCls:n,antCls:o}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{background:t.bg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),color:t.color},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(o,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{background:t.hoverBg},["".concat(n,"-focused& ").concat(n,"-selector")]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},eK=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},eW(e,t))}),eU=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},eW(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.colorPrimary,color:e.colorText})),eK(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),eK(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.colorBgContainer,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)}})}),eX=e=>({"&-borderless":{["".concat(e.componentCls,"-selector")]:{background:"transparent",borderColor:"transparent"},["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)}}});var eq=e=>({[e.componentCls]:Object.assign(Object.assign(Object.assign({},eG(e)),eU(e)),eX(e))});let eY=e=>{let{componentCls:t}=e;return{position:"relative",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut),input:{cursor:"pointer"},["".concat(t,"-show-search&")]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},["".concat(t,"-disabled&")]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},e$=e=>{let{componentCls:t}=e;return{["".concat(t,"-selection-search-input")]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},eQ=e=>{let{antCls:t,componentCls:n,inputPaddingHorizontalBase:o,iconCls:r}=e;return{[n]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"relative",display:"inline-block",cursor:"pointer",["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:Object.assign(Object.assign({},eY(e)),e$(e)),["".concat(n,"-selection-item")]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},eM.vS),{["> ".concat(t,"-typography")]:{display:"inline"}}),["".concat(n,"-selection-placeholder")]:Object.assign(Object.assign({},eM.vS),{flex:1,color:e.colorTextPlaceholder,pointerEvents:"none"}),["".concat(n,"-arrow")]:Object.assign(Object.assign({},(0,eM.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:o,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:"opacity ".concat(e.motionDurationSlow," ease"),[r]:{verticalAlign:"top",transition:"transform ".concat(e.motionDurationSlow),"> svg":{verticalAlign:"top"},["&:not(".concat(n,"-suffix)")]:{pointerEvents:"auto"}},["".concat(n,"-disabled &")]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),["".concat(n,"-clear")]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:o,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:"color ".concat(e.motionDurationMid," ease, opacity ").concat(e.motionDurationSlow," ease"),textRendering:"auto","&:before":{display:"block"},"&:hover":{color:e.colorTextTertiary}},"&:hover":{["".concat(n,"-clear")]:{opacity:1},["".concat(n,"-arrow:not(:last-child)")]:{opacity:0}}}),["".concat(n,"-has-feedback")]:{["".concat(n,"-clear")]:{insetInlineEnd:e.calc(o).add(e.fontSize).add(e.paddingXS).equal()}}}},eJ=e=>{let{componentCls:t}=e;return[{[t]:{["&".concat(t,"-in-form-item")]:{width:"100%"}}},eQ(e),function(e){let{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[eH(e),eH((0,ek.TS)(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),"sm"),{["".concat(t,"-single").concat(t,"-sm")]:{["&:not(".concat(t,"-customize-input)")]:{["".concat(t,"-selection-search")]:{insetInlineStart:n,insetInlineEnd:n},["".concat(t,"-selector")]:{padding:"0 ".concat((0,eL.bf)(n))},["&".concat(t,"-show-arrow ").concat(t,"-selection-search")]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},["\n &".concat(t,"-show-arrow ").concat(t,"-selection-item,\n &").concat(t,"-show-arrow ").concat(t,"-selection-placeholder\n ")]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},eH((0,ek.TS)(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),"lg")]}(e),ez(e),eA(e),{["".concat(t,"-rtl")]:{direction:"rtl"}},(0,eZ.c)(e,{borderElCls:"".concat(t,"-selector"),focusElCls:"".concat(t,"-focused")})]};var e0=(0,eN.I$)("Select",(e,t)=>{let{rootPrefixCls:n}=t,o=(0,ek.TS)(e,{rootPrefixCls:n,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(1).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[eJ(o),eq(o)]},e=>{let{fontSize:t,lineHeight:n,controlHeight:o,controlPaddingHorizontal:r,zIndexPopupBase:l,colorText:a,fontWeightStrong:i,controlItemBgActive:c,controlItemBgHover:u,colorBgContainer:s,colorFillSecondary:d,controlHeightLG:f,controlHeightSM:g,colorBgContainerDisabled:p,colorTextDisabled:m}=e;return{zIndexPopup:l+50,optionSelectedColor:a,optionSelectedFontWeight:i,optionSelectedBg:c,optionActiveBg:u,optionPadding:"".concat((o-t*n)/2,"px ").concat(r,"px"),optionFontSize:t,optionLineHeight:n,optionHeight:o,selectorBg:s,clearBg:s,singleItemHeightLG:f,multipleItemBg:d,multipleItemBorderColor:"transparent",multipleItemHeight:g,multipleItemHeightLG:o,multipleSelectorBgDisabled:p,multipleItemColorDisabled:m,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(1.25*e.fontSize)}},{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),e1=n(9738),e2=n(39725),e5=n(49638),e6=n(70464),e4=n(61935),e3=n(29436),e8=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let e9="SECRET_COMBOBOX_MODE_DO_NOT_USE",e7=o.forwardRef((e,t)=>{var n,r,a;let i;let{prefixCls:c,bordered:u,className:s,rootClassName:d,getPopupContainer:f,popupClassName:g,dropdownClassName:p,listHeight:m=256,placement:v,listItemHeight:h,size:b,disabled:C,notFoundContent:y,status:w,builtinPlacements:S,dropdownMatchSelectWidth:E,popupMatchSelectWidth:R,direction:x,style:I,allowClear:O,variant:P,dropdownStyle:M,transitionName:Z,tagRender:N,maxCount:k}=e,_=e8(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount"]),{getPopupContainer:T,getPrefixCls:j,renderEmpty:A,direction:L,virtual:F,popupMatchSelectWidth:D,popupOverflow:z,select:H}=o.useContext(eC.E_),[,B]=(0,eO.ZP)(),V=null!=h?h:null==B?void 0:B.controlHeight,G=j("select",c),W=j(),K=null!=x?x:L,{compactSize:U,compactItemClassnames:X}=(0,eI.ri)(G,K),[q,Y]=(0,ex.Z)(P,u),$=(0,eS.Z)(G),[J,ee,et]=e0(G,$),en=o.useMemo(()=>{let{mode:t}=e;return"combobox"===t?void 0:t===e9?"combobox":t},[e.mode]),eo="multiple"===en||"tags"===en,er=(r=e.suffixIcon,void 0!==(a=e.showArrow)?a:null!==r),el=null!==(n=null!=R?R:E)&&void 0!==n?n:D,{status:ea,hasFeedback:ei,isFormItemInput:ec,feedbackIcon:eu}=o.useContext(eR.aM),es=(0,eb.F)(ea,w);i=void 0!==y?y:"combobox"===en?null:(null==A?void 0:A("Select"))||o.createElement(ey.Z,{componentName:"Select"});let{suffixIcon:ed,itemIcon:ef,removeIcon:eg,clearIcon:eh}=function(e){let{suffixIcon:t,clearIcon:n,menuItemSelectedIcon:r,removeIcon:l,loading:a,multiple:i,hasFeedback:c,prefixCls:u,showSuffixIcon:s,feedbackIcon:d,showArrow:f,componentName:g}=e,p=null!=n?n:o.createElement(e2.Z,null),m=e=>null!==t||c||f?o.createElement(o.Fragment,null,!1!==s&&e,c&&d):null,v=null;if(void 0!==t)v=m(t);else if(a)v=m(o.createElement(e4.Z,{spin:!0}));else{let e="".concat(u,"-suffix");v=t=>{let{open:n,showSearch:r}=t;return n&&r?m(o.createElement(e3.Z,{className:e})):m(o.createElement(e6.Z,{className:e}))}}let h=null;return h=void 0!==r?r:i?o.createElement(e1.Z,null):null,{clearIcon:p,suffixIcon:v,itemIcon:h,removeIcon:void 0!==l?l:o.createElement(e5.Z,null)}}(Object.assign(Object.assign({},_),{multiple:eo,hasFeedback:ei,feedbackIcon:eu,showSuffixIcon:er,prefixCls:G,componentName:"Select"})),eM=(0,Q.Z)(_,["suffixIcon","itemIcon"]),eZ=l()(g||p,{["".concat(G,"-dropdown-").concat(K)]:"rtl"===K},d,et,$,ee),eN=(0,eE.Z)(e=>{var t;return null!==(t=null!=b?b:U)&&void 0!==t?t:e}),ek=o.useContext(ew.Z),e_=l()({["".concat(G,"-lg")]:"large"===eN,["".concat(G,"-sm")]:"small"===eN,["".concat(G,"-rtl")]:"rtl"===K,["".concat(G,"-").concat(q)]:Y,["".concat(G,"-in-form-item")]:ec},(0,eb.Z)(G,es,ei),X,null==H?void 0:H.className,s,d,et,$,ee),eT=o.useMemo(()=>void 0!==v?v:"rtl"===K?"bottomRight":"bottomLeft",[v,K]),[ej]=(0,em.Cn)("SelectLike",null==M?void 0:M.zIndex);return J(o.createElement(ep,Object.assign({ref:t,virtual:F,showSearch:null==H?void 0:H.showSearch},eM,{style:Object.assign(Object.assign({},null==H?void 0:H.style),I),dropdownMatchSelectWidth:el,transitionName:(0,ev.m)(W,"slide-up",Z),builtinPlacements:S||eP(z),listHeight:m,listItemHeight:V,mode:en,prefixCls:G,placement:eT,direction:K,suffixIcon:ed,menuItemSelectedIcon:ef,removeIcon:eg,allowClear:!0===O?{clearIcon:eh}:O,notFoundContent:i,className:e_,getPopupContainer:f||T,dropdownClassName:eZ,disabled:null!=C?C:ek,dropdownStyle:Object.assign(Object.assign({},M),{zIndex:ej}),maxCount:eo?k:void 0,tagRender:eo?N:void 0})))}),te=(0,eh.Z)(e7);e7.SECRET_COMBOBOX_MODE_DO_NOT_USE=e9,e7.Option=Y,e7.OptGroup=q,e7._InternalPanelDoNotUseOrYouWillBeFired=te;var tt=e7},93142:function(e,t,n){n.d(t,{Z:function(){return h}});var o=n(2265),r=n(36760),l=n.n(r),a=n(45287);function i(e){return["small","middle","large"].includes(e)}function c(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}var u=n(71744),s=n(65658);let d=o.createContext({latestIndex:0}),f=d.Provider;var g=e=>{let{className:t,index:n,children:r,split:l,style:a}=e,{latestIndex:i}=o.useContext(d);return null==r?null:o.createElement(o.Fragment,null,o.createElement("div",{className:t,style:a},r),nt.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let v=o.forwardRef((e,t)=>{var n,r;let{getPrefixCls:s,space:d,direction:v}=o.useContext(u.E_),{size:h=(null==d?void 0:d.size)||"small",align:b,className:C,rootClassName:y,children:w,direction:S="horizontal",prefixCls:E,split:R,style:x,wrap:I=!1,classNames:O,styles:P}=e,M=m(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[Z,N]=Array.isArray(h)?h:[h,h],k=i(N),_=i(Z),T=c(N),j=c(Z),A=(0,a.Z)(w,{keepEmpty:!0}),L=void 0===b&&"horizontal"===S?"center":b,F=s("space",E),[D,z,H]=(0,p.Z)(F),B=l()(F,null==d?void 0:d.className,z,"".concat(F,"-").concat(S),{["".concat(F,"-rtl")]:"rtl"===v,["".concat(F,"-align-").concat(L)]:L,["".concat(F,"-gap-row-").concat(N)]:k,["".concat(F,"-gap-col-").concat(Z)]:_},C,y,H),V=l()("".concat(F,"-item"),null!==(n=null==O?void 0:O.item)&&void 0!==n?n:null===(r=null==d?void 0:d.classNames)||void 0===r?void 0:r.item),G=0,W=A.map((e,t)=>{var n,r;null!=e&&(G=t);let l=e&&e.key||"".concat(V,"-").concat(t);return o.createElement(g,{className:V,key:l,index:t,split:R,style:null!==(n=null==P?void 0:P.item)&&void 0!==n?n:null===(r=null==d?void 0:d.styles)||void 0===r?void 0:r.item},e)}),K=o.useMemo(()=>({latestIndex:G}),[G]);if(0===A.length)return null;let U={};return I&&(U.flexWrap="wrap"),!_&&j&&(U.columnGap=Z),!k&&T&&(U.rowGap=N),D(o.createElement("div",Object.assign({ref:t,className:B,style:Object.assign(Object.assign(Object.assign({},U),null==d?void 0:d.style),x)},M),o.createElement(f,{value:K},W)))});v.Compact=s.ZP;var h=v},11699:function(e,t,n){n.d(t,{J$:function(){return i}});var o=n(352),r=n(37133);let l=new o.E4("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),a=new o.E4("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),i=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{antCls:n}=e,o="".concat(n,"-fade"),i=t?"&":"";return[(0,r.R)(o,l,a,e.motionDurationMid,t),{["\n ".concat(i).concat(o,"-enter,\n ").concat(i).concat(o,"-appear\n ")]:{opacity:0,animationTimingFunction:"linear"},["".concat(i).concat(o,"-leave")]:{animationTimingFunction:"linear"}}]}},29382:function(e,t,n){n.d(t,{Fm:function(){return f}});var o=n(352),r=n(37133);let l=new o.E4("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),a=new o.E4("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),i=new o.E4("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),c=new o.E4("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),u=new o.E4("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),s=new o.E4("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),d={"move-up":{inKeyframes:new o.E4("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),outKeyframes:new o.E4("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}})},"move-down":{inKeyframes:l,outKeyframes:a},"move-left":{inKeyframes:i,outKeyframes:c},"move-right":{inKeyframes:u,outKeyframes:s}},f=(e,t)=>{let{antCls:n}=e,o="".concat(n,"-").concat(t),{inKeyframes:l,outKeyframes:a}=d[t];return[(0,r.R)(o,l,a,e.motionDurationMid),{["\n ".concat(o,"-enter,\n ").concat(o,"-appear\n ")]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},["".concat(o,"-leave")]:{animationTimingFunction:e.motionEaseInOutCirc}}]}},18544:function(e,t,n){n.d(t,{Qt:function(){return i},Uw:function(){return a},fJ:function(){return l},ly:function(){return c},oN:function(){return d}});var o=n(352),r=n(37133);let l=new o.E4("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),a=new o.E4("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),i=new o.E4("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),c=new o.E4("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),u=new o.E4("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),s={"slide-up":{inKeyframes:l,outKeyframes:a},"slide-down":{inKeyframes:i,outKeyframes:c},"slide-left":{inKeyframes:u,outKeyframes:new o.E4("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}})},"slide-right":{inKeyframes:new o.E4("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),outKeyframes:new o.E4("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}})}},d=(e,t)=>{let{antCls:n}=e,o="".concat(n,"-").concat(t),{inKeyframes:l,outKeyframes:a}=s[t];return[(0,r.R)(o,l,a,e.motionDurationMid),{["\n ".concat(o,"-enter,\n ").concat(o,"-appear\n ")]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},["".concat(o,"-leave")]:{animationTimingFunction:e.motionEaseInQuint}}]}},3810:function(e,t,n){n.d(t,{Z:function(){return M}});var o=n(2265),r=n(49638),l=n(36760),a=n.n(l),i=n(93350),c=n(53445),u=n(6694),s=n(71744),d=n(352),f=n(36360),g=n(12918),p=n(3104),m=n(80669);let v=e=>{let{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:o,componentCls:r,calc:l}=e,a=l(o).sub(n).equal(),i=l(t).sub(n).equal();return{[r]:Object.assign(Object.assign({},(0,g.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:a,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:"".concat((0,d.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,opacity:1,transition:"all ".concat(e.motionDurationMid),textAlign:"start",position:"relative",["&".concat(r,"-rtl")]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},["".concat(r,"-close-icon")]:{marginInlineStart:i,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),"&:hover":{color:e.colorTextHeading}},["&".concat(r,"-has-color")]:{borderColor:"transparent",["&, a, a:hover, ".concat(e.iconCls,"-close, ").concat(e.iconCls,"-close:hover")]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",["&:not(".concat(r,"-checkable-checked):hover")]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},["> ".concat(e.iconCls," + span, > span + ").concat(e.iconCls)]:{marginInlineStart:a}}),["".concat(r,"-borderless")]:{borderColor:"transparent",background:e.tagBorderlessBg}}},h=e=>{let{lineWidth:t,fontSizeIcon:n,calc:o}=e,r=e.fontSizeSM;return(0,p.TS)(e,{tagFontSize:r,tagLineHeight:(0,d.bf)(o(e.lineHeightSM).mul(r).equal()),tagIconSize:o(n).sub(o(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary})},b=e=>({defaultBg:new f.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var C=(0,m.I$)("Tag",e=>v(h(e)),b),y=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let w=o.forwardRef((e,t)=>{let{prefixCls:n,style:r,className:l,checked:i,onChange:c,onClick:u}=e,d=y(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:f,tag:g}=o.useContext(s.E_),p=f("tag",n),[m,v,h]=C(p),b=a()(p,"".concat(p,"-checkable"),{["".concat(p,"-checkable-checked")]:i},null==g?void 0:g.className,l,v,h);return m(o.createElement("span",Object.assign({},d,{ref:t,style:Object.assign(Object.assign({},r),null==g?void 0:g.style),className:b,onClick:e=>{null==c||c(!i),null==u||u(e)}})))});var S=n(18536);let E=e=>(0,S.Z)(e,(t,n)=>{let{textColor:o,lightBorderColor:r,lightColor:l,darkColor:a}=n;return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:o,background:l,borderColor:r,"&-inverse":{color:e.colorTextLightSolid,background:a,borderColor:a},["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var R=(0,m.bk)(["Tag","preset"],e=>E(h(e)),b);let x=(e,t,n)=>{let o="string"!=typeof n?n:n.charAt(0).toUpperCase()+n.slice(1);return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:e["color".concat(n)],background:e["color".concat(o,"Bg")],borderColor:e["color".concat(o,"Border")],["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}};var I=(0,m.bk)(["Tag","status"],e=>{let t=h(e);return[x(t,"success","Success"),x(t,"processing","Info"),x(t,"error","Error"),x(t,"warning","Warning")]},b),O=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let P=o.forwardRef((e,t)=>{let{prefixCls:n,className:l,rootClassName:d,style:f,children:g,icon:p,color:m,onClose:v,closeIcon:h,closable:b,bordered:y=!0}=e,w=O(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:S,direction:E,tag:x}=o.useContext(s.E_),[P,M]=o.useState(!0);o.useEffect(()=>{"visible"in w&&M(w.visible)},[w.visible]);let Z=(0,i.o2)(m),N=(0,i.yT)(m),k=Z||N,_=Object.assign(Object.assign({backgroundColor:m&&!k?m:void 0},null==x?void 0:x.style),f),T=S("tag",n),[j,A,L]=C(T),F=a()(T,null==x?void 0:x.className,{["".concat(T,"-").concat(m)]:k,["".concat(T,"-has-color")]:m&&!k,["".concat(T,"-hidden")]:!P,["".concat(T,"-rtl")]:"rtl"===E,["".concat(T,"-borderless")]:!y},l,d,A,L),D=e=>{e.stopPropagation(),null==v||v(e),e.defaultPrevented||M(!1)},[,z]=(0,c.Z)(b,h,e=>null===e?o.createElement(r.Z,{className:"".concat(T,"-close-icon"),onClick:D}):o.createElement("span",{className:"".concat(T,"-close-icon"),onClick:D},e),null,!1),H="function"==typeof w.onClick||g&&"a"===g.type,B=p||null,V=B?o.createElement(o.Fragment,null,B,g&&o.createElement("span",null,g)):g,G=o.createElement("span",Object.assign({},w,{ref:t,className:F,style:_}),V,z,Z&&o.createElement(R,{key:"preset",prefixCls:T}),N&&o.createElement(I,{key:"status",prefixCls:T}));return j(H?o.createElement(u.Z,{component:"Tag"},G):G)});P.CheckableTag=w;var M=P},79205:function(e,t,n){n.d(t,{Z:function(){return d}});var o=n(2265);let r=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),a=e=>{let t=l(e);return t.charAt(0).toUpperCase()+t.slice(1)},i=function(){for(var e=arguments.length,t=Array(e),n=0;n!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()},c=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var u={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"};let s=(0,o.forwardRef)((e,t)=>{let{color:n="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:a,className:s="",children:d,iconNode:f,...g}=e;return(0,o.createElement)("svg",{ref:t,...u,width:r,height:r,stroke:n,strokeWidth:a?24*Number(l)/Number(r):l,className:i("lucide",s),...!d&&!c(g)&&{"aria-hidden":"true"},...g},[...f.map(e=>{let[t,n]=e;return(0,o.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),d=(e,t)=>{let n=(0,o.forwardRef)((n,l)=>{let{className:c,...u}=n;return(0,o.createElement)(s,{ref:l,iconNode:t,className:i("lucide-".concat(r(a(e))),"lucide-".concat(e),c),...u})});return n.displayName=a(e),n}},78867:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},33245:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},27648:function(e,t,n){n.d(t,{default:function(){return r.a}});var o=n(72972),r=n.n(o)},55449:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return o}}),n(33068);let o=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;ol?e.prefetch(t,r):e.prefetch(t,n,o))().catch(e=>{})}}function C(e){return"string"==typeof e?e:(0,c.formatUrl)(e)}let y=l.default.forwardRef(function(e,t){let n,o;let{href:c,as:h,children:y,prefetch:w=null,passHref:S,replace:E,shallow:R,scroll:x,locale:I,onClick:O,onMouseEnter:P,onTouchStart:M,legacyBehavior:Z=!1,...N}=e;n=y,Z&&("string"==typeof n||"number"==typeof n)&&(n=(0,r.jsx)("a",{children:n}));let k=l.default.useContext(d.RouterContext),_=l.default.useContext(f.AppRouterContext),T=null!=k?k:_,j=!k,A=!1!==w,L=null===w?v.PrefetchKind.AUTO:v.PrefetchKind.FULL,{href:F,as:D}=l.default.useMemo(()=>{if(!k){let e=C(c);return{href:e,as:h?C(h):e}}let[e,t]=(0,a.resolveHref)(k,c,!0);return{href:e,as:h?(0,a.resolveHref)(k,h):t||e}},[k,c,h]),z=l.default.useRef(F),H=l.default.useRef(D);Z&&(o=l.default.Children.only(n));let B=Z?o&&"object"==typeof o&&o.ref:t,[V,G,W]=(0,g.useIntersection)({rootMargin:"200px"}),K=l.default.useCallback(e=>{(H.current!==D||z.current!==F)&&(W(),H.current=D,z.current=F),V(e),B&&("function"==typeof B?B(e):"object"==typeof B&&(B.current=e))},[D,B,F,W,V]);l.default.useEffect(()=>{T&&G&&A&&b(T,F,D,{locale:I},{kind:L},j)},[D,F,G,I,A,null==k?void 0:k.locale,T,j,L]);let U={ref:K,onClick(e){Z||"function"!=typeof O||O(e),Z&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(e),T&&!e.defaultPrevented&&function(e,t,n,o,r,a,c,u,s){let{nodeName:d}=e.currentTarget;if("A"===d.toUpperCase()&&(function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!s&&!(0,i.isLocalURL)(n)))return;e.preventDefault();let f=()=>{let e=null==c||c;"beforePopState"in t?t[r?"replace":"push"](n,o,{shallow:a,locale:u,scroll:e}):t[r?"replace":"push"](o||n,{scroll:e})};s?l.default.startTransition(f):f()}(e,T,F,D,E,R,x,I,j)},onMouseEnter(e){Z||"function"!=typeof P||P(e),Z&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),T&&(A||!j)&&b(T,F,D,{locale:I,priority:!0,bypassPrefetchedCheck:!0},{kind:L},j)},onTouchStart:function(e){Z||"function"!=typeof M||M(e),Z&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),T&&(A||!j)&&b(T,F,D,{locale:I,priority:!0,bypassPrefetchedCheck:!0},{kind:L},j)}};if((0,u.isAbsoluteUrl)(D))U.href=D;else if(!Z||S||"a"===o.type&&!("href"in o.props)){let e=void 0!==I?I:null==k?void 0:k.locale,t=(null==k?void 0:k.isLocaleDomain)&&(0,p.getDomainLocale)(D,e,null==k?void 0:k.locales,null==k?void 0:k.domainLocales);U.href=t||(0,m.addBasePath)((0,s.addLocale)(D,e,null==k?void 0:k.defaultLocale))}return Z?l.default.cloneElement(o,U):(0,r.jsx)("a",{...N,...U,children:n})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63515:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{cancelIdleCallback:function(){return o},requestIdleCallback:function(){return n}});let n="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},o="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},25246:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"resolveHref",{enumerable:!0,get:function(){return d}});let o=n(48637),r=n(57497),l=n(17053),a=n(3987),i=n(33068),c=n(53552),u=n(86279),s=n(37205);function d(e,t,n){let d;let f="string"==typeof t?t:(0,r.formatWithValidation)(t),g=f.match(/^[a-zA-Z]{1,}:\/\//),p=g?f.slice(g[0].length):f;if((p.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+f+"' passed to next/router in page: '"+e.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");let t=(0,a.normalizeRepeatedSlashes)(p);f=(g?g[0]:"")+t}if(!(0,c.isLocalURL)(f))return n?[f]:f;try{d=new URL(f.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(e){d=new URL("/","http://n")}try{let e=new URL(f,d);e.pathname=(0,i.normalizePathTrailingSlash)(e.pathname);let t="";if((0,u.isDynamicRoute)(e.pathname)&&e.searchParams&&n){let n=(0,o.searchParamsToUrlQuery)(e.searchParams),{result:a,params:i}=(0,s.interpolateAs)(e.pathname,e.pathname,n);a&&(t=(0,r.formatWithValidation)({pathname:a,hash:e.hash,query:(0,l.omit)(n,i)}))}let a=e.origin===d.origin?e.href.slice(e.origin.length):e.href;return n?[a,t||a]:a}catch(e){return n?[f]:f}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16081:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return c}});let o=n(2265),r=n(63515),l="function"==typeof IntersectionObserver,a=new Map,i=[];function c(e){let{rootRef:t,rootMargin:n,disabled:c}=e,u=c||!l,[s,d]=(0,o.useState)(!1),f=(0,o.useRef)(null),g=(0,o.useCallback)(e=>{f.current=e},[]);return(0,o.useEffect)(()=>{if(l){if(u||s)return;let e=f.current;if(e&&e.tagName)return function(e,t,n){let{id:o,observer:r,elements:l}=function(e){let t;let n={root:e.root||null,margin:e.rootMargin||""},o=i.find(e=>e.root===n.root&&e.margin===n.margin);if(o&&(t=a.get(o)))return t;let r=new Map;return t={id:n,observer:new IntersectionObserver(e=>{e.forEach(e=>{let t=r.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)})},e),elements:r},i.push(n),a.set(n,t),t}(n);return l.set(e,t),r.observe(e),function(){if(l.delete(e),r.unobserve(e),0===l.size){r.disconnect(),a.delete(o);let e=i.findIndex(e=>e.root===o.root&&e.margin===o.margin);e>-1&&i.splice(e,1)}}}(e,e=>e&&d(e),{root:null==t?void 0:t.current,rootMargin:n})}else if(!s){let e=(0,r.requestIdleCallback)(()=>d(!0));return()=>(0,r.cancelIdleCallback)(e)}},[u,n,t,s,f.current]),[g,s,(0,o.useCallback)(()=>{d(!1)},[])]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},19259:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION_SUFFIX:function(){return c},APP_DIR_ALIAS:function(){return O},CACHE_ONE_YEAR:function(){return y},DOT_NEXT_ALIAS:function(){return x},ESLINT_DEFAULT_DIRS:function(){return W},GSP_NO_RETURNED_VALUE:function(){return D},GSSP_COMPONENT_MEMBER_ERROR:function(){return B},GSSP_NO_RETURNED_VALUE:function(){return z},INSTRUMENTATION_HOOK_FILENAME:function(){return E},MIDDLEWARE_FILENAME:function(){return w},MIDDLEWARE_LOCATION_REGEXP:function(){return S},NEXT_BODY_SUFFIX:function(){return d},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return C},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return p},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return m},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return g},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return b},NEXT_CACHE_TAGS_HEADER:function(){return f},NEXT_CACHE_TAG_MAX_ITEMS:function(){return v},NEXT_CACHE_TAG_MAX_LENGTH:function(){return h},NEXT_DATA_SUFFIX:function(){return u},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return o},NEXT_META_SUFFIX:function(){return s},NEXT_QUERY_PARAM_PREFIX:function(){return n},NON_STANDARD_NODE_ENV:function(){return V},PAGES_DIR_ALIAS:function(){return R},PRERENDER_REVALIDATE_HEADER:function(){return r},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return l},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return _},ROOT_DIR_ALIAS:function(){return I},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return k},RSC_ACTION_ENCRYPTION_ALIAS:function(){return N},RSC_ACTION_PROXY_ALIAS:function(){return Z},RSC_ACTION_VALIDATE_ALIAS:function(){return M},RSC_MOD_REF_PROXY_ALIAS:function(){return P},RSC_PREFETCH_SUFFIX:function(){return a},RSC_SUFFIX:function(){return i},SERVER_PROPS_EXPORT_ERROR:function(){return F},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return j},SERVER_PROPS_SSG_CONFLICT:function(){return A},SERVER_RUNTIME:function(){return K},SSG_FALLBACK_EXPORT_ERROR:function(){return G},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return T},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return L},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return H},WEBPACK_LAYERS:function(){return X},WEBPACK_RESOURCE_QUERIES:function(){return q}});let n="nxtP",o="nxtI",r="x-prerender-revalidate",l="x-prerender-revalidate-if-generated",a=".prefetch.rsc",i=".rsc",c=".action",u=".json",s=".meta",d=".body",f="x-next-cache-tags",g="x-next-cache-soft-tags",p="x-next-revalidated-tags",m="x-next-revalidate-tag-token",v=128,h=256,b=1024,C="_N_T_",y=31536e3,w="middleware",S=`(?:src/)?${w}`,E="instrumentation",R="private-next-pages",x="private-dot-next",I="private-next-root-dir",O="private-next-app-dir",P="private-next-rsc-mod-ref-proxy",M="private-next-rsc-action-validate",Z="private-next-rsc-server-reference",N="private-next-rsc-action-encryption",k="private-next-rsc-action-client-wrapper",_="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",T="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",j="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",A="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",L="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",F="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",D="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",z="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",H="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",B="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",V='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',G="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",W=["app","pages","components","lib","src"],K={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},U={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"},X={...U,GROUP:{serverOnly:[U.reactServerComponents,U.actionBrowser,U.appMetadataRoute,U.appRouteHandler,U.instrument],clientOnly:[U.serverSideRendering,U.appPagesBrowser],nonClientServerTarget:[U.middleware,U.api],app:[U.reactServerComponents,U.actionBrowser,U.appMetadataRoute,U.appRouteHandler,U.serverSideRendering,U.appPagesBrowser,U.shared,U.instrument]}},q={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}},90042:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return r}});let n=/[|\\{}()[\]^$+*?.-]/,o=/[|\\{}()[\]^$+*?.-]/g;function r(e){return n.test(e)?e.replace(o,"\\$&"):e}},25523:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return o}});let o=n(47043)._(n(2265)).default.createContext(null)},57497:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{formatUrl:function(){return l},formatWithValidation:function(){return i},urlObjectKeys:function(){return a}});let o=n(53099)._(n(48637)),r=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:n}=e,l=e.protocol||"",a=e.pathname||"",i=e.hash||"",c=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:n&&(u=t+(~n.indexOf(":")?"["+n+"]":n),e.port&&(u+=":"+e.port)),c&&"object"==typeof c&&(c=String(o.urlQueryToSearchParams(c)));let s=e.search||c&&"?"+c||"";return l&&!l.endsWith(":")&&(l+=":"),e.slashes||(!l||r.test(l))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),s&&"?"!==s[0]&&(s="?"+s),""+l+u+(a=a.replace(/[?#]/g,encodeURIComponent))+(s=s.replace("#","%23"))+i}let a=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function i(e){return l(e)}},86279:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getSortedRoutes:function(){return o.getSortedRoutes},isDynamicRoute:function(){return r.isDynamicRoute}});let o=n(14777),r=n(38104)},37205:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"interpolateAs",{enumerable:!0,get:function(){return l}});let o=n(4199),r=n(9964);function l(e,t,n){let l="",a=(0,r.getRouteRegex)(e),i=a.groups,c=(t!==e?(0,o.getRouteMatcher)(a)(t):"")||n;l=e;let u=Object.keys(i);return u.every(e=>{let t=c[e]||"",{repeat:n,optional:o}=i[e],r="["+(n?"...":"")+e+"]";return o&&(r=(t?"":"/")+"["+r+"]"),n&&!Array.isArray(t)&&(t=[t]),(o||e in c)&&(l=l.replace(r,n?t.map(e=>encodeURIComponent(e)).join("/"):encodeURIComponent(t))||"/")})||(l=""),{params:u,result:l}}},38104:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return l}});let o=n(91182),r=/\/\[[^/]+?\](?=\/|$)/;function l(e){return(0,o.isInterceptionRouteAppPath)(e)&&(e=(0,o.extractInterceptionRouteInformation)(e).interceptedRoute),r.test(e)}},53552:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return l}});let o=n(3987),r=n(11283);function l(e){if(!(0,o.isAbsoluteUrl)(e))return!0;try{let t=(0,o.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,r.hasBasePath)(n.pathname)}catch(e){return!1}}},17053:function(e,t){function n(e,t){let n={};return Object.keys(e).forEach(o=>{t.includes(o)||(n[o]=e[o])}),n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return n}})},48637:function(e,t){function n(e){let t={};return e.forEach((e,n)=>{void 0===t[n]?t[n]=e:Array.isArray(t[n])?t[n].push(e):t[n]=[t[n],e]}),t}function o(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function r(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[n,r]=e;Array.isArray(r)?r.forEach(e=>t.append(n,o(e))):t.set(n,o(r))}),t}function l(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,n)=>e.append(n,t))}),e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{assign:function(){return l},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return r}})},4199:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return r}});let o=n(3987);function r(e){let{re:t,groups:n}=e;return e=>{let r=t.exec(e);if(!r)return!1;let l=e=>{try{return decodeURIComponent(e)}catch(e){throw new o.DecodeError("failed to decode param")}},a={};return Object.keys(n).forEach(e=>{let t=n[e],o=r[t.pos];void 0!==o&&(a[e]=~o.indexOf("/")?o.split("/").map(e=>l(e)):t.repeat?[l(o)]:l(o))}),a}}},9964:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getNamedMiddlewareRegex:function(){return g},getNamedRouteRegex:function(){return f},getRouteRegex:function(){return u},parseParameter:function(){return i}});let o=n(19259),r=n(91182),l=n(90042),a=n(26674);function i(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let n=e.startsWith("...");return n&&(e=e.slice(3)),{key:e,repeat:n,optional:t}}function c(e){let t=(0,a.removeTrailingSlash)(e).slice(1).split("/"),n={},o=1;return{parameterizedRoute:t.map(e=>{let t=r.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&a){let{key:e,optional:r,repeat:c}=i(a[1]);return n[e]={pos:o++,repeat:c,optional:r},"/"+(0,l.escapeStringRegexp)(t)+"([^/]+?)"}if(!a)return"/"+(0,l.escapeStringRegexp)(e);{let{key:e,repeat:t,optional:r}=i(a[1]);return n[e]={pos:o++,repeat:t,optional:r},t?r?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:n}}function u(e){let{parameterizedRoute:t,groups:n}=c(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:n}}function s(e){let{interceptionMarker:t,getSafeRouteKey:n,segment:o,routeKeys:r,keyPrefix:a}=e,{key:c,optional:u,repeat:s}=i(o),d=c.replace(/\W/g,"");a&&(d=""+a+d);let f=!1;(0===d.length||d.length>30)&&(f=!0),isNaN(parseInt(d.slice(0,1)))||(f=!0),f&&(d=n()),a?r[d]=""+a+c:r[d]=c;let g=t?(0,l.escapeStringRegexp)(t):"";return s?u?"(?:/"+g+"(?<"+d+">.+?))?":"/"+g+"(?<"+d+">.+?)":"/"+g+"(?<"+d+">[^/]+?)"}function d(e,t){let n;let i=(0,a.removeTrailingSlash)(e).slice(1).split("/"),c=(n=0,()=>{let e="",t=++n;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),u={};return{namedParameterizedRoute:i.map(e=>{let n=r.INTERCEPTION_ROUTE_MARKERS.some(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(n&&a){let[n]=e.split(a[0]);return s({getSafeRouteKey:c,interceptionMarker:n,segment:a[1],routeKeys:u,keyPrefix:t?o.NEXT_INTERCEPTION_MARKER_PREFIX:void 0})}return a?s({getSafeRouteKey:c,segment:a[1],routeKeys:u,keyPrefix:t?o.NEXT_QUERY_PARAM_PREFIX:void 0}):"/"+(0,l.escapeStringRegexp)(e)}).join(""),routeKeys:u}}function f(e,t){let n=d(e,t);return{...u(e),namedRegex:"^"+n.namedParameterizedRoute+"(?:/)?$",routeKeys:n.routeKeys}}function g(e,t){let{parameterizedRoute:n}=c(e),{catchAll:o=!0}=t;if("/"===n)return{namedRegex:"^/"+(o?".*":"")+"$"};let{namedParameterizedRoute:r}=d(e,!1);return{namedRegex:"^"+r+(o?"(?:(/.*)?)":"")+"$"}}},14777:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return o}});class n{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e){void 0===e&&(e="/");let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let n=t.map(t=>this.children.get(t)._smoosh(""+e+t+"/")).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&n.push(...this.children.get("[]")._smoosh(e+"["+this.slugName+"]/")),!this.placeholder){let t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'+t+'" and "'+t+"[[..."+this.optionalRestSlugName+']]").');n.unshift(t)}return null!==this.restSlugName&&n.push(...this.children.get("[...]")._smoosh(e+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&n.push(...this.children.get("[[...]]")._smoosh(e+"[[..."+this.optionalRestSlugName+"]]/")),n}_insert(e,t,o){if(0===e.length){this.placeholder=!1;return}if(o)throw Error("Catch-all must be the last part of the URL.");let r=e[0];if(r.startsWith("[")&&r.endsWith("]")){let n=r.slice(1,-1),a=!1;if(n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1),a=!0),n.startsWith("...")&&(n=n.substring(3),o=!0),n.startsWith("[")||n.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+n+"').");if(n.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+n+"').");function l(e,n){if(null!==e&&e!==n)throw Error("You cannot use different slug names for the same dynamic path ('"+e+"' !== '"+n+"').");t.forEach(e=>{if(e===n)throw Error('You cannot have the same slug name "'+n+'" repeat within a single dynamic path');if(e.replace(/\W/g,"")===r.replace(/\W/g,""))throw Error('You cannot have the slug names "'+e+'" and "'+n+'" differ only by non-word symbols within a single dynamic path')}),t.push(n)}if(o){if(a){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+e[0]+'" ).');l(this.optionalRestSlugName,n),this.optionalRestSlugName=n,r="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+e[0]+'").');l(this.restSlugName,n),this.restSlugName=n,r="[...]"}}else{if(a)throw Error('Optional route parameters are not yet supported ("'+e[0]+'").');l(this.slugName,n),this.slugName=n,r="[]"}}this.children.has(r)||this.children.set(r,new n),this.children.get(r)._insert(e.slice(1),t,o)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function o(e){let t=new n;return e.forEach(e=>t.insert(e)),t.smoosh()}},3987:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DecodeError:function(){return p},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return h},NormalizeError:function(){return m},PageNotFoundError:function(){return v},SP:function(){return f},ST:function(){return g},WEB_VITALS:function(){return n},execOnce:function(){return o},getDisplayName:function(){return c},getLocationOrigin:function(){return a},getURL:function(){return i},isAbsoluteUrl:function(){return l},isResSent:function(){return u},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return s},stringifyError:function(){return C}});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,n=!1;return function(){for(var o=arguments.length,r=Array(o),l=0;lr.test(e);function a(){let{protocol:e,hostname:t,port:n}=window.location;return e+"//"+t+(n?":"+n:"")}function i(){let{href:e}=window.location,t=a();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function u(e){return e.finished||e.headersSent}function s(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function d(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await d(t.Component,t.ctx)}:{};let o=await e.getInitialProps(t);if(n&&u(n))return o;if(!o)throw Error('"'+c(e)+'.getInitialProps()" should resolve to an object. But found "'+o+'" instead.');return o}let f="undefined"!=typeof performance,g=f&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class p extends Error{}class m extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class h extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class b extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function C(e){return JSON.stringify({message:e.message,stack:e.stack})}},71030:function(e,t,n){n.d(t,{Z:function(){return w}});var o=n(1119),r=n(11993),l=n(26365),a=n(6989),i=n(97821),c=n(36760),u=n.n(c),s=n(28791),d=n(2265),f=n(95814),g=n(53346),p=f.Z.ESC,m=f.Z.TAB,v=(0,d.forwardRef)(function(e,t){var n=e.overlay,o=e.arrow,r=e.prefixCls,l=(0,d.useMemo)(function(){return"function"==typeof n?n():n},[n]),a=(0,s.sQ)(t,null==l?void 0:l.ref);return d.createElement(d.Fragment,null,o&&d.createElement("div",{className:"".concat(r,"-arrow")}),d.cloneElement(l,{ref:(0,s.Yr)(l)?a:void 0}))}),h={adjustX:1,adjustY:1},b=[0,0],C={topLeft:{points:["bl","tl"],overflow:h,offset:[0,-4],targetOffset:b},top:{points:["bc","tc"],overflow:h,offset:[0,-4],targetOffset:b},topRight:{points:["br","tr"],overflow:h,offset:[0,-4],targetOffset:b},bottomLeft:{points:["tl","bl"],overflow:h,offset:[0,4],targetOffset:b},bottom:{points:["tc","bc"],overflow:h,offset:[0,4],targetOffset:b},bottomRight:{points:["tr","br"],overflow:h,offset:[0,4],targetOffset:b}},y=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"],w=d.forwardRef(function(e,t){var n,c,f,h,b,w,S,E,R,x,I,O,P,M,Z=e.arrow,N=void 0!==Z&&Z,k=e.prefixCls,_=void 0===k?"rc-dropdown":k,T=e.transitionName,j=e.animation,A=e.align,L=e.placement,F=e.placements,D=e.getPopupContainer,z=e.showAction,H=e.hideAction,B=e.overlayClassName,V=e.overlayStyle,G=e.visible,W=e.trigger,K=void 0===W?["hover"]:W,U=e.autoFocus,X=e.overlay,q=e.children,Y=e.onVisibleChange,$=(0,a.Z)(e,y),Q=d.useState(),J=(0,l.Z)(Q,2),ee=J[0],et=J[1],en="visible"in e?G:ee,eo=d.useRef(null),er=d.useRef(null),el=d.useRef(null);d.useImperativeHandle(t,function(){return eo.current});var ea=function(e){et(e),null==Y||Y(e)};c=(n={visible:en,triggerRef:el,onVisibleChange:ea,autoFocus:U,overlayRef:er}).visible,f=n.triggerRef,h=n.onVisibleChange,b=n.autoFocus,w=n.overlayRef,S=d.useRef(!1),E=function(){if(c){var e,t;null===(e=f.current)||void 0===e||null===(t=e.focus)||void 0===t||t.call(e),null==h||h(!1)}},R=function(){var e;return null!==(e=w.current)&&void 0!==e&&!!e.focus&&(w.current.focus(),S.current=!0,!0)},x=function(e){switch(e.keyCode){case p:E();break;case m:var t=!1;S.current||(t=R()),t?e.preventDefault():E()}},d.useEffect(function(){return c?(window.addEventListener("keydown",x),b&&(0,g.Z)(R,3),function(){window.removeEventListener("keydown",x),S.current=!1}):function(){S.current=!1}},[c]);var ei=function(){return d.createElement(v,{ref:er,overlay:X,prefixCls:_,arrow:N})},ec=d.cloneElement(q,{className:u()(null===(M=q.props)||void 0===M?void 0:M.className,en&&(void 0!==(I=e.openClassName)?I:"".concat(_,"-open"))),ref:(0,s.Yr)(q)?(0,s.sQ)(el,q.ref):void 0}),eu=H;return eu||-1===K.indexOf("contextMenu")||(eu=["click"]),d.createElement(i.Z,(0,o.Z)({builtinPlacements:void 0===F?C:F},$,{prefixCls:_,ref:eo,popupClassName:u()(B,(0,r.Z)({},"".concat(_,"-show-arrow"),N)),popupStyle:V,action:K,showAction:z,hideAction:eu,popupPlacement:void 0===L?"bottomLeft":L,popupAlign:A,popupTransitionName:T,popupAnimation:j,popupVisible:en,stretch:(O=e.minOverlayWidthMatchTrigger,P=e.alignPoint,"minOverlayWidthMatchTrigger"in e?O:!P)?"minWidth":"",popup:"function"==typeof X?ei:ei(),onPopupVisibleChange:ea,onPopupClick:function(t){var n=e.onOverlayClick;et(!1),n&&n(t)},getPopupContainer:D}),ec)})},33082:function(e,t,n){n.d(t,{iz:function(){return eL},ck:function(){return ep},BW:function(){return eA},sN:function(){return ep},Wd:function(){return eN},ZP:function(){return eB},Xl:function(){return O}});var o=n(1119),r=n(11993),l=n(31686),a=n(83145),i=n(26365),c=n(6989),u=n(36760),s=n.n(u),d=n(1699),f=n(50506),g=n(16671),p=n(32559),m=n(2265),v=n(54887),h=m.createContext(null);function b(e,t){return void 0===e?null:"".concat(e,"-").concat(t)}function C(e){return b(m.useContext(h),e)}var y=n(6397),w=["children","locked"],S=m.createContext(null);function E(e){var t=e.children,n=e.locked,o=(0,c.Z)(e,w),r=m.useContext(S),a=(0,y.Z)(function(){var e;return e=(0,l.Z)({},r),Object.keys(o).forEach(function(t){var n=o[t];void 0!==n&&(e[t]=n)}),e},[r,o],function(e,t){return!n&&(e[0]!==t[0]||!(0,g.Z)(e[1],t[1],!0))});return m.createElement(S.Provider,{value:a},t)}var R=m.createContext(null);function x(){return m.useContext(R)}var I=m.createContext([]);function O(e){var t=m.useContext(I);return m.useMemo(function(){return void 0!==e?[].concat((0,a.Z)(t),[e]):t},[t,e])}var P=m.createContext(null),M=m.createContext({}),Z=n(2857);function N(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,Z.Z)(e)){var n=e.nodeName.toLowerCase(),o=["input","select","textarea","button"].includes(n)||e.isContentEditable||"a"===n&&!!e.getAttribute("href"),r=e.getAttribute("tabindex"),l=Number(r),a=null;return r&&!Number.isNaN(l)?a=l:o&&null===a&&(a=0),o&&e.disabled&&(a=null),null!==a&&(a>=0||t&&a<0)}return!1}var k=n(95814),_=n(53346),T=k.Z.LEFT,j=k.Z.RIGHT,A=k.Z.UP,L=k.Z.DOWN,F=k.Z.ENTER,D=k.Z.ESC,z=k.Z.HOME,H=k.Z.END,B=[A,L,T,j];function V(e,t){return(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,a.Z)(e.querySelectorAll("*")).filter(function(e){return N(e,t)});return N(e,t)&&n.unshift(e),n})(e,!0).filter(function(e){return t.has(e)})}function G(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var r=V(e,t),l=r.length,a=r.findIndex(function(e){return n===e});return o<0?-1===a?a=l-1:a-=1:o>0&&(a+=1),r[a=(a+l)%l]}var W=function(e,t){var n=new Set,o=new Map,r=new Map;return e.forEach(function(e){var l=document.querySelector("[data-menu-id='".concat(b(t,e),"']"));l&&(n.add(l),r.set(l,e),o.set(e,l))}),{elements:n,key2element:o,element2key:r}},K="__RC_UTIL_PATH_SPLIT__",U=function(e){return e.join(K)},X="rc-menu-more";function q(e){var t=m.useRef(e);t.current=e;var n=m.useCallback(function(){for(var e,n=arguments.length,o=Array(n),r=0;r1&&(R.motionAppear=!1);var x=R.onVisibleChanged;return(R.onVisibleChanged=function(e){return v.current||e||y(!0),null==x?void 0:x(e)},C)?null:m.createElement(E,{mode:c,locked:!v.current},m.createElement(eI.ZP,(0,o.Z)({visible:w},R,{forceRender:d,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(e){var n=e.className,o=e.style;return m.createElement(ev,{id:t,className:n,style:o},a)}))}var eP=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],eM=["active"],eZ=function(e){var t,n=e.style,a=e.className,u=e.title,f=e.eventKey,g=(e.warnKey,e.disabled),p=e.internalPopupClose,v=e.children,h=e.itemIcon,b=e.expandIcon,y=e.popupClassName,w=e.popupOffset,R=e.popupStyle,x=e.onClick,I=e.onMouseEnter,Z=e.onMouseLeave,N=e.onTitleClick,k=e.onTitleMouseEnter,_=e.onTitleMouseLeave,T=(0,c.Z)(e,eP),j=C(f),A=m.useContext(S),L=A.prefixCls,F=A.mode,D=A.openKeys,z=A.disabled,H=A.overflowDisabled,B=A.activeKey,V=A.selectedKeys,G=A.itemIcon,W=A.expandIcon,K=A.onItemClick,U=A.onOpenChange,X=A.onActive,Y=m.useContext(M)._internalRenderSubMenuItem,$=m.useContext(P).isSubPathKey,Q=O(),J="".concat(L,"-submenu"),ee=z||g,et=m.useRef(),en=m.useRef(),eo=null!=b?b:W,ei=D.includes(f),eu=!H&&ei,es=$(V,f),ed=er(f,ee,k,_),ef=ed.active,eg=(0,c.Z)(ed,eM),ep=m.useState(!1),em=(0,i.Z)(ep,2),eh=em[0],eb=em[1],eC=function(e){ee||eb(e)},ey=m.useMemo(function(){return ef||"inline"!==F&&(eh||$([B],f))},[F,ef,B,eh,f,$]),ew=el(Q.length),eS=q(function(e){null==x||x(ec(e)),K(e)}),eE=j&&"".concat(j,"-popup"),eR=m.createElement("div",(0,o.Z)({role:"menuitem",style:ew,className:"".concat(J,"-title"),tabIndex:ee?null:-1,ref:et,title:"string"==typeof u?u:null,"data-menu-id":H&&j?null:j,"aria-expanded":eu,"aria-haspopup":!0,"aria-controls":eE,"aria-disabled":ee,onClick:function(e){ee||(null==N||N({key:f,domEvent:e}),"inline"===F&&U(f,!ei))},onFocus:function(){X(f)}},eg),u,m.createElement(ea,{icon:"horizontal"!==F?eo:void 0,props:(0,l.Z)((0,l.Z)({},e),{},{isOpen:eu,isSubMenu:!0})},m.createElement("i",{className:"".concat(J,"-arrow")}))),eI=m.useRef(F);if("inline"!==F&&Q.length>1?eI.current="vertical":eI.current=F,!H){var eZ=eI.current;eR=m.createElement(ex,{mode:eZ,prefixCls:J,visible:!p&&eu&&"inline"!==F,popupClassName:y,popupOffset:w,popupStyle:R,popup:m.createElement(E,{mode:"horizontal"===eZ?"vertical":eZ},m.createElement(ev,{id:eE,ref:en},v)),disabled:ee,onVisibleChange:function(e){"inline"!==F&&U(f,e)}},eR)}var eN=m.createElement(d.Z.Item,(0,o.Z)({role:"none"},T,{component:"li",style:n,className:s()(J,"".concat(J,"-").concat(F),a,(t={},(0,r.Z)(t,"".concat(J,"-open"),eu),(0,r.Z)(t,"".concat(J,"-active"),ey),(0,r.Z)(t,"".concat(J,"-selected"),es),(0,r.Z)(t,"".concat(J,"-disabled"),ee),t)),onMouseEnter:function(e){eC(!0),null==I||I({key:f,domEvent:e})},onMouseLeave:function(e){eC(!1),null==Z||Z({key:f,domEvent:e})}}),eR,!H&&m.createElement(eO,{id:eE,open:eu,keyPath:Q},v));return Y&&(eN=Y(eN,e,{selected:es,active:ey,open:eu,disabled:ee})),m.createElement(E,{onItemClick:eS,mode:"horizontal"===F?"vertical":F,itemIcon:null!=h?h:G,expandIcon:eo},eN)};function eN(e){var t,n=e.eventKey,o=e.children,r=O(n),l=eb(o,r),a=x();return m.useEffect(function(){if(a)return a.registerPath(n,r),function(){a.unregisterPath(n,r)}},[r]),t=a?l:m.createElement(eZ,e,l),m.createElement(I.Provider,{value:r},t)}var ek=n(41154),e_=["className","title","eventKey","children"],eT=["children"],ej=function(e){var t=e.className,n=e.title,r=(e.eventKey,e.children),l=(0,c.Z)(e,e_),a=m.useContext(S).prefixCls,i="".concat(a,"-item-group");return m.createElement("li",(0,o.Z)({role:"presentation"},l,{onClick:function(e){return e.stopPropagation()},className:s()(i,t)}),m.createElement("div",{role:"presentation",className:"".concat(i,"-title"),title:"string"==typeof n?n:void 0},n),m.createElement("ul",{role:"group",className:"".concat(i,"-list")},r))};function eA(e){var t=e.children,n=(0,c.Z)(e,eT),o=eb(t,O(n.eventKey));return x()?o:m.createElement(ej,(0,en.Z)(n,["warnKey"]),o)}function eL(e){var t=e.className,n=e.style,o=m.useContext(S).prefixCls;return x()?null:m.createElement("li",{role:"separator",className:s()("".concat(o,"-item-divider"),t),style:n})}var eF=["label","children","key","type"],eD=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],ez=[],eH=m.forwardRef(function(e,t){var n,u,p,b,C,y,w,S,x,I,O,Z,N,k,Q,J,ee,et,en,eo,er,el,ea,ei,eu,es,ed,ef=e.prefixCls,eg=void 0===ef?"rc-menu":ef,em=e.rootClassName,ev=e.style,eh=e.className,eC=e.tabIndex,ey=e.items,ew=e.children,eS=e.direction,eE=e.id,eR=e.mode,ex=void 0===eR?"vertical":eR,eI=e.inlineCollapsed,eO=e.disabled,eP=e.disabledOverflow,eM=e.subMenuOpenDelay,eZ=e.subMenuCloseDelay,e_=e.forceSubMenuRender,eT=e.defaultOpenKeys,ej=e.openKeys,eH=e.activeKey,eB=e.defaultActiveFirst,eV=e.selectable,eG=void 0===eV||eV,eW=e.multiple,eK=void 0!==eW&&eW,eU=e.defaultSelectedKeys,eX=e.selectedKeys,eq=e.onSelect,eY=e.onDeselect,e$=e.inlineIndent,eQ=e.motion,eJ=e.defaultMotions,e0=e.triggerSubMenuAction,e1=e.builtinPlacements,e2=e.itemIcon,e5=e.expandIcon,e6=e.overflowedIndicator,e4=void 0===e6?"...":e6,e3=e.overflowedIndicatorPopupClassName,e8=e.getPopupContainer,e9=e.onClick,e7=e.onOpenChange,te=e.onKeyDown,tt=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),tn=e._internalRenderSubMenuItem,to=(0,c.Z)(e,eD),tr=m.useMemo(function(){var e;return e=ew,ey&&(e=function e(t){return(t||[]).map(function(t,n){if(t&&"object"===(0,ek.Z)(t)){var r=t.label,l=t.children,a=t.key,i=t.type,u=(0,c.Z)(t,eF),s=null!=a?a:"tmp-".concat(n);return l||"group"===i?"group"===i?m.createElement(eA,(0,o.Z)({key:s},u,{title:r}),e(l)):m.createElement(eN,(0,o.Z)({key:s},u,{title:r}),e(l)):"divider"===i?m.createElement(eL,(0,o.Z)({key:s},u)):m.createElement(ep,(0,o.Z)({key:s},u),r)}return null}).filter(function(e){return e})}(ey)),eb(e,ez)},[ew,ey]),tl=m.useState(!1),ta=(0,i.Z)(tl,2),ti=ta[0],tc=ta[1],tu=m.useRef(),ts=(n=(0,f.Z)(eE,{value:eE}),p=(u=(0,i.Z)(n,2))[0],b=u[1],m.useEffect(function(){$+=1;var e="".concat(Y,"-").concat($);b("rc-menu-uuid-".concat(e))},[]),p),td="rtl"===eS,tf=(0,f.Z)(eT,{value:ej,postState:function(e){return e||ez}}),tg=(0,i.Z)(tf,2),tp=tg[0],tm=tg[1],tv=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(){tm(e),null==e7||e7(e)}t?(0,v.flushSync)(n):n()},th=m.useState(tp),tb=(0,i.Z)(th,2),tC=tb[0],ty=tb[1],tw=m.useRef(!1),tS=m.useMemo(function(){return("inline"===ex||"vertical"===ex)&&eI?["vertical",eI]:[ex,!1]},[ex,eI]),tE=(0,i.Z)(tS,2),tR=tE[0],tx=tE[1],tI="inline"===tR,tO=m.useState(tR),tP=(0,i.Z)(tO,2),tM=tP[0],tZ=tP[1],tN=m.useState(tx),tk=(0,i.Z)(tN,2),t_=tk[0],tT=tk[1];m.useEffect(function(){tZ(tR),tT(tx),tw.current&&(tI?tm(tC):tv(ez))},[tR,tx]);var tj=m.useState(0),tA=(0,i.Z)(tj,2),tL=tA[0],tF=tA[1],tD=tL>=tr.length-1||"horizontal"!==tM||eP;m.useEffect(function(){tI&&ty(tp)},[tp]),m.useEffect(function(){return tw.current=!0,function(){tw.current=!1}},[]);var tz=(C=m.useState({}),y=(0,i.Z)(C,2)[1],w=(0,m.useRef)(new Map),S=(0,m.useRef)(new Map),x=m.useState([]),O=(I=(0,i.Z)(x,2))[0],Z=I[1],N=(0,m.useRef)(0),k=(0,m.useRef)(!1),Q=function(){k.current||y({})},J=(0,m.useCallback)(function(e,t){var n,o=U(t);S.current.set(o,e),w.current.set(e,o),N.current+=1;var r=N.current;n=function(){r===N.current&&Q()},Promise.resolve().then(n)},[]),ee=(0,m.useCallback)(function(e,t){var n=U(t);S.current.delete(n),w.current.delete(e)},[]),et=(0,m.useCallback)(function(e){Z(e)},[]),en=(0,m.useCallback)(function(e,t){var n=(w.current.get(e)||"").split(K);return t&&O.includes(n[0])&&n.unshift(X),n},[O]),eo=(0,m.useCallback)(function(e,t){return e.some(function(e){return en(e,!0).includes(t)})},[en]),er=(0,m.useCallback)(function(e){var t="".concat(w.current.get(e)).concat(K),n=new Set;return(0,a.Z)(S.current.keys()).forEach(function(e){e.startsWith(t)&&n.add(S.current.get(e))}),n},[]),m.useEffect(function(){return function(){k.current=!0}},[]),{registerPath:J,unregisterPath:ee,refreshOverflowKeys:et,isSubPathKey:eo,getKeyPath:en,getKeys:function(){var e=(0,a.Z)(w.current.keys());return O.length&&e.push(X),e},getSubPathKeys:er}),tH=tz.registerPath,tB=tz.unregisterPath,tV=tz.refreshOverflowKeys,tG=tz.isSubPathKey,tW=tz.getKeyPath,tK=tz.getKeys,tU=tz.getSubPathKeys,tX=m.useMemo(function(){return{registerPath:tH,unregisterPath:tB}},[tH,tB]),tq=m.useMemo(function(){return{isSubPathKey:tG}},[tG]);m.useEffect(function(){tV(tD?ez:tr.slice(tL+1).map(function(e){return e.key}))},[tL,tD]);var tY=(0,f.Z)(eH||eB&&(null===(es=tr[0])||void 0===es?void 0:es.key),{value:eH}),t$=(0,i.Z)(tY,2),tQ=t$[0],tJ=t$[1],t0=q(function(e){tJ(e)}),t1=q(function(){tJ(void 0)});(0,m.useImperativeHandle)(t,function(){return{list:tu.current,focus:function(e){var t,n,o=W(tK(),ts),r=o.elements,l=o.key2element,a=o.element2key,i=V(tu.current,r),c=null!=tQ?tQ:i[0]?a.get(i[0]):null===(t=tr.find(function(e){return!e.props.disabled}))||void 0===t?void 0:t.key,u=l.get(c);c&&u&&(null==u||null===(n=u.focus)||void 0===n||n.call(u,e))}}});var t2=(0,f.Z)(eU||[],{value:eX,postState:function(e){return Array.isArray(e)?e:null==e?ez:[e]}}),t5=(0,i.Z)(t2,2),t6=t5[0],t4=t5[1],t3=function(e){if(eG){var t,n=e.key,o=t6.includes(n);t4(t=eK?o?t6.filter(function(e){return e!==n}):[].concat((0,a.Z)(t6),[n]):[n]);var r=(0,l.Z)((0,l.Z)({},e),{},{selectedKeys:t});o?null==eY||eY(r):null==eq||eq(r)}!eK&&tp.length&&"inline"!==tM&&tv(ez)},t8=q(function(e){null==e9||e9(ec(e)),t3(e)}),t9=q(function(e,t){var n=tp.filter(function(t){return t!==e});if(t)n.push(e);else if("inline"!==tM){var o=tU(e);n=n.filter(function(e){return!o.has(e)})}(0,g.Z)(tp,n,!0)||tv(n,!0)}),t7=(el=function(e,t){var n=null!=t?t:!tp.includes(e);t9(e,n)},ea=m.useRef(),(ei=m.useRef()).current=tQ,eu=function(){_.Z.cancel(ea.current)},m.useEffect(function(){return function(){eu()}},[]),function(e){var t=e.which;if([].concat(B,[F,D,z,H]).includes(t)){var n=tK(),o=W(n,ts),l=o,a=l.elements,i=l.key2element,c=l.element2key,u=function(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}(i.get(tQ),a),s=c.get(u),d=function(e,t,n,o){var l,a,i,c,u="prev",s="next",d="children",f="parent";if("inline"===e&&o===F)return{inlineTrigger:!0};var g=(l={},(0,r.Z)(l,A,u),(0,r.Z)(l,L,s),l),p=(a={},(0,r.Z)(a,T,n?s:u),(0,r.Z)(a,j,n?u:s),(0,r.Z)(a,L,d),(0,r.Z)(a,F,d),a),m=(i={},(0,r.Z)(i,A,u),(0,r.Z)(i,L,s),(0,r.Z)(i,F,d),(0,r.Z)(i,D,f),(0,r.Z)(i,T,n?d:f),(0,r.Z)(i,j,n?f:d),i);switch(null===(c=({inline:g,horizontal:p,vertical:m,inlineSub:g,horizontalSub:m,verticalSub:m})["".concat(e).concat(t?"":"Sub")])||void 0===c?void 0:c[o]){case u:return{offset:-1,sibling:!0};case s:return{offset:1,sibling:!0};case f:return{offset:-1,sibling:!1};case d:return{offset:1,sibling:!1};default:return null}}(tM,1===tW(s,!0).length,td,t);if(!d&&t!==z&&t!==H)return;(B.includes(t)||[z,H].includes(t))&&e.preventDefault();var f=function(e){if(e){var t=e,n=e.querySelector("a");null!=n&&n.getAttribute("href")&&(t=n);var o=c.get(e);tJ(o),eu(),ea.current=(0,_.Z)(function(){ei.current===o&&t.focus()})}};if([z,H].includes(t)||d.sibling||!u){var g,p=V(g=u&&"inline"!==tM?function(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}(u):tu.current,a);f(t===z?p[0]:t===H?p[p.length-1]:G(g,a,u,d.offset))}else if(d.inlineTrigger)el(s);else if(d.offset>0)el(s,!0),eu(),ea.current=(0,_.Z)(function(){o=W(n,ts);var e=u.getAttribute("aria-controls");f(G(document.getElementById(e),o.elements))},5);else if(d.offset<0){var m=tW(s,!0),v=m[m.length-2],h=i.get(v);el(v,!1),f(h)}}null==te||te(e)});m.useEffect(function(){tc(!0)},[]);var ne=m.useMemo(function(){return{_internalRenderMenuItem:tt,_internalRenderSubMenuItem:tn}},[tt,tn]),nt="horizontal"!==tM||eP?tr:tr.map(function(e,t){return m.createElement(E,{key:e.key,overflowDisabled:t>tL},e)}),nn=m.createElement(d.Z,(0,o.Z)({id:eE,ref:tu,prefixCls:"".concat(eg,"-overflow"),component:"ul",itemComponent:ep,className:s()(eg,"".concat(eg,"-root"),"".concat(eg,"-").concat(tM),eh,(ed={},(0,r.Z)(ed,"".concat(eg,"-inline-collapsed"),t_),(0,r.Z)(ed,"".concat(eg,"-rtl"),td),ed),em),dir:eS,style:ev,role:"menu",tabIndex:void 0===eC?0:eC,data:nt,renderRawItem:function(e){return e},renderRawRest:function(e){var t=e.length,n=t?tr.slice(-t):null;return m.createElement(eN,{eventKey:X,title:e4,disabled:tD,internalPopupClose:0===t,popupClassName:e3},n)},maxCount:"horizontal"!==tM||eP?d.Z.INVALIDATE:d.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){tF(e)},onKeyDown:t7},to));return m.createElement(M.Provider,{value:ne},m.createElement(h.Provider,{value:ts},m.createElement(E,{prefixCls:eg,rootClassName:em,mode:tM,openKeys:tp,rtl:td,disabled:eO,motion:ti?eQ:null,defaultMotions:ti?eJ:null,activeKey:tQ,onActive:t0,onInactive:t1,selectedKeys:t6,inlineIndent:void 0===e$?24:e$,subMenuOpenDelay:void 0===eM?.1:eM,subMenuCloseDelay:void 0===eZ?.1:eZ,forceSubMenuRender:e_,builtinPlacements:e1,triggerSubMenuAction:void 0===e0?"hover":e0,getPopupContainer:e8,itemIcon:e2,expandIcon:e5,onItemClick:t8,onOpenChange:t9},m.createElement(P.Provider,{value:tq},nn),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(R.Provider,{value:tX},tr)))))});eH.Item=ep,eH.SubMenu=eN,eH.ItemGroup=eA,eH.Divider=eL;var eB=eH},1699:function(e,t,n){n.d(t,{Z:function(){return M}});var o=n(1119),r=n(31686),l=n(26365),a=n(6989),i=n(2265),c=n(36760),u=n.n(c),s=n(31474),d=n(27380),f=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],g=void 0,p=i.forwardRef(function(e,t){var n,l=e.prefixCls,c=e.invalidate,d=e.item,p=e.renderItem,m=e.responsive,v=e.responsiveDisabled,h=e.registerSize,b=e.itemKey,C=e.className,y=e.style,w=e.children,S=e.display,E=e.order,R=e.component,x=(0,a.Z)(e,f),I=m&&!S;i.useEffect(function(){return function(){h(b,null)}},[]);var O=p&&d!==g?p(d):w;c||(n={opacity:I?0:1,height:I?0:g,overflowY:I?"hidden":g,order:m?E:g,pointerEvents:I?"none":g,position:I?"absolute":g});var P={};I&&(P["aria-hidden"]=!0);var M=i.createElement(void 0===R?"div":R,(0,o.Z)({className:u()(!c&&l,C),style:(0,r.Z)((0,r.Z)({},n),y)},P,x,{ref:t}),O);return m&&(M=i.createElement(s.Z,{onResize:function(e){h(b,e.offsetWidth)},disabled:v},M)),M});p.displayName="Item";var m=n(58525),v=n(54887),h=n(53346);function b(e,t){var n=i.useState(t),o=(0,l.Z)(n,2),r=o[0],a=o[1];return[r,(0,m.Z)(function(t){e(function(){a(t)})})]}var C=i.createContext(null),y=["component"],w=["className"],S=["className"],E=i.forwardRef(function(e,t){var n=i.useContext(C);if(!n){var r=e.component,l=(0,a.Z)(e,y);return i.createElement(void 0===r?"div":r,(0,o.Z)({},l,{ref:t}))}var c=n.className,s=(0,a.Z)(n,w),d=e.className,f=(0,a.Z)(e,S);return i.createElement(C.Provider,{value:null},i.createElement(p,(0,o.Z)({ref:t,className:u()(c,d)},s,f)))});E.displayName="RawItem";var R=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],x="responsive",I="invalidate";function O(e){return"+ ".concat(e.length," ...")}var P=i.forwardRef(function(e,t){var n,c,f=e.prefixCls,g=void 0===f?"rc-overflow":f,m=e.data,y=void 0===m?[]:m,w=e.renderItem,S=e.renderRawItem,E=e.itemKey,P=e.itemWidth,M=void 0===P?10:P,Z=e.ssr,N=e.style,k=e.className,_=e.maxCount,T=e.renderRest,j=e.renderRawRest,A=e.suffix,L=e.component,F=e.itemComponent,D=e.onVisibleChange,z=(0,a.Z)(e,R),H="full"===Z,B=(n=i.useRef(null),function(e){n.current||(n.current=[],function(e){if("undefined"==typeof MessageChannel)(0,h.Z)(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}(function(){(0,v.unstable_batchedUpdates)(function(){n.current.forEach(function(e){e()}),n.current=null})})),n.current.push(e)}),V=b(B,null),G=(0,l.Z)(V,2),W=G[0],K=G[1],U=W||0,X=b(B,new Map),q=(0,l.Z)(X,2),Y=q[0],$=q[1],Q=b(B,0),J=(0,l.Z)(Q,2),ee=J[0],et=J[1],en=b(B,0),eo=(0,l.Z)(en,2),er=eo[0],el=eo[1],ea=b(B,0),ei=(0,l.Z)(ea,2),ec=ei[0],eu=ei[1],es=(0,i.useState)(null),ed=(0,l.Z)(es,2),ef=ed[0],eg=ed[1],ep=(0,i.useState)(null),em=(0,l.Z)(ep,2),ev=em[0],eh=em[1],eb=i.useMemo(function(){return null===ev&&H?Number.MAX_SAFE_INTEGER:ev||0},[ev,W]),eC=(0,i.useState)(!1),ey=(0,l.Z)(eC,2),ew=ey[0],eS=ey[1],eE="".concat(g,"-item"),eR=Math.max(ee,er),ex=_===x,eI=y.length&&ex,eO=_===I,eP=eI||"number"==typeof _&&y.length>_,eM=(0,i.useMemo)(function(){var e=y;return eI?e=null===W&&H?y:y.slice(0,Math.min(y.length,U/M)):"number"==typeof _&&(e=y.slice(0,_)),e},[y,M,W,_,eI]),eZ=(0,i.useMemo)(function(){return eI?y.slice(eb+1):y.slice(eM.length)},[y,eM,eI,eb]),eN=(0,i.useCallback)(function(e,t){var n;return"function"==typeof E?E(e):null!==(n=E&&(null==e?void 0:e[E]))&&void 0!==n?n:t},[E]),ek=(0,i.useCallback)(w||function(e){return e},[w]);function e_(e,t,n){(ev!==e||void 0!==t&&t!==ef)&&(eh(e),n||(eS(eU){e_(o-1,e-r-ec+er);break}}A&&ej(0)+ec>U&&eg(null)}},[U,Y,er,ec,eN,eM]);var eA=ew&&!!eZ.length,eL={};null!==ef&&eI&&(eL={position:"absolute",left:ef,top:0});var eF={prefixCls:eE,responsive:eI,component:F,invalidate:eO},eD=S?function(e,t){var n=eN(e,t);return i.createElement(C.Provider,{key:n,value:(0,r.Z)((0,r.Z)({},eF),{},{order:t,item:e,itemKey:n,registerSize:eT,display:t<=eb})},S(e,t))}:function(e,t){var n=eN(e,t);return i.createElement(p,(0,o.Z)({},eF,{order:t,key:n,item:e,renderItem:ek,itemKey:n,registerSize:eT,display:t<=eb}))},ez={order:eA?eb:Number.MAX_SAFE_INTEGER,className:"".concat(eE,"-rest"),registerSize:function(e,t){el(t),et(er)},display:eA};if(j)j&&(c=i.createElement(C.Provider,{value:(0,r.Z)((0,r.Z)({},eF),ez)},j(eZ)));else{var eH=T||O;c=i.createElement(p,(0,o.Z)({},eF,ez),"function"==typeof eH?eH(eZ):eH)}var eB=i.createElement(void 0===L?"div":L,(0,o.Z)({className:u()(!eO&&g,k),style:N,ref:t},z),eM.map(eD),eP?c:null,A&&i.createElement(p,(0,o.Z)({},eF,{responsive:ex,responsiveDisabled:!eI,order:eb,className:"".concat(eE,"-suffix"),registerSize:function(e,t){eu(t)},display:!0,style:eL}),A));return ex&&(eB=i.createElement(s.Z,{onResize:function(e,t){K(t.clientWidth)},disabled:!eI},eB)),eB});P.displayName="Overflow",P.Item=E,P.RESPONSIVE=x,P.INVALIDATE=I;var M=P},18242:function(e,t,n){n.d(t,{Z:function(){return a}});var o=n(31686),r="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/);function l(e,t){return 0===e.indexOf(t)}function a(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:(0,o.Z)({},n);var a={};return Object.keys(e).forEach(function(n){(t.aria&&("role"===n||l(n,"aria-"))||t.data&&l(n,"data-")||t.attr&&r.includes(n))&&(a[n]=e[n])}),a}},48625:function(e,t,n){n.d(t,{Z:function(){return _}});var o=n(1119),r=n(31686),l=n(41154),a=n(26365),i=n(11993),c=n(6989),u=n(2265),s=n(54887),d=n(36760),f=n.n(d),g=n(31474),p=u.forwardRef(function(e,t){var n,l=e.height,a=e.offsetY,c=e.offsetX,s=e.children,d=e.prefixCls,p=e.onInnerResize,m=e.innerProps,v=e.rtl,h=e.extra,b={},C={display:"flex",flexDirection:"column"};return void 0!==a&&(b={height:l,position:"relative",overflow:"hidden"},C=(0,r.Z)((0,r.Z)({},C),{},(n={transform:"translateY(".concat(a,"px)")},(0,i.Z)(n,v?"marginRight":"marginLeft",-c),(0,i.Z)(n,"position","absolute"),(0,i.Z)(n,"left",0),(0,i.Z)(n,"right",0),(0,i.Z)(n,"top",0),n))),u.createElement("div",{style:b},u.createElement(g.Z,{onResize:function(e){e.offsetHeight&&p&&p()}},u.createElement("div",(0,o.Z)({style:C,className:f()((0,i.Z)({},"".concat(d,"-holder-inner"),d)),ref:t},m),s,h)))});p.displayName="Filler";var m=n(53346);function v(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]}var h=u.forwardRef(function(e,t){var n,o=e.prefixCls,l=e.rtl,c=e.scrollOffset,s=e.scrollRange,d=e.onStartMove,g=e.onStopMove,p=e.onScroll,h=e.horizontal,b=e.spinSize,C=e.containerSize,y=e.style,w=e.thumbStyle,S=u.useState(!1),E=(0,a.Z)(S,2),R=E[0],x=E[1],I=u.useState(null),O=(0,a.Z)(I,2),P=O[0],M=O[1],Z=u.useState(null),N=(0,a.Z)(Z,2),k=N[0],_=N[1],T=!l,j=u.useRef(),A=u.useRef(),L=u.useState(!1),F=(0,a.Z)(L,2),D=F[0],z=F[1],H=u.useRef(),B=function(){clearTimeout(H.current),z(!0),H.current=setTimeout(function(){z(!1)},3e3)},V=s-C||0,G=C-b||0,W=u.useMemo(function(){return 0===c||0===V?0:c/V*G},[c,V,G]),K=u.useRef({top:W,dragging:R,pageY:P,startTop:k});K.current={top:W,dragging:R,pageY:P,startTop:k};var U=function(e){x(!0),M(v(e,h)),_(K.current.top),d(),e.stopPropagation(),e.preventDefault()};u.useEffect(function(){var e=function(e){e.preventDefault()},t=j.current,n=A.current;return t.addEventListener("touchstart",e),n.addEventListener("touchstart",U),function(){t.removeEventListener("touchstart",e),n.removeEventListener("touchstart",U)}},[]);var X=u.useRef();X.current=V;var q=u.useRef();q.current=G,u.useEffect(function(){if(R){var e,t=function(t){var n=K.current,o=n.dragging,r=n.pageY,l=n.startTop;if(m.Z.cancel(e),o){var a=v(t,h)-r,i=l;!T&&h?i-=a:i+=a;var c=X.current,u=q.current,s=Math.ceil((u?i/u:0)*c);s=Math.min(s=Math.max(s,0),c),e=(0,m.Z)(function(){p(s,h)})}},n=function(){x(!1),g()};return window.addEventListener("mousemove",t),window.addEventListener("touchmove",t),window.addEventListener("mouseup",n),window.addEventListener("touchend",n),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n),m.Z.cancel(e)}}},[R]),u.useEffect(function(){B()},[c]),u.useImperativeHandle(t,function(){return{delayHidden:B}});var Y="".concat(o,"-scrollbar"),$={position:"absolute",visibility:D&&V>0?null:"hidden"},Q={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return h?($.height=8,$.left=0,$.right=0,$.bottom=0,Q.height="100%",Q.width=b,T?Q.left=W:Q.right=W):($.width=8,$.top=0,$.bottom=0,T?$.right=0:$.left=0,Q.width="100%",Q.height=b,Q.top=W),u.createElement("div",{ref:j,className:f()(Y,(n={},(0,i.Z)(n,"".concat(Y,"-horizontal"),h),(0,i.Z)(n,"".concat(Y,"-vertical"),!h),(0,i.Z)(n,"".concat(Y,"-visible"),D),n)),style:(0,r.Z)((0,r.Z)({},$),y),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:B},u.createElement("div",{ref:A,className:f()("".concat(Y,"-thumb"),(0,i.Z)({},"".concat(Y,"-thumb-moving"),R)),style:(0,r.Z)((0,r.Z)({},Q),w),onMouseDown:U}))});function b(e){var t=e.children,n=e.setRef,o=u.useCallback(function(e){n(e)},[]);return u.cloneElement(t,{ref:o})}var C=n(2868),y=n(76405),w=n(25049),S=function(){function e(){(0,y.Z)(this,e),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,w.Z)(e,[{key:"set",value:function(e,t){this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}}]),e}(),E=n(27380),R=n(74126),x=("undefined"==typeof navigator?"undefined":(0,l.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),I=function(e,t){var n=(0,u.useRef)(!1),o=(0,u.useRef)(null),r=(0,u.useRef)({top:e,bottom:t});return r.current.top=e,r.current.bottom=t,function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=e<0&&r.current.top||e>0&&r.current.bottom;return t&&l?(clearTimeout(o.current),n.current=!1):(!l||n.current)&&(clearTimeout(o.current),n.current=!0,o.current=setTimeout(function(){n.current=!1},50)),!n.current&&l}},O=14/15;function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e/t*100;return isNaN(n)&&(n=0),Math.floor(n=Math.min(n=Math.max(n,20),e/2))}var M=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],Z=[],N={overflowY:"auto",overflowAnchor:"none"},k=u.forwardRef(function(e,t){var n,d,v,y,w,k,_,T,j,A,L,F,D,z,H,B,V,G,W,K,U,X,q,Y,$,Q,J,ee,et,en,eo,er,el,ea,ei,ec=e.prefixCls,eu=void 0===ec?"rc-virtual-list":ec,es=e.className,ed=e.height,ef=e.itemHeight,eg=e.fullHeight,ep=e.style,em=e.data,ev=e.children,eh=e.itemKey,eb=e.virtual,eC=e.direction,ey=e.scrollWidth,ew=e.component,eS=e.onScroll,eE=e.onVirtualScroll,eR=e.onVisibleChange,ex=e.innerProps,eI=e.extraRender,eO=e.styles,eP=(0,c.Z)(e,M),eM=!!(!1!==eb&&ed&&ef),eZ=eM&&em&&(ef*em.length>ed||!!ey),eN="rtl"===eC,ek=f()(eu,(0,i.Z)({},"".concat(eu,"-rtl"),eN),es),e_=em||Z,eT=(0,u.useRef)(),ej=(0,u.useRef)(),eA=(0,u.useState)(0),eL=(0,a.Z)(eA,2),eF=eL[0],eD=eL[1],ez=(0,u.useState)(0),eH=(0,a.Z)(ez,2),eB=eH[0],eV=eH[1],eG=(0,u.useState)(!1),eW=(0,a.Z)(eG,2),eK=eW[0],eU=eW[1],eX=function(){eU(!0)},eq=function(){eU(!1)},eY=u.useCallback(function(e){return"function"==typeof eh?eh(e):null==e?void 0:e[eh]},[eh]);function e$(e){eD(function(t){var n,o=(n="function"==typeof e?e(t):e,Number.isNaN(tf.current)||(n=Math.min(n,tf.current)),n=Math.max(n,0));return eT.current.scrollTop=o,o})}var eQ=(0,u.useRef)({start:0,end:e_.length}),eJ=(0,u.useRef)(),e0=(n=u.useState(e_),v=(d=(0,a.Z)(n,2))[0],y=d[1],w=u.useState(null),_=(k=(0,a.Z)(w,2))[0],T=k[1],u.useEffect(function(){var e=function(e,t,n){var o,r,l=e.length,a=t.length;if(0===l&&0===a)return null;l0&&void 0!==arguments[0]&&arguments[0];f();var t=function(){c.current.forEach(function(e,t){if(e&&e.offsetParent){var n=(0,C.Z)(e),o=n.offsetHeight;s.current.get(t)!==o&&s.current.set(t,n.offsetHeight)}}),i(function(e){return e+1})};e?t():d.current=(0,m.Z)(t)}return(0,u.useEffect)(function(){return f},[]),[function(o,r){var l=e(o),a=c.current.get(l);r?(c.current.set(l,r),g()):c.current.delete(l),!a!=!r&&(r?null==t||t(o):null==n||n(o))},g,s.current,l]}(eY,null,null),e5=(0,a.Z)(e2,4),e6=e5[0],e4=e5[1],e3=e5[2],e8=e5[3],e9=u.useMemo(function(){if(!eM)return{scrollHeight:void 0,start:0,end:e_.length-1,offset:void 0};if(!eZ)return{scrollHeight:(null===(e=ej.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:e_.length-1,offset:void 0};for(var e,t,n,o,r=0,l=e_.length,a=0;a=eF&&void 0===t&&(t=a,n=r),u>eF+ed&&void 0===o&&(o=a),r=u}return void 0===t&&(t=0,n=0,o=Math.ceil(ed/ef)),void 0===o&&(o=e_.length-1),{scrollHeight:r,start:t,end:o=Math.min(o+1,e_.length-1),offset:n}},[eZ,eM,eF,e_,e8,ed]),e7=e9.scrollHeight,te=e9.start,tt=e9.end,tn=e9.offset;eQ.current.start=te,eQ.current.end=tt;var to=u.useState({width:0,height:ed}),tr=(0,a.Z)(to,2),tl=tr[0],ta=tr[1],ti=(0,u.useRef)(),tc=(0,u.useRef)(),tu=u.useMemo(function(){return P(tl.width,ey)},[tl.width,ey]),ts=u.useMemo(function(){return P(tl.height,e7)},[tl.height,e7]),td=e7-ed,tf=(0,u.useRef)(td);tf.current=td;var tg=eF<=0,tp=eF>=td,tm=I(tg,tp),tv=function(){return{x:eN?-eB:eB,y:eF}},th=(0,u.useRef)(tv()),tb=(0,R.zX)(function(){if(eE){var e=tv();(th.current.x!==e.x||th.current.y!==e.y)&&(eE(e),th.current=e)}});function tC(e,t){t?((0,s.flushSync)(function(){eV(e)}),tb()):e$(e)}var ty=function(e){var t=e,n=ey-tl.width;return Math.min(t=Math.max(t,0),n)},tw=(0,R.zX)(function(e,t){t?((0,s.flushSync)(function(){eV(function(t){return ty(t+(eN?-e:e))})}),tb()):e$(function(t){return t+e})}),tS=(j=!!ey,A=(0,u.useRef)(0),L=(0,u.useRef)(null),F=(0,u.useRef)(null),D=(0,u.useRef)(!1),z=I(tg,tp),H=(0,u.useRef)(null),B=(0,u.useRef)(null),[function(e){if(eM){m.Z.cancel(B.current),B.current=(0,m.Z)(function(){H.current=null},2);var t,n=e.deltaX,o=e.deltaY,r=e.shiftKey,l=n,a=o;("sx"===H.current||!H.current&&r&&o&&!n)&&(l=o,a=0,H.current="sx");var i=Math.abs(l),c=Math.abs(a);(null===H.current&&(H.current=j&&i>c?"x":"y"),"y"===H.current)?(t=a,m.Z.cancel(L.current),A.current+=t,F.current=t,z(t)||(x||e.preventDefault(),L.current=(0,m.Z)(function(){var e=D.current?10:1;tw(A.current*e),A.current=0}))):(tw(l,!0),x||e.preventDefault())}},function(e){eM&&(D.current=e.detail===F.current)}]),tE=(0,a.Z)(tS,2),tR=tE[0],tx=tE[1];V=function(e,t){return!tm(e,t)&&(tR({preventDefault:function(){},deltaY:e}),!0)},W=(0,u.useRef)(!1),K=(0,u.useRef)(0),U=(0,u.useRef)(null),X=(0,u.useRef)(null),q=function(e){if(W.current){var t=Math.ceil(e.touches[0].pageY),n=K.current-t;K.current=t,V(n)&&e.preventDefault(),clearInterval(X.current),X.current=setInterval(function(){(!V(n*=O,!0)||.1>=Math.abs(n))&&clearInterval(X.current)},16)}},Y=function(){W.current=!1,G()},$=function(e){G(),1!==e.touches.length||W.current||(W.current=!0,K.current=Math.ceil(e.touches[0].pageY),U.current=e.target,U.current.addEventListener("touchmove",q),U.current.addEventListener("touchend",Y))},G=function(){U.current&&(U.current.removeEventListener("touchmove",q),U.current.removeEventListener("touchend",Y))},(0,E.Z)(function(){return eM&&eT.current.addEventListener("touchstart",$),function(){var e;null===(e=eT.current)||void 0===e||e.removeEventListener("touchstart",$),G(),clearInterval(X.current)}},[eM]),(0,E.Z)(function(){function e(e){eM&&e.preventDefault()}var t=eT.current;return t.addEventListener("wheel",tR),t.addEventListener("DOMMouseScroll",tx),t.addEventListener("MozMousePixelScroll",e),function(){t.removeEventListener("wheel",tR),t.removeEventListener("DOMMouseScroll",tx),t.removeEventListener("MozMousePixelScroll",e)}},[eM]),(0,E.Z)(function(){ey&&eV(function(e){return ty(e)})},[tl.width,ey]);var tI=function(){var e,t;null===(e=ti.current)||void 0===e||e.delayHidden(),null===(t=tc.current)||void 0===t||t.delayHidden()},tO=(Q=function(){return e4(!0)},J=u.useRef(),ee=u.useState(null),en=(et=(0,a.Z)(ee,2))[0],eo=et[1],(0,E.Z)(function(){if(en&&en.times<10){if(!eT.current){eo(function(e){return(0,r.Z)({},e)});return}Q();var e=en.targetAlign,t=en.originAlign,n=en.index,o=en.offset,l=eT.current.clientHeight,a=!1,i=e,c=null;if(l){for(var u=e||t,s=0,d=0,f=0,g=Math.min(e_.length-1,n),p=0;p<=g;p+=1){var m=eY(e_[p]);d=s;var v=e3.get(m);s=f=d+(void 0===v?ef:v)}for(var h="top"===u?o:l-o,b=g;b>=0;b-=1){var C=eY(e_[b]),y=e3.get(C);if(void 0===y){a=!0;break}if((h-=y)<=0)break}switch(u){case"top":c=d-o;break;case"bottom":c=f-l+o;break;default:var w=eT.current.scrollTop;dw+l&&(i="bottom")}null!==c&&e$(c),c!==en.lastTop&&(a=!0)}a&&eo((0,r.Z)((0,r.Z)({},en),{},{times:en.times+1,targetAlign:i,lastTop:c}))}},[en,eT.current]),function(e){if(null==e){tI();return}if(m.Z.cancel(J.current),"number"==typeof e)e$(e);else if(e&&"object"===(0,l.Z)(e)){var t,n=e.align;t="index"in e?e.index:e_.findIndex(function(t){return eY(t)===e.key});var o=e.offset;eo({times:0,index:t,offset:void 0===o?0:o,originAlign:n})}});u.useImperativeHandle(t,function(){return{getScrollInfo:tv,scrollTo:function(e){e&&"object"===(0,l.Z)(e)&&("left"in e||"top"in e)?(void 0!==e.left&&eV(ty(e.left)),tO(e.top)):tO(e)}}}),(0,E.Z)(function(){eR&&eR(e_.slice(te,tt+1),e_)},[te,tt,e_]);var tP=(er=u.useMemo(function(){return[new Map,[]]},[e_,e3.id,ef]),ea=(el=(0,a.Z)(er,2))[0],ei=el[1],function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=ea.get(e),o=ea.get(t);if(void 0===n||void 0===o)for(var r=e_.length,l=ei.length;led&&u.createElement(h,{ref:ti,prefixCls:eu,scrollOffset:eF,scrollRange:e7,rtl:eN,onScroll:tC,onStartMove:eX,onStopMove:eq,spinSize:ts,containerSize:tl.height,style:null==eO?void 0:eO.verticalScrollBar,thumbStyle:null==eO?void 0:eO.verticalScrollBarThumb}),eZ&&ey&&u.createElement(h,{ref:tc,prefixCls:eu,scrollOffset:eB,scrollRange:ey,rtl:eN,onScroll:tC,onStartMove:eX,onStopMove:eq,spinSize:tu,containerSize:tl.width,horizontal:!0,style:null==eO?void 0:eO.horizontalScrollBar,thumbStyle:null==eO?void 0:eO.horizontalScrollBarThumb}))});k.displayName="List";var _=k},86462:function(e,t,n){var o=n(2265);let r=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});t.Z=r},44633:function(e,t,n){var o=n(2265);let r=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=r},3477:function(e,t,n){var o=n(2265);let r=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});t.Z=r},17732:function(e,t,n){var o=n(2265);let r=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))});t.Z=r},49084:function(e,t,n){var o=n(2265);let r=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=r},71594:function(e,t,n){n.d(t,{b7:function(){return a},ie:function(){return l}});var o=n(2265),r=n(24525);function l(e,t){return e?"function"==typeof e&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()||"function"==typeof e||"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)?o.createElement(e,t):e:null}function a(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=o.useState(()=>({current:(0,r.W_)(t)})),[l,a]=o.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...l,...e.state},onStateChange:t=>{a(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}},24525:function(e,t,n){function o(e,t){return"function"==typeof e?e(t):e}function r(e,t){return n=>{t.setState(t=>({...t,[e]:o(n,t[e])}))}}function l(e){return e instanceof Function}function a(e,t,n){let o,r=[];return l=>{let a,i;n.key&&n.debug&&(a=Date.now());let c=e(l);if(!(c.length!==r.length||c.some((e,t)=>r[t]!==e)))return o;if(r=c,n.key&&n.debug&&(i=Date.now()),o=t(...c),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){let e=Math.round((Date.now()-a)*100)/100,t=Math.round((Date.now()-i)*100)/100,o=t/16,r=(e,t)=>{for(e=String(e);e.length{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:o}}n.d(t,{W_:function(){return V},rV:function(){return W},sC:function(){return G},tj:function(){return K}});let c="debugHeaders";function u(e,t,n){var o;let r={id:null!=(o=n.id)?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(r,e)}),r}function s(e,t,n,o){var r,l;let a=0,i=function(e,t){void 0===t&&(t=1),a=Math.max(a,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&i(e.columns,t+1)},0)};i(e);let c=[],s=(e,t)=>{let r={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},l=[];e.forEach(e=>{let a;let i=[...l].reverse()[0],c=e.column.depth===r.depth,s=!1;if(c&&e.column.parent?a=e.column.parent:(a=e.column,s=!0),i&&(null==i?void 0:i.column)===a)i.subHeaders.push(e);else{let r=u(n,a,{id:[o,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:s,placeholderId:s?`${l.filter(e=>e.column===a).length}`:void 0,depth:t,index:l.length});r.subHeaders.push(e),l.push(r)}r.headers.push(e),e.headerGroup=r}),c.push(r),t>0&&s(l,t-1)};s(t.map((e,t)=>u(n,e,{depth:a,index:t})),a-1),c.reverse();let d=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,o=[0];return e.subHeaders&&e.subHeaders.length?(o=[],d(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:r}=e;t+=n,o.push(r)})):t=1,n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return d(null!=(r=null==(l=c[0])?void 0:l.headers)?r:[]),c}let d=(e,t,n,o,r,l,c)=>{let u={id:t,index:o,original:n,depth:r,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(u._valuesCache.hasOwnProperty(t))return u._valuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return u._valuesCache[t]=n.accessorFn(u.original,o),u._valuesCache[t]},getUniqueValues:t=>{if(u._uniqueValuesCache.hasOwnProperty(t))return u._uniqueValuesCache[t];let n=e.getColumn(t);return null!=n&&n.accessorFn?(n.columnDef.getUniqueValues?u._uniqueValuesCache[t]=n.columnDef.getUniqueValues(u.original,o):u._uniqueValuesCache[t]=[u.getValue(t)],u._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=u.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=l?l:[],getLeafRows:()=>(function(e,t){let n=[],o=e=>{e.forEach(e=>{n.push(e);let r=t(e);null!=r&&r.length&&o(r)})};return o(e),n})(u.subRows,e=>e.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let e=[],t=u;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:a(()=>[e.getAllLeafColumns()],t=>t.map(t=>(function(e,t,n,o){let r={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>{var t;return null!=(t=r.getValue())?t:e.options.renderFallbackValue},getContext:a(()=>[e,n,t,r],(e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue}),i(e.options,"debugCells","cell.getContext"))};return e._features.forEach(o=>{null==o.createCell||o.createCell(r,n,t,e)},{}),r})(e,u,t,t.id)),i(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:a(()=>[u.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),i(e.options,"debugRows","getAllCellsByColumnId"))};for(let t=0;t{var o,r;let l=null==n||null==(o=n.toString())?void 0:o.toLowerCase();return!!(null==(r=e.getValue(t))||null==(r=r.toString())||null==(r=r.toLowerCase())?void 0:r.includes(l))};f.autoRemove=e=>S(e);let g=(e,t,n)=>{var o;return!!(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.includes(n))};g.autoRemove=e=>S(e);let p=(e,t,n)=>{var o;return(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.toLowerCase())===(null==n?void 0:n.toLowerCase())};p.autoRemove=e=>S(e);let m=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};m.autoRemove=e=>S(e)||!(null!=e&&e.length);let v=(e,t,n)=>!n.some(n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))});v.autoRemove=e=>S(e)||!(null!=e&&e.length);let h=(e,t,n)=>n.some(n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)});h.autoRemove=e=>S(e)||!(null!=e&&e.length);let b=(e,t,n)=>e.getValue(t)===n;b.autoRemove=e=>S(e);let C=(e,t,n)=>e.getValue(t)==n;C.autoRemove=e=>S(e);let y=(e,t,n)=>{let[o,r]=n,l=e.getValue(t);return l>=o&&l<=r};y.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,r="number"!=typeof n?parseFloat(n):n,l=null===t||Number.isNaN(o)?-1/0:o,a=null===n||Number.isNaN(r)?1/0:r;if(l>a){let e=l;l=a,a=e}return[l,a]},y.autoRemove=e=>S(e)||S(e[0])&&S(e[1]);let w={includesString:f,includesStringSensitive:g,equalsString:p,arrIncludes:m,arrIncludesAll:v,arrIncludesSome:h,equals:b,weakEquals:C,inNumberRange:y};function S(e){return null==e||""===e}function E(e,t,n){return!!e&&!!e.autoRemove&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}let R={sum:(e,t,n)=>n.reduce((t,n)=>{let o=n.getValue(e);return t+("number"==typeof o?o:0)},0),min:(e,t,n)=>{let o;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)}),o},max:(e,t,n)=>{let o;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(o=n)&&(o=n)}),o},extent:(e,t,n)=>{let o,r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=r=n):(o>n&&(o=n),r{let n=0,o=0;if(t.forEach(t=>{let r=t.getValue(e);null!=r&&(r=+r)>=r&&(++n,o+=r)}),n)return o/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!(Array.isArray(n)&&n.every(e=>"number"==typeof e)))return;if(1===n.length)return n[0];let o=Math.floor(n.length/2),r=n.sort((e,t)=>e-t);return n.length%2!=0?r[o]:(r[o-1]+r[o])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},x=()=>({left:[],right:[]}),I={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},O=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),P=null;function M(e){return"touchstart"===e.type}function Z(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let N=()=>({pageIndex:0,pageSize:10}),k=()=>({top:[],bottom:[]}),_=(e,t,n,o,r)=>{var l;let a=r.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),a.getCanSelect()&&(e[t]=!0)):delete e[t],o&&null!=(l=a.subRows)&&l.length&&a.getCanSelectSubRows()&&a.subRows.forEach(t=>_(e,t.id,n,o,r))};function T(e,t){let n=e.getState().rowSelection,o=[],r={},l=function(e,t){return e.map(e=>{var t;let a=j(e,n);if(a&&(o.push(e),r[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:l(e.subRows)}),a)return e}).filter(Boolean)};return{rows:l(t.rows),flatRows:o,rowsById:r}}function j(e,t){var n;return null!=(n=t[e.id])&&n}function A(e,t,n){var o;if(!(null!=(o=e.subRows)&&o.length))return!1;let r=!0,l=!1;return e.subRows.forEach(e=>{if((!l||r)&&(e.getCanSelect()&&(j(e,t)?l=!0:r=!1),e.subRows&&e.subRows.length)){let n=A(e,t);"all"===n?l=!0:("some"===n&&(l=!0),r=!1)}}),r?"all":!!l&&"some"}let L=/([0-9]+)/gm;function F(e,t){return e===t?0:e>t?1:-1}function D(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function z(e,t){let n=e.split(L).filter(Boolean),o=t.split(L).filter(Boolean);for(;n.length&&o.length;){let e=n.shift(),t=o.shift(),r=parseInt(e,10),l=parseInt(t,10),a=[r,l].sort();if(isNaN(a[0])){if(e>t)return 1;if(t>e)return -1;continue}if(isNaN(a[1]))return isNaN(r)?-1:1;if(r>l)return 1;if(l>r)return -1}return n.length-o.length}let H={alphanumeric:(e,t,n)=>z(D(e.getValue(n)).toLowerCase(),D(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>z(D(e.getValue(n)),D(t.getValue(n))),text:(e,t,n)=>F(D(e.getValue(n)).toLowerCase(),D(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>F(D(e.getValue(n)),D(t.getValue(n))),datetime:(e,t,n)=>{let o=e.getValue(n),r=t.getValue(n);return o>r?1:oF(e.getValue(n),t.getValue(n))},B=[{createTable:e=>{e.getHeaderGroups=a(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var l,a;let i=null!=(l=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?l:[],c=null!=(a=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?a:[];return s(t,[...i,...n.filter(e=>!(null!=o&&o.includes(e.id))&&!(null!=r&&r.includes(e.id))),...c],e)},i(e.options,c,"getHeaderGroups")),e.getCenterHeaderGroups=a(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>s(t,n=n.filter(e=>!(null!=o&&o.includes(e.id))&&!(null!=r&&r.includes(e.id))),e,"center"),i(e.options,c,"getCenterHeaderGroups")),e.getLeftHeaderGroups=a(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;return s(t,null!=(r=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"left")},i(e.options,c,"getLeftHeaderGroups")),e.getRightHeaderGroups=a(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;return s(t,null!=(r=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"right")},i(e.options,c,"getRightHeaderGroups")),e.getFooterGroups=a(()=>[e.getHeaderGroups()],e=>[...e].reverse(),i(e.options,c,"getFooterGroups")),e.getLeftFooterGroups=a(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),i(e.options,c,"getLeftFooterGroups")),e.getCenterFooterGroups=a(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),i(e.options,c,"getCenterFooterGroups")),e.getRightFooterGroups=a(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),i(e.options,c,"getRightFooterGroups")),e.getFlatHeaders=a(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),i(e.options,c,"getFlatHeaders")),e.getLeftFlatHeaders=a(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),i(e.options,c,"getLeftFlatHeaders")),e.getCenterFlatHeaders=a(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),i(e.options,c,"getCenterFlatHeaders")),e.getRightFlatHeaders=a(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),i(e.options,c,"getRightFlatHeaders")),e.getCenterLeafHeaders=a(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),i(e.options,c,"getCenterLeafHeaders")),e.getLeftLeafHeaders=a(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),i(e.options,c,"getLeftLeafHeaders")),e.getRightLeafHeaders=a(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),i(e.options,c,"getRightLeafHeaders")),e.getLeafHeaders=a(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var o,r,l,a,i,c;return[...null!=(o=null==(r=e[0])?void 0:r.headers)?o:[],...null!=(l=null==(a=t[0])?void 0:a.headers)?l:[],...null!=(i=null==(c=n[0])?void 0:c.headers)?i:[]].map(e=>e.getLeafHeaders()).flat()},i(e.options,c,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:r("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;let r=e.columns;return null==(n=r.length?r.some(e=>e.getIsVisible()):null==(o=t.getState().columnVisibility)?void 0:o[e.id])||n},e.getCanHide=()=>{var n,o;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(o=t.options.enableHiding)||o)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=a(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),i(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=a(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],i(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,n)=>a(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),i(e.options,"debugColumns",t));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},{getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:r("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=a(e=>[Z(t,e)],t=>t.findIndex(t=>t.id===e.id),i(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return(null==(o=Z(t,n)[0])?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;let r=Z(t,n);return(null==(o=r[r.length-1])?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=a(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>o=>{let r=[];if(null!=e&&e.length){let t=[...e],n=[...o];for(;n.length&&t.length;){let e=t.shift(),o=n.findIndex(t=>t.id===e);o>-1&&r.push(n.splice(o,1)[0])}r=[...r,...n]}else r=o;return function(e,t,n){if(!(null!=t&&t.length)||!n)return e;let o=e.filter(e=>!t.includes(e.id));return"remove"===n?o:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...o]}(r,t,n)},i(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:x(),...e}),getDefaultOptions:e=>({onColumnPinningChange:r("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let o=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,r,l,a,i,c;return"right"===n?{left:(null!=(l=null==e?void 0:e.left)?l:[]).filter(e=>!(null!=o&&o.includes(e))),right:[...(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=o&&o.includes(e))),...o]}:"left"===n?{left:[...(null!=(i=null==e?void 0:e.left)?i:[]).filter(e=>!(null!=o&&o.includes(e))),...o],right:(null!=(c=null==e?void 0:e.right)?c:[]).filter(e=>!(null!=o&&o.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=o&&o.includes(e))),right:(null!=(r=null==e?void 0:e.right)?r:[]).filter(e=>!(null!=o&&o.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,o,r;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(o=null!=(r=t.options.enableColumnPinning)?r:t.options.enablePinning)||o)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:o,right:r}=t.getState().columnPinning,l=n.some(e=>null==o?void 0:o.includes(e)),a=n.some(e=>null==r?void 0:r.includes(e));return l?"left":!!a&&"right"},e.getPinnedIndex=()=>{var n,o;let r=e.getIsPinned();return r?null!=(n=null==(o=t.getState().columnPinning)||null==(o=o[r])?void 0:o.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=a(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let o=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!o.includes(e.column.id))},i(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=a(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),i(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=a(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),i(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?x():null!=(n=null==(o=e.initialState)?void 0:o.columnPinning)?n:x())},e.getIsSomeColumnsPinned=t=>{var n,o,r;let l=e.getState().columnPinning;return t?!!(null==(n=l[t])?void 0:n.length):!!((null==(o=l.left)?void 0:o.length)||(null==(r=l.right)?void 0:r.length))},e.getLeftLeafColumns=a(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),i(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=a(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),i(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=a(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let o=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!o.includes(e.id))},i(e.options,"debugColumns","getCenterLeafColumns"))}},{createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},{getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:r("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"string"==typeof o?w.includesString:"number"==typeof o?w.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?w.equals:Array.isArray(o)?w.arrIncludes:w.weakEquals},e.getFilterFn=()=>{var n,o;return l(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(o=t.options.filterFns)?void 0:o[e.columnDef.filterFn])?n:w[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(o=t.options.enableColumnFilters)||o)&&(null==(r=t.options.enableFilters)||r)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().columnFilters)?void 0:o.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{var r,l;let a=e.getFilterFn(),i=null==t?void 0:t.find(t=>t.id===e.id),c=o(n,i?i.value:void 0);if(E(a,c,e))return null!=(r=null==t?void 0:t.filter(t=>t.id!==e.id))?r:[];let u={id:e.id,value:c};return i?null!=(l=null==t?void 0:t.map(t=>t.id===e.id?u:t))?l:[]:null!=t&&t.length?[...t,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var r;return null==(r=o(t,e))?void 0:r.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&E(t.getFilterFn(),e.value,t))})})},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel)?e.getPreFilteredRowModel():e._getFilteredRowModel()}},{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:r("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let o=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof o||"number"==typeof o}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,l;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(o=t.options.enableGlobalFilter)||o)&&(null==(r=t.options.enableFilters)||r)&&(null==(l=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||l)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>w.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:o}=e.options;return l(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:w[o]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:r("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),o=!1;for(let t of n){let n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return H.datetime;if("string"==typeof n&&(o=!0,n.split(L).length>1))return H.alphanumeric}return o?H.text:H.basic},e.getAutoSortDir=()=>{let n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw Error();return l(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:H[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{let r=e.getNextSortingOrder(),l=null!=n;t.setSorting(a=>{let i;let c=null==a?void 0:a.find(t=>t.id===e.id),u=null==a?void 0:a.findIndex(t=>t.id===e.id),s=[],d=l?n:"desc"===r;if("toggle"!=(i=null!=a&&a.length&&e.getCanMultiSort()&&o?c?"toggle":"add":null!=a&&a.length&&u!==a.length-1?"replace":c?"toggle":"replace")||l||r||(i="remove"),"add"===i){var f;(s=[...a,{id:e.id,desc:d}]).splice(0,s.length-(null!=(f=t.options.maxMultiSortColCount)?f:Number.MAX_SAFE_INTEGER))}else s="toggle"===i?a.map(t=>t.id===e.id?{...t,desc:d}:t):"remove"===i?a.filter(t=>t.id!==e.id):[{id:e.id,desc:d}];return s})},e.getFirstSortDir=()=>{var n,o;return(null!=(n=null!=(o=e.columnDef.sortDescFirst)?o:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;let l=e.getFirstSortDir(),a=e.getIsSorted();return a?(a===l||null!=(o=t.options.enableSortingRemoval)&&!o||!!n&&null!=(r=t.options.enableMultiRemove)&&!r)&&("desc"===a?"asc":"desc"):l},e.getCanSort=()=>{var n,o;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(o=t.options.enableSorting)||o)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return null!=(n=null!=(o=e.columnDef.enableMultiSort)?o:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let o=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!o&&(o.desc?"desc":"asc")},e.getSortIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().sorting)?void 0:o.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel)?e.getPreSortedRowModel():e._getSortedRowModel()}},{getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:r("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,o;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(o=t.options.enableGrouping)||o)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?R.sum:"[object Date]"===Object.prototype.toString.call(o)?R.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw Error();return l(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:R[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel)?e.getPreGroupedRowModel():e._getGroupedRowModel()},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let o=t.getColumn(n);return null!=o&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!(null!=(t=n.subRows)&&t.length)}}},{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:r("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if(null!=(o=null!=(r=e.options.autoResetAll)?r:e.options.autoResetExpanded)?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,o;e.setExpanded(t?{}:null!=(n=null==(o=e.initialState)?void 0:o.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return"boolean"==typeof t?!0===t:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel)?e.getPreExpandedRowModel():e._getExpandedRowModel()},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;let l=!0===o||!!(null!=o&&o[e.id]),a={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=o,n=null!=(r=n)?r:!l,!l&&n)return{...a,[e.id]:!0};if(l&&!n){let{[e.id]:t,...n}=a;return n}return o})},e.getIsExpanded=()=>{var n;let o=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===o||(null==o?void 0:o[e.id]))},e.getCanExpand=()=>{var n,o,r;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(o=t.options.enableExpanding)||o)&&!!(null!=(r=e.subRows)&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)n=(o=t.getRow(o.parentId,!0)).getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{...N(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:r("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if(null!=(o=null!=(r=e.options.autoResetAll)?r:e.options.autoResetPageIndex)?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>o(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?N():null!=(n=e.initialState.pagination)?n:N())},e.setPageIndex=t=>{e.setPagination(n=>{let r=o(t,n.pageIndex);return r=Math.max(0,Math.min(r,void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n,o;e.setPageIndex(t?0:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageIndex)?n:0)},e.resetPageSize=t=>{var n,o;e.setPageSize(t?10:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,o(t,e.pageSize)),r=e.pageSize*e.pageIndex;return{...e,pageIndex:Math.floor(r/n),pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var r;let l=o(t,null!=(r=e.options.pageCount)?r:-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...n,pageCount:l}}),e.getPageOptions=a(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},i(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return -1===n||0!==n&&te.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel)?e.getPrePaginationRowModel():e._getPaginationRowModel(),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:k(),...e}),getDefaultOptions:e=>({onRowPinningChange:r("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{let l=o?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],a=new Set([...r?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],e.id,...l]);t.setRowPinning(e=>{var t,o,r,l,i,c;return"bottom"===n?{top:(null!=(r=null==e?void 0:e.top)?r:[]).filter(e=>!(null!=a&&a.has(e))),bottom:[...(null!=(l=null==e?void 0:e.bottom)?l:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)]}:"top"===n?{top:[...(null!=(i=null==e?void 0:e.top)?i:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)],bottom:(null!=(c=null==e?void 0:e.bottom)?c:[]).filter(e=>!(null!=a&&a.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=a&&a.has(e))),bottom:(null!=(o=null==e?void 0:e.bottom)?o:[]).filter(e=>!(null!=a&&a.has(e)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:o,enablePinning:r}=t.options;return"function"==typeof o?o(e):null==(n=null!=o?o:r)||n},e.getIsPinned=()=>{let n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,l=n.some(e=>null==o?void 0:o.includes(e)),a=n.some(e=>null==r?void 0:r.includes(e));return l?"top":!!a&&"bottom"},e.getPinnedIndex=()=>{var n,o;let r=e.getIsPinned();if(!r)return -1;let l=null==(n="top"===r?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(o=null==l?void 0:l.indexOf(e.id))?o:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?k():null!=(n=null==(o=e.initialState)?void 0:o.rowPinning)?n:k())},e.getIsSomeRowsPinned=t=>{var n,o,r;let l=e.getState().rowPinning;return t?!!(null==(n=l[t])?void 0:n.length):!!((null==(o=l.top)?void 0:o.length)||(null==(r=l.bottom)?void 0:r.length))},e._getPinnedRows=(t,n,o)=>{var r;return(null==(r=e.options.keepPinnedRows)||r?(null!=n?n:[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:o}))},e.getTopRows=a(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),i(e.options,"debugRows","getTopRows")),e.getBottomRows=a(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),i(e.options,"debugRows","getBottomRows")),e.getCenterRows=a(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let o=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!o.has(e.id))},i(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:r("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();let o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(e=>{e.getCanSelect()&&(o[e.id]=!0)}):r.forEach(e=>{delete o[e.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let o=void 0!==t?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(t=>{_(r,t.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=a(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?T(e,n):{rows:[],flatRows:[],rowsById:{}},i(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=a(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?T(e,n):{rows:[],flatRows:[],rowsById:{}},i(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=a(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?T(e,n):{rows:[],flatRows:[],rowsById:{}},i(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),o=!!(t.length&&Object.keys(n).length);return o&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),o=!!t.length;return o&&t.some(e=>!n[e.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;let n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n{let t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{let r=e.getIsSelected();t.setRowSelection(l=>{var a;if(n=void 0!==n?n:!r,e.getCanSelect()&&r===n)return l;let i={...l};return _(i,e.id,n,null==(a=null==o?void 0:o.selectChildren)||a,t),i})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return j(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return"some"===A(e,n)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return"all"===A(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}}},{getDefaultColumnDef:()=>I,getInitialState:e=>({columnSizing:{},columnSizingInfo:O(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:r("columnSizing",e),onColumnSizingInfoChange:r("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;let l=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:I.minSize,null!=(o=null!=l?l:e.columnDef.size)?o:I.size),null!=(r=e.columnDef.maxSize)?r:I.maxSize)},e.getStart=a(e=>[e,Z(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),i(t.options,"debugColumns","getStart")),e.getAfter=a(e=>[e,Z(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),i(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...o}=t;return o})},e.getCanResize=()=>{var n,o;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(o=t.options.enableColumnResizing)||o)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{if(e.subHeaders.length)e.subHeaders.forEach(n);else{var o;t+=null!=(o=e.column.getSize())?o:0}};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let o=t.getColumn(e.column.id),r=null==o?void 0:o.getCanResize();return l=>{if(!o||!r||(null==l.persist||l.persist(),M(l)&&l.touches&&l.touches.length>1))return;let a=e.getSize(),i=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[o.id,o.getSize()]],c=M(l)?Math.round(l.touches[0].clientX):l.clientX,u={},s=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var o,r;let l="rtl"===t.options.columnResizeDirection?-1:1,a=(n-(null!=(o=null==e?void 0:e.startOffset)?o:0))*l,i=Math.max(a/(null!=(r=null==e?void 0:e.startSize)?r:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*i,0))/100}),{...e,deltaOffset:a,deltaPercentage:i}}),("onChange"===t.options.columnResizeMode||"end"===e)&&t.setColumnSizing(e=>({...e,...u})))},d=e=>s("move",e),f=e=>{s("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||"undefined"!=typeof document?document:null,p={moveHandler:e=>d(e.clientX),upHandler:e=>{null==g||g.removeEventListener("mousemove",p.moveHandler),null==g||g.removeEventListener("mouseup",p.upHandler),f(e.clientX)}},m={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{var t;null==g||g.removeEventListener("touchmove",m.moveHandler),null==g||g.removeEventListener("touchend",m.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(null==(t=e.touches[0])?void 0:t.clientX)}},v=!!function(){if("boolean"==typeof P)return P;let e=!1;try{let t=()=>{};window.addEventListener("test",t,{get passive(){return e=!0,!1}}),window.removeEventListener("test",t)}catch(t){e=!1}return P=e}()&&{passive:!1};M(l)?(null==g||g.addEventListener("touchmove",m.moveHandler,v),null==g||g.addEventListener("touchend",m.upHandler,v)):(null==g||g.addEventListener("mousemove",p.moveHandler,v),null==g||g.addEventListener("mouseup",p.upHandler,v)),t.setColumnSizingInfo(e=>({...e,startOffset:c,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:i,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?O():null!=(n=e.initialState.columnSizingInfo)?n:O())},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}}];function V(e){var t,n;let r=[...B,...null!=(t=e._features)?t:[]],l={_features:r},c=l._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(l)),{}),u=e=>l.options.mergeOptions?l.options.mergeOptions(c,e):{...c,...e},s={...null!=(n=e.initialState)?n:{}};l._features.forEach(e=>{var t;s=null!=(t=null==e.getInitialState?void 0:e.getInitialState(s))?t:s});let d=[],f=!1,g={_features:r,options:{...c,...e},initialState:s,_queue:e=>{d.push(e),f||(f=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();f=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{l.setState(l.initialState)},setOptions:e=>{let t=o(e,l.options);l.options=u(t)},getState:()=>l.options.state,setState:e=>{null==l.options.onStateChange||l.options.onStateChange(e)},_getRowId:(e,t,n)=>{var o;return null!=(o=null==l.options.getRowId?void 0:l.options.getRowId(e,t,n))?o:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?l.getPrePaginationRowModel():l.getRowModel()).rowsById[e];if(!n&&!(n=l.getCoreRowModel().rowsById[e]))throw Error();return n},_getDefaultColumnDef:a(()=>[l.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...l._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},i(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>l.options.columns,getAllColumns:a(()=>[l._getColumnDefs()],e=>{let t=function(e,n,o){return void 0===o&&(o=0),e.map(e=>{let r=function(e,t,n,o){var r,l;let c;let u={...e._getDefaultColumnDef(),...t},s=u.accessorKey,d=null!=(r=null!=(l=u.id)?l:s?"function"==typeof String.prototype.replaceAll?s.replaceAll(".","_"):s.replace(/\./g,"_"):void 0)?r:"string"==typeof u.header?u.header:void 0;if(u.accessorFn?c=u.accessorFn:s&&(c=s.includes(".")?e=>{let t=e;for(let e of s.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[u.accessorKey]),!d)throw Error();let f={id:`${String(d)}`,accessorFn:c,parent:o,depth:n,columnDef:u,columns:[],getFlatColumns:a(()=>[!0],()=>{var e;return[f,...null==(e=f.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},i(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:a(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=f.columns)&&t.length?e(f.columns.flatMap(e=>e.getLeafColumns())):[f]},i(e.options,"debugColumns","column.getLeafColumns"))};for(let t of e._features)null==t.createColumn||t.createColumn(f,e);return f}(l,e,o,n);return r.columns=e.columns?t(e.columns,r,o+1):[],r})};return t(e)},i(e,"debugColumns","getAllColumns")),getAllFlatColumns:a(()=>[l.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),i(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:a(()=>[l.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),i(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:a(()=>[l.getAllColumns(),l._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),i(e,"debugColumns","getAllLeafColumns")),getColumn:e=>l._getAllFlatColumnsById()[e]};Object.assign(l,g);for(let e=0;ea(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,l){void 0===r&&(r=0);let a=[];for(let c=0;ce._autoResetPageIndex()))}function W(){return e=>a(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(e,t,n)=>t.rows.length&&(!0===e||Object.keys(null!=e?e:{}).length)&&n?function(e){let t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}(t):t,i(e.options,"debugTable","getExpandedRowModel"))}function K(){return e=>a(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(null!=t&&t.length))return n;let o=e.getState().sorting,r=[],l=o.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),a={};l.forEach(t=>{let n=e.getColumn(t.id);n&&(a[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let i=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let o=0;o{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=i(e.subRows))}),t};return{rows:i(n.rows),flatRows:r,rowsById:n.rowsById}},i(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/154-78c3416dcb61977f.js b/litellm/proxy/_experimental/out/_next/static/chunks/154-78c3416dcb61977f.js new file mode 100644 index 00000000000..35d5b094aa9 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/154-78c3416dcb61977f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[154],{31283:function(e,t,o){o.d(t,{o:function(){return a.Z}});var a=o(49566)},63610:function(e,t,o){o.d(t,{d:function(){return u}});var a=o(57437),r=o(2265),n=o(64482),c=o(52787),s=o(20577),l=o(13634),i=o(31283),d=o(15424),p=o(89970),h=o(19250);let u=["metadata","config","enforced_params","aliases"],w=(e,t)=>u.includes(e)||"json"===t.format,g=e=>{if(!e)return!0;try{return JSON.parse(e),!0}catch(e){return!1}},f=(e,t,o)=>{let a={max_budget:"Enter maximum budget in USD (e.g., 100.50)",budget_duration:"Select a time period for budget reset",tpm_limit:"Enter maximum tokens per minute (whole number)",rpm_limit:"Enter maximum requests per minute (whole number)",duration:"Enter duration (e.g., 30s, 24h, 7d)",metadata:'Enter JSON object with key-value pairs\nExample: {"team": "research", "project": "nlp"}',config:'Enter configuration as JSON object\nExample: {"setting": "value"}',permissions:"Enter comma-separated permission strings",enforced_params:'Enter parameters as JSON object\nExample: {"param": "value"}',blocked:"Enter true/false or specific block conditions",aliases:'Enter aliases as JSON object\nExample: {"alias1": "value1", "alias2": "value2"}',models:"Select one or more model names",key_alias:"Enter a unique identifier for this key",tags:"Enter comma-separated tag strings"}[e]||({string:"Text input",number:"Numeric input",integer:"Whole number input",boolean:"True/False value"})[o]||"Text input";return w(e,t)?"".concat(a,"\nMust be valid JSON format"):t.enum?"Select from available options\nAllowed values: ".concat(t.enum.join(", ")):a};t.Z=e=>{let{schemaComponent:t,excludedFields:o=[],form:u,overrideLabels:m={},overrideTooltips:y={},customValidation:k={},defaultValues:C={}}=e,[_,T]=(0,r.useState)(null),[E,S]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{try{let e=(await (0,h.getOpenAPISchema)()).components.schemas[t];if(!e)throw Error('Schema component "'.concat(t,'" not found'));T(e);let a={};Object.keys(e.properties).filter(e=>!o.includes(e)&&void 0!==C[e]).forEach(e=>{a[e]=C[e]}),u.setFieldsValue(a)}catch(e){console.error("Schema fetch error:",e),S(e instanceof Error?e.message:"Failed to fetch schema")}})()},[t,u,o]);let j=e=>{if(e.type)return e.type;if(e.anyOf){let t=e.anyOf.map(e=>e.type);if(t.includes("number")||t.includes("integer"))return"number";t.includes("string")}return"string"},v=(e,t)=>{var o;let r;let h=j(t),u=null==_?void 0:null===(o=_.required)||void 0===o?void 0:o.includes(e),T=m[e]||t.title||e,E=y[e]||t.description,S=[];u&&S.push({required:!0,message:"".concat(T," is required")}),k[e]&&S.push({validator:k[e]}),w(e,t)&&S.push({validator:async(e,t)=>{if(t&&!g(t))throw Error("Please enter valid JSON")}});let v=E?(0,a.jsxs)("span",{children:[T," ",(0,a.jsx)(p.Z,{title:E,children:(0,a.jsx)(d.Z,{style:{marginLeft:"4px"}})})]}):T;return r=w(e,t)?(0,a.jsx)(n.default.TextArea,{rows:4,placeholder:"Enter as JSON",className:"font-mono"}):t.enum?(0,a.jsx)(c.default,{children:t.enum.map(e=>(0,a.jsx)(c.default.Option,{value:e,children:e},e))}):"number"===h||"integer"===h?(0,a.jsx)(s.Z,{style:{width:"100%"},precision:"integer"===h?0:void 0}):"duration"===e?(0,a.jsx)(i.o,{placeholder:"eg: 30s, 30h, 30d"}):(0,a.jsx)(i.o,{placeholder:E||""}),(0,a.jsx)(l.Z.Item,{label:v,name:e,className:"mt-8",rules:S,initialValue:C[e],help:(0,a.jsx)("div",{className:"text-xs text-gray-500",children:f(e,t,h)}),children:r},e)};return E?(0,a.jsxs)("div",{className:"text-red-500",children:["Error: ",E]}):(null==_?void 0:_.properties)?(0,a.jsx)("div",{children:Object.entries(_.properties).filter(e=>{let[t]=e;return!o.includes(t)}).map(e=>{let[t,o]=e;return v(t,o)})}):null}},19250:function(e,t,o){o.r(t),o.d(t,{DEFAULT_ORGANIZATION:function(){return p},PredictedSpendLogsCall:function(){return e9},addAllowedIP:function(){return el},adminGlobalActivity:function(){return eN},adminGlobalActivityExceptions:function(){return eP},adminGlobalActivityExceptionsPerDeployment:function(){return eO},adminGlobalActivityPerModel:function(){return ex},adminGlobalCacheActivity:function(){return eF},adminSpendLogsCall:function(){return eS},adminTopEndUsersCall:function(){return ev},adminTopKeysCall:function(){return ej},adminTopModelsCall:function(){return eB},adminspendByProvider:function(){return eb},alertingSettingsCall:function(){return F},allEndUsersCall:function(){return eC},allTagNamesCall:function(){return ek},availableTeamListCall:function(){return z},budgetCreateCall:function(){return j},budgetDeleteCall:function(){return S},budgetUpdateCall:function(){return v},cachingHealthCheckCall:function(){return tg},callMCPTool:function(){return tx},claimOnboardingToken:function(){return $},createGuardrailCall:function(){return tC},createMCPServer:function(){return tv},createPassThroughEndpoint:function(){return tl},credentialCreateCall:function(){return eV},credentialDeleteCall:function(){return eZ},credentialGetCall:function(){return eH},credentialListCall:function(){return eq},credentialUpdateCall:function(){return eY},defaultProxyBaseUrl:function(){return n},deleteAllowedIP:function(){return ei},deleteCallback:function(){return t6},deleteConfigFieldSetting:function(){return td},deleteGuardrailCall:function(){return tW},deleteMCPServer:function(){return tN},deletePassThroughEndpointsCall:function(){return tp},fetchMCPAccessGroups:function(){return tj},fetchMCPServers:function(){return tS},getAllowedIPs:function(){return es},getBudgetList:function(){return tt},getBudgetSettings:function(){return to},getCallbacksCall:function(){return ta},getConfigFieldSetting:function(){return tc},getDefaultTeamSettings:function(){return tU},getEmailEventSettings:function(){return tH},getGeneralSettingsCall:function(){return tr},getGuardrailInfo:function(){return tX},getGuardrailProviderSpecificParams:function(){return tQ},getGuardrailUISettings:function(){return tK},getGuardrailsList:function(){return tk},getInternalUserSettings:function(){return tT},getOnboardingCredentials:function(){return X},getOpenAPISchema:function(){return k},getPassThroughEndpointInfo:function(){return t5},getPassThroughEndpointsCall:function(){return tn},getPossibleUserRoles:function(){return eL},getProxyBaseUrl:function(){return i},getProxyUISettings:function(){return ty},getPublicModelHubInfo:function(){return y},getRemainingUsers:function(){return t3},getSSOSettings:function(){return t0},getTeamPermissionsCall:function(){return tI},getTotalSpendCall:function(){return Q},getUiConfig:function(){return m},healthCheckCall:function(){return tu},healthCheckHistoryCall:function(){return tf},individualModelHealthCheckCall:function(){return tw},invitationClaimCall:function(){return N},invitationCreateCall:function(){return b},keyCreateCall:function(){return P},keyCreateServiceAccountCall:function(){return x},keyDeleteCall:function(){return B},keyInfoCall:function(){return eG},keyInfoV1Call:function(){return eU},keyListCall:function(){return eA},keySpendLogsCall:function(){return ef},keyUpdateCall:function(){return eW},latestHealthChecksCall:function(){return tm},listMCPTools:function(){return tF},makeModelGroupPublic:function(){return f},mcpToolsCall:function(){return t7},modelAvailableCall:function(){return eg},modelCostMap:function(){return C},modelCreateCall:function(){return _},modelDeleteCall:function(){return E},modelExceptionsCall:function(){return eu},modelHubCall:function(){return ec},modelHubPublicModelsCall:function(){return en},modelInfoCall:function(){return ea},modelInfoV1Call:function(){return er},modelMetricsCall:function(){return ed},modelMetricsSlowResponsesCall:function(){return eh},modelPatchUpdateCall:function(){return eQ},modelSettingsCall:function(){return T},modelUpdateCall:function(){return eX},organizationCreateCall:function(){return V},organizationDeleteCall:function(){return H},organizationInfoCall:function(){return D},organizationListCall:function(){return L},organizationMemberAddCall:function(){return e3},organizationMemberDeleteCall:function(){return e4},organizationMemberUpdateCall:function(){return e5},organizationUpdateCall:function(){return q},perUserAnalyticsCall:function(){return os},proxyBaseUrl:function(){return s},regenerateKeyCall:function(){return ee},resetEmailEventSettings:function(){return tY},serverRootPath:function(){return c},serviceHealthCheck:function(){return te},sessionSpendLogsCall:function(){return tM},setCallbacksCall:function(){return th},setGlobalLitellmHeaderName:function(){return g},slackBudgetAlertsHealthCheck:function(){return e8},spendUsersCall:function(){return eI},streamingModelMetricsCall:function(){return ep},tagCreateCall:function(){return tP},tagDailyActivityCall:function(){return W},tagDauCall:function(){return oo},tagDeleteCall:function(){return tJ},tagDistinctCall:function(){return on},tagInfoCall:function(){return tB},tagListCall:function(){return tG},tagMauCall:function(){return or},tagUpdateCall:function(){return tO},tagWauCall:function(){return oa},tagsSpendLogsCall:function(){return ey},teamBulkMemberAddCall:function(){return e0},teamCreateCall:function(){return eD},teamDailyActivityCall:function(){return K},teamDeleteCall:function(){return J},teamInfoCall:function(){return I},teamListCall:function(){return M},teamMemberAddCall:function(){return e$},teamMemberDeleteCall:function(){return e2},teamMemberUpdateCall:function(){return e1},teamPermissionsUpdateCall:function(){return tR},teamSpendLogsCall:function(){return em},teamUpdateCall:function(){return eK},testConnectionRequest:function(){return eJ},testMCPConnectionRequest:function(){return t9},testMCPToolsListRequest:function(){return t8},transformRequestCall:function(){return Z},uiAuditLogsCall:function(){return t2},uiSpendLogDetailsCall:function(){return t_},uiSpendLogsCall:function(){return eE},updateConfigFieldSetting:function(){return ti},updateDefaultTeamSettings:function(){return tA},updateEmailEventSettings:function(){return tZ},updateGuardrailCall:function(){return t$},updateInternalUserSettings:function(){return tE},updateMCPServer:function(){return tb},updatePassThroughEndpoint:function(){return t4},updatePassThroughFieldSetting:function(){return ts},updateSSOSettings:function(){return t1},updateUsefulLinksCall:function(){return ew},userAgentAnalyticsCall:function(){return ot},userAgentSummaryCall:function(){return oc},userBulkUpdateUserCall:function(){return e7},userCreateCall:function(){return O},userDailyActivityCall:function(){return Y},userDeleteCall:function(){return G},userFilterUICall:function(){return e_},userGetAllUsersCall:function(){return ez},userGetRequesedtModelsCall:function(){return eM},userInfoCall:function(){return A},userListCall:function(){return U},userRequestModelCall:function(){return eR},userSpendLogsCall:function(){return eT},userUpdateUserCall:function(){return e6},v2TeamListCall:function(){return R},vectorStoreCreateCall:function(){return tz},vectorStoreDeleteCall:function(){return tD},vectorStoreInfoCall:function(){return tV},vectorStoreListCall:function(){return tL},vectorStoreSearchCall:function(){return oe},vectorStoreUpdateCall:function(){return tq}});var a=o(41021),r=o(63610);let n=null,c="/",s=null;console.log=function(){};let l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=window.location.origin,a=t||o;console.log("proxyBaseUrl:",s),console.log("serverRootPath:",e),e.length>0&&!a.endsWith(e)&&"/"!=e&&(a+=e,s=a),console.log("Updated proxyBaseUrl:",s)},i=()=>s||window.location.origin,d={GET:"GET",DELETE:"DELETE"},p="default_organization",h=0,u=async e=>{let t=Date.now();t-h>6e4?(e.includes("Authentication Error - Expired Key")&&(a.ZP.info("UI Session Expired. Logging out."),h=t,document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",window.location.href=window.location.pathname),h=t):console.log("Error suppressed to prevent spam:",e)},w="Authorization";function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authorization";console.log("setGlobalLitellmHeaderName: ".concat(e)),w=e}let f=async(e,t)=>{let o=s?"".concat(s,"/model_group/make_public"):"/model_group/make_public";return(await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},m=async()=>{console.log("Getting UI config");let e=await fetch(n?"".concat(n,"/litellm/.well-known/litellm-ui-config"):"/litellm/.well-known/litellm-ui-config"),t=await e.json();return console.log("jsonData in getUiConfig:",t),l(t.server_root_path,t.proxy_base_url),t},y=async()=>{let e=await fetch(n?"".concat(n,"/public/model_hub/info"):"/public/model_hub/info");return await e.json()},k=async()=>{let e=s?"".concat(s,"/openapi.json"):"/openapi.json",t=await fetch(e);return await t.json()},C=async e=>{try{let t=s?"".concat(s,"/get/litellm_model_cost_map"):"/get/litellm_model_cost_map",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("received litellm model cost data: ".concat(a)),a}catch(e){throw console.error("Failed to get model cost map:",e),e}},_=async(e,t)=>{try{let o=s?"".concat(s,"/model/new"):"/model/new",r=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text()||"Network response was not ok";throw a.ZP.error(e),Error(e)}let n=await r.json();return console.log("API Response:",n),a.ZP.destroy(),a.ZP.success("Model ".concat(t.model_name," created successfully"),2),n}catch(e){throw console.error("Failed to create key:",e),e}},T=async e=>{try{let t=s?"".concat(s,"/model/settings"):"/model/settings",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){console.error("Failed to get model settings:",e)}},E=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=s?"".concat(s,"/model/delete"):"/model/delete",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},S=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=s?"".concat(s,"/budget/delete"):"/budget/delete",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},j=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=s?"".concat(s,"/budget/new"):"/budget/new",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},v=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let o=s?"".concat(s,"/budget/update"):"/budget/update",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},b=async(e,t)=>{try{let o=s?"".concat(s,"/invitation/new"):"/invitation/new",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},N=async(e,t)=>{try{console.log("Form Values in invitationCreateCall:",t),console.log("Form Values after check:",t);let o=s?"".concat(s,"/invitation/claim"):"/invitation/claim",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},F=async e=>{try{let t=s?"".concat(s,"/alerting/settings"):"/alerting/settings",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},x=async(e,t)=>{try{for(let e of(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),r.d))if(t[e]){console.log("formValues.".concat(e,":"),t[e]);try{t[e]=JSON.parse(t[e])}catch(t){throw Error("Failed to parse ".concat(e,": ")+t)}}console.log("Form Values after check:",t);let o=s?"".concat(s,"/key/service-account/generate"):"/key/service-account/generate",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error(e)}let n=await a.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},P=async(e,t,o)=>{try{for(let e of(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),r.d))if(o[e]){console.log("formValues.".concat(e,":"),o[e]);try{o[e]=JSON.parse(o[e])}catch(t){throw Error("Failed to parse ".concat(e,": ")+t)}}console.log("Form Values after check:",o);let a=s?"".concat(s,"/key/generate"):"/key/generate",n=await fetch(a,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!n.ok){let e=await n.text();throw u(e),console.error("Error response from the server:",e),Error(e)}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},O=async(e,t,o)=>{try{if(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),o.auto_create_key=!1,o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=s?"".concat(s,"/user/new"):"/user/new",r=await fetch(a,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw u(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},B=async(e,t)=>{try{let o=s?"".concat(s,"/key/delete"):"/key/delete";console.log("in keyDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},G=async(e,t)=>{try{let o=s?"".concat(s,"/user/delete"):"/user/delete";console.log("in userDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_ids:t})});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete user(s):",e),e}},J=async(e,t)=>{try{let o=s?"".concat(s,"/team/delete"):"/team/delete";console.log("in teamDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},U=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let p=s?"".concat(s,"/user/list"):"/user/list";console.log("in userListCall");let h=new URLSearchParams;if(t&&t.length>0){let e=t.join(",");h.append("user_ids",e)}o&&h.append("page",o.toString()),a&&h.append("page_size",a.toString()),r&&h.append("user_email",r),n&&h.append("role",n),c&&h.append("team",c),l&&h.append("sso_user_ids",l),i&&h.append("sort_by",i),d&&h.append("sort_order",d);let g=h.toString();g&&(p+="?".concat(g));let f=await fetch(p,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw u(e),Error("Network response was not ok")}let m=await f.json();return console.log("/user/list API Response:",m),m}catch(e){throw console.error("Failed to create key:",e),e}},A=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];console.log("userInfoCall: ".concat(t,", ").concat(o,", ").concat(a,", ").concat(r,", ").concat(n,", ").concat(c));try{let l;if(a){l=s?"".concat(s,"/user/list"):"/user/list";let e=new URLSearchParams;null!=r&&e.append("page",r.toString()),null!=n&&e.append("page_size",n.toString()),l+="?".concat(e.toString())}else l=s?"".concat(s,"/user/info"):"/user/info",("Admin"!==o&&"Admin Viewer"!==o||c)&&t&&(l+="?user_id=".concat(t));console.log("Requesting user data from:",l);let i=await fetch(l,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw u(e),Error("Network response was not ok")}let d=await i.json();return console.log("API Response:",d),d}catch(e){throw console.error("Failed to fetch user data:",e),e}},I=async(e,t)=>{try{let o=s?"".concat(s,"/team/info"):"/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},R=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6],arguments.length>7&&void 0!==arguments[7]&&arguments[7],arguments.length>8&&void 0!==arguments[8]&&arguments[8];try{let n=s?"".concat(s,"/v2/team/list"):"/v2/team/list";console.log("in teamInfoCall");let c=new URLSearchParams;o&&c.append("user_id",o.toString()),t&&c.append("organization_id",t.toString()),a&&c.append("team_id",a.toString()),r&&c.append("team_alias",r.toString());let l=c.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw u(e),Error("Network response was not ok")}let d=await i.json();return console.log("/v2/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},M=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=s?"".concat(s,"/team/list"):"/team/list";console.log("in teamInfoCall");let c=new URLSearchParams;o&&c.append("user_id",o.toString()),t&&c.append("organization_id",t.toString()),a&&c.append("team_id",a.toString()),r&&c.append("team_alias",r.toString());let l=c.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw u(e),Error("Network response was not ok")}let d=await i.json();return console.log("/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},z=async e=>{try{let t=s?"".concat(s,"/team/available"):"/team/available";console.log("in availableTeamListCall");let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log("/team/available_teams API Response:",a),a}catch(e){throw e}},L=async e=>{try{let t=s?"".concat(s,"/organization/list"):"/organization/list",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},D=async(e,t)=>{try{let o=s?"".concat(s,"/organization/info"):"/organization/info";t&&(o="".concat(o,"?organization_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},V=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let o=s?"".concat(s,"/organization/new"):"/organization/new",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},q=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let o=s?"".concat(s,"/organization/update"):"/organization/update",a=await fetch(o,{method:"PATCH",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},H=async(e,t)=>{try{let o=s?"".concat(s,"/organization/delete"):"/organization/delete",a=await fetch(o,{method:"DELETE",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!a.ok){let e=await a.text();throw u(e),Error("Error deleting organization: ".concat(e))}return await a.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},Z=async(e,t)=>{try{let o=s?"".concat(s,"/utils/transform_request"):"/utils/transform_request",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},Y=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;try{let r=s?"".concat(s,"/user/daily/activity"):"/user/daily/activity",n=new URLSearchParams,c=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};n.append("start_date",c(t)),n.append("end_date",c(o)),n.append("page_size","1000"),n.append("page",a.toString());let l=n.toString();l&&(r+="?".concat(l));let i=await fetch(r,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw u(e),Error("Network response was not ok")}return await i.json()}catch(e){throw console.error("Failed to create key:",e),e}},W=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=s?"".concat(s,"/tag/daily/activity"):"/tag/daily/activity",c=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};c.append("start_date",l(t)),c.append("end_date",l(o)),c.append("page_size","1000"),c.append("page",a.toString()),r&&c.append("tags",r.join(","));let i=c.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw u(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},K=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=s?"".concat(s,"/team/daily/activity"):"/team/daily/activity",c=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};c.append("start_date",l(t)),c.append("end_date",l(o)),c.append("page_size","1000"),c.append("page",a.toString()),r&&c.append("team_ids",r.join(",")),c.append("exclude_team_ids","litellm-dashboard");let i=c.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw u(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},Q=async e=>{try{let t=s?"".concat(s,"/global/spend"):"/global/spend",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},X=async e=>{try{let t=s?"".concat(s,"/onboarding/get_token"):"/onboarding/get_token";t+="?invite_link=".concat(e);let o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},$=async(e,t,o,a)=>{let r=s?"".concat(s,"/onboarding/claim_token"):"/onboarding/claim_token";try{let n=await fetch(r,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({invitation_link:t,user_id:o,password:a})});if(!n.ok){let e=await n.text();throw u(e),Error("Network response was not ok")}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to delete key:",e),e}},ee=async(e,t,o)=>{try{let a=s?"".concat(s,"/key/").concat(t,"/regenerate"):"/key/".concat(t,"/regenerate"),r=await fetch(a,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw u(e),Error("Network response was not ok")}let n=await r.json();return console.log("Regenerate key Response:",n),n}catch(e){throw console.error("Failed to regenerate key:",e),e}},et=!1,eo=null,ea=async(e,t,o)=>{try{console.log("modelInfoCall:",e,t,o);let r=s?"".concat(s,"/v2/model/info"):"/v2/model/info",n=new URLSearchParams;n.append("include_team_models","true"),n.toString()&&(r+="?".concat(n.toString()));let c=await fetch(r,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.text();throw e+="error shown=".concat(et),et||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),a.ZP.info(e,10),et=!0,eo&&clearTimeout(eo),eo=setTimeout(()=>{et=!1},1e4)),Error("Network response was not ok")}let l=await c.json();return console.log("modelInfoCall:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},er=async(e,t)=>{try{let o=s?"".concat(s,"/v1/model/info"):"/v1/model/info";o+="?litellm_model_id=".concat(t);let a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let r=await a.json();return console.log("modelInfoV1Call:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},en=async()=>{let e=s?"".concat(s,"/public/model_hub"):"/public/model_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},ec=async e=>{try{let t=s?"".concat(s,"/model_group/info"):"/model_group/info",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("modelHubCall:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},es=async e=>{try{let t=s?"".concat(s,"/get/allowed_ips"):"/get/allowed_ips",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw Error("Network response was not ok: ".concat(e))}let a=await o.json();return console.log("getAllowedIPs:",a),a.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},el=async(e,t)=>{try{let o=s?"".concat(s,"/add/allowed_ip"):"/add/allowed_ip",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},ei=async(e,t)=>{try{let o=s?"".concat(s,"/delete/allowed_ip"):"/delete/allowed_ip",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},ed=async(e,t,o,a,r,n,c,l)=>{try{let t=s?"".concat(s,"/model/metrics"):"/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ep=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/model/streaming_metrics"):"/model/streaming_metrics";t&&(r="".concat(r,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let n=await fetch(r,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw u(e),Error("Network response was not ok")}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},eh=async(e,t,o,a,r,n,c,l)=>{try{let t=s?"".concat(s,"/model/metrics/slow_responses"):"/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eu=async(e,t,o,a,r,n,c,l)=>{try{let t=s?"".concat(s,"/model/metrics/exceptions"):"/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ew=async(e,t)=>{try{let o=s?"".concat(s,"/model_hub/update_useful_links"):"/model_hub/update_useful_links",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({useful_links:t})});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},eg=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6]);console.log("in /models calls, globalLitellmHeaderName",w);try{let t=s?"".concat(s,"/models"):"/models",o=new URLSearchParams;o.append("include_model_access_groups","True"),!0===a&&o.append("return_wildcard_routes","True"),!0===n&&o.append("only_model_access_groups","True"),r&&o.append("team_id",r.toString()),o.toString()&&(t+="?".concat(o.toString()));let c=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.text();throw u(e),Error("Network response was not ok")}return await c.json()}catch(e){throw console.error("Failed to create key:",e),e}},ef=async(e,t)=>{try{let o=s?"".concat(s,"/global/spend/logs"):"/global/spend/logs";console.log("in keySpendLogsCall:",o);let a=await fetch("".concat(o,"?api_key=").concat(t),{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},em=async e=>{try{let t=s?"".concat(s,"/global/spend/teams"):"/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ey=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/global/spend/tags"):"/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),a&&(r+="".concat(r,"&tags=").concat(a.join(","))),console.log("in tagsSpendLogsCall:",r);let n=await fetch("".concat(r),{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok)throw await n.text(),Error("Network response was not ok");let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to create key:",e),e}},ek=async e=>{try{let t=s?"".concat(s,"/global/spend/all_tag_names"):"/global/spend/all_tag_names";console.log("in global/spend/all_tag_names call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eC=async e=>{try{let t=s?"".concat(s,"/global/all_end_users"):"/global/all_end_users";console.log("in global/all_end_users call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},e_=async(e,t)=>{try{let o=s?"".concat(s,"/user/filter/ui"):"/user/filter/ui";t.get("user_email")&&(o+="?user_email=".concat(t.get("user_email"))),t.get("user_id")&&(o+="?user_id=".concat(t.get("user_id")));let a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},eT=async(e,t,o,a,r,n)=>{try{console.log("user role in spend logs call: ".concat(o));let t=s?"".concat(s,"/spend/logs"):"/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(r,"&end_date=").concat(n):"".concat(t,"?start_date=").concat(r,"&end_date=").concat(n);let c=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.text();throw u(e),Error("Network response was not ok")}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},eE=async(e,t,o,a,r,n,c,l,i,d,p,h)=>{try{let g=s?"".concat(s,"/spend/logs/ui"):"/spend/logs/ui",f=new URLSearchParams;t&&f.append("api_key",t),o&&f.append("team_id",o),a&&f.append("request_id",a),r&&f.append("start_date",r),n&&f.append("end_date",n),c&&f.append("page",c.toString()),l&&f.append("page_size",l.toString()),i&&f.append("user_id",i),d&&f.append("end_user",d),p&&f.append("status_filter",p),h&&f.append("model",h);let m=f.toString();m&&(g+="?".concat(m));let y=await fetch(g,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!y.ok){let e=await y.text();throw u(e),Error("Network response was not ok")}let k=await y.json();return console.log("Spend Logs Response:",k),k}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},eS=async e=>{try{let t=s?"".concat(s,"/global/spend/logs"):"/global/spend/logs",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ej=async e=>{try{let t=s?"".concat(s,"/global/spend/keys?limit=5"):"/global/spend/keys?limit=5",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ev=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/global/spend/end_users"):"/global/spend/end_users",n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let c={method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n},l=await fetch(r,c);if(!l.ok){let e=await l.text();throw u(e),Error("Network response was not ok")}let i=await l.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},eb=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/global/spend/provider"):"/global/spend/provider";o&&a&&(r+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(r+="&api_key=".concat(t));let n={method:"GET",headers:{[w]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.text();throw u(e),Error("Network response was not ok")}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eN=async(e,t,o)=>{try{let a=s?"".concat(s,"/global/activity"):"/global/activity";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[w]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok)throw await n.text(),Error("Network response was not ok");let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eF=async(e,t,o)=>{try{let a=s?"".concat(s,"/global/activity/cache_hits"):"/global/activity/cache_hits";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[w]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok)throw await n.text(),Error("Network response was not ok");let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},ex=async(e,t,o)=>{try{let a=s?"".concat(s,"/global/activity/model"):"/global/activity/model";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[w]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok)throw await n.text(),Error("Network response was not ok");let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eP=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/global/activity/exceptions"):"/global/activity/exceptions";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[w]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok)throw await c.text(),Error("Network response was not ok");let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eO=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/global/activity/exceptions/deployment"):"/global/activity/exceptions/deployment";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[w]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok)throw await c.text(),Error("Network response was not ok");let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eB=async e=>{try{let t=s?"".concat(s,"/global/spend/models?limit=5"):"/global/spend/models?limit=5",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eG=async(e,t)=>{try{let o=s?"".concat(s,"/v2/key/info"):"/v2/key/info",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!a.ok){let e=await a.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},eJ=async(e,t,o)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let r=s?"".concat(s,"/health/test_connection"):"/health/test_connection",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[w]:"Bearer ".concat(e)},body:JSON.stringify({litellm_params:t,mode:o})}),c=n.headers.get("content-type");if(!c||!c.includes("application/json")){let e=await n.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(n.status,": ").concat(n.statusText,"). Check network tab for details."))}let l=await n.json();if(!n.ok||"error"===l.status){if("error"===l.status);else{var a;return{status:"error",message:(null===(a=l.error)||void 0===a?void 0:a.message)||"Connection test failed: ".concat(n.status," ").concat(n.statusText)}}}return l}catch(e){throw console.error("Model connection test error:",e),e}},eU=async(e,t)=>{try{console.log("entering keyInfoV1Call");let o=s?"".concat(s,"/key/info"):"/key/info";o="".concat(o,"?key=").concat(t);let r=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(console.log("response",r),!r.ok){let e=await r.text();u(e),a.ZP.error("Failed to fetch key info - "+e)}let n=await r.json();return console.log("data",n),n}catch(e){throw console.error("Failed to fetch key info:",e),e}},eA=async function(e,t,o,a,r,n,c,l){let i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let p=s?"".concat(s,"/key/list"):"/key/list";console.log("in keyListCall");let h=new URLSearchParams;o&&h.append("team_id",o.toString()),t&&h.append("organization_id",t.toString()),a&&h.append("key_alias",a),n&&h.append("key_hash",n),r&&h.append("user_id",r.toString()),c&&h.append("page",c.toString()),l&&h.append("size",l.toString()),i&&h.append("sort_by",i),d&&h.append("sort_order",d),h.append("return_full_object","true"),h.append("include_team_keys","true");let g=h.toString();g&&(p+="?".concat(g));let f=await fetch(p,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw u(e),Error("Network response was not ok")}let m=await f.json();return console.log("/team/list API Response:",m),m}catch(e){throw console.error("Failed to create key:",e),e}},eI=async(e,t)=>{try{let o=s?"".concat(s,"/spend/users"):"/spend/users";console.log("in spendUsersCall:",o);let a=await fetch("".concat(o,"?user_id=").concat(t),{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get spend for user",e),e}},eR=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/user/request_model"):"/user/request_model",n=await fetch(r,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({models:[t],user_id:o,justification:a})});if(!n.ok){let e=await n.text();throw u(e),Error("Network response was not ok")}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to create key:",e),e}},eM=async e=>{try{let t=s?"".concat(s,"/user/get_requests"):"/user/get_requests";console.log("in userGetRequesedtModelsCall:",t);let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to get requested models:",e),e}},ez=async(e,t)=>{try{let o=s?"".concat(s,"/user/get_users?role=").concat(t):"/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get requested models:",e),e}},eL=async e=>{try{let t=s?"".concat(s,"/user/available_roles"):"/user/available_roles",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("response from user/available_role",a),a}catch(e){throw e}},eD=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=s?"".concat(s,"/team/new"):"/team/new",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eV=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=s?"".concat(s,"/credentials"):"/credentials",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eq=async e=>{try{let t=s?"".concat(s,"/credentials"):"/credentials";console.log("in credentialListCall");let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log("/credentials API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},eH=async(e,t,o)=>{try{let a=s?"".concat(s,"/credentials"):"/credentials";t?a+="/by_name/".concat(t):o&&(a+="/by_model/".concat(o)),console.log("in credentialListCall");let r=await fetch(a,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw u(e),Error("Network response was not ok")}let n=await r.json();return console.log("/credentials API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eZ=async(e,t)=>{try{let o=s?"".concat(s,"/credentials/").concat(t):"/credentials/".concat(t);console.log("in credentialDeleteCall:",t);let a=await fetch(o,{method:"DELETE",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},eY=async(e,t,o)=>{try{if(console.log("Form Values in credentialUpdateCall:",o),o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let a=s?"".concat(s,"/credentials/").concat(t):"/credentials/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...o})});if(!r.ok){let e=await r.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eW=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let o=s?"".concat(s,"/key/update"):"/key/update",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update key Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eK=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=s?"".concat(s,"/team/update"):"/team/update",r=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw u(e),console.error("Error response from the server:",e),a.ZP.error("Failed to update team settings: "+e),Error(e)}let n=await r.json();return console.log("Update Team Response:",n),n}catch(e){throw console.error("Failed to update team:",e),e}},eQ=async(e,t,o)=>{try{console.log("Form Values in modelUpateCall:",t);let a=s?"".concat(s,"/model/").concat(o,"/update"):"/model/".concat(o,"/update"),r=await fetch(a,{method:"PATCH",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw u(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("Update model Response:",n),n}catch(e){throw console.error("Failed to update model:",e),e}},eX=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=s?"".concat(s,"/model/update"):"/model/update",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update model Response:",r),r}catch(e){throw console.error("Failed to update model:",e),e}},e$=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let r=s?"".concat(s,"/team/member_add"):"/team/member_add",n=await fetch(r,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},e0=async(e,t,o,a,r)=>{try{console.log("Bulk add team members:",{teamId:t,members:o,maxBudgetInTeam:a});let c=s?"".concat(s,"/team/bulk_member_add"):"/team/bulk_member_add",l={team_id:t};r?l.all_users=!0:l.members=o,null!=a&&(l.max_budget_in_team=a);let i=await fetch(c,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok){var n;let e=await i.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(n=t.detail)||void 0===n?void 0:n.error)||"Failed to bulk add team members",a=Error(o);throw a.raw=t,a}let d=await i.json();return console.log("Bulk team member add API Response:",d),d}catch(e){throw console.error("Failed to bulk add team members:",e),e}},e1=async(e,t,o)=>{try{console.log("Form Values in teamMemberUpdateCall:",o);let r=s?"".concat(s,"/team/member_update"):"/team/member_update",n=await fetch(r,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,role:o.role,user_id:o.user_id})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to update team member:",e),e}},e2=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=s?"".concat(s,"/team/member_delete"):"/team/member_delete",r=await fetch(a,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,...void 0!==o.user_email&&{user_email:o.user_email},...void 0!==o.user_id&&{user_id:o.user_id}})});if(!r.ok){let e=await r.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},e3=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=s?"".concat(s,"/organization/member_add"):"/organization/member_add",r=await fetch(a,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:o})});if(!r.ok){let e=await r.text();throw u(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create organization member:",e),e}},e4=async(e,t,o)=>{try{console.log("Form Values in organizationMemberDeleteCall:",o);let a=s?"".concat(s,"/organization/member_delete"):"/organization/member_delete",r=await fetch(a,{method:"DELETE",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,user_id:o})});if(!r.ok){let e=await r.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},e5=async(e,t,o)=>{try{console.log("Form Values in organizationMemberUpdateCall:",o);let a=s?"".concat(s,"/organization/member_update"):"/organization/member_update",r=await fetch(a,{method:"PATCH",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,...o})});if(!r.ok){let e=await r.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},e6=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=s?"".concat(s,"/user/update"):"/user/update",r={...t};null!==o&&(r.user_role=o),r=JSON.stringify(r);let n=await fetch(a,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!n.ok){let e=await n.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},e7=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{let r;console.log("Form Values in userUpdateUserCall:",t);let n=s?"".concat(s,"/user/bulk_update"):"/user/bulk_update";if(a)r=JSON.stringify({all_users:!0,user_updates:t});else if(o&&o.length>0){let e=[];for(let a of o)e.push({user_id:a,...t});r=JSON.stringify({users:e})}else throw Error("Must provide either userIds or set allUsers=true");let c=await fetch(n,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!c.ok){let e=await c.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let l=await c.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},e9=async(e,t)=>{try{let o=s?"".concat(s,"/global/predict/spend/logs"):"/global/predict/spend/logs",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},e8=async e=>{try{let t=s?"".concat(s,"/health/services?service=slack_budget_alerts"):"/health/services?service=slack_budget_alerts";console.log("Checking Slack Budget Alerts service health");let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error(e)}let r=await o.json();return a.ZP.success("Test Slack Alert worked - check your Slack!"),console.log("Service Health Response:",r),r}catch(e){throw console.error("Failed to perform health check:",e),e}},te=async(e,t)=>{try{let o=s?"".concat(s,"/health/services?service=").concat(t):"/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let r=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw u(e),Error(e)}let n=await r.json();return a.ZP.success("Test request to ".concat(t," made - check logs/alerts on ").concat(t," to verify")),n}catch(e){throw console.error("Failed to perform health check:",e),e}},tt=async e=>{try{let t=s?"".concat(s,"/budget/list"):"/budget/list",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},to=async e=>{try{let t=s?"".concat(s,"/budget/settings"):"/budget/settings",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},ta=async(e,t,o)=>{try{let t=s?"".concat(s,"/get/config/callbacks"):"/get/config/callbacks",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tr=async e=>{try{let t=s?"".concat(s,"/config/list?config_type=general_settings"):"/config/list?config_type=general_settings",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tn=async e=>{try{let t=s?"".concat(s,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tc=async(e,t)=>{try{let o=s?"".concat(s,"/config/field/info?field_name=").concat(t):"/config/field/info?field_name=".concat(t),a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},ts=async(e,t,o)=>{try{let r=s?"".concat(s,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",n=await fetch(r,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o})});if(!n.ok){let e=await n.text();throw u(e),Error("Network response was not ok")}let c=await n.json();return a.ZP.success("Successfully updated value!"),c}catch(e){throw console.error("Failed to set callbacks:",e),e}},tl=async(e,t)=>{try{let o=s?"".concat(s,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},ti=async(e,t,o)=>{try{let r=s?"".concat(s,"/config/field/update"):"/config/field/update",n=await fetch(r,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!n.ok){let e=await n.text();throw u(e),Error("Network response was not ok")}let c=await n.json();return a.ZP.success("Successfully updated value!"),c}catch(e){throw console.error("Failed to set callbacks:",e),e}},td=async(e,t)=>{try{let o=s?"".concat(s,"/config/field/delete"):"/config/field/delete",r=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!r.ok){let e=await r.text();throw u(e),Error("Network response was not ok")}let n=await r.json();return a.ZP.success("Field reset on proxy"),n}catch(e){throw console.error("Failed to get callbacks:",e),e}},tp=async(e,t)=>{try{let o=s?"".concat(s,"/config/pass_through_endpoint?endpoint_id=").concat(t):"/config/pass_through_endpoint".concat(t),a=await fetch(o,{method:"DELETE",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},th=async(e,t)=>{try{let o=s?"".concat(s,"/config/update"):"/config/update",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tu=async e=>{try{let t=s?"".concat(s,"/health"):"/health",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to call /health:",e),e}},tw=async(e,t)=>{try{let o=s?"".concat(s,"/health?model=").concat(encodeURIComponent(t)):"/health?model=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw Error(e||"Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to call /health for model ".concat(t,":"),e),e}},tg=async e=>{try{let t=s?"".concat(s,"/cache/ping"):"/cache/ping",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tf=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;try{let n=s?"".concat(s,"/health/history"):"/health/history",c=new URLSearchParams;t&&c.append("model",t),o&&c.append("status_filter",o),c.append("limit",a.toString()),c.append("offset",r.toString()),c.toString()&&(n+="?".concat(c.toString()));let l=await fetch(n,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw u(e),Error(e)}return await l.json()}catch(e){throw console.error("Failed to call /health/history:",e),e}},tm=async e=>{try{let t=s?"".concat(s,"/health/latest"):"/health/latest",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},ty=async e=>{try{console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",s);let t=s?"".concat(s,"/sso/get/ui_settings"):"/sso/get/ui_settings",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tk=async e=>{try{let t=s?"".concat(s,"/v2/guardrails/list"):"/v2/guardrails/list",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}},tC=async(e,t)=>{try{let o=s?"".concat(s,"/guardrails"):"/guardrails",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!a.ok){let e=await a.text();throw u(e),Error(e)}let r=await a.json();return console.log("Create guardrail response:",r),r}catch(e){throw console.error("Failed to create guardrail:",e),e}},t_=async(e,t,o)=>{try{let a=s?"".concat(s,"/spend/logs/ui/").concat(t,"?start_date=").concat(encodeURIComponent(o)):"/spend/logs/ui/".concat(t,"?start_date=").concat(encodeURIComponent(o));console.log("Fetching log details from:",a);let r=await fetch(a,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw u(e),Error("Network response was not ok")}let n=await r.json();return console.log("Fetched log details:",n),n}catch(e){throw console.error("Failed to fetch log details:",e),e}},tT=async e=>{try{let t=s?"".concat(s,"/get/internal_user_settings"):"/get/internal_user_settings";console.log("Fetching SSO settings from:",t);let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO settings:",a),a}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},tE=async(e,t)=>{try{let o=s?"".concat(s,"/update/internal_user_settings"):"/update/internal_user_settings";console.log("Updating internal user settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw u(e),Error(e)}let n=await r.json();return console.log("Updated internal user settings:",n),a.ZP.success("Internal user settings updated successfully"),n}catch(e){throw console.error("Failed to update internal user settings:",e),e}},tS=async e=>{try{let t=s?"".concat(s,"/v1/mcp/server"):"/v1/mcp/server";console.log("Fetching MCP servers from:",t);let o=await fetch(t,{method:d.GET,headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP servers:",a),a}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},tj=async e=>{try{let t=s?"".concat(s,"/v1/mcp/access_groups"):"/v1/mcp/access_groups";console.log("Fetching MCP access groups from:",t);let o=await fetch(t,{method:d.GET,headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP access groups:",a),a.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},tv=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let o=s?"".concat(s,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw u(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tb=async(e,t)=>{try{let o=s?"".concat(s,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"PUT",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to update MCP server:",e),e}},tN=async(e,t)=>{try{let o=(s?"".concat(s):"")+"/v1/mcp/server/".concat(t);console.log("in deleteMCPServer:",t);let a=await fetch(o,{method:d.DELETE,headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}}catch(e){throw console.error("Failed to delete key:",e),e}},tF=async(e,t)=>{try{let o=s?"".concat(s,"/mcp-rest/tools/list?server_id=").concat(t):"/mcp-rest/tools/list?server_id=".concat(t);console.log("Fetching MCP tools from:",o);let a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}}),r=await a.json();if(console.log("Fetched MCP tools response:",r),!a.ok){if(r.error&&r.message)throw Error(r.message);throw Error("Failed to fetch MCP tools")}return r}catch(e){return console.error("Failed to fetch MCP tools:",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools"}}},tx=async(e,t,o,a,r)=>{try{let n=s?"".concat(s,"/mcp-rest/tools/call"):"/mcp-rest/tools/call";console.log("Calling MCP tool:",t,"with arguments:",o);let c={[w]:"Bearer ".concat(e),"Content-Type":"application/json"};r?c["x-mcp-".concat(r,"-authorization")]=a:c["x-mcp-auth"]=a;let l=await fetch(n,{method:"POST",headers:c,body:JSON.stringify({name:t,arguments:o})});if(!l.ok){let e="Network response was not ok",t=null,o=await l.text();try{let a=JSON.parse(o);a.detail?"string"==typeof a.detail?e=a.detail:"object"==typeof a.detail&&(e=a.detail.message||a.detail.error||"An error occurred",t=a.detail):e=a.message||a.error||e}catch(t){console.error("Failed to parse JSON error response:",t),o&&(e=o)}let a=Error(e);throw a.status=l.status,a.statusText=l.statusText,a.details=t,u(e),a}let i=await l.json();return console.log("MCP tool call response:",i),i}catch(e){throw console.error("Failed to call MCP tool:",e),console.error("Error type:",typeof e),e instanceof Error&&(console.error("Error message:",e.message),console.error("Error stack:",e.stack)),e}},tP=async(e,t)=>{try{let o=s?"".concat(s,"/tag/new"):"/tag/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await u(e);return}return await a.json()}catch(e){throw console.error("Error creating tag:",e),e}},tO=async(e,t)=>{try{let o=s?"".concat(s,"/tag/update"):"/tag/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await u(e);return}return await a.json()}catch(e){throw console.error("Error updating tag:",e),e}},tB=async(e,t)=>{try{let o=s?"".concat(s,"/tag/info"):"/tag/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({names:t})});if(!a.ok){let e=await a.text();return await u(e),{}}return await a.json()}catch(e){throw console.error("Error getting tag info:",e),e}},tG=async e=>{try{let t=s?"".concat(s,"/tag/list"):"/tag/list",o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.text();return await u(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},tJ=async(e,t)=>{try{let o=s?"".concat(s,"/tag/delete"):"/tag/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({name:t})});if(!a.ok){let e=await a.text();await u(e);return}return await a.json()}catch(e){throw console.error("Error deleting tag:",e),e}},tU=async e=>{try{let t=s?"".concat(s,"/get/default_team_settings"):"/get/default_team_settings";console.log("Fetching default team settings from:",t);let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched default team settings:",a),a}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},tA=async(e,t)=>{try{let o=s?"".concat(s,"/update/default_team_settings"):"/update/default_team_settings";console.log("Updating default team settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw u(e),Error("Network response was not ok")}let n=await r.json();return console.log("Updated default team settings:",n),a.ZP.success("Default team settings updated successfully"),n}catch(e){throw console.error("Failed to update default team settings:",e),e}},tI=async(e,t)=>{try{let o=s?"".concat(s,"/team/permissions_list?team_id=").concat(t):"/team/permissions_list?team_id=".concat(t),a=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log("Team permissions response:",r),r}catch(e){throw console.error("Failed to get team permissions:",e),e}},tR=async(e,t,o)=>{try{let a=s?"".concat(s,"/team/permissions_update"):"/team/permissions_update",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({team_id:t,team_member_permissions:o})});if(!r.ok){let e=await r.text();throw u(e),Error("Network response was not ok")}let n=await r.json();return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},tM=async(e,t)=>{try{let o=s?"".concat(s,"/spend/logs/session/ui?session_id=").concat(encodeURIComponent(t)):"/spend/logs/session/ui?session_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},tz=async(e,t)=>{try{let o=s?"".concat(s,"/vector_store/new"):"/vector_store/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to create vector store")}return await a.json()}catch(e){throw console.error("Error creating vector store:",e),e}},tL=async function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let t=s?"".concat(s,"/vector_store/list"):"/vector_store/list",o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.json();throw Error(e.detail||"Failed to list vector stores")}return await o.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},tD=async(e,t)=>{try{let o=s?"".concat(s,"/vector_store/delete"):"/vector_store/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to delete vector store")}return await a.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},tV=async(e,t)=>{try{let o=s?"".concat(s,"/vector_store/info"):"/vector_store/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to get vector store info")}return await a.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},tq=async(e,t)=>{try{let o=s?"".concat(s,"/vector_store/update"):"/vector_store/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to update vector store")}return await a.json()}catch(e){throw console.error("Error updating vector store:",e),e}},tH=async e=>{try{let t=s?"".concat(s,"/email/event_settings"):"/email/event_settings",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Failed to get email event settings")}let a=await o.json();return console.log("Email event settings response:",a),a}catch(e){throw console.error("Failed to get email event settings:",e),e}},tZ=async(e,t)=>{try{let o=s?"".concat(s,"/email/event_settings"):"/email/event_settings",a=await fetch(o,{method:"PATCH",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw u(e),Error("Failed to update email event settings")}let r=await a.json();return console.log("Update email event settings response:",r),r}catch(e){throw console.error("Failed to update email event settings:",e),e}},tY=async e=>{try{let t=s?"".concat(s,"/email/event_settings/reset"):"/email/event_settings/reset",o=await fetch(t,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Failed to reset email event settings")}let a=await o.json();return console.log("Reset email event settings response:",a),a}catch(e){throw console.error("Failed to reset email event settings:",e),e}},tW=async(e,t)=>{try{let o=s?"".concat(s,"/guardrails/").concat(t):"/guardrails/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error(e)}let r=await a.json();return console.log("Delete guardrail response:",r),r}catch(e){throw console.error("Failed to delete guardrail:",e),e}},tK=async e=>{try{let t=s?"".concat(s,"/guardrails/ui/add_guardrail_settings"):"/guardrails/ui/add_guardrail_settings",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Failed to get guardrail UI settings")}let a=await o.json();return console.log("Guardrail UI settings response:",a),a}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},tQ=async e=>{try{let t=s?"".concat(s,"/guardrails/ui/provider_specific_params"):"/guardrails/ui/provider_specific_params",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Failed to get guardrail provider specific parameters")}let a=await o.json();return console.log("Guardrail provider specific params response:",a),a}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},tX=async(e,t)=>{try{let o=s?"".concat(s,"/guardrails/").concat(t,"/info"):"/guardrails/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Failed to get guardrail info")}let r=await a.json();return console.log("Guardrail info response:",r),r}catch(e){throw console.error("Failed to get guardrail info:",e),e}},t$=async(e,t,o)=>{try{let a=s?"".concat(s,"/guardrails/").concat(t):"/guardrails/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw u(e),Error("Failed to update guardrail")}let n=await r.json();return console.log("Update guardrail response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},t0=async e=>{try{let t=s?"".concat(s,"/get/sso_settings"):"/get/sso_settings";console.log("Fetching SSO configuration from:",t);let o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO configuration:",a),a}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},t1=async(e,t)=>{try{let o=s?"".concat(s,"/update/sso_settings"):"/update/sso_settings";console.log("Updating SSO configuration:",t);let a=await fetch(o,{method:"PATCH",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=await a.json();return console.log("Updated SSO configuration:",r),r}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},t2=async(e,t,o,a,r)=>{try{let t=s?"".concat(s,"/audit"):"/audit",o=new URLSearchParams;a&&o.append("page",a.toString()),r&&o.append("page_size",r.toString());let n=o.toString();n&&(t+="?".concat(n));let c=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.text();throw u(e),Error("Network response was not ok")}return await c.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},t3=async e=>{try{let t=s?"".concat(s,"/user/available_users"):"/user/available_users",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e)}});if(!o.ok){if(404===o.status)return null;let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},t4=async(e,t,o)=>{try{let r=s?"".concat(s,"/config/pass_through_endpoint/").concat(encodeURIComponent(t)):"/config/pass_through_endpoint/".concat(encodeURIComponent(t)),n=await fetch(r,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!n.ok){let e=await n.text();throw u(e),Error("Network response was not ok")}let c=await n.json();return a.ZP.success("Pass through endpoint updated successfully"),c}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},t5=async(e,t)=>{try{let o=s?"".concat(s,"/config/pass_through_endpoint?endpoint_id=").concat(encodeURIComponent(t)):"/config/pass_through_endpoint?endpoint_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}let r=(await a.json()).endpoints;if(!r||0===r.length)throw Error("Pass through endpoint not found");return r[0]}catch(e){throw console.error("Failed to get pass through endpoint info:",e),e}},t6=async(e,t)=>{try{let o=s?"".concat(s,"/config/callback/delete"):"/config/callback/delete",a=await fetch(o,{method:"POST",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({callback_name:t})});if(!a.ok){let e=await a.text();throw u(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to delete specific callback:",e),e}},t7=async e=>{let t=i(),o=await fetch("".concat(t,"/v1/mcp/tools"),{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw Error("HTTP error! status: ".concat(o.status));return await o.json()},t9=async(e,t)=>{try{console.log("Testing MCP connection with config:",JSON.stringify(t));let a=s?"".concat(s,"/mcp-rest/test/connection"):"/mcp-rest/test/connection",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",[w]:"Bearer ".concat(e)},body:JSON.stringify(t)}),n=r.headers.get("content-type");if(!n||!n.includes("application/json")){let e=await r.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(r.status,": ").concat(r.statusText,"). Check network tab for details."))}let c=await r.json();if(!r.ok||"error"===c.status){if("error"===c.status);else{var o;return{status:"error",message:(null===(o=c.error)||void 0===o?void 0:o.message)||"MCP connection test failed: ".concat(r.status," ").concat(r.statusText)}}}return c}catch(e){throw console.error("MCP connection test error:",e),e}},t8=async(e,t)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let o=s?"".concat(s,"/mcp-rest/test/tools/list"):"/mcp-rest/test/tools/list",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",[w]:"Bearer ".concat(e)},body:JSON.stringify(t)}),r=a.headers.get("content-type");if(!r||!r.includes("application/json")){let e=await a.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(a.status,": ").concat(a.statusText,"). Check network tab for details."))}let n=await a.json();if((!a.ok||n.error)&&!n.error)return{tools:[],error:"request_failed",message:n.message||"MCP tools list failed: ".concat(a.status," ").concat(a.statusText)};return n}catch(e){throw console.error("MCP tools list test error:",e),e}},oe=async(e,t,o)=>{try{let a="".concat(i(),"/v1/vector_stores/").concat(t,"/search"),r=await fetch(a,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o})});if(!r.ok){let e=await r.text();return await u(e),null}return await r.json()}catch(e){throw console.error("Error testing vector store search:",e),e}},ot=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:50,n=arguments.length>5?arguments[5]:void 0;try{let c=s?"".concat(s,"/tag/user-agent/analytics"):"/tag/user-agent/analytics",l=new URLSearchParams,i=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};l.append("start_date",i(t)),l.append("end_date",i(o)),l.append("page",a.toString()),l.append("page_size",r.toString()),n&&l.append("user_agent_filter",n);let d=l.toString();d&&(c+="?".concat(d));let p=await fetch(c,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!p.ok){let e=await p.text();throw u(e),Error("Network response was not ok")}return await p.json()}catch(e){throw console.error("Failed to fetch user agent analytics:",e),e}},oo=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/tag/dau"):"/tag/dau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw u(e),Error("Network response was not ok")}return await l.json()}catch(e){throw console.error("Failed to fetch DAU:",e),e}},oa=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/tag/wau"):"/tag/wau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw u(e),Error("Network response was not ok")}return await l.json()}catch(e){throw console.error("Failed to fetch WAU:",e),e}},or=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/tag/mau"):"/tag/mau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw u(e),Error("Network response was not ok")}return await l.json()}catch(e){throw console.error("Failed to fetch MAU:",e),e}},on=async e=>{try{let t=s?"".concat(s,"/tag/distinct"):"/tag/distinct",o=await fetch(t,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw u(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to fetch distinct tags:",e),e}},oc=async(e,t,o,a)=>{try{let r=s?"".concat(s,"/tag/summary"):"/tag/summary",n=new URLSearchParams,c=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};n.append("start_date",c(t)),n.append("end_date",c(o)),a&&a.length>0&&a.forEach(e=>{n.append("tag_filters",e)});let l=n.toString();l&&(r+="?".concat(l));let i=await fetch(r,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw u(e),Error("Network response was not ok")}return await i.json()}catch(e){throw console.error("Failed to fetch user agent summary:",e),e}},os=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,a=arguments.length>3?arguments[3]:void 0;try{let r=s?"".concat(s,"/tag/user-agent/per-user-analytics"):"/tag/user-agent/per-user-analytics",n=new URLSearchParams;n.append("page",t.toString()),n.append("page_size",o.toString()),a&&a.length>0&&a.forEach(e=>{n.append("tag_filters",e)});let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[w]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw u(e),Error("Network response was not ok")}return await l.json()}catch(e){throw console.error("Failed to fetch per-user analytics:",e),e}}},3914:function(e,t,o){function a(){let e=window.location.hostname,t=["Lax","Strict","None"];["/","/ui"].forEach(o=>{document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,";"),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,";"),t.forEach(t=>{let a="None"===t?" Secure;":"";document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; SameSite=").concat(t,";").concat(a),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,"; SameSite=").concat(t,";").concat(a)})}),console.log("After clearing cookies:",document.cookie)}function r(e){let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}o.d(t,{b:function(){return a},e:function(){return r}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/162-8529572226f208c5.js b/litellm/proxy/_experimental/out/_next/static/chunks/162-8529572226f208c5.js new file mode 100644 index 00000000000..6261c91b044 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/162-8529572226f208c5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[162],{36724:function(e,t,n){n.d(t,{Dx:function(){return i.Z},Zb:function(){return a.Z},xv:function(){return r.Z},zx:function(){return s.Z}});var s=n(20831),a=n(12514),r=n(84264),i=n(96761)},19130:function(e,t,n){n.d(t,{RM:function(){return a.Z},SC:function(){return l.Z},iA:function(){return s.Z},pj:function(){return r.Z},ss:function(){return i.Z},xs:function(){return o.Z}});var s=n(21626),a=n(97214),r=n(28241),i=n(58834),o=n(69552),l=n(71876)},88658:function(e,t,n){n.d(t,{L:function(){return a}});var s=n(49817);let a=e=>{let t;let{apiKeySource:n,accessToken:a,apiKey:r,inputMessage:i,chatHistory:o,selectedTags:l,selectedVectorStores:c,selectedGuardrails:d,endpointType:m,selectedModel:p,selectedSdk:u}=e,g="session"===n?a:r,x=window.location.origin,h=(i||"Your prompt here").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),f=o.filter(e=>!e.isImage).map(e=>{let{role:t,content:n}=e;return{role:t,content:n}}),_={};l.length>0&&(_.tags=l),c.length>0&&(_.vector_stores=c),d.length>0&&(_.guardrails=d);let b=p||"your-model-name",v="azure"===u?'import openai\n\nclient = openai.AzureOpenAI(\n api_key="'.concat(g||"YOUR_LITELLM_API_KEY",'",\n azure_endpoint="').concat(x,'",\n api_version="2024-02-01"\n)'):'import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(g||"YOUR_LITELLM_API_KEY",'",\n base_url="').concat(x,'"\n)');switch(m){case s.KP.CHAT:{let e=Object.keys(_).length>0,n="";if(e){let e=JSON.stringify({metadata:_},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}t='\n# request sent to model set on litellm proxy, `litellm --model`\nresponse = client.chat.completions.create(\n model="'.concat(b,'",\n messages = ').concat(JSON.stringify(f,null,4)).concat(n,"\n)\n\nprint(response)\n");break}case s.KP.RESPONSES:{let e=Object.keys(_).length>0,n="";if(e){let e=JSON.stringify({metadata:_},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}t='\n# request sent to model set on litellm proxy, `litellm --model`\nresponse = client.responses.create(\n model="'.concat(b,'",\n messages = ').concat(JSON.stringify(f,null,4)).concat(n,"\n)\n\nprint(response)\n");break}case s.KP.IMAGE:t="azure"===u?"\n# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.\n# This snippet uses 'client.images.generate' and will create a new image based on your prompt.\n# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.\nimport os\nimport requests\nimport json\nimport time\nfrom PIL import Image\n\nresult = client.images.generate(\n model=\"".concat(b,'",\n prompt="').concat(i,'",\n n=1\n)\n\njson_response = json.loads(result.model_dump_json())\n\n# Set the directory for the stored image\nimage_dir = os.path.join(os.curdir, \'images\')\n\n# If the directory doesn\'t exist, create it\nif not os.path.isdir(image_dir):\n os.mkdir(image_dir)\n\n# Initialize the image path\nimage_filename = f"generated_image_{int(time.time())}.png"\nimage_path = os.path.join(image_dir, image_filename)\n\ntry:\n # Retrieve the generated image\n if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):\n image_url = json_response["data"][0]["url"]\n generated_image = requests.get(image_url).content\n with open(image_path, "wb") as image_file:\n image_file.write(generated_image)\n\n print(f"Image saved to {image_path}")\n # Display the image\n image = Image.open(image_path)\n image.show()\n else:\n print("Could not find image URL in response.")\n print("Full response:", json_response)\nexcept Exception as e:\n print(f"An error occurred: {e}")\n print("Full response:", json_response)\n'):"\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(h,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(b,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case s.KP.IMAGE_EDITS:t="azure"===u?'\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# The prompt entered by the user\nprompt = "'.concat(h,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(b,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n'):"\nimport base64\nimport os\nimport time\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(h,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(b,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;default:t="\n# Code generation for this endpoint is not implemented yet."}return"".concat(v,"\n").concat(t)}},49817:function(e,t,n){var s,a,r,i;n.d(t,{KP:function(){return a},vf:function(){return l}}),(r=s||(s={})).IMAGE_GENERATION="image_generation",r.CHAT="chat",r.RESPONSES="responses",r.IMAGE_EDITS="image_edits",r.ANTHROPIC_MESSAGES="anthropic_messages",(i=a||(a={})).IMAGE="image",i.CHAT="chat",i.RESPONSES="responses",i.IMAGE_EDITS="image_edits",i.ANTHROPIC_MESSAGES="anthropic_messages";let o={image_generation:"image",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages"},l=e=>{if(console.log("getEndpointType:",e),Object.values(s).includes(e)){let t=o[e];return console.log("endpointType:",t),t}return"chat"}},8048:function(e,t,n){n.d(t,{C:function(){return m}});var s=n(57437),a=n(71594),r=n(24525),i=n(2265),o=n(19130),l=n(44633),c=n(86462),d=n(49084);function m(e){let{data:t=[],columns:n,isLoading:m=!1,table:p,defaultSorting:u=[]}=e,[g,x]=i.useState(u),[h]=i.useState("onChange"),[f,_]=i.useState({}),[b,v]=i.useState({}),j=(0,a.b7)({data:t,columns:n,state:{sorting:g,columnSizing:f,columnVisibility:b},columnResizeMode:h,onSortingChange:x,onColumnSizingChange:_,onColumnVisibilityChange:v,getCoreRowModel:(0,r.sC)(),getSortedRowModel:(0,r.tj)(),enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return i.useEffect(()=>{p&&(p.current=j)},[j,p]),(0,s.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsx)("div",{className:"relative min-w-full",children:(0,s.jsxs)(o.iA,{className:"[&_td]:py-2 [&_th]:py-2 w-full",children:[(0,s.jsx)(o.ss,{children:j.getHeaderGroups().map(e=>(0,s.jsx)(o.SC,{children:e.headers.map(e=>{var t;return(0,s.jsxs)(o.xs,{className:"py-1 h-8 relative ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.id?120:e.getSize(),position:"actions"===e.id?"sticky":"relative",right:"actions"===e.id?0:"auto"},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,a.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,s.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,s.jsx)(l.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,s.jsx)(c.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,s.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,s.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"absolute right-0 top-0 h-full w-2 cursor-col-resize select-none touch-none ".concat(e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200")})]},e.id)})},e.id))}),(0,s.jsx)(o.RM,{children:m?(0,s.jsx)(o.SC,{children:(0,s.jsx)(o.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:"\uD83D\uDE85 Loading models..."})})})}):j.getRowModel().rows.length>0?j.getRowModel().rows.map(e=>(0,s.jsx)(o.SC,{children:e.getVisibleCells().map(e=>{var t;return(0,s.jsx)(o.pj,{className:"py-0.5 ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.column.id?120:e.column.getSize(),position:"actions"===e.column.id?"sticky":"relative",right:"actions"===e.column.id?0:"auto"},children:(0,a.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)):(0,s.jsx)(o.SC,{children:(0,s.jsx)(o.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:"No models found"})})})})})]})})})})}},65373:function(e,t,n){n.d(t,{Z:function(){return h}});var s=n(57437),a=n(27648),r=n(2265),i=n(89970),o=n(80795),l=n(19250),c=n(15883),d=n(46346),m=n(57400),p=n(91870),u=n(40428),g=n(3914);let x=async e=>{if(!e)return null;try{return await (0,l.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};var h=e=>{let{userID:t,userEmail:n,userRole:h,premiumUser:f,proxySettings:_,setProxySettings:b,accessToken:v,isPublicPage:j=!1}=e,y=(0,l.getProxyBaseUrl)(),[N,w]=(0,r.useState)("");(0,r.useEffect)(()=>{(async()=>{if(v){let e=await x(v);console.log("response from fetchProxySettings",e),e&&b(e)}})()},[v]),(0,r.useEffect)(()=>{w((null==_?void 0:_.PROXY_LOGOUT_URL)||"")},[_]);let A=[{key:"user-info",label:(0,s.jsxs)("div",{className:"px-3 py-3 border-b border-gray-100",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(c.Z,{className:"mr-2 text-gray-700"}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:t})]}),f?(0,s.jsx)(i.Z,{title:"Premium User",placement:"left",children:(0,s.jsxs)("div",{className:"flex items-center bg-gradient-to-r from-amber-500 to-yellow-500 text-white px-2 py-0.5 rounded-full cursor-help",children:[(0,s.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,s.jsx)("span",{className:"text-xs font-medium",children:"Premium"})]})}):(0,s.jsx)(i.Z,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,s.jsxs)("div",{className:"flex items-center bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full cursor-help",children:[(0,s.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,s.jsx)("span",{className:"text-xs font-medium",children:"Standard"})]})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center text-sm",children:[(0,s.jsx)(m.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Role"}),(0,s.jsx)("span",{className:"ml-auto text-gray-700 font-medium",children:h})]}),(0,s.jsxs)("div",{className:"flex items-center text-sm",children:[(0,s.jsx)(p.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Email"}),(0,s.jsx)("span",{className:"ml-auto text-gray-700 font-medium truncate max-w-[150px]",title:n||"Unknown",children:n||"Unknown"})]})]})]})},{key:"logout",label:(0,s.jsxs)("div",{className:"flex items-center py-2 px-3 hover:bg-gray-50 rounded-md mx-1 my-1",onClick:()=>{(0,g.b)(),window.location.href=N},children:[(0,s.jsx)(u.Z,{className:"mr-3 text-gray-600"}),(0,s.jsx)("span",{className:"text-gray-800",children:"Logout"})]})}];return(0,s.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,s.jsx)("div",{className:"w-full",children:(0,s.jsxs)("div",{className:"flex items-center h-12 px-4",children:[(0,s.jsx)("div",{className:"flex items-center flex-shrink-0",children:(0,s.jsx)(a.default,{href:"/",className:"flex items-center",children:(0,s.jsx)("img",{src:y+"/get_image",alt:"LiteLLM Brand",className:"h-8 w-auto"})})}),(0,s.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:"text-[13px] text-gray-600 hover:text-gray-900 transition-colors",children:"Docs"}),!j&&(0,s.jsx)(o.Z,{menu:{items:A,className:"min-w-[200px]",style:{padding:"8px",marginTop:"8px",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.08)"}},overlayStyle:{minWidth:"200px"},children:(0,s.jsxs)("button",{className:"inline-flex items-center text-[13px] text-gray-600 hover:text-gray-900 transition-colors",children:["User",(0,s.jsx)("svg",{className:"ml-1 w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 9l-7 7-7-7"})})]})})]})]})})})}},42673:function(e,t,n){var s,a;n.d(t,{Cl:function(){return s},bK:function(){return d},cd:function(){return o},dr:function(){return l},fK:function(){return r},ph:function(){return c}}),n(2265),(a=s||(s={})).Bedrock="Amazon Bedrock",a.Anthropic="Anthropic",a.AssemblyAI="AssemblyAI",a.SageMaker="AWS SageMaker",a.Azure="Azure",a.Azure_AI_Studio="Azure AI Foundry (Studio)",a.Cerebras="Cerebras",a.Cohere="Cohere",a.Databricks="Databricks",a.DeepInfra="DeepInfra",a.Deepgram="Deepgram",a.Deepseek="Deepseek",a.ElevenLabs="ElevenLabs",a.FireworksAI="Fireworks AI",a.Google_AI_Studio="Google AI Studio",a.Groq="Groq",a.JinaAI="Jina AI",a.MistralAI="Mistral AI",a.Ollama="Ollama",a.OpenAI="OpenAI",a.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",a.OpenAI_Text="OpenAI Text Completion",a.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",a.Openrouter="Openrouter",a.Perplexity="Perplexity",a.Sambanova="Sambanova",a.TogetherAI="TogetherAI",a.Triton="Triton",a.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",a.VolcEngine="VolcEngine",a.Voyage="Voyage AI",a.xAI="xAI";let r={OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",FireworksAI:"fireworks_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra"},i="/ui/assets/logos/",o={Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),Databricks:"".concat(i,"databricks.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png")},l=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:o[e],displayName:e}}let t=Object.keys(r).find(t=>r[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let n=s[t];return{logo:o[n],displayName:n}},c=e=>{if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";if("Azure"==e)return"azure/my-deployment";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else return"gpt-3.5-turbo"},d=(e,t)=>{console.log("Provider key: ".concat(e));let n=r[e];console.log("Provider mapped to: ".concat(n));let s=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(e=>{let[t,a]=e;null!==a&&"object"==typeof a&&"litellm_provider"in a&&(a.litellm_provider===n||a.litellm_provider.includes(n))&&s.push(t)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(e=>{let[t,n]=e;null!==n&&"object"==typeof n&&"litellm_provider"in n&&"cohere_chat"===n.litellm_provider&&s.push(t)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(e=>{let[t,n]=e;null!==n&&"object"==typeof n&&"litellm_provider"in n&&"sagemaker_chat"===n.litellm_provider&&s.push(t)}))),s}},72162:function(e,t,n){var s=n(57437),a=n(2265),r=n(19250),i=n(8048),o=n(36724),l=n(41021),c=n(89970),d=n(3810),m=n(52787),p=n(91679),u=n(3477),g=n(17732),x=n(33245),h=n(78867),f=n(88658),_=n(49817),b=n(42673),v=n(65373);t.Z=e=>{var t,n;let{accessToken:j}=e,[y,N]=(0,a.useState)(null),[w,A]=(0,a.useState)("LiteLLM Gateway"),[S,I]=(0,a.useState)(null),[k,C]=(0,a.useState)(""),[O,E]=(0,a.useState)({}),[M,D]=(0,a.useState)(!0),[T,z]=(0,a.useState)(""),[L,P]=(0,a.useState)([]),[Z,R]=(0,a.useState)([]),[G,H]=(0,a.useState)([]),[K,F]=(0,a.useState)("I'm alive! ✓"),[V,U]=(0,a.useState)(!1),[q,W]=(0,a.useState)(null),[B,J]=(0,a.useState)({}),Y=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=async()=>{try{D(!0);let e=await (0,r.modelHubPublicModelsCall)();console.log("ModelHubData:",e),N(e)}catch(e){console.error("There was an error fetching the public model data",e),F("Service unavailable")}finally{D(!1)}};(async()=>{let e=await (0,r.getPublicModelHubInfo)();console.log("Public Model Hub Info:",e),A(e.docs_title),I(e.custom_docs_description),C(e.litellm_version),E(e.useful_links||{})})(),e()},[]),(0,a.useEffect)(()=>{},[T,L,Z,G]);let $=(0,a.useMemo)(()=>{if(!y)return[];let e=y;if(T.trim()){let t=T.toLowerCase(),n=t.split(/\s+/),s=y.filter(e=>{let s=e.model_group.toLowerCase();return!!s.includes(t)||n.every(e=>s.includes(e))});s.length>0&&(e=s.sort((e,n)=>{let s=e.model_group.toLowerCase(),a=n.model_group.toLowerCase(),r=s===t?1e3:0,i=a===t?1e3:0,o=s.startsWith(t)?100:0,l=a.startsWith(t)?100:0,c=t.split(/\s+/).every(e=>s.includes(e))?50:0,d=t.split(/\s+/).every(e=>a.includes(e))?50:0,m=s.length;return i+l+d+(1e3-a.length)-(r+o+c+(1e3-m))}))}return e.filter(e=>{let t=0===L.length||L.some(t=>e.providers.includes(t)),n=0===Z.length||Z.includes(e.mode||""),s=0===G.length||Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).some(e=>{let[t]=e,n=t.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return G.includes(n)});return t&&n&&s})},[y,T,L,Z,G]),X=e=>{W(e),U(!0)},Q=e=>{navigator.clipboard.writeText(e),l.ZP.success("Copied to clipboard!")},ee=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),et=e=>Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return t}),en=e=>"$".concat((1e6*e).toFixed(4)),es=e=>e?e>=1e3?"".concat((e/1e3).toFixed(0),"K"):e.toString():"N/A",ea=(e,t)=>{let n=[];return e&&n.push("RPM: ".concat(e.toLocaleString())),t&&n.push("TPM: ".concat(t.toLocaleString())),n.length>0?n.join(", "):"N/A"};return(0,s.jsxs)("div",{className:"min-h-screen bg-white",children:[(0,s.jsx)(v.Z,{userID:null,userEmail:null,userRole:null,premiumUser:!1,setProxySettings:J,proxySettings:B,accessToken:j||null,isPublicPage:!0}),(0,s.jsxs)("div",{className:"w-full px-8 py-12",children:[(0,s.jsxs)(o.Zb,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)(o.Dx,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"About"}),(0,s.jsx)("p",{className:"text-gray-700 mb-6 text-base leading-relaxed",children:S||"Proxy Server to call 100+ LLMs in the OpenAI format."}),(0,s.jsx)("div",{className:"flex items-center space-x-3 text-sm text-gray-600",children:(0,s.jsxs)("span",{className:"flex items-center",children:[(0,s.jsx)("span",{className:"w-4 h-4 mr-2",children:"\uD83D\uDD27"}),"Built with litellm: v",k]})})]}),O&&Object.keys(O).length>0&&(0,s.jsxs)(o.Zb,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)(o.Dx,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Useful Links"}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Object.entries(O||{}).map(e=>{let[t,n]=e;return(0,s.jsxs)("button",{onClick:()=>window.open(n,"_blank"),className:"flex items-center space-x-3 text-blue-600 hover:text-blue-800 transition-colors p-3 rounded-lg hover:bg-blue-50 border border-gray-200",children:[(0,s.jsx)(u.Z,{className:"w-4 h-4"}),(0,s.jsx)(o.xv,{className:"text-sm font-medium",children:t})]},t)})})]}),(0,s.jsxs)(o.Zb,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)(o.Dx,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Health and Endpoint Status"}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:(0,s.jsxs)(o.xv,{className:"text-green-600 font-medium text-sm",children:["Service status: ",K]})})]}),(0,s.jsxs)(o.Zb,{className:"p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,s.jsx)(o.Dx,{className:"text-2xl font-semibold text-gray-900",children:"Available Models"})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,s.jsx)(o.xv,{className:"text-sm font-medium text-gray-700",children:"Search Models:"}),(0,s.jsx)(c.Z,{title:"Smart search with relevance ranking - finds models containing your search terms, ranked by relevance. Try searching 'xai grok-4', 'claude-4', 'gpt-4', or 'sonnet'",placement:"top",children:(0,s.jsx)(x.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(g.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,s.jsx)("input",{type:"text",placeholder:"Search model names... (smart search enabled)",value:T,onChange:e=>z(e.target.value),className:"border border-gray-300 rounded-lg pl-10 pr-4 py-2 w-full text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"text-sm font-medium mb-3 text-gray-700",children:"Provider:"}),(0,s.jsx)(m.default,{mode:"multiple",value:L,onChange:e=>P(e),placeholder:"Select providers",className:"w-full",size:"large",allowClear:!0,optionRender:e=>{let{logo:t}=(0,b.dr)(e.value);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,s.jsx)("img",{src:t,alt:e.label,className:"w-5 h-5 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,s.jsx)("span",{className:"capitalize",children:e.label})]})},children:y&&(e=>{let t=new Set;return e.forEach(e=>{e.providers.forEach(e=>t.add(e))}),Array.from(t)})(y).map(e=>(0,s.jsx)(m.default.Option,{value:e,children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"text-sm font-medium mb-3 text-gray-700",children:"Mode:"}),(0,s.jsx)(m.default,{mode:"multiple",value:Z,onChange:e=>R(e),placeholder:"Select modes",className:"w-full",size:"large",allowClear:!0,children:y&&(e=>{let t=new Set;return e.forEach(e=>{e.mode&&t.add(e.mode)}),Array.from(t)})(y).map(e=>(0,s.jsx)(m.default.Option,{value:e,children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"text-sm font-medium mb-3 text-gray-700",children:"Features:"}),(0,s.jsx)(m.default,{mode:"multiple",value:G,onChange:e=>H(e),placeholder:"Select features",className:"w-full",size:"large",allowClear:!0,children:y&&(e=>{let t=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).forEach(e=>{let[n]=e,s=n.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");t.add(s)})}),Array.from(t).sort()})(y).map(e=>(0,s.jsx)(m.default.Option,{value:e,children:e},e))})]})]}),(0,s.jsx)(i.C,{columns:[{header:"Model Name",accessorKey:"model_group",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(c.Z,{title:t.original.model_group,children:(0,s.jsx)(o.zx,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left",onClick:()=>X(t.original),children:t.original.model_group})})})},size:150},{header:"Providers",accessorKey:"providers",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.providers;return(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:n.map(e=>{let{logo:t}=(0,b.dr)(e);return(0,s.jsxs)("div",{className:"flex items-center space-x-1 px-2 py-1 bg-gray-100 rounded text-xs",children:[t&&(0,s.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,s.jsx)("span",{className:"capitalize",children:e})]},e)})})},size:120},{header:"Mode",accessorKey:"mode",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.mode;return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{children:(e=>{switch(null==e?void 0:e.toLowerCase()){case"chat":return"\uD83D\uDCAC";case"rerank":return"\uD83D\uDD04";case"embedding":return"\uD83D\uDCC4";default:return"\uD83E\uDD16"}})(n||"")}),(0,s.jsx)(o.xv,{children:n||"Chat"})]})},size:100},{header:"Max Input",accessorKey:"max_input_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)(o.xv,{className:"text-center",children:es(t.original.max_input_tokens)})},size:100,meta:{className:"text-center"}},{header:"Max Output",accessorKey:"max_output_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)(o.xv,{className:"text-center",children:es(t.original.max_output_tokens)})},size:100,meta:{className:"text-center"}},{header:"Input $/1M",accessorKey:"input_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.input_cost_per_token;return(0,s.jsx)(o.xv,{className:"text-center",children:n?en(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Output $/1M",accessorKey:"output_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.output_cost_per_token;return(0,s.jsx)(o.xv,{className:"text-center",children:n?en(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Features",accessorKey:"supports_vision",enableSorting:!1,cell:e=>{let{row:t}=e,n=Object.entries(t.original).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return ee(t)});return 0===n.length?(0,s.jsx)(o.xv,{className:"text-gray-400",children:"-"}):1===n.length?(0,s.jsx)("div",{className:"h-6 flex items-center",children:(0,s.jsx)(d.Z,{color:"blue",className:"text-xs",children:n[0]})}):(0,s.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,s.jsx)(d.Z,{color:"blue",className:"text-xs",children:n[0]}),(0,s.jsx)(c.Z,{title:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"font-medium",children:"All Features:"}),n.map((e,t)=>(0,s.jsxs)("div",{className:"text-xs",children:["• ",e]},t))]}),trigger:"click",placement:"topLeft",children:(0,s.jsxs)("span",{className:"text-xs text-blue-600 cursor-pointer hover:text-blue-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",n.length-1]})})]})},size:120},{header:"Limits",accessorKey:"rpm",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original;return(0,s.jsx)(o.xv,{className:"text-xs text-gray-600",children:ea(n.rpm,n.tpm)})},size:150}],data:$,isLoading:M,table:Y,defaultSorting:[{id:"model_group",desc:!1}]}),(0,s.jsx)("div",{className:"mt-8 text-center",children:(0,s.jsxs)(o.xv,{className:"text-sm text-gray-600",children:["Showing ",$.length," of ",(null==y?void 0:y.length)||0," models"]})})]})]}),(0,s.jsx)(p.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{children:(null==q?void 0:q.model_group)||"Model Details"}),q&&(0,s.jsx)(c.Z,{title:"Copy model name",children:(0,s.jsx)(h.Z,{onClick:()=>Q(q.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:V,footer:null,onOk:()=>{U(!1),W(null)},onCancel:()=>{U(!1),W(null)},children:q&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium",children:"Model Name:"}),(0,s.jsx)(o.xv,{children:q.model_group})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium",children:"Mode:"}),(0,s.jsx)(o.xv,{children:q.mode||"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium",children:"Providers:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:q.providers.map(e=>{let{logo:t}=(0,b.dr)(e);return(0,s.jsx)(d.Z,{color:"blue",children:(0,s.jsxs)("div",{className:"flex items-center space-x-1",children:[t&&(0,s.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,s.jsx)("span",{className:"capitalize",children:e})]})},e)})})]})]}),q.model_group.includes("*")&&(0,s.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4",children:(0,s.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,s.jsx)(x.Z,{className:"w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium text-blue-900 mb-2",children:"Wildcard Routing"}),(0,s.jsxs)(o.xv,{className:"text-sm text-blue-800 mb-2",children:["This model uses wildcard routing. You can pass any value where you see the ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:"*"})," symbol."]}),(0,s.jsxs)(o.xv,{className:"text-sm text-blue-800",children:["For example, with ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:q.model_group}),", you can use any string (",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:q.model_group.replace("*","my-custom-value")}),") that matches this pattern."]})]})]})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium",children:"Max Input Tokens:"}),(0,s.jsx)(o.xv,{children:(null===(t=q.max_input_tokens)||void 0===t?void 0:t.toLocaleString())||"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium",children:"Max Output Tokens:"}),(0,s.jsx)(o.xv,{children:(null===(n=q.max_output_tokens)||void 0===n?void 0:n.toLocaleString())||"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,s.jsx)(o.xv,{children:q.input_cost_per_token?en(q.input_cost_per_token):"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,s.jsx)(o.xv,{children:q.output_cost_per_token?en(q.output_cost_per_token):"Not specified"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=et(q),t=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,s.jsx)(o.xv,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,n)=>(0,s.jsx)(d.Z,{color:t[n%t.length],children:ee(e)},e))})()})]}),(q.tpm||q.rpm)&&(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[q.tpm&&(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium",children:"Tokens per Minute:"}),(0,s.jsx)(o.xv,{children:q.tpm.toLocaleString()})]}),q.rpm&&(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"font-medium",children:"Requests per Minute:"}),(0,s.jsx)(o.xv,{children:q.rpm.toLocaleString()})]})]})]}),q.supported_openai_params&&(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:q.supported_openai_params.map(e=>(0,s.jsx)(d.Z,{color:"green",children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,s.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,s.jsx)("pre",{className:"text-sm",children:(0,f.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],endpointType:(0,_.vf)(q.mode||"chat"),selectedModel:q.model_group,selectedSdk:"openai"})})}),(0,s.jsx)("div",{className:"mt-2 text-right",children:(0,s.jsx)("button",{onClick:()=>{Q((0,f.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],endpointType:(0,_.vf)(q.mode||"chat"),selectedModel:q.model_group,selectedSdk:"openai"}))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/162-e1f42f86a1eb3286.js b/litellm/proxy/_experimental/out/_next/static/chunks/162-e1f42f86a1eb3286.js deleted file mode 100644 index 8736f9dadcd..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/162-e1f42f86a1eb3286.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[162],{36724:function(e,t,n){n.d(t,{Dx:function(){return i.Z},Zb:function(){return a.Z},xv:function(){return r.Z},zx:function(){return s.Z}});var s=n(20831),a=n(12514),r=n(84264),i=n(96761)},19130:function(e,t,n){n.d(t,{RM:function(){return a.Z},SC:function(){return o.Z},iA:function(){return s.Z},pj:function(){return r.Z},ss:function(){return i.Z},xs:function(){return l.Z}});var s=n(21626),a=n(97214),r=n(28241),i=n(58834),l=n(69552),o=n(71876)},88658:function(e,t,n){n.d(t,{L:function(){return a}});var s=n(49817);let a=e=>{let t;let{apiKeySource:n,accessToken:a,apiKey:r,inputMessage:i,chatHistory:l,selectedTags:o,selectedVectorStores:c,selectedGuardrails:d,endpointType:m,selectedModel:p,selectedSdk:u}=e,g="session"===n?a:r,x=window.location.origin,h=(i||"Your prompt here").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),f=l.filter(e=>!e.isImage).map(e=>{let{role:t,content:n}=e;return{role:t,content:n}}),_={};o.length>0&&(_.tags=o),c.length>0&&(_.vector_stores=c),d.length>0&&(_.guardrails=d);let b=p||"your-model-name",j="azure"===u?'import openai\n\nclient = openai.AzureOpenAI(\n api_key="'.concat(g||"YOUR_LITELLM_API_KEY",'",\n azure_endpoint="').concat(x,'",\n api_version="2024-02-01"\n)'):'import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(g||"YOUR_LITELLM_API_KEY",'",\n base_url="').concat(x,'"\n)');switch(m){case s.KP.CHAT:{let e=Object.keys(_).length>0,n="";if(e){let e=JSON.stringify({metadata:_},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}t='\n# request sent to model set on litellm proxy, `litellm --model`\nresponse = client.chat.completions.create(\n model="'.concat(b,'",\n messages = ').concat(JSON.stringify(f,null,4)).concat(n,"\n)\n\nprint(response)\n");break}case s.KP.RESPONSES:{let e=Object.keys(_).length>0,n="";if(e){let e=JSON.stringify({metadata:_},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}t='\n# request sent to model set on litellm proxy, `litellm --model`\nresponse = client.responses.create(\n model="'.concat(b,'",\n messages = ').concat(JSON.stringify(f,null,4)).concat(n,"\n)\n\nprint(response)\n");break}case s.KP.IMAGE:t="azure"===u?"\n# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.\n# This snippet uses 'client.images.generate' and will create a new image based on your prompt.\n# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.\nimport os\nimport requests\nimport json\nimport time\nfrom PIL import Image\n\nresult = client.images.generate(\n model=\"".concat(b,'",\n prompt="').concat(i,'",\n n=1\n)\n\njson_response = json.loads(result.model_dump_json())\n\n# Set the directory for the stored image\nimage_dir = os.path.join(os.curdir, \'images\')\n\n# If the directory doesn\'t exist, create it\nif not os.path.isdir(image_dir):\n os.mkdir(image_dir)\n\n# Initialize the image path\nimage_filename = f"generated_image_{int(time.time())}.png"\nimage_path = os.path.join(image_dir, image_filename)\n\ntry:\n # Retrieve the generated image\n if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):\n image_url = json_response["data"][0]["url"]\n generated_image = requests.get(image_url).content\n with open(image_path, "wb") as image_file:\n image_file.write(generated_image)\n\n print(f"Image saved to {image_path}")\n # Display the image\n image = Image.open(image_path)\n image.show()\n else:\n print("Could not find image URL in response.")\n print("Full response:", json_response)\nexcept Exception as e:\n print(f"An error occurred: {e}")\n print("Full response:", json_response)\n'):"\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(h,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(b,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case s.KP.IMAGE_EDITS:t="azure"===u?'\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# The prompt entered by the user\nprompt = "'.concat(h,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(b,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n'):"\nimport base64\nimport os\nimport time\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(h,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(b,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;default:t="\n# Code generation for this endpoint is not implemented yet."}return"".concat(j,"\n").concat(t)}},49817:function(e,t,n){var s,a,r,i;n.d(t,{KP:function(){return a},vf:function(){return o}}),(r=s||(s={})).IMAGE_GENERATION="image_generation",r.CHAT="chat",r.RESPONSES="responses",r.IMAGE_EDITS="image_edits",r.ANTHROPIC_MESSAGES="anthropic_messages",(i=a||(a={})).IMAGE="image",i.CHAT="chat",i.RESPONSES="responses",i.IMAGE_EDITS="image_edits",i.ANTHROPIC_MESSAGES="anthropic_messages";let l={image_generation:"image",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages"},o=e=>{if(console.log("getEndpointType:",e),Object.values(s).includes(e)){let t=l[e];return console.log("endpointType:",t),t}return"chat"}},8048:function(e,t,n){n.d(t,{C:function(){return m}});var s=n(57437),a=n(71594),r=n(24525),i=n(2265),l=n(19130),o=n(44633),c=n(86462),d=n(49084);function m(e){let{data:t=[],columns:n,isLoading:m=!1,table:p,defaultSorting:u=[]}=e,[g,x]=i.useState(u),[h]=i.useState("onChange"),[f,_]=i.useState({}),[b,j]=i.useState({}),v=(0,a.b7)({data:t,columns:n,state:{sorting:g,columnSizing:f,columnVisibility:b},columnResizeMode:h,onSortingChange:x,onColumnSizingChange:_,onColumnVisibilityChange:j,getCoreRowModel:(0,r.sC)(),getSortedRowModel:(0,r.tj)(),enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return i.useEffect(()=>{p&&(p.current=v)},[v,p]),(0,s.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsx)("div",{className:"relative min-w-full",children:(0,s.jsxs)(l.iA,{className:"[&_td]:py-2 [&_th]:py-2 w-full",children:[(0,s.jsx)(l.ss,{children:v.getHeaderGroups().map(e=>(0,s.jsx)(l.SC,{children:e.headers.map(e=>{var t;return(0,s.jsxs)(l.xs,{className:"py-1 h-8 relative ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.id?120:e.getSize(),position:"actions"===e.id?"sticky":"relative",right:"actions"===e.id?0:"auto"},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,a.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,s.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,s.jsx)(o.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,s.jsx)(c.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,s.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,s.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"absolute right-0 top-0 h-full w-2 cursor-col-resize select-none touch-none ".concat(e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200")})]},e.id)})},e.id))}),(0,s.jsx)(l.RM,{children:m?(0,s.jsx)(l.SC,{children:(0,s.jsx)(l.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:"\uD83D\uDE85 Loading models..."})})})}):v.getRowModel().rows.length>0?v.getRowModel().rows.map(e=>(0,s.jsx)(l.SC,{children:e.getVisibleCells().map(e=>{var t;return(0,s.jsx)(l.pj,{className:"py-0.5 ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] z-20 w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.column.id?120:e.column.getSize(),position:"actions"===e.column.id?"sticky":"relative",right:"actions"===e.column.id?0:"auto"},children:(0,a.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)):(0,s.jsx)(l.SC,{children:(0,s.jsx)(l.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:"No models found"})})})})})]})})})})}},65373:function(e,t,n){n.d(t,{Z:function(){return h}});var s=n(57437),a=n(27648),r=n(2265),i=n(89970),l=n(80795),o=n(19250),c=n(15883),d=n(46346),m=n(57400),p=n(91870),u=n(40428),g=n(3914);let x=async e=>{if(!e)return null;try{return await (0,o.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};var h=e=>{let{userID:t,userEmail:n,userRole:h,premiumUser:f,proxySettings:_,setProxySettings:b,accessToken:j,isPublicPage:v=!1}=e,y=(0,o.getProxyBaseUrl)(),[N,w]=(0,r.useState)("");(0,r.useEffect)(()=>{(async()=>{if(j){let e=await x(j);console.log("response from fetchProxySettings",e),e&&b(e)}})()},[j]),(0,r.useEffect)(()=>{w((null==_?void 0:_.PROXY_LOGOUT_URL)||"")},[_]);let S=[{key:"user-info",label:(0,s.jsxs)("div",{className:"px-3 py-3 border-b border-gray-100",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(c.Z,{className:"mr-2 text-gray-700"}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:t})]}),f?(0,s.jsx)(i.Z,{title:"Premium User",placement:"left",children:(0,s.jsxs)("div",{className:"flex items-center bg-gradient-to-r from-amber-500 to-yellow-500 text-white px-2 py-0.5 rounded-full cursor-help",children:[(0,s.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,s.jsx)("span",{className:"text-xs font-medium",children:"Premium"})]})}):(0,s.jsx)(i.Z,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,s.jsxs)("div",{className:"flex items-center bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full cursor-help",children:[(0,s.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,s.jsx)("span",{className:"text-xs font-medium",children:"Standard"})]})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center text-sm",children:[(0,s.jsx)(m.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Role"}),(0,s.jsx)("span",{className:"ml-auto text-gray-700 font-medium",children:h})]}),(0,s.jsxs)("div",{className:"flex items-center text-sm",children:[(0,s.jsx)(p.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Email"}),(0,s.jsx)("span",{className:"ml-auto text-gray-700 font-medium truncate max-w-[150px]",title:n||"Unknown",children:n||"Unknown"})]})]})]})},{key:"logout",label:(0,s.jsxs)("div",{className:"flex items-center py-2 px-3 hover:bg-gray-50 rounded-md mx-1 my-1",onClick:()=>{(0,g.b)(),window.location.href=N},children:[(0,s.jsx)(u.Z,{className:"mr-3 text-gray-600"}),(0,s.jsx)("span",{className:"text-gray-800",children:"Logout"})]})}];return(0,s.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,s.jsx)("div",{className:"w-full",children:(0,s.jsxs)("div",{className:"flex items-center h-12 px-4",children:[(0,s.jsx)("div",{className:"flex items-center flex-shrink-0",children:(0,s.jsx)(a.default,{href:"/",className:"flex items-center",children:(0,s.jsx)("img",{src:y+"/get_image",alt:"LiteLLM Brand",className:"h-8 w-auto"})})}),(0,s.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:"text-[13px] text-gray-600 hover:text-gray-900 transition-colors",children:"Docs"}),!v&&(0,s.jsx)(l.Z,{menu:{items:S,className:"min-w-[200px]",style:{padding:"8px",marginTop:"8px",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.08)"}},overlayStyle:{minWidth:"200px"},children:(0,s.jsxs)("button",{className:"inline-flex items-center text-[13px] text-gray-600 hover:text-gray-900 transition-colors",children:["User",(0,s.jsx)("svg",{className:"ml-1 w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 9l-7 7-7-7"})})]})})]})]})})})}},42673:function(e,t,n){var s,a;n.d(t,{Cl:function(){return s},bK:function(){return d},cd:function(){return l},dr:function(){return o},fK:function(){return r},ph:function(){return c}}),n(2265),(a=s||(s={})).OpenAI="OpenAI",a.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",a.OpenAI_Text="OpenAI Text Completion",a.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",a.Azure="Azure",a.Azure_AI_Studio="Azure AI Foundry (Studio)",a.Anthropic="Anthropic",a.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",a.Google_AI_Studio="Google AI Studio",a.Bedrock="Amazon Bedrock",a.Groq="Groq",a.MistralAI="Mistral AI",a.Deepseek="Deepseek",a.Cohere="Cohere",a.Databricks="Databricks",a.Ollama="Ollama",a.xAI="xAI",a.AssemblyAI="AssemblyAI",a.Cerebras="Cerebras",a.Sambanova="Sambanova",a.Perplexity="Perplexity",a.TogetherAI="TogetherAI",a.Openrouter="Openrouter",a.FireworksAI="Fireworks AI",a.Triton="Triton",a.Deepgram="Deepgram",a.ElevenLabs="ElevenLabs";let r={OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",TogetherAI:"together_ai",Openrouter:"openrouter",FireworksAI:"fireworks_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs"},i="/ui/assets/logos/",l={Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),Databricks:"".concat(i,"databricks.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),Sambanova:"".concat(i,"sambanova.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png")},o=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let t=Object.keys(r).find(t=>r[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let n=s[t];return{logo:l[n],displayName:n}},c=e=>"Vertex AI (Anthropic, Gemini, etc.)"===e?"gemini-pro":"Anthropic"==e||"Amazon Bedrock"==e?"claude-3-opus":"Google AI Studio"==e?"gemini-pro":"Azure AI Foundry (Studio)"==e?"azure_ai/command-r-plus":"Azure"==e?"azure/my-deployment":"gpt-3.5-turbo",d=(e,t)=>{console.log("Provider key: ".concat(e));let n=r[e];console.log("Provider mapped to: ".concat(n));let s=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(e=>{let[t,a]=e;null!==a&&"object"==typeof a&&"litellm_provider"in a&&(a.litellm_provider===n||a.litellm_provider.includes(n))&&s.push(t)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(e=>{let[t,n]=e;null!==n&&"object"==typeof n&&"litellm_provider"in n&&"cohere_chat"===n.litellm_provider&&s.push(t)}))),s}},72162:function(e,t,n){var s=n(57437),a=n(2265),r=n(19250),i=n(8048),l=n(36724),o=n(41021),c=n(89970),d=n(3810),m=n(52787),p=n(91679),u=n(3477),g=n(17732),x=n(33245),h=n(78867),f=n(88658),_=n(49817),b=n(42673),j=n(65373);t.Z=e=>{var t,n;let{accessToken:v}=e,[y,N]=(0,a.useState)(null),[w,S]=(0,a.useState)("LiteLLM Gateway"),[A,I]=(0,a.useState)(null),[k,C]=(0,a.useState)(""),[O,E]=(0,a.useState)({}),[T,M]=(0,a.useState)(!0),[z,D]=(0,a.useState)(""),[L,P]=(0,a.useState)([]),[Z,R]=(0,a.useState)([]),[G,H]=(0,a.useState)([]),[K,F]=(0,a.useState)("I'm alive! ✓"),[U,q]=(0,a.useState)(!1),[B,V]=(0,a.useState)(null),[W,Y]=(0,a.useState)({}),J=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=async()=>{try{M(!0);let e=await (0,r.modelHubPublicModelsCall)();console.log("ModelHubData:",e),N(e)}catch(e){console.error("There was an error fetching the public model data",e),F("Service unavailable")}finally{M(!1)}};(async()=>{let e=await (0,r.getPublicModelHubInfo)();console.log("Public Model Hub Info:",e),S(e.docs_title),I(e.custom_docs_description),C(e.litellm_version),E(e.useful_links||{})})(),e()},[]),(0,a.useEffect)(()=>{},[z,L,Z,G]);let $=(0,a.useMemo)(()=>{if(!y)return[];let e=y;if(z.trim()){let t=z.toLowerCase(),n=t.split(/\s+/),s=y.filter(e=>{let s=e.model_group.toLowerCase();return!!s.includes(t)||n.every(e=>s.includes(e))});s.length>0&&(e=s.sort((e,n)=>{let s=e.model_group.toLowerCase(),a=n.model_group.toLowerCase(),r=s===t?1e3:0,i=a===t?1e3:0,l=s.startsWith(t)?100:0,o=a.startsWith(t)?100:0,c=t.split(/\s+/).every(e=>s.includes(e))?50:0,d=t.split(/\s+/).every(e=>a.includes(e))?50:0,m=s.length;return i+o+d+(1e3-a.length)-(r+l+c+(1e3-m))}))}return e.filter(e=>{let t=0===L.length||L.some(t=>e.providers.includes(t)),n=0===Z.length||Z.includes(e.mode||""),s=0===G.length||Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).some(e=>{let[t]=e,n=t.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return G.includes(n)});return t&&n&&s})},[y,z,L,Z,G]),X=e=>{V(e),q(!0)},Q=e=>{navigator.clipboard.writeText(e),o.ZP.success("Copied to clipboard!")},ee=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),et=e=>Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return t}),en=e=>"$".concat((1e6*e).toFixed(4)),es=e=>e?e>=1e3?"".concat((e/1e3).toFixed(0),"K"):e.toString():"N/A",ea=(e,t)=>{let n=[];return e&&n.push("RPM: ".concat(e.toLocaleString())),t&&n.push("TPM: ".concat(t.toLocaleString())),n.length>0?n.join(", "):"N/A"};return(0,s.jsxs)("div",{className:"min-h-screen bg-white",children:[(0,s.jsx)(j.Z,{userID:null,userEmail:null,userRole:null,premiumUser:!1,setProxySettings:Y,proxySettings:W,accessToken:v||null,isPublicPage:!0}),(0,s.jsxs)("div",{className:"w-full px-8 py-12",children:[(0,s.jsxs)(l.Zb,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)(l.Dx,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"About"}),(0,s.jsx)("p",{className:"text-gray-700 mb-6 text-base leading-relaxed",children:A||"Proxy Server to call 100+ LLMs in the OpenAI format."}),(0,s.jsx)("div",{className:"flex items-center space-x-3 text-sm text-gray-600",children:(0,s.jsxs)("span",{className:"flex items-center",children:[(0,s.jsx)("span",{className:"w-4 h-4 mr-2",children:"\uD83D\uDD27"}),"Built with litellm: v",k]})})]}),O&&Object.keys(O).length>0&&(0,s.jsxs)(l.Zb,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)(l.Dx,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Useful Links"}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Object.entries(O||{}).map(e=>{let[t,n]=e;return(0,s.jsxs)("button",{onClick:()=>window.open(n,"_blank"),className:"flex items-center space-x-3 text-blue-600 hover:text-blue-800 transition-colors p-3 rounded-lg hover:bg-blue-50 border border-gray-200",children:[(0,s.jsx)(u.Z,{className:"w-4 h-4"}),(0,s.jsx)(l.xv,{className:"text-sm font-medium",children:t})]},t)})})]}),(0,s.jsxs)(l.Zb,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)(l.Dx,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Health and Endpoint Status"}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:(0,s.jsxs)(l.xv,{className:"text-green-600 font-medium text-sm",children:["Service status: ",K]})})]}),(0,s.jsxs)(l.Zb,{className:"p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,s.jsx)(l.Dx,{className:"text-2xl font-semibold text-gray-900",children:"Available Models"})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,s.jsx)(l.xv,{className:"text-sm font-medium text-gray-700",children:"Search Models:"}),(0,s.jsx)(c.Z,{title:"Smart search with relevance ranking - finds models containing your search terms, ranked by relevance. Try searching 'xai grok-4', 'claude-4', 'gpt-4', or 'sonnet'",placement:"top",children:(0,s.jsx)(x.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(g.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,s.jsx)("input",{type:"text",placeholder:"Search model names... (smart search enabled)",value:z,onChange:e=>D(e.target.value),className:"border border-gray-300 rounded-lg pl-10 pr-4 py-2 w-full text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"text-sm font-medium mb-3 text-gray-700",children:"Provider:"}),(0,s.jsx)(m.default,{mode:"multiple",value:L,onChange:e=>P(e),placeholder:"Select providers",className:"w-full",size:"large",allowClear:!0,optionRender:e=>{let{logo:t}=(0,b.dr)(e.value);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,s.jsx)("img",{src:t,alt:e.label,className:"w-5 h-5 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,s.jsx)("span",{className:"capitalize",children:e.label})]})},children:y&&(e=>{let t=new Set;return e.forEach(e=>{e.providers.forEach(e=>t.add(e))}),Array.from(t)})(y).map(e=>(0,s.jsx)(m.default.Option,{value:e,children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"text-sm font-medium mb-3 text-gray-700",children:"Mode:"}),(0,s.jsx)(m.default,{mode:"multiple",value:Z,onChange:e=>R(e),placeholder:"Select modes",className:"w-full",size:"large",allowClear:!0,children:y&&(e=>{let t=new Set;return e.forEach(e=>{e.mode&&t.add(e.mode)}),Array.from(t)})(y).map(e=>(0,s.jsx)(m.default.Option,{value:e,children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"text-sm font-medium mb-3 text-gray-700",children:"Features:"}),(0,s.jsx)(m.default,{mode:"multiple",value:G,onChange:e=>H(e),placeholder:"Select features",className:"w-full",size:"large",allowClear:!0,children:y&&(e=>{let t=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).forEach(e=>{let[n]=e,s=n.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");t.add(s)})}),Array.from(t).sort()})(y).map(e=>(0,s.jsx)(m.default.Option,{value:e,children:e},e))})]})]}),(0,s.jsx)(i.C,{columns:[{header:"Model Name",accessorKey:"model_group",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(c.Z,{title:t.original.model_group,children:(0,s.jsx)(l.zx,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left",onClick:()=>X(t.original),children:t.original.model_group})})})},size:150},{header:"Providers",accessorKey:"providers",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.providers;return(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:n.map(e=>{let{logo:t}=(0,b.dr)(e);return(0,s.jsxs)("div",{className:"flex items-center space-x-1 px-2 py-1 bg-gray-100 rounded text-xs",children:[t&&(0,s.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,s.jsx)("span",{className:"capitalize",children:e})]},e)})})},size:120},{header:"Mode",accessorKey:"mode",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.mode;return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{children:(e=>{switch(null==e?void 0:e.toLowerCase()){case"chat":return"\uD83D\uDCAC";case"rerank":return"\uD83D\uDD04";case"embedding":return"\uD83D\uDCC4";default:return"\uD83E\uDD16"}})(n||"")}),(0,s.jsx)(l.xv,{children:n||"Chat"})]})},size:100},{header:"Max Input",accessorKey:"max_input_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)(l.xv,{className:"text-center",children:es(t.original.max_input_tokens)})},size:100,meta:{className:"text-center"}},{header:"Max Output",accessorKey:"max_output_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)(l.xv,{className:"text-center",children:es(t.original.max_output_tokens)})},size:100,meta:{className:"text-center"}},{header:"Input $/1M",accessorKey:"input_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.input_cost_per_token;return(0,s.jsx)(l.xv,{className:"text-center",children:n?en(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Output $/1M",accessorKey:"output_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.output_cost_per_token;return(0,s.jsx)(l.xv,{className:"text-center",children:n?en(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Features",accessorKey:"supports_vision",enableSorting:!1,cell:e=>{let{row:t}=e,n=Object.entries(t.original).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return ee(t)});return 0===n.length?(0,s.jsx)(l.xv,{className:"text-gray-400",children:"-"}):1===n.length?(0,s.jsx)("div",{className:"h-6 flex items-center",children:(0,s.jsx)(d.Z,{color:"blue",className:"text-xs",children:n[0]})}):(0,s.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,s.jsx)(d.Z,{color:"blue",className:"text-xs",children:n[0]}),(0,s.jsx)(c.Z,{title:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"font-medium",children:"All Features:"}),n.map((e,t)=>(0,s.jsxs)("div",{className:"text-xs",children:["• ",e]},t))]}),trigger:"click",placement:"topLeft",children:(0,s.jsxs)("span",{className:"text-xs text-blue-600 cursor-pointer hover:text-blue-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",n.length-1]})})]})},size:120},{header:"Limits",accessorKey:"rpm",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original;return(0,s.jsx)(l.xv,{className:"text-xs text-gray-600",children:ea(n.rpm,n.tpm)})},size:150}],data:$,isLoading:T,table:J,defaultSorting:[{id:"model_group",desc:!1}]}),(0,s.jsx)("div",{className:"mt-8 text-center",children:(0,s.jsxs)(l.xv,{className:"text-sm text-gray-600",children:["Showing ",$.length," of ",(null==y?void 0:y.length)||0," models"]})})]})]}),(0,s.jsx)(p.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{children:(null==B?void 0:B.model_group)||"Model Details"}),B&&(0,s.jsx)(c.Z,{title:"Copy model name",children:(0,s.jsx)(h.Z,{onClick:()=>Q(B.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:U,footer:null,onOk:()=>{q(!1),V(null)},onCancel:()=>{q(!1),V(null)},children:B&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium",children:"Model Name:"}),(0,s.jsx)(l.xv,{children:B.model_group})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium",children:"Mode:"}),(0,s.jsx)(l.xv,{children:B.mode||"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium",children:"Providers:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:B.providers.map(e=>{let{logo:t}=(0,b.dr)(e);return(0,s.jsx)(d.Z,{color:"blue",children:(0,s.jsxs)("div",{className:"flex items-center space-x-1",children:[t&&(0,s.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,s.jsx)("span",{className:"capitalize",children:e})]})},e)})})]})]}),B.model_group.includes("*")&&(0,s.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4",children:(0,s.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,s.jsx)(x.Z,{className:"w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium text-blue-900 mb-2",children:"Wildcard Routing"}),(0,s.jsxs)(l.xv,{className:"text-sm text-blue-800 mb-2",children:["This model uses wildcard routing. You can pass any value where you see the ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:"*"})," symbol."]}),(0,s.jsxs)(l.xv,{className:"text-sm text-blue-800",children:["For example, with ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:B.model_group}),", you can use any string (",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:B.model_group.replace("*","my-custom-value")}),") that matches this pattern."]})]})]})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium",children:"Max Input Tokens:"}),(0,s.jsx)(l.xv,{children:(null===(t=B.max_input_tokens)||void 0===t?void 0:t.toLocaleString())||"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium",children:"Max Output Tokens:"}),(0,s.jsx)(l.xv,{children:(null===(n=B.max_output_tokens)||void 0===n?void 0:n.toLocaleString())||"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,s.jsx)(l.xv,{children:B.input_cost_per_token?en(B.input_cost_per_token):"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,s.jsx)(l.xv,{children:B.output_cost_per_token?en(B.output_cost_per_token):"Not specified"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=et(B),t=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,s.jsx)(l.xv,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,n)=>(0,s.jsx)(d.Z,{color:t[n%t.length],children:ee(e)},e))})()})]}),(B.tpm||B.rpm)&&(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[B.tpm&&(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium",children:"Tokens per Minute:"}),(0,s.jsx)(l.xv,{children:B.tpm.toLocaleString()})]}),B.rpm&&(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"font-medium",children:"Requests per Minute:"}),(0,s.jsx)(l.xv,{children:B.rpm.toLocaleString()})]})]})]}),B.supported_openai_params&&(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:B.supported_openai_params.map(e=>(0,s.jsx)(d.Z,{color:"green",children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(l.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,s.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,s.jsx)("pre",{className:"text-sm",children:(0,f.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],endpointType:(0,_.vf)(B.mode||"chat"),selectedModel:B.model_group,selectedSdk:"openai"})})}),(0,s.jsx)("div",{className:"mt-2 text-right",children:(0,s.jsx)("button",{onClick:()=>{Q((0,f.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],endpointType:(0,_.vf)(B.mode||"chat"),selectedModel:B.model_group,selectedSdk:"openai"}))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/172-08ae62d50ce1f0e7.js b/litellm/proxy/_experimental/out/_next/static/chunks/172-08ae62d50ce1f0e7.js new file mode 100644 index 00000000000..6dad099f416 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/172-08ae62d50ce1f0e7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[172],{57018:function(e,s,l){l.d(s,{Ct:function(){return t.Z},Dx:function(){return i.Z},Zb:function(){return a.Z},xv:function(){return n.Z},zx:function(){return r.Z}});var t=l(41649),r=l(20831),a=l(12514),n=l(84264),i=l(96761)},95704:function(e,s,l){l.d(s,{Dx:function(){return x.Z},RM:function(){return a.Z},SC:function(){return o.Z},Zb:function(){return t.Z},iA:function(){return r.Z},pj:function(){return n.Z},ss:function(){return i.Z},xs:function(){return c.Z},xv:function(){return d.Z}});var t=l(12514),r=l(21626),a=l(97214),n=l(28241),i=l(58834),c=l(69552),o=l(71876),d=l(84264),x=l(96761)},36172:function(e,s,l){l.d(s,{Z:function(){return D}});var t=l(57437),r=l(2265),a=l(99376),n=l(19250),i=l(8048),c=l(41649),o=l(20831),d=l(84264),x=l(89970),m=l(3810),u=l(23639),p=l(15424);let h=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),g=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),j=e=>"$".concat((1e6*e).toFixed(2)),b=e=>e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),v=function(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(d.Z,{className:"font-medium text-sm",children:r.model_group}),(0,t.jsx)(x.Z,{title:"Copy model name",children:(0,t.jsx)(u.Z,{onClick:()=>s(r.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(d.Z,{className:"text-xs text-gray-600",children:r.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,s)=>{let l=e.original.providers.join(", "),t=s.original.providers.join(", ");return l.localeCompare(t)},cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,t.jsx)(m.Z,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,t.jsxs)(d.Z,{className:"text-xs text-gray-500",children:["+",l.providers.length-2]})]})},meta:{className:"hidden md:table-cell"}},{header:"Mode",accessorKey:"mode",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return l.mode?(0,t.jsx)(c.Z,{color:"green",size:"sm",children:l.mode}):(0,t.jsx)(d.Z,{className:"text-gray-500",children:"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Tokens",accessorKey:"max_input_tokens",enableSorting:!0,sortingFn:(e,s)=>(e.original.max_input_tokens||0)+(e.original.max_output_tokens||0)-((s.original.max_input_tokens||0)+(s.original.max_output_tokens||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsxs)(d.Z,{className:"text-xs",children:[l.max_input_tokens?b(l.max_input_tokens):"-"," / ",l.max_output_tokens?b(l.max_output_tokens):"-"]})})},meta:{className:"hidden lg:table-cell"}},{header:"Cost/1M",accessorKey:"input_cost_per_token",enableSorting:!0,sortingFn:(e,s)=>(e.original.input_cost_per_token||0)+(e.original.output_cost_per_token||0)-((s.original.input_cost_per_token||0)+(s.original.output_cost_per_token||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(d.Z,{className:"text-xs",children:l.input_cost_per_token?j(l.input_cost_per_token):"-"}),(0,t.jsx)(d.Z,{className:"text-xs text-gray-500",children:l.output_cost_per_token?j(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=g(s.original),r=["green","blue","purple","orange","red","yellow"];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(d.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,s)=>(0,t.jsx)(c.Z,{color:r[s%r.length],size:"xs",children:h(e)},e))})}},{header:"Public",accessorKey:"is_public_model_group",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public_model_group?1:0)-(!0===s.original.is_public_model_group?1:0),cell:e=>{let{row:s}=e;return!0===s.original.is_public_model_group?(0,t.jsx)(c.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(c.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,r=l.original;return(0,t.jsxs)(o.Z,{size:"xs",variant:"secondary",onClick:()=>e(r),icon:p.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return l?r.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):r};var y=l(72162),N=l(91810),f=l(13634),_=l(41021),k=l(61994),w=l(73002),Z=l(91679),C=l(96761),S=l(12514),P=e=>{let{modelHubData:s,onFilteredDataChange:l,showFiltersCard:a=!0,className:n=""}=e,[i,c]=(0,r.useState)(""),[o,x]=(0,r.useState)(""),[m,u]=(0,r.useState)(""),[p,h]=(0,r.useState)(""),g=(0,r.useRef)([]),j=(0,r.useMemo)(()=>(null==s?void 0:s.filter(e=>{let s=e.model_group.toLowerCase().includes(i.toLowerCase()),l=""===o||e.providers.includes(o),t=""===m||e.mode===m,r=""===p||Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).some(e=>{let[s]=e;return s.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")===p});return s&&l&&t&&r}))||[],[s,i,o,m,p]);(0,r.useEffect)(()=>{(j.length!==g.current.length||j.some((e,s)=>{var l;return e.model_group!==(null===(l=g.current[s])||void 0===l?void 0:l.model_group)}))&&(g.current=j,l(j))},[j,l]);let b=(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names...",value:i,onChange:e=>c(e.target.value),className:"border rounded px-3 py-2 w-64 h-10 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,t.jsxs)("select",{value:o,onChange:e=>x(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-40 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Providers"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.providers.forEach(e=>s.add(e))}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Mode:"}),(0,t.jsxs)("select",{value:m,onChange:e=>u(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-32 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Modes"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.mode&&s.add(e.mode)}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,t.jsxs)("select",{value:p,onChange:e=>h(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-48 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Features"}),s&&(e=>{let s=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).forEach(e=>{let[l]=e,t=l.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");s.add(t)})}),Array.from(s).sort()})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(i||o||m||p)&&(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsx)("button",{onClick:()=>{c(""),x(""),u(""),h("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return a?(0,t.jsx)(S.Z,{className:"mb-6 ".concat(n),children:b}):(0,t.jsx)("div",{className:n,children:b})};let{Step:M}=N.default;var L=e=>{let{visible:s,onClose:l,accessToken:a,modelHubData:i,onSuccess:o}=e,[x,m]=(0,r.useState)(0),[u,p]=(0,r.useState)(new Set),[h,g]=(0,r.useState)([]),[j,b]=(0,r.useState)(!1),[v]=f.Z.useForm(),y=()=>{m(0),p(new Set),g([]),v.resetFields(),l()},S=(e,s)=>{let l=new Set(u);s?l.add(e):l.delete(e),p(l)},L=e=>{e?p(new Set(h.map(e=>e.model_group))):p(new Set)},A=(0,r.useCallback)(e=>{g(e)},[]);(0,r.useEffect)(()=>{s&&i.length>0&&(g(i),p(new Set(i.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[s,i]);let F=async()=>{if(0===u.size){_.ZP.error("Please select at least one model to make public");return}b(!0);try{let e=Array.from(u);await (0,n.makeModelGroupPublic)(a,e),_.ZP.success("Successfully made ".concat(e.length," model group(s) public!")),y(),o()}catch(e){console.error("Error making model groups public:",e),_.ZP.error("Failed to make model groups public. Please try again.")}finally{b(!1)}},U=()=>{let e=h.length>0&&h.every(e=>u.has(e.model_group)),s=u.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(C.Z,{children:"Select Models to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(k.Z,{checked:e,indeterminate:s,onChange:e=>L(e.target.checked),disabled:0===h.length,children:["Select All ",h.length>0&&"(".concat(h.length,")")]})})]}),(0,t.jsx)(d.Z,{className:"text-sm text-gray-600",children:"Select the models you want to be visible on the public model hub. Users will still require a valid API key to use these models."}),(0,t.jsx)(P,{modelHubData:i,onFilteredDataChange:A,showFiltersCard:!1,className:"border rounded-lg p-4 bg-gray-50"}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:0===h.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(d.Z,{children:"No models match the current filters."})}):h.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(k.Z,{checked:u.has(e.model_group),onChange:s=>S(e.model_group,s.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(d.Z,{className:"font-medium",children:e.model_group}),e.mode&&(0,t.jsx)(c.Z,{color:"green",size:"sm",children:e.mode})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),u.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(d.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:u.size})," model",1!==u.size?"s":""," selected"]})})]})},z=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(C.Z,{children:"Confirm Making Models Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(d.Z,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these models public, anyone who can go to the ",(0,t.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Models to be made public:"}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,t.jsx)("div",{className:"space-y-2",children:Array.from(u).map(e=>{let s=i.find(s=>s.model_group===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:e}),s&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:s.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",size:"xs",children:e},e))})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(d.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:u.size})," model",1!==u.size?"s":""," will be made public"]})})]});return(0,t.jsx)(Z.Z,{title:"Make Models Public",open:s,onCancel:y,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(f.Z,{form:v,layout:"vertical",children:[(0,t.jsxs)(N.default,{current:x,className:"mb-6",children:[(0,t.jsx)(M,{title:"Select Models"}),(0,t.jsx)(M,{title:"Confirm"})]}),(()=>{switch(x){case 0:return U();case 1:return z();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(w.ZP,{onClick:0===x?y:()=>{1===x&&m(0)},children:0===x?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===x&&(0,t.jsx)(w.ZP,{onClick:()=>{if(0===x){if(0===u.size){_.ZP.error("Please select at least one model to make public");return}m(1)}},disabled:0===u.size,children:"Next"}),1===x&&(0,t.jsx)(w.ZP,{onClick:F,loading:j,children:"Make Public"})]})]})]})})},A=l(69870),F=l(57018),U=l(17906),z=l(78867),E=l(20347),D=e=>{var s,l;let{accessToken:c,publicPage:o,premiumUser:d,userRole:x}=e,[m,u]=(0,r.useState)(!1),[p,h]=(0,r.useState)(null),[g,j]=(0,r.useState)(!0),[b,N]=(0,r.useState)(!1),[f,k]=(0,r.useState)(!1),[w,C]=(0,r.useState)(null),[S,M]=(0,r.useState)([]),[D,R]=(0,r.useState)(!1),H=(0,a.useRouter)(),O=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=async e=>{try{j(!0);let s=await (0,n.modelHubCall)(e);console.log("ModelHubData:",s),h(s.data),(0,n.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&u(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{j(!1)}},s=async()=>{try{var e,s;j(!0);let l=await (0,n.modelHubPublicModelsCall)();console.log("ModelHubData:",l),console.log("First model structure:",l[0]),console.log("Model has model_group?",null===(e=l[0])||void 0===e?void 0:e.model_group),console.log("Model has providers?",null===(s=l[0])||void 0===s?void 0:s.providers),h(l),u(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{j(!1)}};c?e(c):o&&s()},[c,o]);let T=()=>{c&&R(!0)},I=()=>{N(!1),k(!1),C(null)},K=()=>{N(!1),k(!1),C(null)},Y=e=>{navigator.clipboard.writeText(e),_.ZP.success("Copied to clipboard!")},W=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),B=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),V=e=>"$".concat((1e6*e).toFixed(2)),q=(0,r.useCallback)(e=>{M(e)},[]);return(console.log("publicPage: ",o),console.log("publicPageAllowed: ",m),o&&m)?(0,t.jsx)(y.Z,{accessToken:c}):(0,t.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==o?(0,t.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsx)(F.Dx,{className:"text-center",children:"Model Hub"}),(0,E.tY)(x||"")?(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Make models public for developers to know what models are available on the proxy."}):(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"A list of all public model names personally available to you."})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)(F.xv,{children:"Model Hub URL:"}),(0,t.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,t.jsx)(F.xv,{className:"mr-2",children:"".concat((0,n.getProxyBaseUrl)(),"/ui/model_hub_table")}),(0,t.jsx)("button",{onClick:()=>Y("".concat((0,n.getProxyBaseUrl)(),"/ui/model_hub_table")),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,t.jsx)(z.Z,{size:16,className:"text-gray-600"})})]}),!1==o&&(0,E.tY)(x||"")&&(0,t.jsx)(F.zx,{className:"ml-4",onClick:()=>T(),children:"Make Public"})]})]}),(0,E.tY)(x||"")&&(0,t.jsx)("div",{className:"mt-8 mb-2",children:(0,t.jsx)(A.Z,{accessToken:c,userRole:x})}),(0,t.jsxs)(F.Zb,{children:[(0,t.jsx)(P,{modelHubData:p||[],onFilteredDataChange:q}),(0,t.jsx)(i.C,{columns:v(e=>{C(e),N(!0)},Y,o),data:S,isLoading:g,table:O,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(F.xv,{className:"text-sm text-gray-600",children:["Showing ",S.length," of ",(null==p?void 0:p.length)||0," models"]})})]}):(0,t.jsxs)(F.Zb,{className:"mx-auto max-w-xl mt-10",children:[(0,t.jsx)(F.xv,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,t.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,t.jsx)(Z.Z,{title:"Public Model Hub",width:600,visible:f,footer:null,onOk:I,onCancel:K,children:(0,t.jsxs)("div",{className:"pt-5 pb-5",children:[(0,t.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,t.jsx)(F.xv,{className:"text-base mr-2",children:"Shareable Link:"}),(0,t.jsx)(F.xv,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:"".concat((0,n.getProxyBaseUrl)(),"/ui/model_hub_table")})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(F.zx,{onClick:()=>{H.replace("/model_hub_table?key=".concat(c))},children:"See Page"})})]})}),(0,t.jsx)(Z.Z,{title:(null==w?void 0:w.model_group)||"Model Details",width:1e3,visible:b,footer:null,onOk:I,onCancel:K,children:w&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Model Group:"}),(0,t.jsx)(F.xv,{children:w.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(F.xv,{children:w.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:w.providers.map(e=>(0,t.jsx)(F.Ct,{color:"blue",children:e},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(F.xv,{children:(null===(s=w.max_input_tokens)||void 0===s?void 0:s.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(F.xv,{children:(null===(l=w.max_output_tokens)||void 0===l?void 0:l.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(F.xv,{children:w.input_cost_per_token?V(w.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(F.xv,{children:w.output_cost_per_token?V(w.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=B(w),s=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,t.jsx)(F.xv,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,l)=>(0,t.jsx)(F.Ct,{color:s[l%s.length],children:W(e)},e))})()})]}),(w.tpm||w.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[w.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(F.xv,{children:w.tpm.toLocaleString()})]}),w.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(F.xv,{children:w.rpm.toLocaleString()})]})]})]}),w.supported_openai_params&&(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:w.supported_openai_params.map(e=>(0,t.jsx)(F.Ct,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(U.Z,{language:"python",className:"text-sm",children:'import openai\n\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # Your LiteLLM Proxy URL\n)\n\nresponse = client.chat.completions.create(\n model="'.concat(w.model_group,'",\n messages=[\n {\n "role": "user",\n "content": "Hello, how are you?"\n }\n ]\n)\n\nprint(response.choices[0].message.content)')})]})]})}),(0,t.jsx)(L,{visible:D,onClose:()=>R(!1),accessToken:c||"",modelHubData:p||[],onSuccess:()=>{c&&(async()=>{try{let e=await (0,n.modelHubCall)(c);h(e.data)}catch(e){console.error("Error refreshing model data:",e)}})()}})]})}},69870:function(e,s,l){var t=l(57437),r=l(2265),a=l(91679),n=l(41021),i=l(86462),c=l(47686),o=l(77355),d=l(93416),x=l(74998),m=l(20347),u=l(19250),p=l(95704);s.Z=e=>{let{accessToken:s,userRole:l}=e,[h,g]=(0,r.useState)([]),[j,b]=(0,r.useState)({url:"",displayName:""}),[v,y]=(0,r.useState)(null),[N,f]=(0,r.useState)(!1),[_,k]=(0,r.useState)(!0),w=async()=>{if(s)try{f(!0);let e=await (0,u.getPublicModelHubInfo)();if(e&&e.useful_links){let s=e.useful_links||{},l=Object.entries(s).map((e,s)=>{let[l,t]=e;return{id:"".concat(s,"-").concat(l),displayName:l,url:t}});g(l)}else g([])}catch(e){console.error("Error fetching useful links:",e),g([])}finally{f(!1)}};if((0,r.useEffect)(()=>{w()},[s]),!(0,m.tY)(l||""))return null;let Z=async e=>{if(!s)return!1;try{let l={};return e.forEach(e=>{l[e.displayName]=e.url}),await (0,u.updateUsefulLinksCall)(s,l),a.Z.success({title:"Links Saved Successfully",content:(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)("p",{className:"text-gray-600 mb-4",children:"Your useful links have been saved and are now visible on the public model hub."}),(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,t.jsx)("p",{className:"text-sm text-blue-800 mb-2 font-medium",children:"View your updated model hub:"}),(0,t.jsx)("a",{href:"".concat((0,u.getProxyBaseUrl)(),"/ui/model_hub_table"),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-blue-600 hover:text-blue-800 underline text-sm font-medium",children:"Open Public Model Hub →"})]})]}),width:500,okText:"Close",maskClosable:!0,keyboard:!0}),!0}catch(e){return console.error("Error saving links:",e),n.ZP.error("Failed to save links - ".concat(e)),!1}},C=async()=>{if(!j.url||!j.displayName)return;try{new URL(j.url)}catch(e){n.ZP.error("Please enter a valid URL");return}if(h.some(e=>e.displayName===j.displayName)){n.ZP.error("A link with this display name already exists");return}let e=[...h,{id:"".concat(Date.now(),"-").concat(j.displayName),displayName:j.displayName,url:j.url}];await Z(e)&&(g(e),b({url:"",displayName:""}),n.ZP.success("Link added successfully"))},S=e=>{y({...e})},P=async()=>{if(!v)return;try{new URL(v.url)}catch(e){n.ZP.error("Please enter a valid URL");return}if(h.some(e=>e.id!==v.id&&e.displayName===v.displayName)){n.ZP.error("A link with this display name already exists");return}let e=h.map(e=>e.id===v.id?v:e);await Z(e)&&(g(e),y(null),n.ZP.success("Link updated successfully"))},M=()=>{y(null)},L=async e=>{let s=h.filter(s=>s.id!==e);await Z(s)&&(g(s),n.ZP.success("Link deleted successfully"))},A=e=>{window.open(e,"_blank")};return(0,t.jsxs)(p.Zb,{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>k(!_),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(p.Dx,{className:"mb-0",children:"Link Management"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Manage the links that are displayed under 'Useful Links' on the public model hub."})]}),(0,t.jsx)("div",{className:"flex items-center",children:_?(0,t.jsx)(i.Z,{className:"w-5 h-5 text-gray-500"}):(0,t.jsx)(c.Z,{className:"w-5 h-5 text-gray-500"})})]}),_&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(p.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Link"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"URL"}),(0,t.jsx)("input",{type:"text",value:j.url,onChange:e=>b({...j,url:e.target.value}),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Display Name"}),(0,t.jsx)("input",{type:"text",value:j.displayName,onChange:e=>b({...j,displayName:e.target.value}),placeholder:"Friendly name",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:C,disabled:!j.url||!j.displayName,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(j.url&&j.displayName?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,t.jsx)(o.Z,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,t.jsx)(p.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Links"}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(p.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(p.ss,{children:(0,t.jsxs)(p.SC,{children:[(0,t.jsx)(p.xs,{className:"py-1 h-8",children:"Display Name"}),(0,t.jsx)(p.xs,{className:"py-1 h-8",children:"URL"}),(0,t.jsx)(p.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(p.RM,{children:[h.map(e=>(0,t.jsx)(p.SC,{className:"h-8",children:v&&v.id===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:v.displayName,onChange:e=>y({...v,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(p.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:v.url,onChange:e=>y({...v,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(p.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:P,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,t.jsx)("button",{onClick:M,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.pj,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,t.jsx)(p.pj,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,t.jsx)(p.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>A(e.url),className:"text-xs bg-green-50 text-green-600 px-2 py-1 rounded hover:bg-green-100",children:"Use"}),(0,t.jsx)("button",{onClick:()=>S(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,t.jsx)(d.Z,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>L(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,t.jsx)(x.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===h.length&&(0,t.jsx)(p.SC,{children:(0,t.jsx)(p.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})}},20347:function(e,s,l){l.d(s,{LQ:function(){return a},ZL:function(){return t},lo:function(){return r},tY:function(){return n}});let t=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],r=["Internal User","Internal Viewer"],a=["Internal User","Admin"],n=e=>t.includes(e)}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/172-b2d8ff2740510f56.js b/litellm/proxy/_experimental/out/_next/static/chunks/172-b2d8ff2740510f56.js deleted file mode 100644 index e8f7edf8dd7..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/172-b2d8ff2740510f56.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[172],{57018:function(e,s,l){l.d(s,{Ct:function(){return t.Z},Dx:function(){return i.Z},Zb:function(){return r.Z},xv:function(){return n.Z},zx:function(){return a.Z}});var t=l(41649),a=l(20831),r=l(12514),n=l(84264),i=l(96761)},36172:function(e,s,l){l.d(s,{Z:function(){return D}});var t=l(57437),a=l(2265),r=l(99376),n=l(19250),i=l(8048),c=l(41649),o=l(20831),d=l(84264),x=l(89970),m=l(3810),u=l(23639),h=l(15424);let p=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),g=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),j=e=>"$".concat((1e6*e).toFixed(2)),b=e=>e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),v=function(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(d.Z,{className:"font-medium text-sm",children:a.model_group}),(0,t.jsx)(x.Z,{title:"Copy model name",children:(0,t.jsx)(u.Z,{onClick:()=>s(a.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(d.Z,{className:"text-xs text-gray-600",children:a.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,s)=>{let l=e.original.providers.join(", "),t=s.original.providers.join(", ");return l.localeCompare(t)},cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,t.jsx)(m.Z,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,t.jsxs)(d.Z,{className:"text-xs text-gray-500",children:["+",l.providers.length-2]})]})},meta:{className:"hidden md:table-cell"}},{header:"Mode",accessorKey:"mode",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return l.mode?(0,t.jsx)(c.Z,{color:"green",size:"sm",children:l.mode}):(0,t.jsx)(d.Z,{className:"text-gray-500",children:"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Tokens",accessorKey:"max_input_tokens",enableSorting:!0,sortingFn:(e,s)=>(e.original.max_input_tokens||0)+(e.original.max_output_tokens||0)-((s.original.max_input_tokens||0)+(s.original.max_output_tokens||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsxs)(d.Z,{className:"text-xs",children:[l.max_input_tokens?b(l.max_input_tokens):"-"," / ",l.max_output_tokens?b(l.max_output_tokens):"-"]})})},meta:{className:"hidden lg:table-cell"}},{header:"Cost/1M",accessorKey:"input_cost_per_token",enableSorting:!0,sortingFn:(e,s)=>(e.original.input_cost_per_token||0)+(e.original.output_cost_per_token||0)-((s.original.input_cost_per_token||0)+(s.original.output_cost_per_token||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(d.Z,{className:"text-xs",children:l.input_cost_per_token?j(l.input_cost_per_token):"-"}),(0,t.jsx)(d.Z,{className:"text-xs text-gray-500",children:l.output_cost_per_token?j(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=g(s.original),a=["green","blue","purple","orange","red","yellow"];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(d.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,s)=>(0,t.jsx)(c.Z,{color:a[s%a.length],size:"xs",children:p(e)},e))})}},{header:"Public",accessorKey:"is_public_model_group",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public_model_group?1:0)-(!0===s.original.is_public_model_group?1:0),cell:e=>{let{row:s}=e;return!0===s.original.is_public_model_group?(0,t.jsx)(c.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(c.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,a=l.original;return(0,t.jsxs)(o.Z,{size:"xs",variant:"secondary",onClick:()=>e(a),icon:h.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return l?a.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):a};var y=l(72162),N=l(91810),f=l(13634),_=l(41021),k=l(61994),w=l(73002),Z=l(91679),C=l(96761),S=l(12514),P=e=>{let{modelHubData:s,onFilteredDataChange:l,showFiltersCard:r=!0,className:n=""}=e,[i,c]=(0,a.useState)(""),[o,x]=(0,a.useState)(""),[m,u]=(0,a.useState)(""),[h,p]=(0,a.useState)(""),g=(0,a.useRef)([]),j=(0,a.useMemo)(()=>(null==s?void 0:s.filter(e=>{let s=e.model_group.toLowerCase().includes(i.toLowerCase()),l=""===o||e.providers.includes(o),t=""===m||e.mode===m,a=""===h||Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).some(e=>{let[s]=e;return s.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")===h});return s&&l&&t&&a}))||[],[s,i,o,m,h]);(0,a.useEffect)(()=>{(j.length!==g.current.length||j.some((e,s)=>{var l;return e.model_group!==(null===(l=g.current[s])||void 0===l?void 0:l.model_group)}))&&(g.current=j,l(j))},[j,l]);let b=(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names...",value:i,onChange:e=>c(e.target.value),className:"border rounded px-3 py-2 w-64 h-10 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,t.jsxs)("select",{value:o,onChange:e=>x(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-40 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Providers"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.providers.forEach(e=>s.add(e))}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Mode:"}),(0,t.jsxs)("select",{value:m,onChange:e=>u(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-32 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Modes"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.mode&&s.add(e.mode)}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,t.jsxs)("select",{value:h,onChange:e=>p(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-48 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Features"}),s&&(e=>{let s=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).forEach(e=>{let[l]=e,t=l.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");s.add(t)})}),Array.from(s).sort()})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(i||o||m||h)&&(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsx)("button",{onClick:()=>{c(""),x(""),u(""),p("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return r?(0,t.jsx)(S.Z,{className:"mb-6 ".concat(n),children:b}):(0,t.jsx)("div",{className:n,children:b})};let{Step:M}=N.default;var L=e=>{let{visible:s,onClose:l,accessToken:r,modelHubData:i,onSuccess:o}=e,[x,m]=(0,a.useState)(0),[u,h]=(0,a.useState)(new Set),[p,g]=(0,a.useState)([]),[j,b]=(0,a.useState)(!1),[v]=f.Z.useForm(),y=()=>{m(0),h(new Set),g([]),v.resetFields(),l()},S=(e,s)=>{let l=new Set(u);s?l.add(e):l.delete(e),h(l)},L=e=>{e?h(new Set(p.map(e=>e.model_group))):h(new Set)},A=(0,a.useCallback)(e=>{g(e)},[]);(0,a.useEffect)(()=>{s&&i.length>0&&(g(i),h(new Set(i.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[s,i]);let F=async()=>{if(0===u.size){_.ZP.error("Please select at least one model to make public");return}b(!0);try{let e=Array.from(u);await (0,n.makeModelGroupPublic)(r,e),_.ZP.success("Successfully made ".concat(e.length," model group(s) public!")),y(),o()}catch(e){console.error("Error making model groups public:",e),_.ZP.error("Failed to make model groups public. Please try again.")}finally{b(!1)}},U=()=>{let e=p.length>0&&p.every(e=>u.has(e.model_group)),s=u.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(C.Z,{children:"Select Models to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(k.Z,{checked:e,indeterminate:s,onChange:e=>L(e.target.checked),disabled:0===p.length,children:["Select All ",p.length>0&&"(".concat(p.length,")")]})})]}),(0,t.jsx)(d.Z,{className:"text-sm text-gray-600",children:"Select the models you want to be visible on the public model hub. Users will still require a valid API key to use these models."}),(0,t.jsx)(P,{modelHubData:i,onFilteredDataChange:A,showFiltersCard:!1,className:"border rounded-lg p-4 bg-gray-50"}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:0===p.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(d.Z,{children:"No models match the current filters."})}):p.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(k.Z,{checked:u.has(e.model_group),onChange:s=>S(e.model_group,s.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(d.Z,{className:"font-medium",children:e.model_group}),e.mode&&(0,t.jsx)(c.Z,{color:"green",size:"sm",children:e.mode})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),u.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(d.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:u.size})," model",1!==u.size?"s":""," selected"]})})]})},z=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(C.Z,{children:"Confirm Making Models Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(d.Z,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these models public, anyone who can go to the ",(0,t.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(d.Z,{className:"font-medium",children:"Models to be made public:"}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,t.jsx)("div",{className:"space-y-2",children:Array.from(u).map(e=>{let s=i.find(s=>s.model_group===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Z,{className:"font-medium",children:e}),s&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:s.providers.map(e=>(0,t.jsx)(c.Z,{color:"blue",size:"xs",children:e},e))})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(d.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:u.size})," model",1!==u.size?"s":""," will be made public"]})})]});return(0,t.jsx)(Z.Z,{title:"Make Models Public",open:s,onCancel:y,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(f.Z,{form:v,layout:"vertical",children:[(0,t.jsxs)(N.default,{current:x,className:"mb-6",children:[(0,t.jsx)(M,{title:"Select Models"}),(0,t.jsx)(M,{title:"Confirm"})]}),(()=>{switch(x){case 0:return U();case 1:return z();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(w.ZP,{onClick:0===x?y:()=>{1===x&&m(0)},children:0===x?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===x&&(0,t.jsx)(w.ZP,{onClick:()=>{if(0===x){if(0===u.size){_.ZP.error("Please select at least one model to make public");return}m(1)}},disabled:0===u.size,children:"Next"}),1===x&&(0,t.jsx)(w.ZP,{onClick:F,loading:j,children:"Make Public"})]})]})]})})},A=l(382),F=l(57018),U=l(17906),z=l(78867),E=l(20347),D=e=>{var s,l;let{accessToken:c,publicPage:o,premiumUser:d,userRole:x}=e,[m,u]=(0,a.useState)(!1),[h,p]=(0,a.useState)(null),[g,j]=(0,a.useState)(!0),[b,N]=(0,a.useState)(!1),[f,k]=(0,a.useState)(!1),[w,C]=(0,a.useState)(null),[S,M]=(0,a.useState)([]),[D,H]=(0,a.useState)(!1),O=(0,r.useRouter)(),R=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=async e=>{try{j(!0);let s=await (0,n.modelHubCall)(e);console.log("ModelHubData:",s),p(s.data),(0,n.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&u(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{j(!1)}},s=async()=>{try{var e,s;j(!0);let l=await (0,n.modelHubPublicModelsCall)();console.log("ModelHubData:",l),console.log("First model structure:",l[0]),console.log("Model has model_group?",null===(e=l[0])||void 0===e?void 0:e.model_group),console.log("Model has providers?",null===(s=l[0])||void 0===s?void 0:s.providers),p(l),u(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{j(!1)}};c?e(c):o&&s()},[c,o]);let T=()=>{c&&H(!0)},I=()=>{N(!1),k(!1),C(null)},K=()=>{N(!1),k(!1),C(null)},Y=e=>{navigator.clipboard.writeText(e),_.ZP.success("Copied to clipboard!")},W=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),B=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),V=e=>"$".concat((1e6*e).toFixed(2)),q=(0,a.useCallback)(e=>{M(e)},[]);return(console.log("publicPage: ",o),console.log("publicPageAllowed: ",m),o&&m)?(0,t.jsx)(y.Z,{accessToken:c}):(0,t.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==o?(0,t.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsx)(F.Dx,{className:"text-center",children:"Model Hub"}),(0,E.tY)(x||"")?(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Make models public for developers to know what models are available on the proxy."}):(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"A list of all public model names personally available to you."})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)(F.xv,{children:"Model Hub URL:"}),(0,t.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,t.jsx)(F.xv,{className:"mr-2",children:"".concat((0,n.getProxyBaseUrl)(),"/ui/model_hub_table")}),(0,t.jsx)("button",{onClick:()=>Y("".concat((0,n.getProxyBaseUrl)(),"/ui/model_hub_table")),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,t.jsx)(z.Z,{size:16,className:"text-gray-600"})})]}),!1==o&&(0,E.tY)(x||"")&&(0,t.jsx)(F.zx,{className:"ml-4",onClick:()=>T(),children:"Make Public"})]})]}),(0,E.tY)(x||"")&&(0,t.jsx)("div",{className:"mt-8 mb-2",children:(0,t.jsx)(A.Z,{accessToken:c,userRole:x})}),(0,t.jsxs)(F.Zb,{children:[(0,t.jsx)(P,{modelHubData:h||[],onFilteredDataChange:q}),(0,t.jsx)(i.C,{columns:v(e=>{C(e),N(!0)},Y,o),data:S,isLoading:g,table:R,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(F.xv,{className:"text-sm text-gray-600",children:["Showing ",S.length," of ",(null==h?void 0:h.length)||0," models"]})})]}):(0,t.jsxs)(F.Zb,{className:"mx-auto max-w-xl mt-10",children:[(0,t.jsx)(F.xv,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,t.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,t.jsx)(Z.Z,{title:"Public Model Hub",width:600,visible:f,footer:null,onOk:I,onCancel:K,children:(0,t.jsxs)("div",{className:"pt-5 pb-5",children:[(0,t.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,t.jsx)(F.xv,{className:"text-base mr-2",children:"Shareable Link:"}),(0,t.jsx)(F.xv,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:"".concat((0,n.getProxyBaseUrl)(),"/ui/model_hub_table")})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(F.zx,{onClick:()=>{O.replace("/model_hub_table?key=".concat(c))},children:"See Page"})})]})}),(0,t.jsx)(Z.Z,{title:(null==w?void 0:w.model_group)||"Model Details",width:1e3,visible:b,footer:null,onOk:I,onCancel:K,children:w&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Model Group:"}),(0,t.jsx)(F.xv,{children:w.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(F.xv,{children:w.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:w.providers.map(e=>(0,t.jsx)(F.Ct,{color:"blue",children:e},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(F.xv,{children:(null===(s=w.max_input_tokens)||void 0===s?void 0:s.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(F.xv,{children:(null===(l=w.max_output_tokens)||void 0===l?void 0:l.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(F.xv,{children:w.input_cost_per_token?V(w.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(F.xv,{children:w.output_cost_per_token?V(w.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=B(w),s=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,t.jsx)(F.xv,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,l)=>(0,t.jsx)(F.Ct,{color:s[l%s.length],children:W(e)},e))})()})]}),(w.tpm||w.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[w.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(F.xv,{children:w.tpm.toLocaleString()})]}),w.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(F.xv,{children:w.rpm.toLocaleString()})]})]})]}),w.supported_openai_params&&(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:w.supported_openai_params.map(e=>(0,t.jsx)(F.Ct,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(F.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(U.Z,{language:"python",className:"text-sm",children:'import openai\n\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # Your LiteLLM Proxy URL\n)\n\nresponse = client.chat.completions.create(\n model="'.concat(w.model_group,'",\n messages=[\n {\n "role": "user",\n "content": "Hello, how are you?"\n }\n ]\n)\n\nprint(response.choices[0].message.content)')})]})]})}),(0,t.jsx)(L,{visible:D,onClose:()=>H(!1),accessToken:c||"",modelHubData:h||[],onSuccess:()=>{c&&(async()=>{try{let e=await (0,n.modelHubCall)(c);p(e.data)}catch(e){console.error("Error refreshing model data:",e)}})()}})]})}},382:function(e,s,l){l.d(s,{Z:function(){return _}});var t=l(57437),a=l(2265),r=l(91679),n=l(41021),i=l(86462),c=l(47686),o=l(77355),d=l(93416),x=l(74998),m=l(20347),u=l(19250),h=l(12514),p=l(21626),g=l(97214),j=l(28241),b=l(58834),v=l(69552),y=l(71876),N=l(84264),f=l(96761),_=e=>{let{accessToken:s,userRole:l}=e,[_,k]=(0,a.useState)([]),[w,Z]=(0,a.useState)({url:"",displayName:""}),[C,S]=(0,a.useState)(null),[P,M]=(0,a.useState)(!1),[L,A]=(0,a.useState)(!0),F=async()=>{if(s)try{M(!0);let e=await (0,u.getPublicModelHubInfo)();if(e&&e.useful_links){let s=e.useful_links||{},l=Object.entries(s).map((e,s)=>{let[l,t]=e;return{id:"".concat(s,"-").concat(l),displayName:l,url:t}});k(l)}else k([])}catch(e){console.error("Error fetching useful links:",e),k([])}finally{M(!1)}};if((0,a.useEffect)(()=>{F()},[s]),!(0,m.tY)(l||""))return null;let U=async e=>{if(!s)return!1;try{let l={};return e.forEach(e=>{l[e.displayName]=e.url}),await (0,u.updateUsefulLinksCall)(s,l),r.Z.success({title:"Links Saved Successfully",content:(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)("p",{className:"text-gray-600 mb-4",children:"Your useful links have been saved and are now visible on the public model hub."}),(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,t.jsx)("p",{className:"text-sm text-blue-800 mb-2 font-medium",children:"View your updated model hub:"}),(0,t.jsx)("a",{href:"".concat((0,u.getProxyBaseUrl)(),"/ui/model_hub_table"),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-blue-600 hover:text-blue-800 underline text-sm font-medium",children:"Open Public Model Hub →"})]})]}),width:500,okText:"Close",maskClosable:!0,keyboard:!0}),!0}catch(e){return console.error("Error saving links:",e),n.ZP.error("Failed to save links - ".concat(e)),!1}},z=async()=>{if(!w.url||!w.displayName)return;try{new URL(w.url)}catch(e){n.ZP.error("Please enter a valid URL");return}if(_.some(e=>e.displayName===w.displayName)){n.ZP.error("A link with this display name already exists");return}let e=[..._,{id:"".concat(Date.now(),"-").concat(w.displayName),displayName:w.displayName,url:w.url}];await U(e)&&(k(e),Z({url:"",displayName:""}),n.ZP.success("Link added successfully"))},E=e=>{S({...e})},D=async()=>{if(!C)return;try{new URL(C.url)}catch(e){n.ZP.error("Please enter a valid URL");return}if(_.some(e=>e.id!==C.id&&e.displayName===C.displayName)){n.ZP.error("A link with this display name already exists");return}let e=_.map(e=>e.id===C.id?C:e);await U(e)&&(k(e),S(null),n.ZP.success("Link updated successfully"))},H=()=>{S(null)},O=async e=>{let s=_.filter(s=>s.id!==e);await U(s)&&(k(s),n.ZP.success("Link deleted successfully"))},R=e=>{window.open(e,"_blank")};return(0,t.jsxs)(h.Z,{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>A(!L),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(f.Z,{className:"mb-0",children:"Link Management"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Manage the links that are displayed under 'Useful Links' on the public model hub."})]}),(0,t.jsx)("div",{className:"flex items-center",children:L?(0,t.jsx)(i.Z,{className:"w-5 h-5 text-gray-500"}):(0,t.jsx)(c.Z,{className:"w-5 h-5 text-gray-500"})})]}),L&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(N.Z,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Link"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"URL"}),(0,t.jsx)("input",{type:"text",value:w.url,onChange:e=>Z({...w,url:e.target.value}),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Display Name"}),(0,t.jsx)("input",{type:"text",value:w.displayName,onChange:e=>Z({...w,displayName:e.target.value}),placeholder:"Friendly name",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:z,disabled:!w.url||!w.displayName,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(w.url&&w.displayName?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,t.jsx)(o.Z,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,t.jsx)(N.Z,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Links"}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(p.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(b.Z,{children:(0,t.jsxs)(y.Z,{children:[(0,t.jsx)(v.Z,{className:"py-1 h-8",children:"Display Name"}),(0,t.jsx)(v.Z,{className:"py-1 h-8",children:"URL"}),(0,t.jsx)(v.Z,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(g.Z,{children:[_.map(e=>(0,t.jsx)(y.Z,{className:"h-8",children:C&&C.id===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:C.displayName,onChange:e=>S({...C,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(j.Z,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:C.url,onChange:e=>S({...C,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(j.Z,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:D,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,t.jsx)("button",{onClick:H,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,t.jsx)(j.Z,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,t.jsx)(j.Z,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>R(e.url),className:"text-xs bg-green-50 text-green-600 px-2 py-1 rounded hover:bg-green-100",children:"Use"}),(0,t.jsx)("button",{onClick:()=>E(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,t.jsx)(d.Z,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>O(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,t.jsx)(x.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===_.length&&(0,t.jsx)(y.Z,{children:(0,t.jsx)(j.Z,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})}},20347:function(e,s,l){l.d(s,{LQ:function(){return r},ZL:function(){return t},lo:function(){return a},tY:function(){return n}});let t=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],a=["Internal User","Internal Viewer"],r=["Internal User","Admin"],n=e=>t.includes(e)}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/199-7d06fdac37bed3ff.js b/litellm/proxy/_experimental/out/_next/static/chunks/199-7d06fdac37bed3ff.js deleted file mode 100644 index 4cfc11ce022..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/199-7d06fdac37bed3ff.js +++ /dev/null @@ -1,12 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[199],{12660:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},88009:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},37527:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 00-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]},name:"bank",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},9775:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},68208:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83669:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26430:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},5540:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11894:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},44625:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26349:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62670:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},73879:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},29271:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41169:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11741:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},97416:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},6520:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34310:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM472 744a40 40 0 1080 0 40 40 0 10-80 0zm16-104h48c4.4 0 8-3.6 8-8V448c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8z"}}]},name:"file-exclamation",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},38434:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},10798:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71282:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},92403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},48231:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62272:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},45246:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},16601:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 394c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H400V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v236H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h228v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h164c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V394h164zM628 630H400V394h228v236z"}}]},name:"number",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},99890:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},28595:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34419:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},96473:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},89245:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},69993:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},78355:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},23907:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},55322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},8881:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71891:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41361:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"}}]},name:"team",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58630:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},3632:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},35291:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58747:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))}},75105:function(e,t,n){"use strict";n.d(t,{Z:function(){return et}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(87602),s=n(59221),c=n(86757),u=n.n(c),d=n(95645),f=n.n(d),p=n(77571),h=n.n(p),m=n(82559),g=n.n(m),v=n(21652),y=n.n(v),b=n(57165),x=n(81889),w=n(9841),k=n(58772),S=n(34067),E=n(16630),O=n(85355),C=n(82944),j=["layout","type","stroke","connectNulls","isRange","ref"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(a,j));return o.createElement(w.m,{clipPath:n?"url(#clipPath-".concat(r,")"):null},o.createElement(b.H,P({},(0,C.L6)(d,!0),{points:e,connectNulls:c,type:l,baseLine:t,layout:i,stroke:"none",className:"recharts-area-area"})),"none"!==s&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:e})),"none"!==s&&u&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:t})))}},{key:"renderAreaWithAnimation",value:function(e,t){var n=this,r=this.props,a=r.points,i=r.baseLine,l=r.isAnimationActive,c=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationId,p=this.state,m=p.prevPoints,v=p.prevBaseLine;return o.createElement(s.ZP,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"area-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var l=r.t;if(m){var s,c=m.length/a.length,u=a.map(function(e,t){var n=Math.floor(t*c);if(m[n]){var r=m[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e});return s=(0,E.hj)(i)&&"number"==typeof i?(0,E.k4)(v,i)(l):h()(i)||g()(i)?(0,E.k4)(v,0)(l):i.map(function(e,t){var n=Math.floor(t*c);if(v[n]){var r=v[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e}),n.renderAreaStatically(u,s,e,t)}return o.createElement(w.m,null,o.createElement("defs",null,o.createElement("clipPath",{id:"animationClipPath-".concat(t)},n.renderClipRect(l))),o.createElement(w.m,{clipPath:"url(#animationClipPath-".concat(t,")")},n.renderAreaStatically(a,i,e,t)))})}},{key:"renderArea",value:function(e,t){var n=this.props,r=n.points,o=n.baseLine,a=n.isAnimationActive,i=this.state,l=i.prevPoints,s=i.prevBaseLine,c=i.totalLength;return a&&r&&r.length&&(!l&&c>0||!y()(l,r)||!y()(s,o))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,o,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.dot,a=t.points,i=t.className,s=t.top,c=t.left,u=t.xAxis,d=t.yAxis,f=t.width,p=t.height,m=t.isAnimationActive,g=t.id;if(n||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=1===a.length,b=(0,l.Z)("recharts-area",i),x=u&&u.allowDataOverflow,S=d&&d.allowDataOverflow,E=x||S,O=h()(g)?this.id:g,j=null!==(e=(0,C.L6)(r,!1))&&void 0!==e?e:{r:3,strokeWidth:2},_=j.r,P=j.strokeWidth,N=((0,C.$k)(r)?r:{}).clipDot,T=void 0===N||N,A=2*(void 0===_?3:_)+(void 0===P?2:P);return o.createElement(w.m,{className:b},x||S?o.createElement("defs",null,o.createElement("clipPath",{id:"clipPath-".concat(O)},o.createElement("rect",{x:x?c:c-f/2,y:S?s:s-p/2,width:x?f:2*f,height:S?p:2*p})),!T&&o.createElement("clipPath",{id:"clipPath-dots-".concat(O)},o.createElement("rect",{x:c-A/2,y:s-A/2,width:f+A,height:p+A}))):null,y?null:this.renderArea(E,O),(r||y)&&this.renderDots(E,T,O),(!m||v)&&k.e.renderCallByParent(this.props,a))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],n&&A(i.prototype,n),r&&A(i,r),Object.defineProperty(i,"prototype",{writable:!1}),i}(o.PureComponent);D(Z,"displayName","Area"),D(Z,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!S.x.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),D(Z,"getBaseValue",function(e,t,n,r){var o=e.layout,a=e.baseValue,i=t.props.baseValue,l=null!=i?i:a;if((0,E.hj)(l)&&"number"==typeof l)return l;var s="horizontal"===o?r:n,c=s.scale.domain();if("number"===s.type){var u=Math.max(c[0],c[1]),d=Math.min(c[0],c[1]);return"dataMin"===l?d:"dataMax"===l?u:u<0?u:Math.max(Math.min(c[0],c[1]),0)}return"dataMin"===l?c[0]:"dataMax"===l?c[1]:c[0]}),D(Z,"getComposedData",function(e){var t,n=e.props,r=e.item,o=e.xAxis,a=e.yAxis,i=e.xAxisTicks,l=e.yAxisTicks,s=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,p=e.offset,h=n.layout,m=u&&u.length,g=Z.getBaseValue(n,r,o,a),v="horizontal"===h,y=!1,b=f.map(function(e,t){m?n=u[d+t]:Array.isArray(n=(0,O.F$)(e,c))?y=!0:n=[g,n];var n,r=null==n[1]||m&&null==(0,O.F$)(e,c);return v?{x:(0,O.Hv)({axis:o,ticks:i,bandSize:s,entry:e,index:t}),y:r?null:a.scale(n[1]),value:n,payload:e}:{x:r?null:o.scale(n[1]),y:(0,O.Hv)({axis:a,ticks:l,bandSize:s,entry:e,index:t}),value:n,payload:e}});return t=m||y?b.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?a.scale(t):null}:{x:null!=t?o.scale(t):null,y:e.y}}):v?a.scale(g):o.scale(g),T({points:b,baseLine:t,layout:h,isRange:y},p)}),D(Z,"renderDotItem",function(e,t){return o.isValidElement(e)?o.cloneElement(e,t):u()(e)?e(t):o.createElement(x.o,P({},t,{className:"recharts-area-dot"}))});var z=n(97059),B=n(62994),F=n(25311),H=(0,i.z)({chartName:"AreaChart",GraphicalChild:Z,axisComponents:[{axisType:"xAxis",AxisComp:z.K},{axisType:"yAxis",AxisComp:B.B}],formatAxisMap:F.t9}),q=n(56940),W=n(8147),U=n(22190),K=n(54061),$=n(65278),V=n(98593),X=n(69448),G=n(32644),Y=n(7084),Q=n(26898),J=n(97324),ee=n(1153);let et=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:l,stack:s=!1,colors:c=Q.s,valueFormatter:u=ee.Cj,startEndOnly:d=!1,showXAxis:f=!0,showYAxis:p=!0,yAxisWidth:h=56,intervalType:m="equidistantPreserveStart",showAnimation:g=!1,animationDuration:v=900,showTooltip:y=!0,showLegend:b=!0,showGridLines:w=!0,showGradient:k=!0,autoMinValue:S=!1,curveType:E="linear",minValue:O,maxValue:C,connectNulls:j=!1,allowDecimals:_=!0,noDataText:P,className:N,onValueChange:T,enableLegendSlider:A=!1,customTooltip:M,rotateLabelX:I,tickGap:R=5}=e,D=(0,r._T)(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),L=(f||p)&&(!d||p)?20:0,[F,et]=(0,o.useState)(60),[en,er]=(0,o.useState)(void 0),[eo,ea]=(0,o.useState)(void 0),ei=(0,G.me)(i,c),el=(0,G.i4)(S,O,C),es=!!T;function ec(e){es&&(e===eo&&!en||(0,G.FB)(n,e)&&en&&en.dataKey===e?(ea(void 0),null==T||T(null)):(ea(e),null==T||T({eventType:"category",categoryClicked:e})),er(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,J.q)("w-full h-80",N)},D),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(H,{data:n,onClick:es&&(eo||en)?()=>{er(void 0),ea(void 0),null==T||T(null)}:void 0},w?o.createElement(q.q,{className:(0,J.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(z.K,{padding:{left:L,right:L},hide:!f,dataKey:l,tick:{transform:"translate(0, 6)"},ticks:d?[n[0][l],n[n.length-1][l]]:void 0,fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:d?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:R,angle:null==I?void 0:I.angle,dy:null==I?void 0:I.verticalShift,height:null==I?void 0:I.xAxisHeight}),o.createElement(B.B,{width:h,hide:!p,axisLine:!1,tickLine:!1,type:"number",domain:el,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:u,allowDecimals:_}),o.createElement(W.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:y?e=>{let{active:t,payload:n,label:r}=e;return M?o.createElement(M,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ei.get(e.dataKey))&&void 0!==t?t:Y.fr.Gray})}),active:t,label:r}):o.createElement(V.ZP,{active:t,payload:n,label:r,valueFormatter:u,categoryColors:ei})}:o.createElement(o.Fragment,null),position:{y:0}}),b?o.createElement(U.D,{verticalAlign:"top",height:F,content:e=>{let{payload:t}=e;return(0,$.Z)({payload:t},ei,et,eo,es?e=>ec(e):void 0,A)}}):null,i.map(e=>{var t,n;return o.createElement("defs",{key:e},k?o.createElement("linearGradient",{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.15:.4}),o.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):o.createElement("linearGradient",{className:(0,ee.bM)(null!==(n=ei.get(e))&&void 0!==n?n:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.1:.3})))}),i.map(e=>{var t;return o.createElement(Z,{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).strokeColor,strokeOpacity:en||eo&&eo!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(x.o,{className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(t=ei.get(u))&&void 0!==t?t:Y.fr.Gray,Q.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),es&&(e.index===(null==en?void 0:en.index)&&e.dataKey===(null==en?void 0:en.dataKey)||(0,G.FB)(n,e.dataKey)&&eo&&eo===e.dataKey?(ea(void 0),er(void 0),null==T||T(null)):(ea(e.dataKey),er({index:e.index,dataKey:e.dataKey}),null==T||T(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,G.FB)(n,e)&&!(en||eo&&eo!==e)||(null==en?void 0:en.index)===f&&(null==en?void 0:en.dataKey)===e?o.createElement(x.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(r=ei.get(d))&&void 0!==r?r:Y.fr.Gray,Q.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:E,dataKey:e,stroke:"",fill:"url(#".concat(ei.get(e),")"),strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:g,animationDuration:v,stackId:s?"a":void 0,connectNulls:j})}),T?i.map(e=>o.createElement(K.x,{className:(0,J.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:E,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:j,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ec(n)}})):null):o.createElement(X.Z,{noDataText:P})))});et.displayName="AreaChart"},40278:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(47625),u=n(93765),d=n(31699),f=n(97059),p=n(62994),h=n(25311),m=(0,u.z)({chartName:"BarChart",GraphicalChild:d.$,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:f.K},{axisType:"yAxis",AxisComp:p.B}],formatAxisMap:h.t9}),g=n(56940),v=n(8147),y=n(22190),b=n(65278),x=n(98593),w=n(69448),k=n(32644);let S=s.forwardRef((e,t)=>{let{data:n=[],categories:u=[],index:h,colors:S=a.s,valueFormatter:E=l.Cj,layout:O="horizontal",stack:C=!1,relative:j=!1,startEndOnly:_=!1,animationDuration:P=900,showAnimation:N=!1,showXAxis:T=!0,showYAxis:A=!0,yAxisWidth:M=56,intervalType:I="equidistantPreserveStart",showTooltip:R=!0,showLegend:D=!0,showGridLines:L=!0,autoMinValue:Z=!1,minValue:z,maxValue:B,allowDecimals:F=!0,noDataText:H,onValueChange:q,enableLegendSlider:W=!1,customTooltip:U,rotateLabelX:K,tickGap:$=5,className:V}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),G=T||A?20:0,[Y,Q]=(0,s.useState)(60),J=(0,k.me)(u,S),[ee,et]=s.useState(void 0),[en,er]=(0,s.useState)(void 0),eo=!!q;function ea(e,t,n){var r,o,a,i;n.stopPropagation(),q&&((0,k.vZ)(ee,Object.assign(Object.assign({},e.payload),{value:e.value}))?(er(void 0),et(void 0),null==q||q(null)):(er(null===(o=null===(r=e.tooltipPayload)||void 0===r?void 0:r[0])||void 0===o?void 0:o.dataKey),et(Object.assign(Object.assign({},e.payload),{value:e.value})),null==q||q(Object.assign({eventType:"bar",categoryClicked:null===(i=null===(a=e.tooltipPayload)||void 0===a?void 0:a[0])||void 0===i?void 0:i.dataKey},e.payload))))}let ei=(0,k.i4)(Z,z,B);return s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-80",V)},X),s.createElement(c.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(m,{data:n,stackOffset:C?"sign":j?"expand":"none",layout:"vertical"===O?"vertical":"horizontal",onClick:eo&&(en||ee)?()=>{et(void 0),er(void 0),null==q||q(null)}:void 0},L?s.createElement(g.q,{className:(0,i.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==O,vertical:"vertical"===O}):null,"vertical"!==O?s.createElement(f.K,{padding:{left:G,right:G},hide:!T,dataKey:h,interval:_?"preserveStartEnd":I,tick:{transform:"translate(0, 6)"},ticks:_?[n[0][h],n[n.length-1][h]]:void 0,fill:"",stroke:"",className:(0,i.q)("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight,minTickGap:$}):s.createElement(f.K,{hide:!T,type:"number",tick:{transform:"translate(-3, 0)"},domain:ei,fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:E,minTickGap:$,allowDecimals:F,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight}),"vertical"!==O?s.createElement(p.B,{width:M,hide:!A,axisLine:!1,tickLine:!1,type:"number",domain:ei,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:j?e=>"".concat((100*e).toString()," %"):E,allowDecimals:F}):s.createElement(p.B,{width:M,hide:!A,dataKey:h,axisLine:!1,tickLine:!1,ticks:_?[n[0][h],n[n.length-1][h]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),s.createElement(v.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:R?e=>{let{active:t,payload:n,label:r}=e;return U?s.createElement(U,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=J.get(e.dataKey))&&void 0!==t?t:o.fr.Gray})}),active:t,label:r}):s.createElement(x.ZP,{active:t,payload:n,label:r,valueFormatter:E,categoryColors:J})}:s.createElement(s.Fragment,null),position:{y:0}}),D?s.createElement(y.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,b.Z)({payload:t},J,Q,en,eo?e=>{eo&&(e!==en||ee?(er(e),null==q||q({eventType:"category",categoryClicked:e})):(er(void 0),null==q||q(null)),et(void 0))}:void 0,W)}}):null,u.map(e=>{var t;return s.createElement(d.$,{className:(0,i.q)((0,l.bM)(null!==(t=J.get(e))&&void 0!==t?t:o.fr.Gray,a.K.background).fillColor,q?"cursor-pointer":""),key:e,name:e,type:"linear",stackId:C||j?"a":void 0,dataKey:e,fill:"",isAnimationActive:N,animationDuration:P,shape:e=>((e,t,n,r)=>{let{fillOpacity:o,name:a,payload:i,value:l}=e,{x:c,width:u,y:d,height:f}=e;return"horizontal"===r&&f<0?(d+=f,f=Math.abs(f)):"vertical"===r&&u<0&&(c+=u,u=Math.abs(u)),s.createElement("rect",{x:c,y:d,width:u,height:f,opacity:t||n&&n!==a?(0,k.vZ)(t,Object.assign(Object.assign({},i),{value:l}))?o:.3:o})})(e,ee,en,O),onClick:ea})})):s.createElement(w.Z,{noDataText:H})))});S.displayName="BarChart"},14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return ez}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(60474),u=n(47625),d=n(93765),f=n(86757),p=n.n(f),h=n(9841),m=n(81889),g=n(87602),v=n(82944),y=["points","className","baseLinePoints","connectNulls"];function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){k(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),k(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},E=function(e,t){var n=S(e);t&&(n=[n.reduce(function(e,t){return[].concat(x(e),x(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},O=function(e,t,n){var r=E(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(E(t.reverse(),n).slice(1))},C=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,y);if(!t||!t.length)return null;var i=(0,g.Z)("recharts-polygon",n);if(r&&r.length){var l=a.stroke&&"none"!==a.stroke,c=O(t,r,o);return s.createElement("g",{className:i},s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===c.slice(-1)?a.fill:"none",stroke:"none",d:c})),l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(t,o)})):null,l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(r,o)})):null)}var u=E(t,o);return s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===u.slice(-1)?a.fill:"none",className:i,d:u}))},j=n(58811),_=n(41637),P=n(39206);function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(){return(T=Object.assign?Object.assign.bind():function(e){for(var t=1;t1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,a=e.axisLineType,i=M(M({},(0,v.L6)(this.props,!1)),{},{fill:"none"},(0,v.L6)(o,!1));if("circle"===a)return s.createElement(m.o,T({className:"recharts-polar-angle-axis-line"},i,{cx:t,cy:n,r:r}));var l=this.props.ticks.map(function(e){return(0,P.op)(t,n,r,e.coordinate)});return s.createElement(C,T({className:"recharts-polar-angle-axis-line"},i,{points:l}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.tickLine,i=t.tickFormatter,l=t.stroke,c=(0,v.L6)(this.props,!1),u=(0,v.L6)(r,!1),d=M(M({},c),{},{fill:"none"},(0,v.L6)(o,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),p=M(M(M({textAnchor:e.getTickTextAnchor(t)},c),{},{stroke:"none",fill:l},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return s.createElement(h.m,T({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(t.coordinate)},(0,_.bw)(e.props,t,n)),o&&s.createElement("line",T({className:"recharts-polar-angle-axis-tick-line"},d,f)),r&&a.renderTickItem(r,p,i?i(t.value,n):t.value))});return s.createElement(h.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?s.createElement(h.m,{className:"recharts-polar-angle-axis"},r&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(j.x,T({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],n&&I(a.prototype,n),r&&I(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);L(B,"displayName","PolarAngleAxis"),L(B,"axisType","angleAxis"),L(B,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var F=n(35802),H=n.n(F),q=n(37891),W=n.n(q),U=n(26680),K=["cx","cy","angle","ticks","axisLine"],$=["ticks","tick","angle","tickFormatter","stroke"];function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(){return(X=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function J(e,t){for(var n=0;n0?el()(e,"paddingAngle",0):0;if(n){var l=(0,eg.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),s=eS(eS({},e),{},{startAngle:a+i,endAngle:a+l(r)+i});o.push(s),a=s.endAngle}else{var c=e.endAngle,d=e.startAngle,f=(0,eg.k4)(0,c-d)(r),p=eS(eS({},e),{},{startAngle:a+i,endAngle:a+f+i});o.push(p),a=p.endAngle}}),s.createElement(h.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!ec()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,a=t.label,i=t.cx,l=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eg.hj)(i)||!(0,eg.hj)(l)||!(0,eg.hj)(c)||!(0,eg.hj)(u))return null;var p=(0,g.Z)("recharts-pie",o);return s.createElement(h.m,{tabIndex:this.props.rootTabIndex,className:p,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),U._.renderCallByParent(this.props,null,!1),(!d||f)&&ep.e.renderCallByParent(this.props,r,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e=360?x:x-1)*u,k=a.reduce(function(e,t){var n=(0,ev.F$)(t,b,0);return e+((0,eg.hj)(n)?n:0)},0);return k>0&&(t=a.map(function(e,t){var r,o=(0,ev.F$)(e,b,0),a=(0,ev.F$)(e,f,t),i=((0,eg.hj)(o)?o:0)/k,c=(r=t?n.endAngle+(0,eg.uY)(v)*u*(0!==o?1:0):s)+(0,eg.uY)(v)*((0!==o?m:0)+i*w),d=(r+c)/2,p=(g.innerRadius+g.outerRadius)/2,y=[{name:a,value:o,payload:e,dataKey:b,type:h}],x=(0,P.op)(g.cx,g.cy,p,d);return n=eS(eS(eS({percent:i,cornerRadius:l,name:a,tooltipPayload:y,midAngle:d,middleRadius:p,tooltipPosition:x},e),g),{},{value:(0,ev.F$)(e,b),startAngle:r,endAngle:c,payload:e,paddingAngle:(0,eg.uY)(v)*u})})),eS(eS({},g),{},{sectors:t,data:a})});var eT=(0,d.z)({chartName:"PieChart",GraphicalChild:eN,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:B},{axisType:"radiusAxis",AxisComp:eo}],formatAxisMap:P.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eA=n(8147),eM=n(69448),eI=n(98593);let eR=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return s.createElement(eI.$B,null,s.createElement("div",{className:(0,i.q)("px-4 py-2")},s.createElement(eI.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eD=(e,t)=>e.map((e,n)=>{let r=ne||t((0,l.vP)(n.map(e=>e[r]))),eZ=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l}=e;return s.createElement("g",null,s.createElement(c.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l,fill:"",opacity:.3,style:{outline:"none"}}))},ez=s.forwardRef((e,t)=>{let{data:n=[],category:c="value",index:d="name",colors:f=a.s,variant:p="donut",valueFormatter:h=l.Cj,label:m,showLabel:g=!0,animationDuration:v=900,showAnimation:y=!1,showTooltip:b=!0,noDataText:x,onValueChange:w,customTooltip:k,className:S}=e,E=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),O="donut"==p,C=eL(m,h,n,c),[j,_]=s.useState(void 0),P=!!w;return(0,s.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[j]),s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-40",S)},E),s.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(eT,{onClick:P&&j?()=>{_(void 0),null==w||w(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},g&&O?s.createElement("text",{className:(0,i.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},C):null,s.createElement(eN,{className:(0,i.q)("stroke-tremor-background dark:stroke-dark-tremor-background",w?"cursor-pointer":"cursor-default"),data:eD(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:O?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:c,nameKey:d,isAnimationActive:y,animationDuration:v,onClick:function(e,t,n){n.stopPropagation(),P&&(j===t?(_(void 0),null==w||w(null)):(_(t),null==w||w(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:j,inactiveShape:eZ,style:{outline:"none"}}),s.createElement(eA.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:b?e=>{var t;let{active:n,payload:r}=e;return k?s.createElement(k,{payload:null==r?void 0:r.map(e=>{var t,n,a;return Object.assign(Object.assign({},e),{color:null!==(a=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==a?a:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):s.createElement(eR,{active:n,payload:r,valueFormatter:h})}:s.createElement(s.Fragment,null)})):s.createElement(eM.Z,{noDataText:x})))});ez.displayName="DonutChart"},59664:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(54061),s=n(97059),c=n(62994),u=n(25311),d=(0,i.z)({chartName:"LineChart",GraphicalChild:l.x,axisComponents:[{axisType:"xAxis",AxisComp:s.K},{axisType:"yAxis",AxisComp:c.B}],formatAxisMap:u.t9}),f=n(56940),p=n(8147),h=n(22190),m=n(81889),g=n(65278),v=n(98593),y=n(69448),b=n(32644),x=n(7084),w=n(26898),k=n(97324),S=n(1153);let E=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:u,colors:E=w.s,valueFormatter:O=S.Cj,startEndOnly:C=!1,showXAxis:j=!0,showYAxis:_=!0,yAxisWidth:P=56,intervalType:N="equidistantPreserveStart",animationDuration:T=900,showAnimation:A=!1,showTooltip:M=!0,showLegend:I=!0,showGridLines:R=!0,autoMinValue:D=!1,curveType:L="linear",minValue:Z,maxValue:z,connectNulls:B=!1,allowDecimals:F=!0,noDataText:H,className:q,onValueChange:W,enableLegendSlider:U=!1,customTooltip:K,rotateLabelX:$,tickGap:V=5}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),G=j||_?20:0,[Y,Q]=(0,o.useState)(60),[J,ee]=(0,o.useState)(void 0),[et,en]=(0,o.useState)(void 0),er=(0,b.me)(i,E),eo=(0,b.i4)(D,Z,z),ea=!!W;function ei(e){ea&&(e===et&&!J||(0,b.FB)(n,e)&&J&&J.dataKey===e?(en(void 0),null==W||W(null)):(en(e),null==W||W({eventType:"category",categoryClicked:e})),ee(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,k.q)("w-full h-80",q)},X),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(d,{data:n,onClick:ea&&(et||J)?()=>{ee(void 0),en(void 0),null==W||W(null)}:void 0},R?o.createElement(f.q,{className:(0,k.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(s.K,{padding:{left:G,right:G},hide:!j,dataKey:u,interval:C?"preserveStartEnd":N,tick:{transform:"translate(0, 6)"},ticks:C?[n[0][u],n[n.length-1][u]]:void 0,fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:V,angle:null==$?void 0:$.angle,dy:null==$?void 0:$.verticalShift,height:null==$?void 0:$.xAxisHeight}),o.createElement(c.B,{width:P,hide:!_,axisLine:!1,tickLine:!1,type:"number",domain:eo,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:O,allowDecimals:F}),o.createElement(p.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?e=>{let{active:t,payload:n,label:r}=e;return K?o.createElement(K,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=er.get(e.dataKey))&&void 0!==t?t:x.fr.Gray})}),active:t,label:r}):o.createElement(v.ZP,{active:t,payload:n,label:r,valueFormatter:O,categoryColors:er})}:o.createElement(o.Fragment,null),position:{y:0}}),I?o.createElement(h.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,g.Z)({payload:t},er,Q,et,ea?e=>ei(e):void 0,U)}}):null,i.map(e=>{var t;return o.createElement(l.x,{className:(0,k.q)((0,S.bM)(null!==(t=er.get(e))&&void 0!==t?t:x.fr.Gray,w.K.text).strokeColor),strokeOpacity:J||et&&et!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(m.o,{className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(t=er.get(u))&&void 0!==t?t:x.fr.Gray,w.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),ea&&(e.index===(null==J?void 0:J.index)&&e.dataKey===(null==J?void 0:J.dataKey)||(0,b.FB)(n,e.dataKey)&&et&&et===e.dataKey?(en(void 0),ee(void 0),null==W||W(null)):(en(e.dataKey),ee({index:e.index,dataKey:e.dataKey}),null==W||W(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,b.FB)(n,e)&&!(J||et&&et!==e)||(null==J?void 0:J.index)===f&&(null==J?void 0:J.dataKey)===e?o.createElement(m.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(r=er.get(d))&&void 0!==r?r:x.fr.Gray,w.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:L,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:A,animationDuration:T,connectNulls:B})}),W?i.map(e=>o.createElement(l.x,{className:(0,k.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:L,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:B,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ei(n)}})):null):o.createElement(y.Z,{noDataText:H})))});E.displayName="LineChart"},65278:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(2265);let o=(e,t)=>{let[n,o]=(0,r.useState)(t);(0,r.useEffect)(()=>{let t=()=>{o(window.innerWidth),e()};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e,n])};var a=n(5853),i=n(26898),l=n(97324),s=n(1153);let c=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))},u=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))},d=(0,s.fn)("Legend"),f=e=>{let{name:t,color:n,onClick:o,activeLegend:a}=e,c=!!o;return r.createElement("li",{className:(0,l.q)(d("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",c?"cursor-pointer":"cursor-default","text-tremor-content",c?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",c?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:e=>{e.stopPropagation(),null==o||o(t,n)}},r.createElement("svg",{className:(0,l.q)("flex-none h-2 w-2 mr-1.5",(0,s.bM)(n,i.K.text).textColor,a&&a!==t?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},r.createElement("circle",{cx:4,cy:4,r:4})),r.createElement("p",{className:(0,l.q)("whitespace-nowrap truncate text-tremor-default","text-tremor-content",c?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",a&&a!==t?"opacity-40":"opacity-100",c?"dark:group-hover:text-dark-tremor-content-emphasis":"")},t))},p=e=>{let{icon:t,onClick:n,disabled:o}=e,[a,i]=r.useState(!1),s=r.useRef(null);return r.useEffect(()=>(a?s.current=setInterval(()=>{null==n||n()},300):clearInterval(s.current),()=>clearInterval(s.current)),[a,n]),(0,r.useEffect)(()=>{o&&(clearInterval(s.current),i(!1))},[o]),r.createElement("button",{type:"button",className:(0,l.q)(d("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:e=>{e.stopPropagation(),null==n||n()},onMouseDown:e=>{e.stopPropagation(),i(!0)},onMouseUp:e=>{e.stopPropagation(),i(!1)}},r.createElement(t,{className:"w-full"}))},h=r.forwardRef((e,t)=>{var n,o;let{categories:s,colors:h=i.s,className:m,onClickLegendItem:g,activeLegend:v,enableLegendSlider:y=!1}=e,b=(0,a._T)(e,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),x=r.useRef(null),[w,k]=r.useState(null),[S,E]=r.useState(null),O=r.useRef(null),C=(0,r.useCallback)(()=>{let e=null==x?void 0:x.current;e&&k({left:e.scrollLeft>0,right:e.scrollWidth-e.clientWidth>e.scrollLeft})},[k]),j=(0,r.useCallback)(e=>{var t;let n=null==x?void 0:x.current,r=null!==(t=null==n?void 0:n.clientWidth)&&void 0!==t?t:0;n&&y&&(n.scrollTo({left:"left"===e?n.scrollLeft-r:n.scrollLeft+r,behavior:"smooth"}),setTimeout(()=>{C()},400))},[y,C]);r.useEffect(()=>{let e=e=>{"ArrowLeft"===e?j("left"):"ArrowRight"===e&&j("right")};return S?(e(S),O.current=setInterval(()=>{e(S)},300)):clearInterval(O.current),()=>clearInterval(O.current)},[S,j]);let _=e=>{e.stopPropagation(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),E(e.key))},P=e=>{e.stopPropagation(),E(null)};return r.useEffect(()=>{let e=null==x?void 0:x.current;return y&&(C(),null==e||e.addEventListener("keydown",_),null==e||e.addEventListener("keyup",P)),()=>{null==e||e.removeEventListener("keydown",_),null==e||e.removeEventListener("keyup",P)}},[C,y]),r.createElement("ol",Object.assign({ref:t,className:(0,l.q)(d("root"),"relative overflow-hidden",m)},b),r.createElement("div",{ref:x,tabIndex:0,className:(0,l.q)("h-full flex",y?(null==w?void 0:w.right)||(null==w?void 0:w.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},s.map((e,t)=>r.createElement(f,{key:"item-".concat(t),name:e,color:h[t],onClick:g,activeLegend:v}))),y&&((null==w?void 0:w.right)||(null==w?void 0:w.left))?r.createElement(r.Fragment,null,r.createElement("div",{className:(0,l.q)("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},r.createElement(p,{icon:c,onClick:()=>{E(null),j("left")},disabled:!(null==w?void 0:w.left)}),r.createElement(p,{icon:u,onClick:()=>{E(null),j("right")},disabled:!(null==w?void 0:w.right)}))):null)});h.displayName="Legend";let m=(e,t,n,a,i,l)=>{let{payload:s}=e,c=(0,r.useRef)(null);o(()=>{var e,t;n((t=null===(e=c.current)||void 0===e?void 0:e.clientHeight)?Number(t)+20:60)});let u=s.filter(e=>"none"!==e.type);return r.createElement("div",{ref:c,className:"flex items-center justify-end"},r.createElement(h,{categories:u.map(e=>e.value),colors:u.map(e=>t.get(e.value)),onClickLegendItem:i,activeLegend:a,enableLegendSlider:l}))}},98593:function(e,t,n){"use strict";n.d(t,{$B:function(){return s},ZP:function(){return u},zX:function(){return c}});var r=n(2265),o=n(7084),a=n(26898),i=n(97324),l=n(1153);let s=e=>{let{children:t}=e;return r.createElement("div",{className:(0,i.q)("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},t)},c=e=>{let{value:t,name:n,color:o}=e;return r.createElement("div",{className:"flex items-center justify-between space-x-8"},r.createElement("div",{className:"flex items-center space-x-2"},r.createElement("span",{className:(0,i.q)("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",(0,l.bM)(o,a.K.background).bgColor)}),r.createElement("p",{className:(0,i.q)("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},n)),r.createElement("p",{className:(0,i.q)("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},t))},u=e=>{let{active:t,payload:n,label:a,categoryColors:l,valueFormatter:u}=e;if(t&&n){let e=n.filter(e=>"none"!==e.type);return r.createElement(s,null,r.createElement("div",{className:(0,i.q)("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},r.createElement("p",{className:(0,i.q)("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},a)),r.createElement("div",{className:(0,i.q)("px-4 py-2 space-y-1")},e.map((e,t)=>{var n;let{value:a,name:i}=e;return r.createElement(c,{key:"id-".concat(t),value:u(a),name:i,color:null!==(n=l.get(i))&&void 0!==n?n:o.fr.Blue})})))}return null}},69448:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(97324),o=n(2265),a=n(5853);let i=(0,n(1153).fn)("Flex"),l={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},s={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},c={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},u=o.forwardRef((e,t)=>{let{flexDirection:n="row",justifyContent:u="between",alignItems:d="center",children:f,className:p}=e,h=(0,a._T)(e,["flexDirection","justifyContent","alignItems","children","className"]);return o.createElement("div",Object.assign({ref:t,className:(0,r.q)(i("root"),"flex w-full",c[n],l[u],s[d],p)},h),f)});u.displayName="Flex";var d=n(84264);let f=e=>{let{noDataText:t="No data"}=e;return o.createElement(u,{alignItems:"center",justifyContent:"center",className:(0,r.q)("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},o.createElement(d.Z,{className:(0,r.q)("text-tremor-content","dark:text-dark-tremor-content")},t))}},32644:function(e,t,n){"use strict";n.d(t,{FB:function(){return a},i4:function(){return o},me:function(){return r},vZ:function(){return function e(t,n){if(t===n)return!0;if("object"!=typeof t||"object"!=typeof n||null===t||null===n)return!1;let r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(let a of r)if(!o.includes(a)||!e(t[a],n[a]))return!1;return!0}}});let r=(e,t)=>{let n=new Map;return e.forEach((e,r)=>{n.set(e,t[r])}),n},o=(e,t,n)=>[e?"auto":null!=t?t:0,null!=n?n:"auto"];function a(e,t){let n=[];for(let r of e)if(Object.prototype.hasOwnProperty.call(r,t)&&(n.push(r[t]),n.length>1))return!1;return!0}},47323:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(5853),o=n(2265),a=n(1526),i=n(7084),l=n(97324),s=n(1153),c=n(26898);let u={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},d={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},f={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},p=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,s.bM)(t,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,l.q)((0,s.bM)(t,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,s.fn)("Icon"),m=o.forwardRef((e,t)=>{let{icon:n,variant:c="simple",tooltip:m,size:g=i.u8.SM,color:v,className:y}=e,b=(0,r._T)(e,["icon","variant","tooltip","size","color","className"]),x=p(c,v),{tooltipProps:w,getReferenceProps:k}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,s.lq)([t,w.refs.setReference]),className:(0,l.q)(h("root"),"inline-flex flex-shrink-0 items-center",x.bgColor,x.textColor,x.borderColor,x.ringColor,f[c].rounded,f[c].border,f[c].shadow,f[c].ring,u[g].paddingX,u[g].paddingY,y)},k,b),o.createElement(a.Z,Object.assign({text:m},w)),o.createElement(n,{className:(0,l.q)(h("icon"),"shrink-0",d[g].height,d[g].width)}))});m.displayName="Icon"},69262:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},l=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var s=n(96398),c=n(97324),u=n(1153);let d=o.forwardRef((e,t)=>{let{value:n,defaultValue:d,type:f,placeholder:p="Type...",icon:h,error:m=!1,errorMessage:g,disabled:v=!1,stepper:y,makeInputClassName:b,className:x,onChange:w,onValueChange:k,autoFocus:S}=e,E=(0,r._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[O,C]=(0,o.useState)(S||!1),[j,_]=(0,o.useState)(!1),P=(0,o.useCallback)(()=>_(!j),[j,_]),N=(0,o.useRef)(null),T=(0,s.Uh)(n||d);return o.useEffect(()=>{let e=()=>C(!0),t=()=>C(!1),n=N.current;return n&&(n.addEventListener("focus",e),n.addEventListener("blur",t),S&&n.focus()),()=>{n&&(n.removeEventListener("focus",e),n.removeEventListener("blur",t))}},[S]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,c.q)(b("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,s.um)(T,v,m),O&&(0,c.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),x)},h?o.createElement(h,{className:(0,c.q)(b("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,u.lq)([N,t]),defaultValue:d,value:n,type:j?"text":f,className:(0,c.q)(b("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",h?"pl-2":"pl-3",m?"pr-3":"pr-4",v?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:v,"data-testid":"base-input",onChange:e=>{null==w||w(e),null==k||k(e.target.value)}},E)),"password"!==f||v?null:o.createElement("button",{className:(0,c.q)(b("toggleButton"),"mr-2"),type:"button",onClick:()=>P(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(l,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(i,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),m?o.createElement(a,{className:(0,c.q)(b("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=y?y:null),m&&g?o.createElement("p",{className:(0,c.q)(b("errorMessage"),"text-sm text-red-500 mt-1")},g):null)});d.displayName="BaseInput"},53003:function(e,t,n){"use strict";let r,o,a;n.d(t,{Z:function(){return nF}});var i,l,s,c,u=n(5853),d=n(2265),f=n(54887),p=n(13323),h=n(64518),m=n(96822),g=n(40293);function v(){for(var e=arguments.length,t=Array(e),n=0;n(0,g.r)(...t),[...t])}var y=n(72238),b=n(93689);let x=(0,d.createContext)(!1);var w=n(61424),k=n(27847);let S=d.Fragment,E=d.Fragment,O=(0,d.createContext)(null),C=(0,d.createContext)(null);Object.assign((0,k.yV)(function(e,t){var n;let r,o,a=(0,d.useRef)(null),i=(0,b.T)((0,b.h)(e=>{a.current=e}),t),l=v(a),s=function(e){let t=(0,d.useContext)(x),n=(0,d.useContext)(O),r=v(e),[o,a]=(0,d.useState)(()=>{if(!t&&null!==n||w.O.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return(0,d.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),(0,d.useEffect)(()=>{t||null!==n&&a(n.current)},[n,a,t]),o}(a),[c]=(0,d.useState)(()=>{var e;return w.O.isServer?null:null!=(e=null==l?void 0:l.createElement("div"))?e:null}),u=(0,d.useContext)(C),g=(0,y.H)();return(0,h.e)(()=>{!s||!c||s.contains(c)||(c.setAttribute("data-headlessui-portal",""),s.appendChild(c))},[s,c]),(0,h.e)(()=>{if(c&&u)return u.register(c)},[u,c]),n=()=>{var e;s&&c&&(c instanceof Node&&s.contains(c)&&s.removeChild(c),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))},r=(0,p.z)(n),o=(0,d.useRef)(!1),(0,d.useEffect)(()=>(o.current=!1,()=>{o.current=!0,(0,m.Y)(()=>{o.current&&r()})}),[r]),g&&s&&c?(0,f.createPortal)((0,k.sY)({ourProps:{ref:i},theirProps:e,defaultTag:S,name:"Portal"}),c):null}),{Group:(0,k.yV)(function(e,t){let{target:n,...r}=e,o={ref:(0,b.T)(t)};return d.createElement(O.Provider,{value:n},(0,k.sY)({ourProps:o,theirProps:r,defaultTag:E,name:"Popover.Group"}))})});var j=n(31948),_=n(17684),P=n(98505),N=n(80004),T=n(38198),A=n(3141),M=((r=M||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function I(){let e=(0,d.useRef)(0);return(0,A.s)("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}var R=n(37863),D=n(47634),L=n(37105),Z=n(24536),z=n(37388),B=((o=B||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),F=((a=F||{})[a.TogglePopover=0]="TogglePopover",a[a.ClosePopover=1]="ClosePopover",a[a.SetButton=2]="SetButton",a[a.SetButtonId=3]="SetButtonId",a[a.SetPanel=4]="SetPanel",a[a.SetPanelId=5]="SetPanelId",a);let H={0:e=>{let t={...e,popoverState:(0,Z.E)(e.popoverState,{0:1,1:0})};return 0===t.popoverState&&(t.__demoMode=!1),t},1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},q=(0,d.createContext)(null);function W(e){let t=(0,d.useContext)(q);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,W),t}return t}q.displayName="PopoverContext";let U=(0,d.createContext)(null);function K(e){let t=(0,d.useContext)(U);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,K),t}return t}U.displayName="PopoverAPIContext";let $=(0,d.createContext)(null);function V(){return(0,d.useContext)($)}$.displayName="PopoverGroupContext";let X=(0,d.createContext)(null);function G(e,t){return(0,Z.E)(t.type,H,e,t)}X.displayName="PopoverPanelContext";let Y=k.AN.RenderStrategy|k.AN.Static,Q=k.AN.RenderStrategy|k.AN.Static,J=Object.assign((0,k.yV)(function(e,t){var n,r,o,a;let i,l,s,c,u,f;let{__demoMode:h=!1,...m}=e,g=(0,d.useRef)(null),y=(0,b.T)(t,(0,b.h)(e=>{g.current=e})),x=(0,d.useRef)([]),w=(0,d.useReducer)(G,{__demoMode:h,popoverState:h?0:1,buttons:x,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:(0,d.createRef)(),afterPanelSentinel:(0,d.createRef)()}),[{popoverState:S,button:E,buttonId:O,panel:_,panelId:N,beforePanelSentinel:A,afterPanelSentinel:M},I]=w,D=v(null!=(n=g.current)?n:E),z=(0,d.useMemo)(()=>{if(!E||!_)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(E))^Number(null==e?void 0:e.contains(_)))return!0;let e=(0,L.GO)(),t=e.indexOf(E),n=(t+e.length-1)%e.length,r=(t+1)%e.length,o=e[n],a=e[r];return!_.contains(o)&&!_.contains(a)},[E,_]),B=(0,j.E)(O),F=(0,j.E)(N),H=(0,d.useMemo)(()=>({buttonId:B,panelId:F,close:()=>I({type:1})}),[B,F,I]),W=V(),K=null==W?void 0:W.registerPopover,$=(0,p.z)(()=>{var e;return null!=(e=null==W?void 0:W.isFocusWithinPopoverGroup())?e:(null==D?void 0:D.activeElement)&&((null==E?void 0:E.contains(D.activeElement))||(null==_?void 0:_.contains(D.activeElement)))});(0,d.useEffect)(()=>null==K?void 0:K(H),[K,H]);let[Y,Q]=(i=(0,d.useContext)(C),l=(0,d.useRef)([]),s=(0,p.z)(e=>(l.current.push(e),i&&i.register(e),()=>c(e))),c=(0,p.z)(e=>{let t=l.current.indexOf(e);-1!==t&&l.current.splice(t,1),i&&i.unregister(e)}),u=(0,d.useMemo)(()=>({register:s,unregister:c,portals:l}),[s,c,l]),[l,(0,d.useMemo)(()=>function(e){let{children:t}=e;return d.createElement(C.Provider,{value:u},t)},[u])]),J=function(){var e;let{defaultContainers:t=[],portals:n,mainTreeNodeRef:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(0,d.useRef)(null!=(e=null==r?void 0:r.current)?e:null),a=v(o),i=(0,p.z)(()=>{var e,r,i;let l=[];for(let e of t)null!==e&&(e instanceof HTMLElement?l.push(e):"current"in e&&e.current instanceof HTMLElement&&l.push(e.current));if(null!=n&&n.current)for(let e of n.current)l.push(e);for(let t of null!=(e=null==a?void 0:a.querySelectorAll("html > *, body > *"))?e:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(o.current)||t.contains(null==(i=null==(r=o.current)?void 0:r.getRootNode())?void 0:i.host)||l.some(e=>t.contains(e))||l.push(t));return l});return{resolveContainers:i,contains:(0,p.z)(e=>i().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:(0,d.useMemo)(()=>function(){return null!=r?null:d.createElement(T._,{features:T.A.Hidden,ref:o})},[o,r])}}({mainTreeNodeRef:null==W?void 0:W.mainTreeNodeRef,portals:Y,defaultContainers:[E,_]});r=null==D?void 0:D.defaultView,o="focus",a=e=>{var t,n,r,o;e.target!==window&&e.target instanceof HTMLElement&&0===S&&($()||E&&_&&(J.contains(e.target)||null!=(n=null==(t=A.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(o=null==(r=M.current)?void 0:r.contains)&&o.call(r,e.target)||I({type:1})))},f=(0,j.E)(a),(0,d.useEffect)(()=>{function e(e){f.current(e)}return(r=null!=r?r:window).addEventListener(o,e,!0),()=>r.removeEventListener(o,e,!0)},[r,o,!0]),(0,P.O)(J.resolveContainers,(e,t)=>{I({type:1}),(0,L.sP)(t,L.tJ.Loose)||(e.preventDefault(),null==E||E.focus())},0===S);let ee=(0,p.z)(e=>{I({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:E:E;null==t||t.focus()}),et=(0,d.useMemo)(()=>({close:ee,isPortalled:z}),[ee,z]),en=(0,d.useMemo)(()=>({open:0===S,close:ee}),[S,ee]);return d.createElement(X.Provider,{value:null},d.createElement(q.Provider,{value:w},d.createElement(U.Provider,{value:et},d.createElement(R.up,{value:(0,Z.E)(S,{0:R.ZM.Open,1:R.ZM.Closed})},d.createElement(Q,null,(0,k.sY)({ourProps:{ref:y},theirProps:m,slot:en,defaultTag:"div",name:"Popover"}),d.createElement(J.MainTreeNode,null))))))}),{Button:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-button-".concat(n),...o}=e,[a,i]=W("Popover.Button"),{isPortalled:l}=K("Popover.Button"),s=(0,d.useRef)(null),c="headlessui-focus-sentinel-".concat((0,_.M)()),u=V(),f=null==u?void 0:u.closeOthers,h=null!==(0,d.useContext)(X);(0,d.useEffect)(()=>{if(!h)return i({type:3,buttonId:r}),()=>{i({type:3,buttonId:null})}},[h,r,i]);let[m]=(0,d.useState)(()=>Symbol()),g=(0,b.T)(s,t,h?null:e=>{if(e)a.buttons.current.push(m);else{let e=a.buttons.current.indexOf(m);-1!==e&&a.buttons.current.splice(e,1)}a.buttons.current.length>1&&console.warn("You are already using a but only 1 is supported."),e&&i({type:2,button:e})}),y=(0,b.T)(s,t),x=v(s),w=(0,p.z)(e=>{var t,n,r;if(h){if(1===a.popoverState)return;switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),i({type:1}),null==(r=a.button)||r.focus()}}else switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),e.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0});break;case z.R.Escape:if(0!==a.popoverState)return null==f?void 0:f(a.buttonId);if(!s.current||null!=x&&x.activeElement&&!s.current.contains(x.activeElement))return;e.preventDefault(),e.stopPropagation(),i({type:1})}}),S=(0,p.z)(e=>{h||e.key===z.R.Space&&e.preventDefault()}),E=(0,p.z)(t=>{var n,r;(0,D.P)(t.currentTarget)||e.disabled||(h?(i({type:1}),null==(n=a.button)||n.focus()):(t.preventDefault(),t.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0}),null==(r=a.button)||r.focus()))}),O=(0,p.z)(e=>{e.preventDefault(),e.stopPropagation()}),C=0===a.popoverState,j=(0,d.useMemo)(()=>({open:C}),[C]),P=(0,N.f)(e,s),A=h?{ref:y,type:P,onKeyDown:w,onClick:E}:{ref:g,id:a.buttonId,type:P,"aria-expanded":0===a.popoverState,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:w,onKeyUp:S,onClick:E,onMouseDown:O},R=I(),B=(0,p.z)(()=>{let e=a.panel;e&&(0,Z.E)(R.current,{[M.Forwards]:()=>(0,L.jA)(e,L.TO.First),[M.Backwards]:()=>(0,L.jA)(e,L.TO.Last)})===L.fE.Error&&(0,L.jA)((0,L.GO)().filter(e=>"true"!==e.dataset.headlessuiFocusGuard),(0,Z.E)(R.current,{[M.Forwards]:L.TO.Next,[M.Backwards]:L.TO.Previous}),{relativeTo:a.button})});return d.createElement(d.Fragment,null,(0,k.sY)({ourProps:A,theirProps:o,slot:j,defaultTag:"button",name:"Popover.Button"}),C&&!h&&l&&d.createElement(T._,{id:c,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:B}))}),Overlay:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-overlay-".concat(n),...o}=e,[{popoverState:a},i]=W("Popover.Overlay"),l=(0,b.T)(t),s=(0,R.oJ)(),c=null!==s?(s&R.ZM.Open)===R.ZM.Open:0===a,u=(0,p.z)(e=>{if((0,D.P)(e.currentTarget))return e.preventDefault();i({type:1})}),f=(0,d.useMemo)(()=>({open:0===a}),[a]);return(0,k.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0,onClick:u},theirProps:o,slot:f,defaultTag:"div",features:Y,visible:c,name:"Popover.Overlay"})}),Panel:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-panel-".concat(n),focus:o=!1,...a}=e,[i,l]=W("Popover.Panel"),{close:s,isPortalled:c}=K("Popover.Panel"),u="headlessui-focus-sentinel-before-".concat((0,_.M)()),f="headlessui-focus-sentinel-after-".concat((0,_.M)()),m=(0,d.useRef)(null),g=(0,b.T)(m,t,e=>{l({type:4,panel:e})}),y=v(m),x=(0,k.Y2)();(0,h.e)(()=>(l({type:5,panelId:r}),()=>{l({type:5,panelId:null})}),[r,l]);let w=(0,R.oJ)(),S=null!==w?(w&R.ZM.Open)===R.ZM.Open:0===i.popoverState,E=(0,p.z)(e=>{var t;if(e.key===z.R.Escape){if(0!==i.popoverState||!m.current||null!=y&&y.activeElement&&!m.current.contains(y.activeElement))return;e.preventDefault(),e.stopPropagation(),l({type:1}),null==(t=i.button)||t.focus()}});(0,d.useEffect)(()=>{var t;e.static||1===i.popoverState&&(null==(t=e.unmount)||t)&&l({type:4,panel:null})},[i.popoverState,e.unmount,e.static,l]),(0,d.useEffect)(()=>{if(i.__demoMode||!o||0!==i.popoverState||!m.current)return;let e=null==y?void 0:y.activeElement;m.current.contains(e)||(0,L.jA)(m.current,L.TO.First)},[i.__demoMode,o,m,i.popoverState]);let O=(0,d.useMemo)(()=>({open:0===i.popoverState,close:s}),[i,s]),C={ref:g,id:r,onKeyDown:E,onBlur:o&&0===i.popoverState?e=>{var t,n,r,o,a;let s=e.relatedTarget;s&&m.current&&(null!=(t=m.current)&&t.contains(s)||(l({type:1}),(null!=(r=null==(n=i.beforePanelSentinel.current)?void 0:n.contains)&&r.call(n,s)||null!=(a=null==(o=i.afterPanelSentinel.current)?void 0:o.contains)&&a.call(o,s))&&s.focus({preventScroll:!0})))}:void 0,tabIndex:-1},j=I(),P=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var t;(0,L.jA)(e,L.TO.First)===L.fE.Error&&(null==(t=i.afterPanelSentinel.current)||t.focus())},[M.Backwards]:()=>{var e;null==(e=i.button)||e.focus({preventScroll:!0})}})}),N=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var e;if(!i.button)return;let t=(0,L.GO)(),n=t.indexOf(i.button),r=t.slice(0,n+1),o=[...t.slice(n+1),...r];for(let t of o.slice())if("true"===t.dataset.headlessuiFocusGuard||null!=(e=i.panel)&&e.contains(t)){let e=o.indexOf(t);-1!==e&&o.splice(e,1)}(0,L.jA)(o,L.TO.First,{sorted:!1})},[M.Backwards]:()=>{var t;(0,L.jA)(e,L.TO.Previous)===L.fE.Error&&(null==(t=i.button)||t.focus())}})});return d.createElement(X.Provider,{value:r},S&&c&&d.createElement(T._,{id:u,ref:i.beforePanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:P}),(0,k.sY)({mergeRefs:x,ourProps:C,theirProps:a,slot:O,defaultTag:"div",features:Q,visible:S,name:"Popover.Panel"}),S&&c&&d.createElement(T._,{id:f,ref:i.afterPanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:N}))}),Group:(0,k.yV)(function(e,t){let n;let r=(0,d.useRef)(null),o=(0,b.T)(r,t),[a,i]=(0,d.useState)([]),l={mainTreeNodeRef:n=(0,d.useRef)(null),MainTreeNode:(0,d.useMemo)(()=>function(){return d.createElement(T._,{features:T.A.Hidden,ref:n})},[n])},s=(0,p.z)(e=>{i(t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t})}),c=(0,p.z)(e=>(i(t=>[...t,e]),()=>s(e))),u=(0,p.z)(()=>{var e;let t=(0,g.r)(r);if(!t)return!1;let n=t.activeElement;return!!(null!=(e=r.current)&&e.contains(n))||a.some(e=>{var r,o;return(null==(r=t.getElementById(e.buttonId.current))?void 0:r.contains(n))||(null==(o=t.getElementById(e.panelId.current))?void 0:o.contains(n))})}),f=(0,p.z)(e=>{for(let t of a)t.buttonId.current!==e&&t.close()}),h=(0,d.useMemo)(()=>({registerPopover:c,unregisterPopover:s,isFocusWithinPopoverGroup:u,closeOthers:f,mainTreeNodeRef:l.mainTreeNodeRef}),[c,s,u,f,l.mainTreeNodeRef]),m=(0,d.useMemo)(()=>({}),[]);return d.createElement($.Provider,{value:h},(0,k.sY)({ourProps:{ref:o},theirProps:e,slot:m,defaultTag:"div",name:"Popover.Group"}),d.createElement(l.MainTreeNode,null))})});var ee=n(33044),et=n(28517);let en=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};var er=n(4537),eo=n(99735),ea=n(7656);function ei(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setHours(0,0,0,0),t}function el(){return ei(Date.now())}function es(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setDate(1),t.setHours(0,0,0,0),t}var ec=n(97324),eu=n(96398),ed=n(41154);function ef(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ed.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||nt||isNaN(t.getDate()))&&(n=t)}),n||new Date(NaN)}var eh=n(25721),em=n(47869);function eg(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,-n)}var ev=n(55463);function ey(e,t){if((0,ea.Z)(2,arguments),!t||"object"!==(0,ed.Z)(t))return new Date(NaN);var n=t.years?(0,em.Z)(t.years):0,r=t.months?(0,em.Z)(t.months):0,o=t.weeks?(0,em.Z)(t.weeks):0,a=t.days?(0,em.Z)(t.days):0,i=t.hours?(0,em.Z)(t.hours):0,l=t.minutes?(0,em.Z)(t.minutes):0,s=t.seconds?(0,em.Z)(t.seconds):0;return new Date(eg(function(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,-n)}(e,r+12*n),a+7*o).getTime()-1e3*(s+60*(l+60*i)))}function eb(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ex(e){return(0,ea.Z)(1,arguments),e instanceof Date||"object"===(0,ed.Z)(e)&&"[object Date]"===Object.prototype.toString.call(e)}function ew(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCDay();return t.setUTCDate(t.getUTCDate()-((n<1?7:0)+n-1)),t.setUTCHours(0,0,0,0),t}function ek(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=ew(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=ew(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}var eS={};function eE(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getUTCDay();return d.setUTCDate(d.getUTCDate()-((f=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var h=eE(p,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var g=eE(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}function eC(e,t){for(var n=Math.abs(e).toString();n.length0?n:1-n;return eC("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):eC(n+1,2)},d:function(e,t){return eC(e.getUTCDate(),t.length)},h:function(e,t){return eC(e.getUTCHours()%12||12,t.length)},H:function(e,t){return eC(e.getUTCHours(),t.length)},m:function(e,t){return eC(e.getUTCMinutes(),t.length)},s:function(e,t){return eC(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length;return eC(Math.floor(e.getUTCMilliseconds()*Math.pow(10,n-3)),t.length)}},e_={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function eP(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+(t||"")+eC(a,2)}function eN(e,t){return e%60==0?(e>0?"-":"+")+eC(Math.abs(e)/60,2):eT(e,t)}function eT(e,t){var n=Math.abs(e);return(e>0?"-":"+")+eC(Math.floor(n/60),2)+(t||"")+eC(n%60,2)}var eA={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return ej.y(e,t)},Y:function(e,t,n,r){var o=eO(e,r),a=o>0?o:1-o;return"YY"===t?eC(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):eC(a,t.length)},R:function(e,t){return eC(ek(e),t.length)},u:function(e,t){return eC(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return eC(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return eC(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return ej.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return eC(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((eE(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=eO(e,t),f=new Date(0);return f.setUTCFullYear(d,0,u),f.setUTCHours(0,0,0,0),eE(f,t)})(n,t).getTime())/6048e5)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):eC(o,t.length)},I:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((ew(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=ek(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),ew(n)})(t).getTime())/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):eC(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):ej.d(e,t)},D:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getTime();return t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),Math.floor((n-t.getTime())/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):eC(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return eC(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return eC(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return eC(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?e_.noon:0===o?e_.midnight:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?e_.evening:o>=12?e_.afternoon:o>=4?e_.morning:e_.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ej.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ej.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):ej.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):ej.s(e,t)},S:function(e,t){return ej.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return eN(o);case"XXXX":case"XX":return eT(o);default:return eT(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return eN(o);case"xxxx":case"xx":return eT(o);default:return eT(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},t:function(e,t,n,r){return eC(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return eC((r._originalDate||e).getTime(),t.length)}},eM=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},eI=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},eR={p:eI,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],a=r[2];if(!a)return eM(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",eM(o,t)).replace("{{time}}",eI(a,t))}};function eD(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var eL=["D","DD"],eZ=["YY","YYYY"];function ez(e,t,n){if("YYYY"===e)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var eB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function eF(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var eH={date:eF({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:eF({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:eF({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},eq={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function eW(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=null!=n&&n.width?String(n.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var i=e.defaultWidth,l=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[i]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function eU(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var l=i[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?function(e,t){for(var n=0;n0?"in "+r:r+" ago":r},formatLong:eH,formatRelative:function(e,t,n,r){return eq[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:eW({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:eW({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:eW({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:eW({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:eW({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(i={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(i.matchPattern);if(!n)return null;var r=n[0],o=e.match(i.parsePattern);if(!o)return null;var a=i.valueCallback?i.valueCallback(o[0]):o[0];return{value:a=t.valueCallback?t.valueCallback(a):a,rest:e.slice(r.length)}}),era:eU({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:eU({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:eU({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:eU({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:eU({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},e$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eX=/^'([^]*?)'?$/,eG=/''/g,eY=/[a-zA-Z]/;function eQ(e,t,n){(0,ea.Z)(2,arguments);var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w=String(t),k=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:eS.locale)&&void 0!==r?r:eK,S=(0,em.Z)(null!==(a=null!==(i=null!==(l=null!==(s=null==n?void 0:n.firstWeekContainsDate)&&void 0!==s?s:null==n?void 0:null===(c=n.locale)||void 0===c?void 0:null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==l?l:eS.firstWeekContainsDate)&&void 0!==i?i:null===(d=eS.locale)||void 0===d?void 0:null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==a?a:1);if(!(S>=1&&S<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=(0,em.Z)(null!==(p=null!==(h=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n?void 0:null===(v=n.locale)||void 0===v?void 0:null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:eS.weekStartsOn)&&void 0!==h?h:null===(b=eS.locale)||void 0===b?void 0:null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(E>=0&&E<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw RangeError("locale must contain localize property");if(!k.formatLong)throw RangeError("locale must contain formatLong property");var O=(0,eo.Z)(e);if(!function(e){return(0,ea.Z)(1,arguments),(!!ex(e)||"number"==typeof e)&&!isNaN(Number((0,eo.Z)(e)))}(O))throw RangeError("Invalid time value");var C=eD(O),j=function(e,t){return(0,ea.Z)(2,arguments),function(e,t){return(0,ea.Z)(2,arguments),new Date((0,eo.Z)(e).getTime()+(0,em.Z)(t))}(e,-(0,em.Z)(t))}(O,C),_={firstWeekContainsDate:S,weekStartsOn:E,locale:k,_originalDate:O};return w.match(eV).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,eR[t])(e,k.formatLong):e}).join("").match(e$).map(function(r){if("''"===r)return"'";var o,a=r[0];if("'"===a)return(o=r.match(eX))?o[1].replace(eG,"'"):r;var i=eA[a];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===eZ.indexOf(r)||ez(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||-1===eL.indexOf(r)||ez(r,t,String(e)),i(j,r,k.localize,_);if(a.match(eY))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r}).join("")}var eJ=n(1153);let e0=(0,eJ.fn)("DateRangePicker"),e1=(e,t,n,r)=>{var o;if(n&&(e=null===(o=r.get(n))||void 0===o?void 0:o.from),e)return ei(e&&!t?e:ef([e,t]))},e2=(e,t,n,r)=>{var o,a;if(n&&(e=ei(null!==(a=null===(o=r.get(n))||void 0===o?void 0:o.to)&&void 0!==a?a:el())),e)return ei(e&&!t?e:ep([e,t]))},e6=[{value:"tdy",text:"Today",from:el()},{value:"w",text:"Last 7 days",from:ey(el(),{days:7})},{value:"t",text:"Last 30 days",from:ey(el(),{days:30})},{value:"m",text:"Month to Date",from:es(el())},{value:"y",text:"Year to Date",from:eb(el())}],e4=(e,t,n,r)=>{let o=(null==n?void 0:n.code)||"en-US";if(!e&&!t)return"";if(e&&!t)return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e&&t){if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()===r.getTime()}(e,t))return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())return r?"".concat(eQ(e,r)," - ").concat(eQ(t,r)):"".concat(e.toLocaleDateString(o,{month:"short",day:"numeric"})," - \n ").concat(t.getDate(),", ").concat(t.getFullYear());{if(r)return"".concat(eQ(e,r)," - ").concat(eQ(t,r));let n={year:"numeric",month:"short",day:"numeric"};return"".concat(e.toLocaleDateString(o,n)," - \n ").concat(t.toLocaleDateString(o,n))}}return""};function e3(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function e5(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t),o=n.getFullYear(),a=n.getDate(),i=new Date(0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);var l=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(i);return n.setMonth(r,Math.min(a,l)),n}function e8(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function e7(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function e9(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function te(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()-((fr.getTime()}function ta(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return Math.round((n.getTime()-eD(n)-(r.getTime()-eD(r)))/864e5)}function ti(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,7*n)}function tl(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,12*n)}function ts(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()+((fe7(l,i)&&(i=(0,ev.Z)(l,-1*((void 0===c?1:c)-1))),s&&0>e7(i,s)&&(i=s),u=es(i),f=t.month,h=(p=(0,d.useState)(u))[0],m=[void 0===f?h:f,p[1]])[0],v=m[1],[g,function(e){if(!t.disableNavigation){var n,r=es(e);v(r),null===(n=t.onMonthChange)||void 0===n||n.call(t,r)}}]),x=b[0],w=b[1],k=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=es(e),a=e7(es((0,ev.Z)(o,r)),o),i=[],l=0;l=e7(a,n)))return(0,ev.Z)(a,-(r?void 0===o?1:o:1))}}(x,y),O=function(e){return k.some(function(t){return e9(e,t)})};return th.jsx(tP.Provider,{value:{currentMonth:x,displayMonths:k,goToMonth:w,goToDate:function(e,t){O(e)||(t&&te(e,t)?w((0,ev.Z)(e,1+-1*y.numberOfMonths)):w(e))},previousMonth:E,nextMonth:S,isDateDisplayed:O},children:e.children})}function tT(){var e=(0,d.useContext)(tP);if(!e)throw Error("useNavigation must be used within a NavigationProvider");return e}function tA(e){var t,n=tS(),r=n.classNames,o=n.styles,a=n.components,i=tT().goToMonth,l=function(t){i((0,ev.Z)(t,e.displayIndex?-e.displayIndex:0))},s=null!==(t=null==a?void 0:a.CaptionLabel)&&void 0!==t?t:tE,c=th.jsx(s,{id:e.id,displayMonth:e.displayMonth});return th.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[th.jsx("div",{className:r.vhidden,children:c}),th.jsx(tj,{onChange:l,displayMonth:e.displayMonth}),th.jsx(t_,{onChange:l,displayMonth:e.displayMonth})]})}function tM(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tI(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var tR=(0,d.forwardRef)(function(e,t){var n=tS(),r=n.classNames,o=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var i=a.join(" "),l=tu(tu({},o.button_reset),o.button);return e.style&&Object.assign(l,e.style),th.jsx("button",tu({},e,{ref:t,type:"button",className:i,style:l}))});function tD(e){var t,n,r=tS(),o=r.dir,a=r.locale,i=r.classNames,l=r.styles,s=r.labels,c=s.labelPrevious,u=s.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return th.jsx(th.Fragment,{});var f=c(e.previousMonth,{locale:a}),p=[i.nav_button,i.nav_button_previous].join(" "),h=u(e.nextMonth,{locale:a}),m=[i.nav_button,i.nav_button_next].join(" "),g=null!==(t=null==d?void 0:d.IconRight)&&void 0!==t?t:tI,v=null!==(n=null==d?void 0:d.IconLeft)&&void 0!==n?n:tM;return th.jsxs("div",{className:i.nav,style:l.nav,children:[!e.hidePrevious&&th.jsx(tR,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===o?th.jsx(g,{className:i.nav_icon,style:l.nav_icon}):th.jsx(v,{className:i.nav_icon,style:l.nav_icon})}),!e.hideNext&&th.jsx(tR,{name:"next-month","aria-label":h,className:m,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===o?th.jsx(v,{className:i.nav_icon,style:l.nav_icon}):th.jsx(g,{className:i.nav_icon,style:l.nav_icon})})]})}function tL(e){var t=tS().numberOfMonths,n=tT(),r=n.previousMonth,o=n.nextMonth,a=n.goToMonth,i=n.displayMonths,l=i.findIndex(function(t){return e9(e.displayMonth,t)}),s=0===l,c=l===i.length-1;return th.jsx(tD,{displayMonth:e.displayMonth,hideNext:t>1&&(s||!c),hidePrevious:t>1&&(c||!s),nextMonth:o,previousMonth:r,onPreviousClick:function(){r&&a(r)},onNextClick:function(){o&&a(o)}})}function tZ(e){var t,n,r=tS(),o=r.classNames,a=r.disableNavigation,i=r.styles,l=r.captionLayout,s=r.components,c=null!==(t=null==s?void 0:s.CaptionLabel)&&void 0!==t?t:tE;return n=a?th.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?th.jsx(tA,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?th.jsxs(th.Fragment,{children:[th.jsx(tA,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),th.jsx(tL,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):th.jsxs(th.Fragment,{children:[th.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(tL,{displayMonth:e.displayMonth,id:e.id})]}),th.jsx("div",{className:o.caption,style:i.caption,children:n})}function tz(e){var t=tS(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?th.jsx("tfoot",{className:o,style:r.tfoot,children:th.jsx("tr",{children:th.jsx("td",{colSpan:8,children:n})})}):th.jsx(th.Fragment,{})}function tB(){var e=tS(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,a=e.weekStartsOn,i=e.ISOWeek,l=e.formatters.formatWeekdayName,s=e.labels.labelWeekday,c=function(e,t,n){for(var r=n?tn(new Date):tt(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=(0,eh.Z)(r,a);o.push(i)}return o}(o,a,i);return th.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&th.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(e,r){return th.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":s(e,{locale:o}),children:l(e,{locale:o})},r)})]})}function tF(){var e,t=tS(),n=t.classNames,r=t.styles,o=t.components,a=null!==(e=null==o?void 0:o.HeadRow)&&void 0!==e?e:tB;return th.jsx("thead",{style:r.head,className:n.head,children:th.jsx(a,{})})}function tH(e){var t=tS(),n=t.locale,r=t.formatters.formatDay;return th.jsx(th.Fragment,{children:r(e.date,{locale:n})})}var tq=(0,d.createContext)(void 0);function tW(e){return tm(e.initialProps)?th.jsx(tU,{initialProps:e.initialProps,children:e.children}):th.jsx(tq.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}function tU(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,a=t.max,i={disabled:[]};return r&&i.disabled.push(function(e){var t=a&&r.length>a-1,n=r.some(function(t){return tr(t,e)});return!!(t&&!n)}),th.jsx(tq.Provider,{value:{selected:r,onDayClick:function(e,n,i){if(null===(l=t.onDayClick)||void 0===l||l.call(t,e,n,i),(!n.selected||!o||(null==r?void 0:r.length)!==o)&&(n.selected||!a||(null==r?void 0:r.length)!==a)){var l,s,c=r?td([],r,!0):[];if(n.selected){var u=c.findIndex(function(t){return tr(e,t)});c.splice(u,1)}else c.push(e);null===(s=t.onSelect)||void 0===s||s.call(t,c,e,n,i)}},modifiers:i},children:n})}function tK(){var e=(0,d.useContext)(tq);if(!e)throw Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var t$=(0,d.createContext)(void 0);function tV(e){return tg(e.initialProps)?th.jsx(tX,{initialProps:e.initialProps,children:e.children}):th.jsx(t$.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}function tX(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},a=o.from,i=o.to,l=t.min,s=t.max,c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(c.range_start=[a],i?(c.range_end=[i],tr(a,i)||(c.range_middle=[{after:a,before:i}])):c.range_end=[a]):i&&(c.range_start=[i],c.range_end=[i]),l&&(a&&!i&&c.disabled.push({after:eg(a,l-1),before:(0,eh.Z)(a,l-1)}),a&&i&&c.disabled.push({after:a,before:(0,eh.Z)(a,l-1)}),!a&&i&&c.disabled.push({after:eg(i,l-1),before:(0,eh.Z)(i,l-1)})),s){if(a&&!i&&(c.disabled.push({before:(0,eh.Z)(a,-s+1)}),c.disabled.push({after:(0,eh.Z)(a,s-1)})),a&&i){var u=s-(ta(i,a)+1);c.disabled.push({before:eg(a,u)}),c.disabled.push({after:(0,eh.Z)(i,u)})}!a&&i&&(c.disabled.push({before:(0,eh.Z)(i,-s+1)}),c.disabled.push({after:(0,eh.Z)(i,s-1)}))}return th.jsx(t$.Provider,{value:{selected:r,onDayClick:function(e,n,o){null===(s=t.onDayClick)||void 0===s||s.call(t,e,n,o);var a,i,l,s,c,u=(i=(a=r||{}).from,l=a.to,i&&l?tr(l,e)&&tr(i,e)?void 0:tr(l,e)?{from:l,to:void 0}:tr(i,e)?void 0:to(i,e)?{from:e,to:l}:{from:i,to:e}:l?to(e,l)?{from:l,to:e}:{from:e,to:l}:i?te(e,i)?{from:e,to:i}:{from:i,to:e}:{from:e,to:void 0});null===(c=t.onSelect)||void 0===c||c.call(t,u,e,n,o)},modifiers:c},children:n})}function tG(){var e=(0,d.useContext)(t$);if(!e)throw Error("useSelectRange must be used within a SelectRangeProvider");return e}function tY(e){return Array.isArray(e)?td([],e,!0):void 0!==e?[e]:[]}(l=c||(c={})).Outside="outside",l.Disabled="disabled",l.Selected="selected",l.Hidden="hidden",l.Today="today",l.RangeStart="range_start",l.RangeEnd="range_end",l.RangeMiddle="range_middle";var tQ=c.Selected,tJ=c.Disabled,t0=c.Hidden,t1=c.Today,t2=c.RangeEnd,t6=c.RangeMiddle,t4=c.RangeStart,t3=c.Outside,t5=(0,d.createContext)(void 0);function t8(e){var t,n,r,o=tS(),a=tK(),i=tG(),l=((t={})[tQ]=tY(o.selected),t[tJ]=tY(o.disabled),t[t0]=tY(o.hidden),t[t1]=[o.today],t[t2]=[],t[t6]=[],t[t4]=[],t[t3]=[],o.fromDate&&t[tJ].push({before:o.fromDate}),o.toDate&&t[tJ].push({after:o.toDate}),tm(o)?t[tJ]=t[tJ].concat(a.modifiers[tJ]):tg(o)&&(t[tJ]=t[tJ].concat(i.modifiers[tJ]),t[t4]=i.modifiers[t4],t[t6]=i.modifiers[t6],t[t2]=i.modifiers[t2]),t),s=(n=o.modifiers,r={},Object.entries(n).forEach(function(e){var t=e[0],n=e[1];r[t]=tY(n)}),r),c=tu(tu({},l),s);return th.jsx(t5.Provider,{value:c,children:e.children})}function t7(){var e=(0,d.useContext)(t5);if(!e)throw Error("useModifiers must be used within a ModifiersProvider");return e}function t9(e,t,n){var r=Object.keys(t).reduce(function(n,r){return t[r].some(function(t){if("boolean"==typeof t)return t;if(ex(t))return tr(e,t);if(Array.isArray(t)&&t.every(ex))return t.includes(e);if(t&&"object"==typeof t&&"from"in t)return r=t.from,o=t.to,r&&o?(0>ta(o,r)&&(r=(n=[o,r])[0],o=n[1]),ta(e,r)>=0&&ta(o,e)>=0):o?tr(o,e):!!r&&tr(r,e);if(t&&"object"==typeof t&&"dayOfWeek"in t)return t.dayOfWeek.includes(e.getDay());if(t&&"object"==typeof t&&"before"in t&&"after"in t){var n,r,o,a=ta(t.before,e),i=ta(t.after,e),l=a>0,s=i<0;return to(t.before,t.after)?s&&l:l||s}return t&&"object"==typeof t&&"after"in t?ta(e,t.after)>0:t&&"object"==typeof t&&"before"in t?ta(t.before,e)>0:"function"==typeof t&&t(e)})&&n.push(r),n},[]),o={};return r.forEach(function(e){return o[e]=!0}),n&&!e9(e,n)&&(o.outside=!0),o}var ne=(0,d.createContext)(void 0);function nt(e){var t=tT(),n=t7(),r=(0,d.useState)(),o=r[0],a=r[1],i=(0,d.useState)(),l=i[0],s=i[1],c=function(e,t){for(var n,r,o=es(e[0]),a=e3(e[e.length-1]),i=o;i<=a;){var l=t9(i,t);if(!(!l.disabled&&!l.hidden)){i=(0,eh.Z)(i,1);continue}if(l.selected)return i;l.today&&!r&&(r=i),n||(n=i),i=(0,eh.Z)(i,1)}return r||n}(t.displayMonths,n),u=(null!=o?o:l&&t.isDateDisplayed(l))?l:c,f=function(e){a(e)},p=tS(),h=function(e,r){if(o){var a=function e(t,n){var r=n.moveBy,o=n.direction,a=n.context,i=n.modifiers,l=n.retry,s=void 0===l?{count:0,lastFocused:t}:l,c=a.weekStartsOn,u=a.fromDate,d=a.toDate,f=a.locale,p=({day:eh.Z,week:ti,month:ev.Z,year:tl,startOfWeek:function(e){return a.ISOWeek?tn(e):tt(e,{locale:f,weekStartsOn:c})},endOfWeek:function(e){return a.ISOWeek?tc(e):ts(e,{locale:f,weekStartsOn:c})}})[r](t,"after"===o?1:-1);"before"===o&&u?p=ef([u,p]):"after"===o&&d&&(p=ep([d,p]));var h=!0;if(i){var m=t9(p,i);h=!m.disabled&&!m.hidden}return h?p:s.count>365?s.lastFocused:e(p,{moveBy:r,direction:o,context:a,modifiers:i,retry:tu(tu({},s),{count:s.count+1})})}(o,{moveBy:e,direction:r,context:p,modifiers:n});tr(o,a)||(t.goToDate(a,o),f(a))}};return th.jsx(ne.Provider,{value:{focusedDay:o,focusTarget:u,blur:function(){s(o),a(void 0)},focus:f,focusDayAfter:function(){return h("day","after")},focusDayBefore:function(){return h("day","before")},focusWeekAfter:function(){return h("week","after")},focusWeekBefore:function(){return h("week","before")},focusMonthBefore:function(){return h("month","before")},focusMonthAfter:function(){return h("month","after")},focusYearBefore:function(){return h("year","before")},focusYearAfter:function(){return h("year","after")},focusStartOfWeek:function(){return h("startOfWeek","before")},focusEndOfWeek:function(){return h("endOfWeek","after")}},children:e.children})}function nn(){var e=(0,d.useContext)(ne);if(!e)throw Error("useFocusContext must be used within a FocusProvider");return e}var nr=(0,d.createContext)(void 0);function no(e){return tv(e.initialProps)?th.jsx(na,{initialProps:e.initialProps,children:e.children}):th.jsx(nr.Provider,{value:{selected:void 0},children:e.children})}function na(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var o,a,i;if(null===(o=t.onDayClick)||void 0===o||o.call(t,e,n,r),n.selected&&!t.required){null===(a=t.onSelect)||void 0===a||a.call(t,void 0,e,n,r);return}null===(i=t.onSelect)||void 0===i||i.call(t,e,e,n,r)}};return th.jsx(nr.Provider,{value:r,children:n})}function ni(){var e=(0,d.useContext)(nr);if(!e)throw Error("useSelectSingle must be used within a SelectSingleProvider");return e}function nl(e){var t,n,r,o,a,i,l,s,u,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,j,_,P,N,T,A,M,I,R,D,L,Z,z,B,F,H,q,W,U=(0,d.useRef)(null),K=(t=e.date,n=e.displayMonth,i=tS(),l=nn(),s=t9(t,t7(),n),u=tS(),f=ni(),p=tK(),h=tG(),g=(m=nn()).focusDayAfter,v=m.focusDayBefore,y=m.focusWeekAfter,b=m.focusWeekBefore,x=m.blur,w=m.focus,k=m.focusMonthBefore,S=m.focusMonthAfter,E=m.focusYearBefore,O=m.focusYearAfter,C=m.focusStartOfWeek,j=m.focusEndOfWeek,_={onClick:function(e){var n,r,o,a;tv(u)?null===(n=f.onDayClick)||void 0===n||n.call(f,t,s,e):tm(u)?null===(r=p.onDayClick)||void 0===r||r.call(p,t,s,e):tg(u)?null===(o=h.onDayClick)||void 0===o||o.call(h,t,s,e):null===(a=u.onDayClick)||void 0===a||a.call(u,t,s,e)},onFocus:function(e){var n;w(t),null===(n=u.onDayFocus)||void 0===n||n.call(u,t,s,e)},onBlur:function(e){var n;x(),null===(n=u.onDayBlur)||void 0===n||n.call(u,t,s,e)},onKeyDown:function(e){var n;switch(e.key){case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?g():v();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?v():g();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),y();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),b();break;case"PageUp":e.preventDefault(),e.stopPropagation(),e.shiftKey?E():k();break;case"PageDown":e.preventDefault(),e.stopPropagation(),e.shiftKey?O():S();break;case"Home":e.preventDefault(),e.stopPropagation(),C();break;case"End":e.preventDefault(),e.stopPropagation(),j()}null===(n=u.onDayKeyDown)||void 0===n||n.call(u,t,s,e)},onKeyUp:function(e){var n;null===(n=u.onDayKeyUp)||void 0===n||n.call(u,t,s,e)},onMouseEnter:function(e){var n;null===(n=u.onDayMouseEnter)||void 0===n||n.call(u,t,s,e)},onMouseLeave:function(e){var n;null===(n=u.onDayMouseLeave)||void 0===n||n.call(u,t,s,e)},onPointerEnter:function(e){var n;null===(n=u.onDayPointerEnter)||void 0===n||n.call(u,t,s,e)},onPointerLeave:function(e){var n;null===(n=u.onDayPointerLeave)||void 0===n||n.call(u,t,s,e)},onTouchCancel:function(e){var n;null===(n=u.onDayTouchCancel)||void 0===n||n.call(u,t,s,e)},onTouchEnd:function(e){var n;null===(n=u.onDayTouchEnd)||void 0===n||n.call(u,t,s,e)},onTouchMove:function(e){var n;null===(n=u.onDayTouchMove)||void 0===n||n.call(u,t,s,e)},onTouchStart:function(e){var n;null===(n=u.onDayTouchStart)||void 0===n||n.call(u,t,s,e)}},P=tS(),N=ni(),T=tK(),A=tG(),M=tv(P)?N.selected:tm(P)?T.selected:tg(P)?A.selected:void 0,I=!!(i.onDayClick||"default"!==i.mode),(0,d.useEffect)(function(){var e;!s.outside&&l.focusedDay&&I&&tr(l.focusedDay,t)&&(null===(e=U.current)||void 0===e||e.focus())},[l.focusedDay,t,U,I,s.outside]),D=(R=[i.classNames.day],Object.keys(s).forEach(function(e){var t=i.modifiersClassNames[e];if(t)R.push(t);else if(Object.values(c).includes(e)){var n=i.classNames["day_".concat(e)];n&&R.push(n)}}),R).join(" "),L=tu({},i.styles.day),Object.keys(s).forEach(function(e){var t;L=tu(tu({},L),null===(t=i.modifiersStyles)||void 0===t?void 0:t[e])}),Z=L,z=!!(s.outside&&!i.showOutsideDays||s.hidden),B=null!==(a=null===(o=i.components)||void 0===o?void 0:o.DayContent)&&void 0!==a?a:tH,F={style:Z,className:D,children:th.jsx(B,{date:t,displayMonth:n,activeModifiers:s}),role:"gridcell"},H=l.focusTarget&&tr(l.focusTarget,t)&&!s.outside,q=l.focusedDay&&tr(l.focusedDay,t),W=tu(tu(tu({},F),((r={disabled:s.disabled,role:"gridcell"})["aria-selected"]=s.selected,r.tabIndex=q||H?0:-1,r)),_),{isButton:I,isHidden:z,activeModifiers:s,selectedDays:M,buttonProps:W,divProps:F});return K.isHidden?th.jsx("div",{role:"gridcell"}):K.isButton?th.jsx(tR,tu({name:"day",ref:U},K.buttonProps)):th.jsx("div",tu({},K.divProps))}function ns(e){var t=e.number,n=e.dates,r=tS(),o=r.onWeekNumberClick,a=r.styles,i=r.classNames,l=r.locale,s=r.labels.labelWeekNumber,c=(0,r.formatters.formatWeekNumber)(Number(t),{locale:l});if(!o)return th.jsx("span",{className:i.weeknumber,style:a.weeknumber,children:c});var u=s(Number(t),{locale:l});return th.jsx(tR,{name:"week-number","aria-label":u,className:i.weeknumber,style:a.weeknumber,onClick:function(e){o(t,n,e)},children:c})}function nc(e){var t,n,r,o=tS(),a=o.styles,i=o.classNames,l=o.showWeekNumber,s=o.components,c=null!==(t=null==s?void 0:s.Day)&&void 0!==t?t:nl,u=null!==(n=null==s?void 0:s.WeekNumber)&&void 0!==n?n:ns;return l&&(r=th.jsx("td",{className:i.cell,style:a.cell,children:th.jsx(u,{number:e.weekNumber,dates:e.dates})})),th.jsxs("tr",{className:i.row,style:a.row,children:[r,e.dates.map(function(t){return th.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:th.jsx(c,{displayMonth:e.displayMonth,date:t})},function(e){return(0,ea.Z)(1,arguments),Math.floor(function(e){return(0,ea.Z)(1,arguments),(0,eo.Z)(e).getTime()}(e)/1e3)}(t))})]})}function nu(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?tc(t):ts(t,n),o=(null==n?void 0:n.ISOWeek)?tn(e):tt(e,n),a=ta(r,o),i=[],l=0;l<=a;l++)i.push((0,eh.Z)(o,l));return i.reduce(function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((tn(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=tn(r),a=new Date(0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);var i=tn(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),tn(n)})(t).getTime())/6048e5)+1}(t):function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((tt(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,eo.Z)(e),d=u.getFullYear(),f=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var h=tt(p,t),m=new Date(0);m.setFullYear(d,0,f),m.setHours(0,0,0,0);var g=tt(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(d,0,u),f.setHours(0,0,0,0),tt(f,t)})(n,t).getTime())/6048e5)+1}(t,n),o=e.find(function(e){return e.weekNumber===r});return o?o.dates.push(t):e.push({weekNumber:r,dates:[t]}),e},[])}function nd(e){var t,n,r,o=tS(),a=o.locale,i=o.classNames,l=o.styles,s=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,f=o.firstWeekContainsDate,p=o.ISOWeek,h=function(e,t){var n=nu(es(e),e3(e),t);if(null==t?void 0:t.useFixedWeeks){var r=function(e,t){return(0,ea.Z)(1,arguments),function(e,t,n){(0,ea.Z)(2,arguments);var r=tt(e,n),o=tt(t,n);return Math.round((r.getTime()-eD(r)-(o.getTime()-eD(o)))/6048e5)}(function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),es(e),t)+1}(e,t);if(r<6){var o=n[n.length-1],a=o.dates[o.dates.length-1],i=ti(a,6-r),l=nu(ti(a,1),i,t);n.push.apply(n,l)}}return n}(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:a,weekStartsOn:d,firstWeekContainsDate:f}),m=null!==(t=null==u?void 0:u.Head)&&void 0!==t?t:tF,g=null!==(n=null==u?void 0:u.Row)&&void 0!==n?n:nc,v=null!==(r=null==u?void 0:u.Footer)&&void 0!==r?r:tz;return th.jsxs("table",{id:e.id,className:i.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!s&&th.jsx(m,{}),th.jsx("tbody",{className:i.tbody,style:l.tbody,children:h.map(function(t){return th.jsx(g,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),th.jsx(v,{displayMonth:e.displayMonth})]})}var nf="undefined"!=typeof window&&window.document&&window.document.createElement?d.useLayoutEffect:d.useEffect,np=!1,nh=0;function nm(){return"react-day-picker-".concat(++nh)}function ng(e){var t,n,r,o,a,i,l,s,c=tS(),u=c.dir,f=c.classNames,p=c.styles,h=c.components,m=tT().displayMonths,g=(r=null!=(t=c.id?"".concat(c.id,"-").concat(e.displayIndex):void 0)?t:np?nm():null,a=(o=(0,d.useState)(r))[0],i=o[1],nf(function(){null===a&&i(nm())},[]),(0,d.useEffect)(function(){!1===np&&(np=!0)},[]),null!==(n=null!=t?t:a)&&void 0!==n?n:void 0),v=c.id?"".concat(c.id,"-grid-").concat(e.displayIndex):void 0,y=[f.month],b=p.month,x=0===e.displayIndex,w=e.displayIndex===m.length-1,k=!x&&!w;"rtl"===u&&(w=(l=[x,w])[0],x=l[1]),x&&(y.push(f.caption_start),b=tu(tu({},b),p.caption_start)),w&&(y.push(f.caption_end),b=tu(tu({},b),p.caption_end)),k&&(y.push(f.caption_between),b=tu(tu({},b),p.caption_between));var S=null!==(s=null==h?void 0:h.Caption)&&void 0!==s?s:tZ;return th.jsxs("div",{className:y.join(" "),style:b,children:[th.jsx(S,{id:g,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(nd,{id:v,"aria-labelledby":g,displayMonth:e.displayMonth})]},e.displayIndex)}function nv(e){var t=tS(),n=t.classNames,r=t.styles;return th.jsx("div",{className:n.months,style:r.months,children:e.children})}function ny(e){var t,n,r=e.initialProps,o=tS(),a=nn(),i=tT(),l=(0,d.useState)(!1),s=l[0],c=l[1];(0,d.useEffect)(function(){o.initialFocus&&a.focusTarget&&(s||(a.focus(a.focusTarget),c(!0)))},[o.initialFocus,s,a.focus,a.focusTarget,a]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var f=tu(tu({},o.styles.root),o.style),p=Object.keys(r).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var n;return tu(tu({},e),((n={})[t]=r[t],n))},{}),h=null!==(n=null===(t=r.components)||void 0===t?void 0:t.Months)&&void 0!==n?n:nv;return th.jsx("div",tu({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:th.jsx(h,{children:i.displayMonths.map(function(e,t){return th.jsx(ng,{displayIndex:t,displayMonth:e},t)})})}))}function nb(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}(e,["children"]);return th.jsx(tk,{initialProps:n,children:th.jsx(tN,{children:th.jsx(no,{initialProps:n,children:th.jsx(tW,{initialProps:n,children:th.jsx(tV,{initialProps:n,children:th.jsx(t8,{children:th.jsx(nt,{children:t})})})})})})})}function nx(e){return th.jsx(nb,tu({},e,{children:th.jsx(ny,{initialProps:e})}))}let nw=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))},nk=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))},nS=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))},nE=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))};var nO=n(84264);n(41649);var nC=n(1526),nj=n(7084),n_=n(26898);let nP={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},nN={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},nT={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},nA={[nj.wu.Increase]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.ModerateIncrease]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.Decrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.ModerateDecrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.Unchanged]:{bgColor:(0,eJ.bM)(nj.fr.Orange,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Orange,n_.K.text).textColor}},nM={[nj.wu.Increase]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))},[nj.wu.ModerateIncrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))},[nj.wu.Decrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))},[nj.wu.ModerateDecrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))},[nj.wu.Unchanged]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))}},nI=(0,eJ.fn)("BadgeDelta");d.forwardRef((e,t)=>{let{deltaType:n=nj.wu.Increase,isIncreasePositive:r=!0,size:o=nj.u8.SM,tooltip:a,children:i,className:l}=e,s=(0,u._T)(e,["deltaType","isIncreasePositive","size","tooltip","children","className"]),c=nM[n],f=(0,eJ.Fo)(n,r),p=i?nN:nP,{tooltipProps:h,getReferenceProps:m}=(0,nC.l)();return d.createElement("span",Object.assign({ref:(0,eJ.lq)([t,h.refs.setReference]),className:(0,ec.q)(nI("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-full bg-opacity-20 dark:bg-opacity-25",nA[f].bgColor,nA[f].textColor,p[o].paddingX,p[o].paddingY,p[o].fontSize,l)},m,s),d.createElement(nC.Z,Object.assign({text:a},h)),d.createElement(c,{className:(0,ec.q)(nI("icon"),"shrink-0",i?(0,ec.q)("-ml-1 mr-1.5"):nT[o].height,nT[o].width)}),i?d.createElement("p",{className:(0,ec.q)(nI("text"),"text-sm whitespace-nowrap")},i):null)}).displayName="BadgeDelta";var nR=n(47323);let nD=e=>{var{onClick:t,icon:n}=e,r=(0,u._T)(e,["onClick","icon"]);return d.createElement("button",Object.assign({type:"button",className:(0,ec.q)("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},r),d.createElement(nR.Z,{onClick:t,icon:n,variant:"simple",color:"slate",size:"sm"}))};function nL(e){var{mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,enableYearNavigation:l,classNames:s,weekStartsOn:c=0}=e,f=(0,u._T)(e,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return d.createElement(nx,Object.assign({showOutsideDays:!0,mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,weekStartsOn:c,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},s),components:{IconLeft:e=>{var t=(0,u._T)(e,[]);return d.createElement(nw,Object.assign({className:"h-4 w-4"},t))},IconRight:e=>{var t=(0,u._T)(e,[]);return d.createElement(nk,Object.assign({className:"h-4 w-4"},t))},Caption:e=>{var t=(0,u._T)(e,[]);let{goToMonth:n,nextMonth:r,previousMonth:o,currentMonth:i}=tT();return d.createElement("div",{className:"flex justify-between items-center"},d.createElement("div",{className:"flex items-center space-x-1"},l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,-1)),icon:nS}),d.createElement(nD,{onClick:()=>o&&n(o),icon:nw})),d.createElement(nO.Z,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},eQ(t.displayMonth,"LLLL yyy",{locale:a})),d.createElement("div",{className:"flex items-center space-x-1"},d.createElement(nD,{onClick:()=>r&&n(r),icon:nk}),l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,1)),icon:nE})))}}},f))}nL.displayName="DateRangePicker",n(27281);var nZ=n(57365),nz=n(44140);let nB=el(),nF=d.forwardRef((e,t)=>{var n,r;let{value:o,defaultValue:a,onValueChange:i,enableSelect:l=!0,minDate:s,maxDate:c,placeholder:f="Select range",selectPlaceholder:p="Select range",disabled:h=!1,locale:m=eK,enableClear:g=!0,displayFormat:v,children:y,className:b,enableYearNavigation:x=!1,weekStartsOn:w=0,disabledDates:k}=e,S=(0,u._T)(e,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[E,O]=(0,nz.Z)(a,o),[C,j]=(0,d.useState)(!1),[_,P]=(0,d.useState)(!1),N=(0,d.useMemo)(()=>{let e=[];return s&&e.push({before:s}),c&&e.push({after:c}),[...e,...null!=k?k:[]]},[s,c,k]),T=(0,d.useMemo)(()=>{let e=new Map;return y?d.Children.forEach(y,t=>{var n;e.set(t.props.value,{text:null!==(n=(0,eu.qg)(t))&&void 0!==n?n:t.props.value,from:t.props.from,to:t.props.to})}):e6.forEach(t=>{e.set(t.value,{text:t.text,from:t.from,to:nB})}),e},[y]),A=(0,d.useMemo)(()=>{if(y)return(0,eu.sl)(y);let e=new Map;return e6.forEach(t=>e.set(t.value,t.text)),e},[y]),M=(null==E?void 0:E.selectValue)||"",I=e1(null==E?void 0:E.from,s,M,T),R=e2(null==E?void 0:E.to,c,M,T),D=I||R?e4(I,R,m,v):f,L=es(null!==(r=null!==(n=null!=R?R:I)&&void 0!==n?n:c)&&void 0!==r?r:nB),Z=g&&!h;return d.createElement("div",Object.assign({ref:t,className:(0,ec.q)("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",b)},S),d.createElement(J,{as:"div",className:(0,ec.q)("w-full",l?"rounded-l-tremor-default":"rounded-tremor-default",C&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},d.createElement("div",{className:"relative w-full"},d.createElement(J.Button,{onFocus:()=>j(!0),onBlur:()=>j(!1),disabled:h,className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",l?"rounded-l-tremor-default":"rounded-tremor-default",Z?"pr-8":"pr-4",(0,eu.um)((0,eu.Uh)(I||R),h))},d.createElement(en,{className:(0,ec.q)(e0("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),d.createElement("p",{className:"truncate"},D)),Z&&I?d.createElement("button",{type:"button",className:(0,ec.q)("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==i||i({}),O({})}},d.createElement(er.Z,{className:(0,ec.q)(e0("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),d.createElement(ee.u,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(J.Panel,{focus:!0,className:(0,ec.q)("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},d.createElement(nL,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:L,selected:{from:I,to:R},onSelect:e=>{null==i||i({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),O({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:m,disabled:N,enableYearNavigation:x,classNames:{day_range_middle:(0,ec.q)("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:w},e))))),l&&d.createElement(et.R,{as:"div",className:(0,ec.q)("w-48 -ml-px rounded-r-tremor-default",_&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:M,onChange:e=>{let{from:t,to:n}=T.get(e),r=null!=n?n:nB;null==i||i({from:t,to:r,selectValue:e}),O({from:t,to:r,selectValue:e})},disabled:h},e=>{var t;let{value:n}=e;return d.createElement(d.Fragment,null,d.createElement(et.R.Button,{onFocus:()=>P(!0),onBlur:()=>P(!1),className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",(0,eu.um)((0,eu.Uh)(n),h))},n&&null!==(t=A.get(n))&&void 0!==t?t:p),d.createElement(ee.u,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(et.R.Options,{className:(0,ec.q)("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=y?y:e6.map(e=>d.createElement(nZ.Z,{key:e.value,value:e.value},e.text)))))}))});nF.displayName="DateRangePicker"},92414:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(5853),o=n(2265);n(42698),n(64016),n(8710);var a=n(33232),i=n(44140),l=n(58747);let s=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var c=n(4537),u=n(28517),d=n(33044);let f=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),o.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var p=n(97324),h=n(1153),m=n(96398);let g=(0,h.fn)("MultiSelect"),v=o.forwardRef((e,t)=>{let{defaultValue:n,value:h,onValueChange:v,placeholder:y="Select...",placeholderSearch:b="Search",disabled:x=!1,icon:w,children:k,className:S}=e,E=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className"]),[O,C]=(0,i.Z)(n,h),{reactElementChildren:j,optionsAvailable:_}=(0,o.useMemo)(()=>{let e=o.Children.toArray(k).filter(o.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,m.n0)("",e)}},[k]),[P,N]=(0,o.useState)(""),T=(null!=O?O:[]).length>0,A=(0,o.useMemo)(()=>P?(0,m.n0)(P,j):_,[P,j,_]),M=()=>{N("")};return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:O,value:O,onChange:e=>{null==v||v(e),C(e)},disabled:x,className:(0,p.q)("w-full min-w-[10rem] relative text-tremor-default",S)},E,{multiple:!0}),e=>{let{value:t}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,p.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",w?"pl-11 -ml-0.5":"pl-3",(0,m.um)(t.length>0,x))},w&&o.createElement("span",{className:(0,p.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(w,{className:(0,p.q)(g("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("div",{className:"h-6 flex items-center"},t.length>0?o.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},_.filter(e=>t.includes(e.props.value)).map((e,n)=>{var r;return o.createElement("div",{key:n,className:(0,p.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},o.createElement("div",{className:"text-xs truncate "},null!==(r=e.props.children)&&void 0!==r?r:e.props.value),o.createElement("div",{onClick:n=>{n.preventDefault();let r=t.filter(t=>t!==e.props.value);null==v||v(r),C(r)}},o.createElement(f,{className:(0,p.q)(g("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):o.createElement("span",null,y)),o.createElement("span",{className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},o.createElement(l.Z,{className:(0,p.q)(g("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),T&&!x?o.createElement("button",{type:"button",className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),C([]),null==v||v([])}},o.createElement(c.Z,{className:(0,p.q)(g("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,p.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},o.createElement("div",{className:(0,p.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},o.createElement("span",null,o.createElement(s,{className:(0,p.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:b,className:(0,p.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>N(e.target.value),value:P})),o.createElement(a.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:M}},{value:{selectedValue:t}}),A))))})});v.displayName="MultiSelect"},46030:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853);n(42698),n(64016),n(8710);var o=n(33232),a=n(2265),i=n(97324),l=n(1153),s=n(28517);let c=(0,l.fn)("MultiSelectItem"),u=a.forwardRef((e,t)=>{let{value:n,className:u,children:d}=e,f=(0,r._T)(e,["value","className","children"]),{selectedValue:p}=(0,a.useContext)(o.Z),h=(0,l.NZ)(n,p);return a.createElement(s.R.Option,Object.assign({className:(0,i.q)(c("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",u),ref:t,key:n,value:n},f),a.createElement("input",{type:"checkbox",className:(0,i.q)(c("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),a.createElement("span",{className:"whitespace-nowrap truncate"},null!=d?d:n))});u.displayName="MultiSelectItem"},30150:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var l=n(97324),s=n(1153),c=n(69262);let u="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",f=o.forwardRef((e,t)=>{let{onSubmit:n,enableStepper:f=!0,disabled:p,onValueChange:h,onChange:m}=e,g=(0,r._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),v=(0,o.useRef)(null),[y,b]=o.useState(!1),x=o.useCallback(()=>{b(!0)},[]),w=o.useCallback(()=>{b(!1)},[]),[k,S]=o.useState(!1),E=o.useCallback(()=>{S(!0)},[]),O=o.useCallback(()=>{S(!1)},[]);return o.createElement(c.Z,Object.assign({type:"number",ref:(0,s.lq)([v,t]),disabled:p,makeInputClassName:(0,s.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=v.current)||void 0===t?void 0:t.value;null==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&O()},onChange:e=>{p||(null==h||h(parseFloat(e.target.value)),null==m||m(e))},stepper:f?o.createElement("div",{className:(0,l.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepDown(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(i,{"data-testid":"step-down",className:(y?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepUp(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-up",className:(k?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},g))});f.displayName="NumberInput"},27281:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(5853),o=n(2265),a=n(58747),i=n(4537),l=n(97324),s=n(1153),c=n(96398),u=n(28517),d=n(33044),f=n(44140);let p=(0,s.fn)("Select"),h=o.forwardRef((e,t)=>{let{defaultValue:n,value:s,onValueChange:h,placeholder:m="Select...",disabled:g=!1,icon:v,enableClear:y=!0,children:b,className:x}=e,w=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","children","className"]),[k,S]=(0,f.Z)(n,s),E=(0,o.useMemo)(()=>{let e=o.Children.toArray(b).filter(o.isValidElement);return(0,c.sl)(e)},[b]);return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:k,value:k,onChange:e=>{null==h||h(e),S(e)},disabled:g,className:(0,l.q)("w-full min-w-[10rem] relative text-tremor-default",x)},w),e=>{var t;let{value:n}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,l.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",v?"pl-10":"pl-3",(0,c.um)((0,c.Uh)(n),g))},v&&o.createElement("span",{className:(0,l.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(v,{className:(0,l.q)(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("span",{className:"w-[90%] block truncate"},n&&null!==(t=E.get(n))&&void 0!==t?t:m),o.createElement("span",{className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-3")},o.createElement(a.Z,{className:(0,l.q)(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),y&&k?o.createElement("button",{type:"button",className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),S(""),null==h||h("")}},o.createElement(i.Z,{className:(0,l.q)(p("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,l.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},b)))})});h.displayName="Select"},57365:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),a=n(28517),i=n(97324);let l=(0,n(1153).fn)("SelectItem"),s=o.forwardRef((e,t)=>{let{value:n,icon:s,className:c,children:u}=e,d=(0,r._T)(e,["value","icon","className","children"]);return o.createElement(a.R.Option,Object.assign({className:(0,i.q)(l("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",c),ref:t,key:n,value:n},d),s&&o.createElement(s,{className:(0,i.q)(l("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),o.createElement("span",{className:"whitespace-nowrap truncate"},null!=u?u:n))});s.displayName="SelectItem"},92858:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});var r=n(5853),o=n(2265),a=n(62963),i=n(90945),l=n(13323),s=n(17684),c=n(80004),u=n(93689),d=n(38198),f=n(47634),p=n(56314),h=n(27847),m=n(64518);let g=(0,o.createContext)(null),v=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-description-".concat(n),...a}=e,i=function e(){let t=(0,o.useContext)(g);if(null===t){let t=Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),l=(0,u.T)(t);(0,m.e)(()=>i.register(r),[r,i.register]);let c={ref:l,...i.props,id:r};return(0,h.sY)({ourProps:c,theirProps:a,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})}),{});var y=n(37388);let b=(0,o.createContext)(null),x=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-label-".concat(n),passive:a=!1,...i}=e,l=function e(){let t=(0,o.useContext)(b);if(null===t){let t=Error("You used a